vibe-coding-master 0.7.11 → 0.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/dist/backend/adapters/ccr-gateway-adapter.js +149 -0
- package/dist/backend/adapters/claude-adapter.js +4 -1
- package/dist/backend/adapters/filesystem.js +3 -0
- package/dist/backend/api/app-settings-routes.js +9 -0
- package/dist/backend/api/session-routes.js +1 -0
- package/dist/backend/api/translation-worker-routes.js +1 -0
- package/dist/backend/server.js +13 -1
- package/dist/backend/services/app-settings-service.js +31 -1
- package/dist/backend/services/ccr-integration-service.js +194 -0
- package/dist/backend/services/session-service.js +33 -6
- package/dist/shared/types/session.js +31 -4
- package/dist-frontend/assets/index-BAE_pjXJ.js +97 -0
- package/dist-frontend/assets/index-CiEUp9Si.css +32 -0
- package/dist-frontend/index.html +2 -2
- package/package.json +1 -1
- package/dist-frontend/assets/index-42EpETgd.js +0 -97
- package/dist-frontend/assets/index-D65x2x0F.css +0 -32
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
var L0=Object.defineProperty;var O0=(t,r,s)=>r in t?L0(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;var Rm=(t,r,s)=>O0(t,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))l(d);new MutationObserver(d=>{for(const p of d)if(p.type==="childList")for(const f of p.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const p={};return d.integrity&&(p.integrity=d.integrity),d.referrerPolicy&&(p.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?p.credentials="include":d.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function l(d){if(d.ep)return;d.ep=!0;const p=s(d);fetch(d.href,p)}})();function i_(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fu={exports:{}},Ua={};/**
|
|
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 Dm;function B0(){if(Dm)return Ua;Dm=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(l,d,p){var f=null;if(p!==void 0&&(f=""+p),d.key!==void 0&&(f=""+d.key),"key"in d){p={};for(var o in d)o!=="key"&&(p[o]=d[o])}else p=d;return d=p.ref,{$$typeof:t,type:l,key:f,ref:d!==void 0?d:null,props:p}}return Ua.Fragment=r,Ua.jsx=s,Ua.jsxs=s,Ua}var Mm;function j0(){return Mm||(Mm=1,Fu.exports=B0()),Fu.exports}var x=j0(),qu={exports:{}},ze={};/**
|
|
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 Lm;function N0(){if(Lm)return ze;Lm=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),y=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=y&&N[y]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,b={};function v(N,$,I){this.props=N,this.context=$,this.refs=b,this.updater=I||T}v.prototype.isReactComponent={},v.prototype.setState=function(N,$){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,$,"setState")},v.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function _(){}_.prototype=v.prototype;function S(N,$,I){this.props=N,this.context=$,this.refs=b,this.updater=I||T}var A=S.prototype=new _;A.constructor=S,E(A,v.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function M(){}var D={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function R(N,$,I){var ie=I.ref;return{$$typeof:t,type:N,key:$,ref:ie!==void 0?ie:null,props:I}}function B(N,$){return R(N.type,$,N.props)}function H(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function U(N){var $={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(I){return $[I]})}var P=/\/+/g;function V(N,$){return typeof N=="object"&&N!==null&&N.key!=null?U(""+N.key):$.toString(36)}function K(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(M,M):(N.status="pending",N.then(function($){N.status==="pending"&&(N.status="fulfilled",N.value=$)},function($){N.status==="pending"&&(N.status="rejected",N.reason=$)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function G(N,$,I,ie,me){var ve=typeof N;(ve==="undefined"||ve==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(ve){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(N.$$typeof){case t:case r:Q=!0;break;case m:return Q=N._init,G(Q(N._payload),$,I,ie,me)}}if(Q)return me=me(N),Q=ie===""?"."+V(N,0):ie,L(me)?(I="",Q!=null&&(I=Q.replace(P,"$&/")+"/"),G(me,$,I,"",function(ae){return ae})):me!=null&&(H(me)&&(me=B(me,I+(me.key==null||N&&N.key===me.key?"":(""+me.key).replace(P,"$&/")+"/")+Q)),$.push(me)),1;Q=0;var q=ie===""?".":ie+":";if(L(N))for(var ce=0;ce<N.length;ce++)ie=N[ce],ve=q+V(ie,ce),Q+=G(ie,$,I,ve,me);else if(ce=w(N),typeof ce=="function")for(N=ce.call(N),ce=0;!(ie=N.next()).done;)ie=ie.value,ve=q+V(ie,ce++),Q+=G(ie,$,I,ve,me);else if(ve==="object"){if(typeof N.then=="function")return G(K(N),$,I,ie,me);throw $=String(N),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Q}function Y(N,$,I){if(N==null)return N;var ie=[],me=0;return G(N,ie,"","",function(ve){return $.call(I,ve,me++)}),ie}function ee(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(I){(N._status===0||N._status===-1)&&(N._status=1,N._result=I)},function(I){(N._status===0||N._status===-1)&&(N._status=2,N._result=I)}),N._status===-1&&(N._status=0,N._result=$)}if(N._status===1)return N._result.default;throw N._result}var z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},j={map:Y,forEach:function(N,$,I){Y(N,function(){$.apply(this,arguments)},I)},count:function(N){var $=0;return Y(N,function(){$++}),$},toArray:function(N){return Y(N,function($){return $})||[]},only:function(N){if(!H(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return ze.Activity=u,ze.Children=j,ze.Component=v,ze.Fragment=s,ze.Profiler=d,ze.PureComponent=S,ze.StrictMode=l,ze.Suspense=c,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,ze.__COMPILER_RUNTIME={__proto__:null,c:function(N){return D.H.useMemoCache(N)}},ze.cache=function(N){return function(){return N.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(N,$,I){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ie=E({},N.props),me=N.key;if($!=null)for(ve in $.key!==void 0&&(me=""+$.key),$)!k.call($,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&$.ref===void 0||(ie[ve]=$[ve]);var ve=arguments.length-2;if(ve===1)ie.children=I;else if(1<ve){for(var Q=Array(ve),q=0;q<ve;q++)Q[q]=arguments[q+2];ie.children=Q}return R(N.type,me,ie)},ze.createContext=function(N){return N={$$typeof:f,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:p,_context:N},N},ze.createElement=function(N,$,I){var ie,me={},ve=null;if($!=null)for(ie in $.key!==void 0&&(ve=""+$.key),$)k.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(me[ie]=$[ie]);var Q=arguments.length-2;if(Q===1)me.children=I;else if(1<Q){for(var q=Array(Q),ce=0;ce<Q;ce++)q[ce]=arguments[ce+2];me.children=q}if(N&&N.defaultProps)for(ie in Q=N.defaultProps,Q)me[ie]===void 0&&(me[ie]=Q[ie]);return R(N,ve,me)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(N){return{$$typeof:o,render:N}},ze.isValidElement=H,ze.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:ee}},ze.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},ze.startTransition=function(N){var $=D.T,I={};D.T=I;try{var ie=N(),me=D.S;me!==null&&me(I,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(M,z)}catch(ve){z(ve)}finally{$!==null&&I.types!==null&&($.types=I.types),D.T=$}},ze.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},ze.use=function(N){return D.H.use(N)},ze.useActionState=function(N,$,I){return D.H.useActionState(N,$,I)},ze.useCallback=function(N,$){return D.H.useCallback(N,$)},ze.useContext=function(N){return D.H.useContext(N)},ze.useDebugValue=function(){},ze.useDeferredValue=function(N,$){return D.H.useDeferredValue(N,$)},ze.useEffect=function(N,$){return D.H.useEffect(N,$)},ze.useEffectEvent=function(N){return D.H.useEffectEvent(N)},ze.useId=function(){return D.H.useId()},ze.useImperativeHandle=function(N,$,I){return D.H.useImperativeHandle(N,$,I)},ze.useInsertionEffect=function(N,$){return D.H.useInsertionEffect(N,$)},ze.useLayoutEffect=function(N,$){return D.H.useLayoutEffect(N,$)},ze.useMemo=function(N,$){return D.H.useMemo(N,$)},ze.useOptimistic=function(N,$){return D.H.useOptimistic(N,$)},ze.useReducer=function(N,$,I){return D.H.useReducer(N,$,I)},ze.useRef=function(N){return D.H.useRef(N)},ze.useState=function(N){return D.H.useState(N)},ze.useSyncExternalStore=function(N,$,I){return D.H.useSyncExternalStore(N,$,I)},ze.useTransition=function(){return D.H.useTransition()},ze.version="19.2.6",ze}var Om;function Oh(){return Om||(Om=1,qu.exports=N0()),qu.exports}var te=Oh(),$u={exports:{}},Fa={},Gu={exports:{}},Vu={};/**
|
|
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 Bm;function H0(){return Bm||(Bm=1,(function(t){function r(G,Y){var ee=G.length;G.push(Y);e:for(;0<ee;){var z=ee-1>>>1,j=G[z];if(0<d(j,Y))G[z]=Y,G[ee]=j,ee=z;else break e}}function s(G){return G.length===0?null:G[0]}function l(G){if(G.length===0)return null;var Y=G[0],ee=G.pop();if(ee!==Y){G[0]=ee;e:for(var z=0,j=G.length,N=j>>>1;z<N;){var $=2*(z+1)-1,I=G[$],ie=$+1,me=G[ie];if(0>d(I,ee))ie<j&&0>d(me,I)?(G[z]=me,G[ie]=ee,z=ie):(G[z]=I,G[$]=ee,z=$);else if(ie<j&&0>d(me,ee))G[z]=me,G[ie]=ee,z=ie;else break e}}return Y}function d(G,Y){var ee=G.sortIndex-Y.sortIndex;return ee!==0?ee:G.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;t.unstable_now=function(){return p.now()}}else{var f=Date,o=f.now();t.unstable_now=function(){return f.now()-o}}var c=[],h=[],m=1,u=null,y=3,w=!1,T=!1,E=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function A(G){for(var Y=s(h);Y!==null;){if(Y.callback===null)l(h);else if(Y.startTime<=G)l(h),Y.sortIndex=Y.expirationTime,r(c,Y);else break;Y=s(h)}}function L(G){if(E=!1,A(G),!T)if(s(c)!==null)T=!0,M||(M=!0,U());else{var Y=s(h);Y!==null&&K(L,Y.startTime-G)}}var M=!1,D=-1,k=5,R=-1;function B(){return b?!0:!(t.unstable_now()-R<k)}function H(){if(b=!1,M){var G=t.unstable_now();R=G;var Y=!0;try{e:{T=!1,E&&(E=!1,_(D),D=-1),w=!0;var ee=y;try{t:{for(A(G),u=s(c);u!==null&&!(u.expirationTime>G&&B());){var z=u.callback;if(typeof z=="function"){u.callback=null,y=u.priorityLevel;var j=z(u.expirationTime<=G);if(G=t.unstable_now(),typeof j=="function"){u.callback=j,A(G),Y=!0;break t}u===s(c)&&l(c),A(G)}else l(c);u=s(c)}if(u!==null)Y=!0;else{var N=s(h);N!==null&&K(L,N.startTime-G),Y=!1}}break e}finally{u=null,y=ee,w=!1}Y=void 0}}finally{Y?U():M=!1}}}var U;if(typeof S=="function")U=function(){S(H)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,V=P.port2;P.port1.onmessage=H,U=function(){V.postMessage(null)}}else U=function(){v(H,0)};function K(G,Y){D=v(function(){G(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(G){G.callback=null},t.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<G?Math.floor(1e3/G):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(G){switch(y){case 1:case 2:case 3:var Y=3;break;default:Y=y}var ee=y;y=Y;try{return G()}finally{y=ee}},t.unstable_requestPaint=function(){b=!0},t.unstable_runWithPriority=function(G,Y){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=y;y=G;try{return Y()}finally{y=ee}},t.unstable_scheduleCallback=function(G,Y,ee){var z=t.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?z+ee:z):ee=z,G){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=ee+j,G={id:m++,callback:Y,priorityLevel:G,startTime:ee,expirationTime:j,sortIndex:-1},ee>z?(G.sortIndex=ee,r(h,G),s(c)===null&&G===s(h)&&(E?(_(D),D=-1):E=!0,K(L,ee-z))):(G.sortIndex=j,r(c,G),T||w||(T=!0,M||(M=!0,U()))),G},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(G){var Y=y;return function(){var ee=y;y=Y;try{return G.apply(this,arguments)}finally{y=ee}}}})(Vu)),Vu}var jm;function z0(){return jm||(jm=1,Gu.exports=H0()),Gu.exports}var Wu={exports:{}},Xt={};/**
|
|
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 Nm;function I0(){if(Nm)return Xt;Nm=1;var t=Oh();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var l={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function p(c,h,m){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:u==null?null:""+u,children:c,containerInfo:h,implementation:m}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Xt.createPortal=function(c,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return p(c,h,null,m)},Xt.flushSync=function(c){var h=f.T,m=l.p;try{if(f.T=null,l.p=2,c)return c()}finally{f.T=h,l.p=m,l.d.f()}},Xt.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,l.d.C(c,h))},Xt.prefetchDNS=function(c){typeof c=="string"&&l.d.D(c)},Xt.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var m=h.as,u=o(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?l.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:y,fetchPriority:w}):m==="script"&&l.d.X(c,{crossOrigin:u,integrity:y,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Xt.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=o(h.as,h.crossOrigin);l.d.M(c,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&l.d.M(c)},Xt.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,u=o(m,h.crossOrigin);l.d.L(c,m,{crossOrigin:u,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Xt.preloadModule=function(c,h){if(typeof c=="string")if(h){var m=o(h.as,h.crossOrigin);l.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else l.d.m(c)},Xt.requestFormReset=function(c){l.d.r(c)},Xt.unstable_batchedUpdates=function(c,h){return c(h)},Xt.useFormState=function(c,h,m){return f.H.useFormState(c,h,m)},Xt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Xt.version="19.2.6",Xt}var Hm;function P0(){if(Hm)return Wu.exports;Hm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Wu.exports=I0(),Wu.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 zm;function U0(){if(zm)return Fa;zm=1;var t=z0(),r=Oh(),s=P0();function l(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function p(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function f(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function o(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function c(e){if(p(e)!==e)throw Error(l(188))}function h(e){var n=e.alternate;if(!n){if(n=p(e),n===null)throw Error(l(188));return n!==e?null:e}for(var i=e,a=n;;){var g=i.return;if(g===null)break;var C=g.alternate;if(C===null){if(a=g.return,a!==null){i=a;continue}break}if(g.child===C.child){for(C=g.child;C;){if(C===i)return c(g),e;if(C===a)return c(g),n;C=C.sibling}throw Error(l(188))}if(i.return!==a.return)i=g,a=C;else{for(var O=!1,F=g.child;F;){if(F===i){O=!0,i=g,a=C;break}if(F===a){O=!0,a=g,i=C;break}F=F.sibling}if(!O){for(F=C.child;F;){if(F===i){O=!0,i=C,a=g;break}if(F===a){O=!0,a=C,i=g;break}F=F.sibling}if(!O)throw Error(l(189))}}if(i.alternate!==a)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e:n}function m(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=m(e),n!==null)return n;e=e.sibling}return null}var u=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),S=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var P=Symbol.for("react.client.reference");function V(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===P?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case v:return"Profiler";case b:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case S:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case A:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return n=e.displayName||null,n!==null?n:V(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return V(e(n))}catch{}}return null}var K=Array.isArray,G=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,ee={pending:!1,data:null,method:null,action:null},z=[],j=-1;function N(e){return{current:e}}function $(e){0>j||(e.current=z[j],z[j]=null,j--)}function I(e,n){j++,z[j]=e.current,e.current=n}var ie=N(null),me=N(null),ve=N(null),Q=N(null);function q(e,n){switch(I(ve,n),I(me,e),I(ie,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?Jp(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=Jp(n),e=Zp(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ie),I(ie,e)}function ce(){$(ie),$(me),$(ve)}function ae(e){e.memoizedState!==null&&I(Q,e);var n=ie.current,i=Zp(n,e.type);n!==i&&(I(me,e),I(ie,i))}function be(e){me.current===e&&($(ie),$(me)),Q.current===e&&($(Q),Ha._currentValue=ee)}var Ee,xe;function de(e){if(Ee===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);Ee=n&&n[1]||"",xe=-1<i.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ee+e+xe}var Me=!1;function $e(e,n){if(!e||Me)return"";Me=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(n){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(oe){var le=oe}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(oe){le=oe}e.call(_e.prototype)}}else{try{throw Error()}catch(oe){le=oe}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(oe){if(oe&&le&&typeof oe.stack=="string")return[oe.stack,le.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 C=a.DetermineComponentFrameRoot(),O=C[0],F=C[1];if(O&&F){var X=O.split(`
|
|
44
|
-
`),se=F.split(`
|
|
45
|
-
`);for(g=a=0;a<X.length&&!X[a].includes("DetermineComponentFrameRoot");)a++;for(;g<se.length&&!se[g].includes("DetermineComponentFrameRoot");)g++;if(a===X.length||g===se.length)for(a=X.length-1,g=se.length-1;1<=a&&0<=g&&X[a]!==se[g];)g--;for(;1<=a&&0<=g;a--,g--)if(X[a]!==se[g]){if(a!==1||g!==1)do if(a--,g--,0>g||X[a]!==se[g]){var fe=`
|
|
46
|
-
`+X[a].replace(" at new "," at ");return e.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",e.displayName)),fe}while(1<=a&&0<=g);break}}}finally{Me=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?de(i):""}function Ae(e,n){switch(e.tag){case 26:case 27:case 5:return de(e.type);case 16:return de("Lazy");case 13:return e.child!==n&&n!==null?de("Suspense Fallback"):de("Suspense");case 19:return de("SuspenseList");case 0:case 15:return $e(e.type,!1);case 11:return $e(e.type.render,!1);case 1:return $e(e.type,!0);case 31:return de("Activity");default:return""}}function ge(e){try{var n="",i=null;do n+=Ae(e,i),i=e,e=e.return;while(e);return n}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}var He=Object.prototype.hasOwnProperty,Ke=t.unstable_scheduleCallback,Dt=t.unstable_cancelCallback,Vt=t.unstable_shouldYield,St=t.unstable_requestPaint,dt=t.unstable_now,Nt=t.unstable_getCurrentPriorityLevel,he=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,Re=t.unstable_NormalPriority,je=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,_t=t.log,qe=t.unstable_setDisableYieldValue,bt=null,Ct=null;function xt(e){if(typeof _t=="function"&&qe(e),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(bt,e)}catch{}}var nt=Math.clz32?Math.clz32:br,mn=Math.log,en=Math.LN2;function br(e){return e>>>=0,e===0?32:31-(mn(e)/en|0)|0}var ci=256,ui=262144,hi=4194304;function gn(e){var n=e&42;if(n!==0)return n;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 _n(e,n,i){var a=e.pendingLanes;if(a===0)return 0;var g=0,C=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~C,a!==0?g=gn(a):(O&=F,O!==0?g=gn(O):i||(i=F&~e,i!==0&&(g=gn(i))))):(F=a&~C,F!==0?g=gn(F):O!==0?g=gn(O):i||(i=a&~e,i!==0&&(g=gn(i)))),g===0?0:n!==0&&n!==g&&(n&C)===0&&(C=g&-g,i=n&-n,C>=i||C===32&&(i&4194048)!==0)?n:g}function wt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function fi(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Bi(){var e=hi;return hi<<=1,(hi&62914560)===0&&(hi=4194304),e}function tn(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function qn(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qn(e,n,i,a,g,C){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 F=e.entanglements,X=e.expirationTimes,se=e.hiddenUpdates;for(i=O&~i;0<i;){var fe=31-nt(i),_e=1<<fe;F[fe]=0,X[fe]=-1;var le=se[fe];if(le!==null)for(se[fe]=null,fe=0;fe<le.length;fe++){var oe=le[fe];oe!==null&&(oe.lane&=-536870913)}i&=~_e}a!==0&&$n(e,a,0),C!==0&&g===0&&e.tag!==0&&(e.suspendedLanes|=C&~(O&~n))}function $n(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var a=31-nt(n);e.entangledLanes|=n,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function Dn(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var a=31-nt(i),g=1<<a;g&n|e[a]&n&&(e[a]|=n),i&=~g}}function nn(e,n){var i=n&-n;return i=(i&42)!==0?1:Ie(i),(i&(e.suspendedLanes|n))!==0?0:i}function Ie(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 di(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Cr(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Cm(e.type))}function Yr(e,n){var i=Y.p;try{return Y.p=e,n()}finally{Y.p=i}}var vn=Math.random().toString(36).slice(2),At="__reactFiber$"+vn,It="__reactProps$"+vn,ji="__reactContainer$"+vn,Mn="__reactEvents$"+vn,Fo="__reactListeners$"+vn,qo="__reactHandles$"+vn,$s="__reactResources$"+vn,Ln="__reactMarker$"+vn;function Xr(e){delete e[At],delete e[It],delete e[Mn],delete e[Fo],delete e[qo]}function Ni(e){var n=e[At];if(n)return n;for(var i=e.parentNode;i;){if(n=i[ji]||i[At]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=am(e);e!==null;){if(i=e[At])return i;e=am(e)}return n}e=i,i=e.parentNode}return null}function Hi(e){if(e=e[At]||e[ji]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function zi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function Ii(e){var n=e[$s];return n||(n=e[$s]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function vt(e){e[Ln]=!0}var Gs=new Set,Jn={};function Zn(e,n){ei(e,n),ei(e+"Capture",n)}function ei(e,n){for(Jn[e]=n,e=0;e<n.length;e++)Gs.add(n[e])}var ol=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]*$"),Vs={},Ws={};function Qr(e){return He.call(Ws,e)?!0:He.call(Vs,e)?!1:ol.test(e)?Ws[e]=!0:(Vs[e]=!0,!1)}function wr(e,n,i){if(Qr(n))if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var a=n.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+i)}}function Pi(e,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+i)}}function Z(e,n,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(n,i,""+a)}}function pt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jr(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function cl(e,n,i){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var g=a.get,C=a.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return g.call(this)},set:function(O){i=""+O,C.call(this,O)}}),Object.defineProperty(e,n,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(O){i=""+O},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ks(e){if(!e._valueTracker){var n=Jr(e)?"checked":"value";e._valueTracker=cl(e,n,""+e[n])}}function ul(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),a="";return e&&(a=Jr(e)?e.checked?"true":"false":e.value),e=a,e!==i?(n.setValue(e),!0):!1}function Zr(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 hl=/[\n"\\]/g;function an(e){return e.replace(hl,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Ys(e,n,i,a,g,C,O,F){e.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.type=O:e.removeAttribute("type"),n!=null?O==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+pt(n)):e.value!==""+pt(n)&&(e.value=""+pt(n)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),n!=null?yn(e,O,pt(n)):i!=null?yn(e,O,pt(i)):a!=null&&e.removeAttribute("value"),g==null&&C!=null&&(e.defaultChecked=!!C),g!=null&&(e.checked=g&&typeof g!="function"&&typeof g!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?e.name=""+pt(F):e.removeAttribute("name")}function Pt(e,n,i,a,g,C,O,F){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(e.type=C),n!=null||i!=null){if(!(C!=="submit"&&C!=="reset"||n!=null)){Ks(e);return}i=i!=null?""+pt(i):"",n=n!=null?""+pt(n):i,F||n===e.value||(e.value=n),e.defaultValue=n}a=a??g,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=F?e.checked:!!a,e.defaultChecked=!!a,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(e.name=O),Ks(e)}function yn(e,n,i){n==="number"&&Zr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function pi(e,n,i,a){if(e=e.options,n){n={};for(var g=0;g<i.length;g++)n["$"+i[g]]=!0;for(i=0;i<e.length;i++)g=n.hasOwnProperty("$"+e[i].value),e[i].selected!==g&&(e[i].selected=g),g&&a&&(e[i].defaultSelected=!0)}else{for(i=""+pt(i),n=null,g=0;g<e.length;g++){if(e[g].value===i){e[g].selected=!0,a&&(e[g].defaultSelected=!0);return}n!==null||e[g].disabled||(n=e[g])}n!==null&&(n.selected=!0)}}function Xs(e,n,i){if(n!=null&&(n=""+pt(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+pt(i):""}function es(e,n,i,a){if(n==null){if(a!=null){if(i!=null)throw Error(l(92));if(K(a)){if(1<a.length)throw Error(l(93));a=a[0]}i=a}i==null&&(i=""),n=i}i=pt(n),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Ks(e)}function Ui(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var $o=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 fl(e,n,i){var a=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?a?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":a?e.setProperty(n,i):typeof i!="number"||i===0||$o.has(n)?n==="float"?e.cssFloat=i:e[n]=(""+i).trim():e[n]=i+"px"}function dl(e,n,i){if(n!=null&&typeof n!="object")throw Error(l(62));if(e=e.style,i!=null){for(var a in i)!i.hasOwnProperty(a)||n!=null&&n.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var g in n)a=n[g],n.hasOwnProperty(g)&&i[g]!==a&&fl(e,g,a)}else for(var C in n)n.hasOwnProperty(C)&&fl(e,C,n[C])}function Qs(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 Fi=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"]]),Js=/^[\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 qi(e){return Js.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wt(){}var Zs=null;function ts(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ti=null,mi=null;function ea(e){var n=Hi(e);if(n&&(e=n.stateNode)){var i=e[It]||null;e:switch(e=n.stateNode,n.type){case"input":if(Ys(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+an(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var a=i[n];if(a!==e&&a.form===e.form){var g=a[It]||null;if(!g)throw Error(l(90));Ys(a,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(n=0;n<i.length;n++)a=i[n],a.form===e.form&&ul(a)}break e;case"textarea":Xs(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&pi(e,!!i.multiple,n,!1)}}}var ni=!1;function ta(e,n,i){if(ni)return e(n,i);ni=!0;try{var a=e(n);return a}finally{if(ni=!1,(ti!==null||mi!==null)&&(Ql(),ti&&(n=ti,e=mi,mi=ti=null,ea(n),e)))for(n=0;n<e.length;n++)ea(e[n])}}function Sn(e,n){var i=e.stateNode;if(i===null)return null;var a=i[It]||null;if(a===null)return null;i=a[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,n,typeof i));return i}var Kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),na=!1;if(Kt)try{var xr={};Object.defineProperty(xr,"passive",{get:function(){na=!0}}),window.addEventListener("test",xr,xr),window.removeEventListener("test",xr,xr)}catch{na=!1}var Gn=null,ia=null,Yt=null;function ns(){if(Yt)return Yt;var e,n=ia,i=n.length,a,g="value"in Gn?Gn.value:Gn.textContent,C=g.length;for(e=0;e<i&&n[e]===g[e];e++);var O=i-e;for(a=1;a<=O&&n[i-a]===g[C-a];a++);return Yt=g.slice(e,1<a?1-a:void 0)}function $i(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Gi(){return!0}function pl(){return!1}function ke(e){function n(i,a,g,C,O){this._reactName=i,this._targetInst=g,this.type=a,this.nativeEvent=C,this.target=O,this.currentTarget=null;for(var F in e)e.hasOwnProperty(F)&&(i=e[F],this[F]=i?i(C):C[F]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Gi:pl,this.isPropagationStopped=pl,this}return u(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Gi)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Gi)},persist:function(){},isPersistent:Gi}),n}var gi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},is=ke(gi),Er=u({},gi,{view:0,detail:0}),Go=ke(Er),ln,kr,Vi,Wi=u({},Er,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wo,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!==Vi&&(Vi&&e.type==="mousemove"?(ln=e.screenX-Vi.screenX,kr=e.screenY-Vi.screenY):kr=ln=0,Vi=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:kr}}),ml=ke(Wi),W=u({},Wi,{dataTransfer:0}),ue=ke(W),Je=u({},Er,{relatedTarget:0}),Ut=ke(Je),Ar=u({},gi,{animationName:0,elapsedTime:0,pseudoElement:0}),Vo=ke(Ar),Nv=u({},gi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hv=ke(Nv),zv=u({},gi,{data:0}),tf=ke(zv),Iv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Uv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fv(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Uv[e])?!!n[e]:!1}function Wo(){return Fv}var qv=u({},Er,{key:function(e){if(e.key){var n=Iv[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=$i(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wo,charCode:function(e){return e.type==="keypress"?$i(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$i(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$v=ke(qv),Gv=u({},Wi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nf=ke(Gv),Vv=u({},Er,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wo}),Wv=ke(Vv),Kv=u({},gi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yv=ke(Kv),Xv=u({},Wi,{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}),Qv=ke(Xv),Jv=u({},gi,{newState:0,oldState:0}),Zv=ke(Jv),ey=[9,13,27,32],Ko=Kt&&"CompositionEvent"in window,ra=null;Kt&&"documentMode"in document&&(ra=document.documentMode);var ty=Kt&&"TextEvent"in window&&!ra,rf=Kt&&(!Ko||ra&&8<ra&&11>=ra),sf=" ",af=!1;function lf(e,n){switch(e){case"keyup":return ey.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function of(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rs=!1;function ny(e,n){switch(e){case"compositionend":return of(n);case"keypress":return n.which!==32?null:(af=!0,sf);case"textInput":return e=n.data,e===sf&&af?null:e;default:return null}}function iy(e,n){if(rs)return e==="compositionend"||!Ko&&lf(e,n)?(e=ns(),Yt=ia=Gn=null,rs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return rf&&n.locale!=="ko"?null:n.data;default:return null}}var ry={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 cf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ry[e.type]:n==="textarea"}function uf(e,n,i,a){ti?mi?mi.push(a):mi=[a]:ti=a,n=ro(n,"onChange"),0<n.length&&(i=new is("onChange","change",null,i,a),e.push({event:i,listeners:n}))}var sa=null,aa=null;function sy(e){Vp(e,0)}function gl(e){var n=zi(e);if(ul(n))return e}function hf(e,n){if(e==="change")return n}var ff=!1;if(Kt){var Yo;if(Kt){var Xo="oninput"in document;if(!Xo){var df=document.createElement("div");df.setAttribute("oninput","return;"),Xo=typeof df.oninput=="function"}Yo=Xo}else Yo=!1;ff=Yo&&(!document.documentMode||9<document.documentMode)}function pf(){sa&&(sa.detachEvent("onpropertychange",mf),aa=sa=null)}function mf(e){if(e.propertyName==="value"&&gl(aa)){var n=[];uf(n,aa,e,ts(e)),ta(sy,n)}}function ay(e,n,i){e==="focusin"?(pf(),sa=n,aa=i,sa.attachEvent("onpropertychange",mf)):e==="focusout"&&pf()}function ly(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gl(aa)}function oy(e,n){if(e==="click")return gl(n)}function cy(e,n){if(e==="input"||e==="change")return gl(n)}function uy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var bn=typeof Object.is=="function"?Object.is:uy;function la(e,n){if(bn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),a=Object.keys(n);if(i.length!==a.length)return!1;for(a=0;a<i.length;a++){var g=i[a];if(!He.call(n,g)||!bn(e[g],n[g]))return!1}return!0}function gf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _f(e,n){var i=gf(e);e=0;for(var a;i;){if(i.nodeType===3){if(a=e+i.textContent.length,e<=n&&a>=n)return{node:i,offset:n-e};e=a}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=gf(i)}}function vf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?vf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function yf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Zr(e.document);n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=Zr(e.document)}return n}function Qo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var hy=Kt&&"documentMode"in document&&11>=document.documentMode,ss=null,Jo=null,oa=null,Zo=!1;function Sf(e,n,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Zo||ss==null||ss!==Zr(a)||(a=ss,"selectionStart"in a&&Qo(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}),oa&&la(oa,a)||(oa=a,a=ro(Jo,"onSelect"),0<a.length&&(n=new is("onSelect","select",null,n,i),e.push({event:n,listeners:a}),n.target=ss)))}function Tr(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var as={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},ec={},bf={};Kt&&(bf=document.createElement("div").style,"AnimationEvent"in window||(delete as.animationend.animation,delete as.animationiteration.animation,delete as.animationstart.animation),"TransitionEvent"in window||delete as.transitionend.transition);function Rr(e){if(ec[e])return ec[e];if(!as[e])return e;var n=as[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in bf)return ec[e]=n[i];return e}var Cf=Rr("animationend"),wf=Rr("animationiteration"),xf=Rr("animationstart"),fy=Rr("transitionrun"),dy=Rr("transitionstart"),py=Rr("transitioncancel"),Ef=Rr("transitionend"),kf=new Map,tc="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(" ");tc.push("scrollEnd");function Vn(e,n){kf.set(e,n),Zn(n,[e])}var _l=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},On=[],ls=0,nc=0;function vl(){for(var e=ls,n=nc=ls=0;n<e;){var i=On[n];On[n++]=null;var a=On[n];On[n++]=null;var g=On[n];On[n++]=null;var C=On[n];if(On[n++]=null,a!==null&&g!==null){var O=a.pending;O===null?g.next=g:(g.next=O.next,O.next=g),a.pending=g}C!==0&&Af(i,g,C)}}function yl(e,n,i,a){On[ls++]=e,On[ls++]=n,On[ls++]=i,On[ls++]=a,nc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function ic(e,n,i,a){return yl(e,n,i,a),Sl(e)}function Dr(e,n){return yl(e,null,null,n),Sl(e)}function Af(e,n,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var g=!1,C=e.return;C!==null;)C.childLanes|=i,a=C.alternate,a!==null&&(a.childLanes|=i),C.tag===22&&(e=C.stateNode,e===null||e._visibility&1||(g=!0)),e=C,C=C.return;return e.tag===3?(C=e.stateNode,g&&n!==null&&(g=31-nt(i),e=C.hiddenUpdates,a=e[g],a===null?e[g]=[n]:a.push(n),n.lane=i|536870912),C):null}function Sl(e){if(50<Da)throw Da=0,fu=null,Error(l(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var os={};function my(e,n,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=n,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 Cn(e,n,i,a){return new my(e,n,i,a)}function rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _i(e,n){var i=e.alternate;return i===null?(i=Cn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,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,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Tf(e,n){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=n,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,n=i.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function bl(e,n,i,a,g,C){var O=0;if(a=e,typeof e=="function")rc(e)&&(O=1);else if(typeof e=="string")O=S0(e,i,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=Cn(31,i,n,g),e.elementType=R,e.lanes=C,e;case E:return Mr(i.children,g,C,n);case b:O=8,g|=24;break;case v:return e=Cn(12,i,n,g|2),e.elementType=v,e.lanes=C,e;case L:return e=Cn(13,i,n,g),e.elementType=L,e.lanes=C,e;case M:return e=Cn(19,i,n,g),e.elementType=M,e.lanes=C,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:O=10;break e;case _:O=9;break e;case A:O=11;break e;case D:O=14;break e;case k:O=16,a=null;break e}O=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return n=Cn(O,i,n,g),n.elementType=e,n.type=a,n.lanes=C,n}function Mr(e,n,i,a){return e=Cn(7,e,a,n),e.lanes=i,e}function sc(e,n,i){return e=Cn(6,e,null,n),e.lanes=i,e}function Rf(e){var n=Cn(18,null,null,0);return n.stateNode=e,n}function ac(e,n,i){return n=Cn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Df=new WeakMap;function Bn(e,n){if(typeof e=="object"&&e!==null){var i=Df.get(e);return i!==void 0?i:(n={value:e,source:n,stack:ge(n)},Df.set(e,n),n)}return{value:e,source:n,stack:ge(n)}}var cs=[],us=0,Cl=null,ca=0,jn=[],Nn=0,Ki=null,ii=1,ri="";function vi(e,n){cs[us++]=ca,cs[us++]=Cl,Cl=e,ca=n}function Mf(e,n,i){jn[Nn++]=ii,jn[Nn++]=ri,jn[Nn++]=Ki,Ki=e;var a=ii;e=ri;var g=32-nt(a)-1;a&=~(1<<g),i+=1;var C=32-nt(n)+g;if(30<C){var O=g-g%5;C=(a&(1<<O)-1).toString(32),a>>=O,g-=O,ii=1<<32-nt(n)+g|i<<g|a,ri=C+e}else ii=1<<C|i<<g|a,ri=e}function lc(e){e.return!==null&&(vi(e,1),Mf(e,1,0))}function oc(e){for(;e===Cl;)Cl=cs[--us],cs[us]=null,ca=cs[--us],cs[us]=null;for(;e===Ki;)Ki=jn[--Nn],jn[Nn]=null,ri=jn[--Nn],jn[Nn]=null,ii=jn[--Nn],jn[Nn]=null}function Lf(e,n){jn[Nn++]=ii,jn[Nn++]=ri,jn[Nn++]=Ki,ii=n.id,ri=n.overflow,Ki=e}var Ft=null,mt=null,Qe=!1,Yi=null,Hn=!1,cc=Error(l(519));function Xi(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ua(Bn(n,e)),cc}function Of(e){var n=e.stateNode,i=e.type,a=e.memoizedProps;switch(n[At]=e,n[It]=a,i){case"dialog":Ve("cancel",n),Ve("close",n);break;case"iframe":case"object":case"embed":Ve("load",n);break;case"video":case"audio":for(i=0;i<La.length;i++)Ve(La[i],n);break;case"source":Ve("error",n);break;case"img":case"image":case"link":Ve("error",n),Ve("load",n);break;case"details":Ve("toggle",n);break;case"input":Ve("invalid",n),Pt(n,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ve("invalid",n);break;case"textarea":Ve("invalid",n),es(n,a.value,a.defaultValue,a.children)}i=a.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||a.suppressHydrationWarning===!0||Xp(n.textContent,i)?(a.popover!=null&&(Ve("beforetoggle",n),Ve("toggle",n)),a.onScroll!=null&&Ve("scroll",n),a.onScrollEnd!=null&&Ve("scrollend",n),a.onClick!=null&&(n.onclick=Wt),n=!0):n=!1,n||Xi(e,!0)}function Bf(e){for(Ft=e.return;Ft;)switch(Ft.tag){case 5:case 31:case 13:Hn=!1;return;case 27:case 3:Hn=!0;return;default:Ft=Ft.return}}function hs(e){if(e!==Ft)return!1;if(!Qe)return Bf(e),Qe=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Au(e.type,e.memoizedProps)),i=!i),i&&mt&&Xi(e),Bf(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));mt=sm(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));mt=sm(e)}else n===27?(n=mt,ur(e.type)?(e=Lu,Lu=null,mt=e):mt=n):mt=Ft?In(e.stateNode.nextSibling):null;return!0}function Lr(){mt=Ft=null,Qe=!1}function uc(){var e=Yi;return e!==null&&(hn===null?hn=e:hn.push.apply(hn,e),Yi=null),e}function ua(e){Yi===null?Yi=[e]:Yi.push(e)}var hc=N(null),Or=null,yi=null;function Qi(e,n,i){I(hc,n._currentValue),n._currentValue=i}function Si(e){e._currentValue=hc.current,$(hc)}function fc(e,n,i){for(;e!==null;){var a=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,a!==null&&(a.childLanes|=n)):a!==null&&(a.childLanes&n)!==n&&(a.childLanes|=n),e===i)break;e=e.return}}function dc(e,n,i,a){var g=e.child;for(g!==null&&(g.return=e);g!==null;){var C=g.dependencies;if(C!==null){var O=g.child;C=C.firstContext;e:for(;C!==null;){var F=C;C=g;for(var X=0;X<n.length;X++)if(F.context===n[X]){C.lanes|=i,F=C.alternate,F!==null&&(F.lanes|=i),fc(C.return,i,e),a||(O=null);break e}C=F.next}}else if(g.tag===18){if(O=g.return,O===null)throw Error(l(341));O.lanes|=i,C=O.alternate,C!==null&&(C.lanes|=i),fc(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 fs(e,n,i,a){e=null;for(var g=n,C=!1;g!==null;){if(!C){if((g.flags&524288)!==0)C=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var O=g.alternate;if(O===null)throw Error(l(387));if(O=O.memoizedProps,O!==null){var F=g.type;bn(g.pendingProps.value,O.value)||(e!==null?e.push(F):e=[F])}}else if(g===Q.current){if(O=g.alternate,O===null)throw Error(l(387));O.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(e!==null?e.push(Ha):e=[Ha])}g=g.return}e!==null&&dc(n,e,i,a),n.flags|=262144}function wl(e){for(e=e.firstContext;e!==null;){if(!bn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Br(e){Or=e,yi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qt(e){return jf(Or,e)}function xl(e,n){return Or===null&&Br(e),jf(e,n)}function jf(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},yi===null){if(e===null)throw Error(l(308));yi=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else yi=yi.next=n;return i}var gy=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(i,a){e.push(a)}};this.abort=function(){n.aborted=!0,e.forEach(function(i){return i()})}},_y=t.unstable_scheduleCallback,vy=t.unstable_NormalPriority,Mt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pc(){return{controller:new gy,data:new Map,refCount:0}}function ha(e){e.refCount--,e.refCount===0&&_y(vy,function(){e.controller.abort()})}var fa=null,mc=0,ds=0,ps=null;function yy(e,n){if(fa===null){var i=fa=[];mc=0,ds=vu(),ps={status:"pending",value:void 0,then:function(a){i.push(a)}}}return mc++,n.then(Nf,Nf),n}function Nf(){if(--mc===0&&fa!==null){ps!==null&&(ps.status="fulfilled");var e=fa;fa=null,ds=0,ps=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Sy(e,n){var i=[],a={status:"pending",value:null,reason:null,then:function(g){i.push(g)}};return e.then(function(){a.status="fulfilled",a.value=n;for(var g=0;g<i.length;g++)(0,i[g])(n)},function(g){for(a.status="rejected",a.reason=g,g=0;g<i.length;g++)(0,i[g])(void 0)}),a}var Hf=G.S;G.S=function(e,n){Sp=dt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&yy(e,n),Hf!==null&&Hf(e,n)};var jr=N(null);function gc(){var e=jr.current;return e!==null?e:ct.pooledCache}function El(e,n){n===null?I(jr,jr.current):I(jr,n.pool)}function zf(){var e=gc();return e===null?null:{parent:Mt._currentValue,pool:e}}var ms=Error(l(460)),_c=Error(l(474)),kl=Error(l(542)),Al={then:function(){}};function If(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pf(e,n,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(Wt,Wt),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Ff(e),e;default:if(typeof n.status=="string")n.then(Wt,Wt);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=n,e.status="pending",e.then(function(a){if(n.status==="pending"){var g=n;g.status="fulfilled",g.value=a}},function(a){if(n.status==="pending"){var g=n;g.status="rejected",g.reason=a}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Ff(e),e}throw Hr=n,ms}}function Nr(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Hr=i,ms):i}}var Hr=null;function Uf(){if(Hr===null)throw Error(l(459));var e=Hr;return Hr=null,e}function Ff(e){if(e===ms||e===kl)throw Error(l(483))}var gs=null,da=0;function Tl(e){var n=da;return da+=1,gs===null&&(gs=[]),Pf(gs,e,n)}function pa(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Rl(e,n){throw n.$$typeof===y?Error(l(525)):(e=Object.prototype.toString.call(n),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function qf(e){function n(ne,J){if(e){var re=ne.deletions;re===null?(ne.deletions=[J],ne.flags|=16):re.push(J)}}function i(ne,J){if(!e)return null;for(;J!==null;)n(ne,J),J=J.sibling;return null}function a(ne){for(var J=new Map;ne!==null;)ne.key!==null?J.set(ne.key,ne):J.set(ne.index,ne),ne=ne.sibling;return J}function g(ne,J){return ne=_i(ne,J),ne.index=0,ne.sibling=null,ne}function C(ne,J,re){return ne.index=re,e?(re=ne.alternate,re!==null?(re=re.index,re<J?(ne.flags|=67108866,J):re):(ne.flags|=67108866,J)):(ne.flags|=1048576,J)}function O(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function F(ne,J,re,pe){return J===null||J.tag!==6?(J=sc(re,ne.mode,pe),J.return=ne,J):(J=g(J,re),J.return=ne,J)}function X(ne,J,re,pe){var Le=re.type;return Le===E?fe(ne,J,re.props.children,pe,re.key):J!==null&&(J.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===k&&Nr(Le)===J.type)?(J=g(J,re.props),pa(J,re),J.return=ne,J):(J=bl(re.type,re.key,re.props,null,ne.mode,pe),pa(J,re),J.return=ne,J)}function se(ne,J,re,pe){return J===null||J.tag!==4||J.stateNode.containerInfo!==re.containerInfo||J.stateNode.implementation!==re.implementation?(J=ac(re,ne.mode,pe),J.return=ne,J):(J=g(J,re.children||[]),J.return=ne,J)}function fe(ne,J,re,pe,Le){return J===null||J.tag!==7?(J=Mr(re,ne.mode,pe,Le),J.return=ne,J):(J=g(J,re),J.return=ne,J)}function _e(ne,J,re){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=sc(""+J,ne.mode,re),J.return=ne,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case w:return re=bl(J.type,J.key,J.props,null,ne.mode,re),pa(re,J),re.return=ne,re;case T:return J=ac(J,ne.mode,re),J.return=ne,J;case k:return J=Nr(J),_e(ne,J,re)}if(K(J)||U(J))return J=Mr(J,ne.mode,re,null),J.return=ne,J;if(typeof J.then=="function")return _e(ne,Tl(J),re);if(J.$$typeof===S)return _e(ne,xl(ne,J),re);Rl(ne,J)}return null}function le(ne,J,re,pe){var Le=J!==null?J.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Le!==null?null:F(ne,J,""+re,pe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return re.key===Le?X(ne,J,re,pe):null;case T:return re.key===Le?se(ne,J,re,pe):null;case k:return re=Nr(re),le(ne,J,re,pe)}if(K(re)||U(re))return Le!==null?null:fe(ne,J,re,pe,null);if(typeof re.then=="function")return le(ne,J,Tl(re),pe);if(re.$$typeof===S)return le(ne,J,xl(ne,re),pe);Rl(ne,re)}return null}function oe(ne,J,re,pe,Le){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ne=ne.get(re)||null,F(J,ne,""+pe,Le);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case w:return ne=ne.get(pe.key===null?re:pe.key)||null,X(J,ne,pe,Le);case T:return ne=ne.get(pe.key===null?re:pe.key)||null,se(J,ne,pe,Le);case k:return pe=Nr(pe),oe(ne,J,re,pe,Le)}if(K(pe)||U(pe))return ne=ne.get(re)||null,fe(J,ne,pe,Le,null);if(typeof pe.then=="function")return oe(ne,J,re,Tl(pe),Le);if(pe.$$typeof===S)return oe(ne,J,re,xl(J,pe),Le);Rl(J,pe)}return null}function Te(ne,J,re,pe){for(var Le=null,et=null,De=J,Ue=J=0,Xe=null;De!==null&&Ue<re.length;Ue++){De.index>Ue?(Xe=De,De=null):Xe=De.sibling;var tt=le(ne,De,re[Ue],pe);if(tt===null){De===null&&(De=Xe);break}e&&De&&tt.alternate===null&&n(ne,De),J=C(tt,J,Ue),et===null?Le=tt:et.sibling=tt,et=tt,De=Xe}if(Ue===re.length)return i(ne,De),Qe&&vi(ne,Ue),Le;if(De===null){for(;Ue<re.length;Ue++)De=_e(ne,re[Ue],pe),De!==null&&(J=C(De,J,Ue),et===null?Le=De:et.sibling=De,et=De);return Qe&&vi(ne,Ue),Le}for(De=a(De);Ue<re.length;Ue++)Xe=oe(De,ne,Ue,re[Ue],pe),Xe!==null&&(e&&Xe.alternate!==null&&De.delete(Xe.key===null?Ue:Xe.key),J=C(Xe,J,Ue),et===null?Le=Xe:et.sibling=Xe,et=Xe);return e&&De.forEach(function(mr){return n(ne,mr)}),Qe&&vi(ne,Ue),Le}function Be(ne,J,re,pe){if(re==null)throw Error(l(151));for(var Le=null,et=null,De=J,Ue=J=0,Xe=null,tt=re.next();De!==null&&!tt.done;Ue++,tt=re.next()){De.index>Ue?(Xe=De,De=null):Xe=De.sibling;var mr=le(ne,De,tt.value,pe);if(mr===null){De===null&&(De=Xe);break}e&&De&&mr.alternate===null&&n(ne,De),J=C(mr,J,Ue),et===null?Le=mr:et.sibling=mr,et=mr,De=Xe}if(tt.done)return i(ne,De),Qe&&vi(ne,Ue),Le;if(De===null){for(;!tt.done;Ue++,tt=re.next())tt=_e(ne,tt.value,pe),tt!==null&&(J=C(tt,J,Ue),et===null?Le=tt:et.sibling=tt,et=tt);return Qe&&vi(ne,Ue),Le}for(De=a(De);!tt.done;Ue++,tt=re.next())tt=oe(De,ne,Ue,tt.value,pe),tt!==null&&(e&&tt.alternate!==null&&De.delete(tt.key===null?Ue:tt.key),J=C(tt,J,Ue),et===null?Le=tt:et.sibling=tt,et=tt);return e&&De.forEach(function(M0){return n(ne,M0)}),Qe&&vi(ne,Ue),Le}function ot(ne,J,re,pe){if(typeof re=="object"&&re!==null&&re.type===E&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case w:e:{for(var Le=re.key;J!==null;){if(J.key===Le){if(Le=re.type,Le===E){if(J.tag===7){i(ne,J.sibling),pe=g(J,re.props.children),pe.return=ne,ne=pe;break e}}else if(J.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===k&&Nr(Le)===J.type){i(ne,J.sibling),pe=g(J,re.props),pa(pe,re),pe.return=ne,ne=pe;break e}i(ne,J);break}else n(ne,J);J=J.sibling}re.type===E?(pe=Mr(re.props.children,ne.mode,pe,re.key),pe.return=ne,ne=pe):(pe=bl(re.type,re.key,re.props,null,ne.mode,pe),pa(pe,re),pe.return=ne,ne=pe)}return O(ne);case T:e:{for(Le=re.key;J!==null;){if(J.key===Le)if(J.tag===4&&J.stateNode.containerInfo===re.containerInfo&&J.stateNode.implementation===re.implementation){i(ne,J.sibling),pe=g(J,re.children||[]),pe.return=ne,ne=pe;break e}else{i(ne,J);break}else n(ne,J);J=J.sibling}pe=ac(re,ne.mode,pe),pe.return=ne,ne=pe}return O(ne);case k:return re=Nr(re),ot(ne,J,re,pe)}if(K(re))return Te(ne,J,re,pe);if(U(re)){if(Le=U(re),typeof Le!="function")throw Error(l(150));return re=Le.call(re),Be(ne,J,re,pe)}if(typeof re.then=="function")return ot(ne,J,Tl(re),pe);if(re.$$typeof===S)return ot(ne,J,xl(ne,re),pe);Rl(ne,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,J!==null&&J.tag===6?(i(ne,J.sibling),pe=g(J,re),pe.return=ne,ne=pe):(i(ne,J),pe=sc(re,ne.mode,pe),pe.return=ne,ne=pe),O(ne)):i(ne,J)}return function(ne,J,re,pe){try{da=0;var Le=ot(ne,J,re,pe);return gs=null,Le}catch(De){if(De===ms||De===kl)throw De;var et=Cn(29,De,null,ne.mode);return et.lanes=pe,et.return=ne,et}finally{}}}var zr=qf(!0),$f=qf(!1),Ji=!1;function vc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yc(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Zi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function er(e,n,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(it&2)!==0){var g=a.pending;return g===null?n.next=n:(n.next=g.next,g.next=n),a.pending=n,n=Sl(e),Af(e,null,i),n}return yl(e,a,n,i),Sl(e)}function ma(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var a=n.lanes;a&=e.pendingLanes,i|=a,n.lanes=i,Dn(e,i)}}function Sc(e,n){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var g=null,C=null;if(i=i.firstBaseUpdate,i!==null){do{var O={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};C===null?g=C=O:C=C.next=O,i=i.next}while(i!==null);C===null?g=C=n:C=C.next=n}else g=C=n;i={baseState:a.baseState,firstBaseUpdate:g,lastBaseUpdate:C,shared:a.shared,callbacks:a.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}var bc=!1;function ga(){if(bc){var e=ps;if(e!==null)throw e}}function _a(e,n,i,a){bc=!1;var g=e.updateQueue;Ji=!1;var C=g.firstBaseUpdate,O=g.lastBaseUpdate,F=g.shared.pending;if(F!==null){g.shared.pending=null;var X=F,se=X.next;X.next=null,O===null?C=se:O.next=se,O=X;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,F=fe.lastBaseUpdate,F!==O&&(F===null?fe.firstBaseUpdate=se:F.next=se,fe.lastBaseUpdate=X))}if(C!==null){var _e=g.baseState;O=0,fe=se=X=null,F=C;do{var le=F.lane&-536870913,oe=le!==F.lane;if(oe?(Ye&le)===le:(a&le)===le){le!==0&&le===ds&&(bc=!0),fe!==null&&(fe=fe.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var Te=e,Be=F;le=n;var ot=i;switch(Be.tag){case 1:if(Te=Be.payload,typeof Te=="function"){_e=Te.call(ot,_e,le);break e}_e=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Be.payload,le=typeof Te=="function"?Te.call(ot,_e,le):Te,le==null)break e;_e=u({},_e,le);break e;case 2:Ji=!0}}le=F.callback,le!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=g.callbacks,oe===null?g.callbacks=[le]:oe.push(le))}else oe={lane:le,tag:F.tag,payload:F.payload,callback:F.callback,next:null},fe===null?(se=fe=oe,X=_e):fe=fe.next=oe,O|=le;if(F=F.next,F===null){if(F=g.shared.pending,F===null)break;oe=F,F=oe.next,oe.next=null,g.lastBaseUpdate=oe,g.shared.pending=null}}while(!0);fe===null&&(X=_e),g.baseState=X,g.firstBaseUpdate=se,g.lastBaseUpdate=fe,C===null&&(g.shared.lanes=0),sr|=O,e.lanes=O,e.memoizedState=_e}}function Gf(e,n){if(typeof e!="function")throw Error(l(191,e));e.call(n)}function Vf(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Gf(i[e],n)}var _s=N(null),Dl=N(0);function Wf(e,n){e=Ri,I(Dl,e),I(_s,n),Ri=e|n.baseLanes}function Cc(){I(Dl,Ri),I(_s,_s.current)}function wc(){Ri=Dl.current,$(_s),$(Dl)}var wn=N(null),zn=null;function tr(e){var n=e.alternate;I(Tt,Tt.current&1),I(wn,e),zn===null&&(n===null||_s.current!==null||n.memoizedState!==null)&&(zn=e)}function xc(e){I(Tt,Tt.current),I(wn,e),zn===null&&(zn=e)}function Kf(e){e.tag===22?(I(Tt,Tt.current),I(wn,e),zn===null&&(zn=e)):nr()}function nr(){I(Tt,Tt.current),I(wn,wn.current)}function xn(e){$(wn),zn===e&&(zn=null),$(Tt)}var Tt=N(0);function Ml(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Du(i)||Mu(i)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var bi=0,Pe=null,at=null,Lt=null,Ll=!1,vs=!1,Ir=!1,Ol=0,va=0,ys=null,by=0;function Et(){throw Error(l(321))}function Ec(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!bn(e[i],n[i]))return!1;return!0}function kc(e,n,i,a,g,C){return bi=C,Pe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=e===null||e.memoizedState===null?Md:Uc,Ir=!1,C=i(a,g),Ir=!1,vs&&(C=Xf(n,i,a,g)),Yf(e),C}function Yf(e){G.H=ba;var n=at!==null&&at.next!==null;if(bi=0,Lt=at=Pe=null,Ll=!1,va=0,ys=null,n)throw Error(l(300));e===null||Ot||(e=e.dependencies,e!==null&&wl(e)&&(Ot=!0))}function Xf(e,n,i,a){Pe=e;var g=0;do{if(vs&&(ys=null),va=0,vs=!1,25<=g)throw Error(l(301));if(g+=1,Lt=at=null,e.updateQueue!=null){var C=e.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}G.H=Ld,C=n(i,a)}while(vs);return C}function Cy(){var e=G.H,n=e.useState()[0];return n=typeof n.then=="function"?ya(n):n,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(Pe.flags|=1024),n}function Ac(){var e=Ol!==0;return Ol=0,e}function Tc(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function Rc(e){if(Ll){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Ll=!1}bi=0,Lt=at=Pe=null,vs=!1,va=Ol=0,ys=null}function rn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?Pe.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Rt(){if(at===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var n=Lt===null?Pe.memoizedState:Lt.next;if(n!==null)Lt=n,at=e;else{if(e===null)throw Pe.alternate===null?Error(l(467)):Error(l(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Lt===null?Pe.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function Bl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ya(e){var n=va;return va+=1,ys===null&&(ys=[]),e=Pf(ys,e,n),n=Pe,(Lt===null?n.memoizedState:Lt.next)===null&&(n=n.alternate,G.H=n===null||n.memoizedState===null?Md:Uc),e}function jl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ya(e);if(e.$$typeof===S)return qt(e)}throw Error(l(438,String(e)))}function Dc(e){var n=null,i=Pe.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var a=Pe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(n={data:a.data.map(function(g){return g.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=Bl(),Pe.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(e),a=0;a<e;a++)i[a]=B;return n.index++,i}function Ci(e,n){return typeof n=="function"?n(e):n}function Nl(e){var n=Rt();return Mc(n,at,e)}function Mc(e,n,i){var a=e.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=i;var g=e.baseQueue,C=a.pending;if(C!==null){if(g!==null){var O=g.next;g.next=C.next,C.next=O}n.baseQueue=g=C,a.pending=null}if(C=e.baseState,g===null)e.memoizedState=C;else{n=g.next;var F=O=null,X=null,se=n,fe=!1;do{var _e=se.lane&-536870913;if(_e!==se.lane?(Ye&_e)===_e:(bi&_e)===_e){var le=se.revertLane;if(le===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),_e===ds&&(fe=!0);else if((bi&le)===le){se=se.next,le===ds&&(fe=!0);continue}else _e={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},X===null?(F=X=_e,O=C):X=X.next=_e,Pe.lanes|=le,sr|=le;_e=se.action,Ir&&i(C,_e),C=se.hasEagerState?se.eagerState:i(C,_e)}else le={lane:_e,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},X===null?(F=X=le,O=C):X=X.next=le,Pe.lanes|=_e,sr|=_e;se=se.next}while(se!==null&&se!==n);if(X===null?O=C:X.next=F,!bn(C,e.memoizedState)&&(Ot=!0,fe&&(i=ps,i!==null)))throw i;e.memoizedState=C,e.baseState=O,e.baseQueue=X,a.lastRenderedState=C}return g===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Lc(e){var n=Rt(),i=n.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var a=i.dispatch,g=i.pending,C=n.memoizedState;if(g!==null){i.pending=null;var O=g=g.next;do C=e(C,O.action),O=O.next;while(O!==g);bn(C,n.memoizedState)||(Ot=!0),n.memoizedState=C,n.baseQueue===null&&(n.baseState=C),i.lastRenderedState=C}return[C,a]}function Qf(e,n,i){var a=Pe,g=Rt(),C=Qe;if(C){if(i===void 0)throw Error(l(407));i=i()}else i=n();var O=!bn((at||g).memoizedState,i);if(O&&(g.memoizedState=i,Ot=!0),g=g.queue,jc(ed.bind(null,a,g,e),[e]),g.getSnapshot!==n||O||Lt!==null&&Lt.memoizedState.tag&1){if(a.flags|=2048,Ss(9,{destroy:void 0},Zf.bind(null,a,g,i,n),null),ct===null)throw Error(l(349));C||(bi&127)!==0||Jf(a,n,i)}return i}function Jf(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Pe.updateQueue,n===null?(n=Bl(),Pe.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function Zf(e,n,i,a){n.value=i,n.getSnapshot=a,td(n)&&nd(e)}function ed(e,n,i){return i(function(){td(n)&&nd(e)})}function td(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!bn(e,i)}catch{return!0}}function nd(e){var n=Dr(e,2);n!==null&&fn(n,e,2)}function Oc(e){var n=rn();if(typeof e=="function"){var i=e;if(e=i(),Ir){xt(!0);try{i()}finally{xt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:e},n}function id(e,n,i,a){return e.baseState=i,Mc(e,at,typeof a=="function"?a:Ci)}function wy(e,n,i,a,g){if(Il(e))throw Error(l(485));if(e=n.action,e!==null){var C={payload:g,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){C.listeners.push(O)}};G.T!==null?i(!0):C.isTransition=!1,a(C),i=n.pending,i===null?(C.next=n.pending=C,rd(n,C)):(C.next=i.next,n.pending=i.next=C)}}function rd(e,n){var i=n.action,a=n.payload,g=e.state;if(n.isTransition){var C=G.T,O={};G.T=O;try{var F=i(g,a),X=G.S;X!==null&&X(O,F),sd(e,n,F)}catch(se){Bc(e,n,se)}finally{C!==null&&O.types!==null&&(C.types=O.types),G.T=C}}else try{C=i(g,a),sd(e,n,C)}catch(se){Bc(e,n,se)}}function sd(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){ad(e,n,a)},function(a){return Bc(e,n,a)}):ad(e,n,i)}function ad(e,n,i){n.status="fulfilled",n.value=i,ld(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,rd(e,i)))}function Bc(e,n,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do n.status="rejected",n.reason=i,ld(n),n=n.next;while(n!==a)}e.action=null}function ld(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function od(e,n){return n}function cd(e,n){if(Qe){var i=ct.formState;if(i!==null){e:{var a=Pe;if(Qe){if(mt){t:{for(var g=mt,C=Hn;g.nodeType!==8;){if(!C){g=null;break t}if(g=In(g.nextSibling),g===null){g=null;break t}}C=g.data,g=C==="F!"||C==="F"?g:null}if(g){mt=In(g.nextSibling),a=g.data==="F!";break e}}Xi(a)}a=!1}a&&(n=i[0])}}return i=rn(),i.memoizedState=i.baseState=n,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:od,lastRenderedState:n},i.queue=a,i=Td.bind(null,Pe,a),a.dispatch=i,a=Oc(!1),C=Pc.bind(null,Pe,!1,a.queue),a=rn(),g={state:n,dispatch:null,action:e,pending:null},a.queue=g,i=wy.bind(null,Pe,g,C,i),g.dispatch=i,a.memoizedState=e,[n,i,!1]}function ud(e){var n=Rt();return hd(n,at,e)}function hd(e,n,i){if(n=Mc(e,n,od)[0],e=Nl(Ci)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var a=ya(n)}catch(O){throw O===ms?kl:O}else a=n;n=Rt();var g=n.queue,C=g.dispatch;return i!==n.memoizedState&&(Pe.flags|=2048,Ss(9,{destroy:void 0},xy.bind(null,g,i),null)),[a,C,e]}function xy(e,n){e.action=n}function fd(e){var n=Rt(),i=at;if(i!==null)return hd(n,i,e);Rt(),n=n.memoizedState,i=Rt();var a=i.queue.dispatch;return i.memoizedState=e,[n,a,!1]}function Ss(e,n,i,a){return e={tag:e,create:i,deps:a,inst:n,next:null},n=Pe.updateQueue,n===null&&(n=Bl(),Pe.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=e.next=e:(a=i.next,i.next=e,e.next=a,n.lastEffect=e),e}function dd(){return Rt().memoizedState}function Hl(e,n,i,a){var g=rn();Pe.flags|=e,g.memoizedState=Ss(1|n,{destroy:void 0},i,a===void 0?null:a)}function zl(e,n,i,a){var g=Rt();a=a===void 0?null:a;var C=g.memoizedState.inst;at!==null&&a!==null&&Ec(a,at.memoizedState.deps)?g.memoizedState=Ss(n,C,i,a):(Pe.flags|=e,g.memoizedState=Ss(1|n,C,i,a))}function pd(e,n){Hl(8390656,8,e,n)}function jc(e,n){zl(2048,8,e,n)}function Ey(e){Pe.flags|=4;var n=Pe.updateQueue;if(n===null)n=Bl(),Pe.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function md(e){var n=Rt().memoizedState;return Ey({ref:n,nextImpl:e}),function(){if((it&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function gd(e,n){return zl(4,2,e,n)}function _d(e,n){return zl(4,4,e,n)}function vd(e,n){if(typeof n=="function"){e=e();var i=n(e);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function yd(e,n,i){i=i!=null?i.concat([e]):null,zl(4,4,vd.bind(null,n,e),i)}function Nc(){}function Sd(e,n){var i=Rt();n=n===void 0?null:n;var a=i.memoizedState;return n!==null&&Ec(n,a[1])?a[0]:(i.memoizedState=[e,n],e)}function bd(e,n){var i=Rt();n=n===void 0?null:n;var a=i.memoizedState;if(n!==null&&Ec(n,a[1]))return a[0];if(a=e(),Ir){xt(!0);try{e()}finally{xt(!1)}}return i.memoizedState=[a,n],a}function Hc(e,n,i){return i===void 0||(bi&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=Cp(),Pe.lanes|=e,sr|=e,i)}function Cd(e,n,i,a){return bn(i,n)?i:_s.current!==null?(e=Hc(e,i,a),bn(e,n)||(Ot=!0),e):(bi&42)===0||(bi&1073741824)!==0&&(Ye&261930)===0?(Ot=!0,e.memoizedState=i):(e=Cp(),Pe.lanes|=e,sr|=e,n)}function wd(e,n,i,a,g){var C=Y.p;Y.p=C!==0&&8>C?C:8;var O=G.T,F={};G.T=F,Pc(e,!1,n,i);try{var X=g(),se=G.S;if(se!==null&&se(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var fe=Sy(X,a);Sa(e,n,fe,An(e))}else Sa(e,n,a,An(e))}catch(_e){Sa(e,n,{then:function(){},status:"rejected",reason:_e},An())}finally{Y.p=C,O!==null&&F.types!==null&&(O.types=F.types),G.T=O}}function ky(){}function zc(e,n,i,a){if(e.tag!==5)throw Error(l(476));var g=xd(e).queue;wd(e,g,n,ee,i===null?ky:function(){return Ed(e),i(a)})}function xd(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:ee},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ci,lastRenderedState:i},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Ed(e){var n=xd(e);n.next===null&&(n=e.alternate.memoizedState),Sa(e,n.next.queue,{},An())}function Ic(){return qt(Ha)}function kd(){return Rt().memoizedState}function Ad(){return Rt().memoizedState}function Ay(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=An();e=Zi(i);var a=er(n,e,i);a!==null&&(fn(a,n,i),ma(a,n,i)),n={cache:pc()},e.payload=n;return}n=n.return}}function Ty(e,n,i){var a=An();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Il(e)?Rd(n,i):(i=ic(e,n,i,a),i!==null&&(fn(i,e,a),Dd(i,n,a)))}function Td(e,n,i){var a=An();Sa(e,n,i,a)}function Sa(e,n,i,a){var g={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Il(e))Rd(n,g);else{var C=e.alternate;if(e.lanes===0&&(C===null||C.lanes===0)&&(C=n.lastRenderedReducer,C!==null))try{var O=n.lastRenderedState,F=C(O,i);if(g.hasEagerState=!0,g.eagerState=F,bn(F,O))return yl(e,n,g,0),ct===null&&vl(),!1}catch{}finally{}if(i=ic(e,n,g,a),i!==null)return fn(i,e,a),Dd(i,n,a),!0}return!1}function Pc(e,n,i,a){if(a={lane:2,revertLane:vu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Il(e)){if(n)throw Error(l(479))}else n=ic(e,i,a,2),n!==null&&fn(n,e,2)}function Il(e){var n=e.alternate;return e===Pe||n!==null&&n===Pe}function Rd(e,n){vs=Ll=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Dd(e,n,i){if((i&4194048)!==0){var a=n.lanes;a&=e.pendingLanes,i|=a,n.lanes=i,Dn(e,i)}}var ba={readContext:qt,use:jl,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};ba.useEffectEvent=Et;var Md={readContext:qt,use:jl,useCallback:function(e,n){return rn().memoizedState=[e,n===void 0?null:n],e},useContext:qt,useEffect:pd,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,Hl(4194308,4,vd.bind(null,n,e),i)},useLayoutEffect:function(e,n){return Hl(4194308,4,e,n)},useInsertionEffect:function(e,n){Hl(4,2,e,n)},useMemo:function(e,n){var i=rn();n=n===void 0?null:n;var a=e();if(Ir){xt(!0);try{e()}finally{xt(!1)}}return i.memoizedState=[a,n],a},useReducer:function(e,n,i){var a=rn();if(i!==void 0){var g=i(n);if(Ir){xt(!0);try{i(n)}finally{xt(!1)}}}else g=n;return a.memoizedState=a.baseState=g,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:g},a.queue=e,e=e.dispatch=Ty.bind(null,Pe,e),[a.memoizedState,e]},useRef:function(e){var n=rn();return e={current:e},n.memoizedState=e},useState:function(e){e=Oc(e);var n=e.queue,i=Td.bind(null,Pe,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:Nc,useDeferredValue:function(e,n){var i=rn();return Hc(i,e,n)},useTransition:function(){var e=Oc(!1);return e=wd.bind(null,Pe,e.queue,!0,!1),rn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var a=Pe,g=rn();if(Qe){if(i===void 0)throw Error(l(407));i=i()}else{if(i=n(),ct===null)throw Error(l(349));(Ye&127)!==0||Jf(a,n,i)}g.memoizedState=i;var C={value:i,getSnapshot:n};return g.queue=C,pd(ed.bind(null,a,C,e),[e]),a.flags|=2048,Ss(9,{destroy:void 0},Zf.bind(null,a,C,i,n),null),i},useId:function(){var e=rn(),n=ct.identifierPrefix;if(Qe){var i=ri,a=ii;i=(a&~(1<<32-nt(a)-1)).toString(32)+i,n="_"+n+"R_"+i,i=Ol++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=by++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Ic,useFormState:cd,useActionState:cd,useOptimistic:function(e){var n=rn();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Pc.bind(null,Pe,!0,i),i.dispatch=n,[e,n]},useMemoCache:Dc,useCacheRefresh:function(){return rn().memoizedState=Ay.bind(null,Pe)},useEffectEvent:function(e){var n=rn(),i={impl:e};return n.memoizedState=i,function(){if((it&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Uc={readContext:qt,use:jl,useCallback:Sd,useContext:qt,useEffect:jc,useImperativeHandle:yd,useInsertionEffect:gd,useLayoutEffect:_d,useMemo:bd,useReducer:Nl,useRef:dd,useState:function(){return Nl(Ci)},useDebugValue:Nc,useDeferredValue:function(e,n){var i=Rt();return Cd(i,at.memoizedState,e,n)},useTransition:function(){var e=Nl(Ci)[0],n=Rt().memoizedState;return[typeof e=="boolean"?e:ya(e),n]},useSyncExternalStore:Qf,useId:kd,useHostTransitionStatus:Ic,useFormState:ud,useActionState:ud,useOptimistic:function(e,n){var i=Rt();return id(i,at,e,n)},useMemoCache:Dc,useCacheRefresh:Ad};Uc.useEffectEvent=md;var Ld={readContext:qt,use:jl,useCallback:Sd,useContext:qt,useEffect:jc,useImperativeHandle:yd,useInsertionEffect:gd,useLayoutEffect:_d,useMemo:bd,useReducer:Lc,useRef:dd,useState:function(){return Lc(Ci)},useDebugValue:Nc,useDeferredValue:function(e,n){var i=Rt();return at===null?Hc(i,e,n):Cd(i,at.memoizedState,e,n)},useTransition:function(){var e=Lc(Ci)[0],n=Rt().memoizedState;return[typeof e=="boolean"?e:ya(e),n]},useSyncExternalStore:Qf,useId:kd,useHostTransitionStatus:Ic,useFormState:fd,useActionState:fd,useOptimistic:function(e,n){var i=Rt();return at!==null?id(i,at,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Dc,useCacheRefresh:Ad};Ld.useEffectEvent=md;function Fc(e,n,i,a){n=e.memoizedState,i=i(a,n),i=i==null?n:u({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var qc={enqueueSetState:function(e,n,i){e=e._reactInternals;var a=An(),g=Zi(a);g.payload=n,i!=null&&(g.callback=i),n=er(e,g,a),n!==null&&(fn(n,e,a),ma(n,e,a))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var a=An(),g=Zi(a);g.tag=1,g.payload=n,i!=null&&(g.callback=i),n=er(e,g,a),n!==null&&(fn(n,e,a),ma(n,e,a))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=An(),a=Zi(i);a.tag=2,n!=null&&(a.callback=n),n=er(e,a,i),n!==null&&(fn(n,e,i),ma(n,e,i))}};function Od(e,n,i,a,g,C,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,C,O):n.prototype&&n.prototype.isPureReactComponent?!la(i,a)||!la(g,C):!0}function Bd(e,n,i,a){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,a),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,a),n.state!==e&&qc.enqueueReplaceState(n,n.state,null)}function Pr(e,n){var i=n;if("ref"in n){i={};for(var a in n)a!=="ref"&&(i[a]=n[a])}if(e=e.defaultProps){i===n&&(i=u({},i));for(var g in e)i[g]===void 0&&(i[g]=e[g])}return i}function jd(e){_l(e)}function Nd(e){console.error(e)}function Hd(e){_l(e)}function Pl(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(a){setTimeout(function(){throw a})}}function zd(e,n,i){try{var a=e.onCaughtError;a(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function $c(e,n,i){return i=Zi(i),i.tag=3,i.payload={element:null},i.callback=function(){Pl(e,n)},i}function Id(e){return e=Zi(e),e.tag=3,e}function Pd(e,n,i,a){var g=i.type.getDerivedStateFromError;if(typeof g=="function"){var C=a.value;e.payload=function(){return g(C)},e.callback=function(){zd(n,i,a)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){zd(n,i,a),typeof g!="function"&&(ar===null?ar=new Set([this]):ar.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function Ry(e,n,i,a,g){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(n=i.alternate,n!==null&&fs(n,i,g,!0),i=wn.current,i!==null){switch(i.tag){case 31:case 13:return zn===null?Jl():i.alternate===null&&kt===0&&(kt=3),i.flags&=-257,i.flags|=65536,i.lanes=g,a===Al?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([a]):n.add(a),mu(e,a,g)),!1;case 22:return i.flags|=65536,a===Al?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([a])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([a]):i.add(a)),mu(e,a,g)),!1}throw Error(l(435,i.tag))}return mu(e,a,g),Jl(),!1}if(Qe)return n=wn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=g,a!==cc&&(e=Error(l(422),{cause:a}),ua(Bn(e,i)))):(a!==cc&&(n=Error(l(423),{cause:a}),ua(Bn(n,i))),e=e.current.alternate,e.flags|=65536,g&=-g,e.lanes|=g,a=Bn(a,i),g=$c(e.stateNode,a,g),Sc(e,g),kt!==4&&(kt=2)),!1;var C=Error(l(520),{cause:a});if(C=Bn(C,i),Ra===null?Ra=[C]:Ra.push(C),kt!==4&&(kt=2),n===null)return!0;a=Bn(a,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,e=g&-g,i.lanes|=e,e=$c(i.stateNode,a,e),Sc(i,e),!1;case 1:if(n=i.type,C=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(ar===null||!ar.has(C))))return i.flags|=65536,g&=-g,i.lanes|=g,g=Id(g),Pd(g,e,i,a),Sc(i,g),!1}i=i.return}while(i!==null);return!1}var Gc=Error(l(461)),Ot=!1;function $t(e,n,i,a){n.child=e===null?$f(n,null,i,a):zr(n,e.child,i,a)}function Ud(e,n,i,a,g){i=i.render;var C=n.ref;if("ref"in a){var O={};for(var F in a)F!=="ref"&&(O[F]=a[F])}else O=a;return Br(n),a=kc(e,n,i,O,C,g),F=Ac(),e!==null&&!Ot?(Tc(e,n,g),wi(e,n,g)):(Qe&&F&&lc(n),n.flags|=1,$t(e,n,a,g),n.child)}function Fd(e,n,i,a,g){if(e===null){var C=i.type;return typeof C=="function"&&!rc(C)&&C.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=C,qd(e,n,C,a,g)):(e=bl(i.type,null,a,n,n.mode,g),e.ref=n.ref,e.return=n,n.child=e)}if(C=e.child,!Zc(e,g)){var O=C.memoizedProps;if(i=i.compare,i=i!==null?i:la,i(O,a)&&e.ref===n.ref)return wi(e,n,g)}return n.flags|=1,e=_i(C,a),e.ref=n.ref,e.return=n,n.child=e}function qd(e,n,i,a,g){if(e!==null){var C=e.memoizedProps;if(la(C,a)&&e.ref===n.ref)if(Ot=!1,n.pendingProps=a=C,Zc(e,g))(e.flags&131072)!==0&&(Ot=!0);else return n.lanes=e.lanes,wi(e,n,g)}return Vc(e,n,i,a,g)}function $d(e,n,i,a){var g=a.children,C=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((n.flags&128)!==0){if(C=C!==null?C.baseLanes|i:i,e!==null){for(a=n.child=e.child,g=0;a!==null;)g=g|a.lanes|a.childLanes,a=a.sibling;a=g&~C}else a=0,n.child=null;return Gd(e,n,C,i,a)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&El(n,C!==null?C.cachePool:null),C!==null?Wf(n,C):Cc(),Kf(n);else return a=n.lanes=536870912,Gd(e,n,C!==null?C.baseLanes|i:i,i,a)}else C!==null?(El(n,C.cachePool),Wf(n,C),nr(),n.memoizedState=null):(e!==null&&El(n,null),Cc(),nr());return $t(e,n,g,i),n.child}function Ca(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Gd(e,n,i,a,g){var C=gc();return C=C===null?null:{parent:Mt._currentValue,pool:C},n.memoizedState={baseLanes:i,cachePool:C},e!==null&&El(n,null),Cc(),Kf(n),e!==null&&fs(e,n,a,!0),n.childLanes=g,null}function Ul(e,n){return n=ql({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Vd(e,n,i){return zr(n,e.child,null,i),e=Ul(n,n.pendingProps),e.flags|=2,xn(n),n.memoizedState=null,e}function Dy(e,n,i){var a=n.pendingProps,g=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Qe){if(a.mode==="hidden")return e=Ul(n,a),n.lanes=536870912,Ca(null,e);if(xc(n),(e=mt)?(e=rm(e,Hn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:ii,overflow:ri}:null,retryLane:536870912,hydrationErrors:null},i=Rf(e),i.return=n,n.child=i,Ft=n,mt=null)):e=null,e===null)throw Xi(n);return n.lanes=536870912,null}return Ul(n,a)}var C=e.memoizedState;if(C!==null){var O=C.dehydrated;if(xc(n),g)if(n.flags&256)n.flags&=-257,n=Vd(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(l(558));else if(Ot||fs(e,n,i,!1),g=(i&e.childLanes)!==0,Ot||g){if(a=ct,a!==null&&(O=nn(a,i),O!==0&&O!==C.retryLane))throw C.retryLane=O,Dr(e,O),fn(a,e,O),Gc;Jl(),n=Vd(e,n,i)}else e=C.treeContext,mt=In(O.nextSibling),Ft=n,Qe=!0,Yi=null,Hn=!1,e!==null&&Lf(n,e),n=Ul(n,a),n.flags|=4096;return n}return e=_i(e.child,{mode:a.mode,children:a.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Fl(e,n){var i=n.ref;if(i===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(n.flags|=4194816)}}function Vc(e,n,i,a,g){return Br(n),i=kc(e,n,i,a,void 0,g),a=Ac(),e!==null&&!Ot?(Tc(e,n,g),wi(e,n,g)):(Qe&&a&&lc(n),n.flags|=1,$t(e,n,i,g),n.child)}function Wd(e,n,i,a,g,C){return Br(n),n.updateQueue=null,i=Xf(n,a,i,g),Yf(e),a=Ac(),e!==null&&!Ot?(Tc(e,n,C),wi(e,n,C)):(Qe&&a&&lc(n),n.flags|=1,$t(e,n,i,C),n.child)}function Kd(e,n,i,a,g){if(Br(n),n.stateNode===null){var C=os,O=i.contextType;typeof O=="object"&&O!==null&&(C=qt(O)),C=new i(a,C),n.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=qc,n.stateNode=C,C._reactInternals=n,C=n.stateNode,C.props=a,C.state=n.memoizedState,C.refs={},vc(n),O=i.contextType,C.context=typeof O=="object"&&O!==null?qt(O):os,C.state=n.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&(Fc(n,i,O,a),C.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(O=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),O!==C.state&&qc.enqueueReplaceState(C,C.state,null),_a(n,a,C,g),ga(),C.state=n.memoizedState),typeof C.componentDidMount=="function"&&(n.flags|=4194308),a=!0}else if(e===null){C=n.stateNode;var F=n.memoizedProps,X=Pr(i,F);C.props=X;var se=C.context,fe=i.contextType;O=os,typeof fe=="object"&&fe!==null&&(O=qt(fe));var _e=i.getDerivedStateFromProps;fe=typeof _e=="function"||typeof C.getSnapshotBeforeUpdate=="function",F=n.pendingProps!==F,fe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F||se!==O)&&Bd(n,C,a,O),Ji=!1;var le=n.memoizedState;C.state=le,_a(n,a,C,g),ga(),se=n.memoizedState,F||le!==se||Ji?(typeof _e=="function"&&(Fc(n,i,_e,a),se=n.memoizedState),(X=Ji||Od(n,i,X,a,le,se,O))?(fe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(n.flags|=4194308)):(typeof C.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=a,n.memoizedState=se),C.props=a,C.state=se,C.context=O,a=X):(typeof C.componentDidMount=="function"&&(n.flags|=4194308),a=!1)}else{C=n.stateNode,yc(e,n),O=n.memoizedProps,fe=Pr(i,O),C.props=fe,_e=n.pendingProps,le=C.context,se=i.contextType,X=os,typeof se=="object"&&se!==null&&(X=qt(se)),F=i.getDerivedStateFromProps,(se=typeof F=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==_e||le!==X)&&Bd(n,C,a,X),Ji=!1,le=n.memoizedState,C.state=le,_a(n,a,C,g),ga();var oe=n.memoizedState;O!==_e||le!==oe||Ji||e!==null&&e.dependencies!==null&&wl(e.dependencies)?(typeof F=="function"&&(Fc(n,i,F,a),oe=n.memoizedState),(fe=Ji||Od(n,i,fe,a,le,oe,X)||e!==null&&e.dependencies!==null&&wl(e.dependencies))?(se||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(a,oe,X),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(a,oe,X)),typeof C.componentDidUpdate=="function"&&(n.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&le===e.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&le===e.memoizedState||(n.flags|=1024),n.memoizedProps=a,n.memoizedState=oe),C.props=a,C.state=oe,C.context=X,a=fe):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&le===e.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&le===e.memoizedState||(n.flags|=1024),a=!1)}return C=a,Fl(e,n),a=(n.flags&128)!==0,C||a?(C=n.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:C.render(),n.flags|=1,e!==null&&a?(n.child=zr(n,e.child,null,g),n.child=zr(n,null,i,g)):$t(e,n,i,g),n.memoizedState=C.state,e=n.child):e=wi(e,n,g),e}function Yd(e,n,i,a){return Lr(),n.flags|=256,$t(e,n,i,a),n.child}var Wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:zf()}}function Yc(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=kn),e}function Xd(e,n,i){var a=n.pendingProps,g=!1,C=(n.flags&128)!==0,O;if((O=C)||(O=e!==null&&e.memoizedState===null?!1:(Tt.current&2)!==0),O&&(g=!0,n.flags&=-129),O=(n.flags&32)!==0,n.flags&=-33,e===null){if(Qe){if(g?tr(n):nr(),(e=mt)?(e=rm(e,Hn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:ii,overflow:ri}:null,retryLane:536870912,hydrationErrors:null},i=Rf(e),i.return=n,n.child=i,Ft=n,mt=null)):e=null,e===null)throw Xi(n);return Mu(e)?n.lanes=32:n.lanes=536870912,null}var F=a.children;return a=a.fallback,g?(nr(),g=n.mode,F=ql({mode:"hidden",children:F},g),a=Mr(a,g,i,null),F.return=n,a.return=n,F.sibling=a,n.child=F,a=n.child,a.memoizedState=Kc(i),a.childLanes=Yc(e,O,i),n.memoizedState=Wc,Ca(null,a)):(tr(n),Xc(n,F))}var X=e.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(C)n.flags&256?(tr(n),n.flags&=-257,n=Qc(e,n,i)):n.memoizedState!==null?(nr(),n.child=e.child,n.flags|=128,n=null):(nr(),F=a.fallback,g=n.mode,a=ql({mode:"visible",children:a.children},g),F=Mr(F,g,i,null),F.flags|=2,a.return=n,F.return=n,a.sibling=F,n.child=a,zr(n,e.child,null,i),a=n.child,a.memoizedState=Kc(i),a.childLanes=Yc(e,O,i),n.memoizedState=Wc,n=Ca(null,a));else if(tr(n),Mu(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var se=O.dgst;O=se,a=Error(l(419)),a.stack="",a.digest=O,ua({value:a,source:null,stack:null}),n=Qc(e,n,i)}else if(Ot||fs(e,n,i,!1),O=(i&e.childLanes)!==0,Ot||O){if(O=ct,O!==null&&(a=nn(O,i),a!==0&&a!==X.retryLane))throw X.retryLane=a,Dr(e,a),fn(O,e,a),Gc;Du(F)||Jl(),n=Qc(e,n,i)}else Du(F)?(n.flags|=192,n.child=e.child,n=null):(e=X.treeContext,mt=In(F.nextSibling),Ft=n,Qe=!0,Yi=null,Hn=!1,e!==null&&Lf(n,e),n=Xc(n,a.children),n.flags|=4096);return n}return g?(nr(),F=a.fallback,g=n.mode,X=e.child,se=X.sibling,a=_i(X,{mode:"hidden",children:a.children}),a.subtreeFlags=X.subtreeFlags&65011712,se!==null?F=_i(se,F):(F=Mr(F,g,i,null),F.flags|=2),F.return=n,a.return=n,a.sibling=F,n.child=a,Ca(null,a),a=n.child,F=e.child.memoizedState,F===null?F=Kc(i):(g=F.cachePool,g!==null?(X=Mt._currentValue,g=g.parent!==X?{parent:X,pool:X}:g):g=zf(),F={baseLanes:F.baseLanes|i,cachePool:g}),a.memoizedState=F,a.childLanes=Yc(e,O,i),n.memoizedState=Wc,Ca(e.child,a)):(tr(n),i=e.child,e=i.sibling,i=_i(i,{mode:"visible",children:a.children}),i.return=n,i.sibling=null,e!==null&&(O=n.deletions,O===null?(n.deletions=[e],n.flags|=16):O.push(e)),n.child=i,n.memoizedState=null,i)}function Xc(e,n){return n=ql({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function ql(e,n){return e=Cn(22,e,null,n),e.lanes=0,e}function Qc(e,n,i){return zr(n,e.child,null,i),e=Xc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Qd(e,n,i){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n),fc(e.return,n,i)}function Jc(e,n,i,a,g,C){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:g,treeForkCount:C}:(O.isBackwards=n,O.rendering=null,O.renderingStartTime=0,O.last=a,O.tail=i,O.tailMode=g,O.treeForkCount=C)}function Jd(e,n,i){var a=n.pendingProps,g=a.revealOrder,C=a.tail;a=a.children;var O=Tt.current,F=(O&2)!==0;if(F?(O=O&1|2,n.flags|=128):O&=1,I(Tt,O),$t(e,n,a,i),a=Qe?ca:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qd(e,i,n);else if(e.tag===19)Qd(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(g){case"forwards":for(i=n.child,g=null;i!==null;)e=i.alternate,e!==null&&Ml(e)===null&&(g=i),i=i.sibling;i=g,i===null?(g=n.child,n.child=null):(g=i.sibling,i.sibling=null),Jc(n,!1,g,i,C,a);break;case"backwards":case"unstable_legacy-backwards":for(i=null,g=n.child,n.child=null;g!==null;){if(e=g.alternate,e!==null&&Ml(e)===null){n.child=g;break}e=g.sibling,g.sibling=i,i=g,g=e}Jc(n,!0,i,null,C,a);break;case"together":Jc(n,!1,null,null,void 0,a);break;default:n.memoizedState=null}return n.child}function wi(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),sr|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(fs(e,n,i,!1),(i&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(l(153));if(n.child!==null){for(e=n.child,i=_i(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=_i(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function Zc(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&wl(e)))}function My(e,n,i){switch(n.tag){case 3:q(n,n.stateNode.containerInfo),Qi(n,Mt,e.memoizedState.cache),Lr();break;case 27:case 5:ae(n);break;case 4:q(n,n.stateNode.containerInfo);break;case 10:Qi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,xc(n),null;break;case 13:var a=n.memoizedState;if(a!==null)return a.dehydrated!==null?(tr(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Xd(e,n,i):(tr(n),e=wi(e,n,i),e!==null?e.sibling:null);tr(n);break;case 19:var g=(e.flags&128)!==0;if(a=(i&n.childLanes)!==0,a||(fs(e,n,i,!1),a=(i&n.childLanes)!==0),g){if(a)return Jd(e,n,i);n.flags|=128}if(g=n.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),I(Tt,Tt.current),a)break;return null;case 22:return n.lanes=0,$d(e,n,i,n.pendingProps);case 24:Qi(n,Mt,e.memoizedState.cache)}return wi(e,n,i)}function Zd(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)Ot=!0;else{if(!Zc(e,i)&&(n.flags&128)===0)return Ot=!1,My(e,n,i);Ot=(e.flags&131072)!==0}else Ot=!1,Qe&&(n.flags&1048576)!==0&&Mf(n,ca,n.index);switch(n.lanes=0,n.tag){case 16:e:{var a=n.pendingProps;if(e=Nr(n.elementType),n.type=e,typeof e=="function")rc(e)?(a=Pr(e,a),n.tag=1,n=Kd(null,n,e,a,i)):(n.tag=0,n=Vc(null,n,e,a,i));else{if(e!=null){var g=e.$$typeof;if(g===A){n.tag=11,n=Ud(null,n,e,a,i);break e}else if(g===D){n.tag=14,n=Fd(null,n,e,a,i);break e}}throw n=V(e)||e,Error(l(306,n,""))}}return n;case 0:return Vc(e,n,n.type,n.pendingProps,i);case 1:return a=n.type,g=Pr(a,n.pendingProps),Kd(e,n,a,g,i);case 3:e:{if(q(n,n.stateNode.containerInfo),e===null)throw Error(l(387));a=n.pendingProps;var C=n.memoizedState;g=C.element,yc(e,n),_a(n,a,null,i);var O=n.memoizedState;if(a=O.cache,Qi(n,Mt,a),a!==C.cache&&dc(n,[Mt],i,!0),ga(),a=O.element,C.isDehydrated)if(C={element:a,isDehydrated:!1,cache:O.cache},n.updateQueue.baseState=C,n.memoizedState=C,n.flags&256){n=Yd(e,n,a,i);break e}else if(a!==g){g=Bn(Error(l(424)),n),ua(g),n=Yd(e,n,a,i);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(mt=In(e.firstChild),Ft=n,Qe=!0,Yi=null,Hn=!0,i=$f(n,null,a,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Lr(),a===g){n=wi(e,n,i);break e}$t(e,n,a,i)}n=n.child}return n;case 26:return Fl(e,n),e===null?(i=um(n.type,null,n.pendingProps,null))?n.memoizedState=i:Qe||(i=n.type,e=n.pendingProps,a=so(ve.current).createElement(i),a[At]=n,a[It]=e,Gt(a,i,e),vt(a),n.stateNode=a):n.memoizedState=um(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ae(n),e===null&&Qe&&(a=n.stateNode=lm(n.type,n.pendingProps,ve.current),Ft=n,Hn=!0,g=mt,ur(n.type)?(Lu=g,mt=In(a.firstChild)):mt=g),$t(e,n,n.pendingProps.children,i),Fl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Qe&&((g=a=mt)&&(a=l0(a,n.type,n.pendingProps,Hn),a!==null?(n.stateNode=a,Ft=n,mt=In(a.firstChild),Hn=!1,g=!0):g=!1),g||Xi(n)),ae(n),g=n.type,C=n.pendingProps,O=e!==null?e.memoizedProps:null,a=C.children,Au(g,C)?a=null:O!==null&&Au(g,O)&&(n.flags|=32),n.memoizedState!==null&&(g=kc(e,n,Cy,null,null,i),Ha._currentValue=g),Fl(e,n),$t(e,n,a,i),n.child;case 6:return e===null&&Qe&&((e=i=mt)&&(i=o0(i,n.pendingProps,Hn),i!==null?(n.stateNode=i,Ft=n,mt=null,e=!0):e=!1),e||Xi(n)),null;case 13:return Xd(e,n,i);case 4:return q(n,n.stateNode.containerInfo),a=n.pendingProps,e===null?n.child=zr(n,null,a,i):$t(e,n,a,i),n.child;case 11:return Ud(e,n,n.type,n.pendingProps,i);case 7:return $t(e,n,n.pendingProps,i),n.child;case 8:return $t(e,n,n.pendingProps.children,i),n.child;case 12:return $t(e,n,n.pendingProps.children,i),n.child;case 10:return a=n.pendingProps,Qi(n,n.type,a.value),$t(e,n,a.children,i),n.child;case 9:return g=n.type._context,a=n.pendingProps.children,Br(n),g=qt(g),a=a(g),n.flags|=1,$t(e,n,a,i),n.child;case 14:return Fd(e,n,n.type,n.pendingProps,i);case 15:return qd(e,n,n.type,n.pendingProps,i);case 19:return Jd(e,n,i);case 31:return Dy(e,n,i);case 22:return $d(e,n,i,n.pendingProps);case 24:return Br(n),a=qt(Mt),e===null?(g=gc(),g===null&&(g=ct,C=pc(),g.pooledCache=C,C.refCount++,C!==null&&(g.pooledCacheLanes|=i),g=C),n.memoizedState={parent:a,cache:g},vc(n),Qi(n,Mt,g)):((e.lanes&i)!==0&&(yc(e,n),_a(n,null,null,i),ga()),g=e.memoizedState,C=n.memoizedState,g.parent!==a?(g={parent:a,cache:a},n.memoizedState=g,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=g),Qi(n,Mt,a)):(a=C.cache,Qi(n,Mt,a),a!==g.cache&&dc(n,[Mt],i,!0))),$t(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function xi(e){e.flags|=4}function eu(e,n,i,a,g){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(g&335544128)===g)if(e.stateNode.complete)e.flags|=8192;else if(kp())e.flags|=8192;else throw Hr=Al,_c}else e.flags&=-16777217}function ep(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!mm(n))if(kp())e.flags|=8192;else throw Hr=Al,_c}function $l(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Bi():536870912,e.lanes|=n,xs|=n)}function wa(e,n){if(!Qe)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.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?n||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function gt(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,a=0;if(n)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,n}function Ly(e,n,i){var a=n.pendingProps;switch(oc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(n),null;case 1:return gt(n),null;case 3:return i=n.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Si(Mt),ce(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(hs(n)?xi(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,uc())),gt(n),null;case 26:var g=n.type,C=n.memoizedState;return e===null?(xi(n),C!==null?(gt(n),ep(n,C)):(gt(n),eu(n,g,null,a,i))):C?C!==e.memoizedState?(xi(n),gt(n),ep(n,C)):(gt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==a&&xi(n),gt(n),eu(n,g,e,a,i)),null;case 27:if(be(n),i=ve.current,g=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&xi(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return gt(n),null}e=ie.current,hs(n)?Of(n):(e=lm(g,a,i),n.stateNode=e,xi(n))}return gt(n),null;case 5:if(be(n),g=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&xi(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return gt(n),null}if(C=ie.current,hs(n))Of(n);else{var O=so(ve.current);switch(C){case 1:C=O.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:C=O.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":C=O.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":C=O.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":C=O.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof a.is=="string"?O.createElement("select",{is:a.is}):O.createElement("select"),a.multiple?C.multiple=!0:a.size&&(C.size=a.size);break;default:C=typeof a.is=="string"?O.createElement(g,{is:a.is}):O.createElement(g)}}C[At]=n,C[It]=a;e:for(O=n.child;O!==null;){if(O.tag===5||O.tag===6)C.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===n)break e;for(;O.sibling===null;){if(O.return===null||O.return===n)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}n.stateNode=C;e:switch(Gt(C,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&&xi(n)}}return gt(n),eu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,i),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==a&&xi(n);else{if(typeof a!="string"&&n.stateNode===null)throw Error(l(166));if(e=ve.current,hs(n)){if(e=n.stateNode,i=n.memoizedProps,a=null,g=Ft,g!==null)switch(g.tag){case 27:case 5:a=g.memoizedProps}e[At]=n,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Xp(e.nodeValue,i)),e||Xi(n,!0)}else e=so(e).createTextNode(a),e[At]=n,n.stateNode=e}return gt(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(a=hs(n),i!==null){if(e===null){if(!a)throw Error(l(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[At]=n}else Lr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),e=!1}else i=uc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return n.flags&256?(xn(n),n):(xn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return gt(n),null;case 13:if(a=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(g=hs(n),a!==null&&a.dehydrated!==null){if(e===null){if(!g)throw Error(l(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(l(317));g[At]=n}else Lr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;gt(n),g=!1}else g=uc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=g),g=!0;if(!g)return n.flags&256?(xn(n),n):(xn(n),null)}return xn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=a!==null,e=e!==null&&e.memoizedState!==null,i&&(a=n.child,g=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(g=a.alternate.memoizedState.cachePool.pool),C=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(C=a.memoizedState.cachePool.pool),C!==g&&(a.flags|=2048)),i!==e&&i&&(n.child.flags|=8192),$l(n,n.updateQueue),gt(n),null);case 4:return ce(),e===null&&Cu(n.stateNode.containerInfo),gt(n),null;case 10:return Si(n.type),gt(n),null;case 19:if($(Tt),a=n.memoizedState,a===null)return gt(n),null;if(g=(n.flags&128)!==0,C=a.rendering,C===null)if(g)wa(a,!1);else{if(kt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(C=Ml(e),C!==null){for(n.flags|=128,wa(a,!1),e=C.updateQueue,n.updateQueue=e,$l(n,e),n.subtreeFlags=0,e=i,i=n.child;i!==null;)Tf(i,e),i=i.sibling;return I(Tt,Tt.current&1|2),Qe&&vi(n,a.treeForkCount),n.child}e=e.sibling}a.tail!==null&&dt()>Yl&&(n.flags|=128,g=!0,wa(a,!1),n.lanes=4194304)}else{if(!g)if(e=Ml(C),e!==null){if(n.flags|=128,g=!0,e=e.updateQueue,n.updateQueue=e,$l(n,e),wa(a,!0),a.tail===null&&a.tailMode==="hidden"&&!C.alternate&&!Qe)return gt(n),null}else 2*dt()-a.renderingStartTime>Yl&&i!==536870912&&(n.flags|=128,g=!0,wa(a,!1),n.lanes=4194304);a.isBackwards?(C.sibling=n.child,n.child=C):(e=a.last,e!==null?e.sibling=C:n.child=C,a.last=C)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=dt(),e.sibling=null,i=Tt.current,I(Tt,g?i&1|2:i&1),Qe&&vi(n,a.treeForkCount),e):(gt(n),null);case 22:case 23:return xn(n),wc(),a=n.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(n.flags|=8192):a&&(n.flags|=8192),a?(i&536870912)!==0&&(n.flags&128)===0&&(gt(n),n.subtreeFlags&6&&(n.flags|=8192)):gt(n),i=n.updateQueue,i!==null&&$l(n,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),a=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),a!==i&&(n.flags|=2048),e!==null&&$(jr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Si(Mt),gt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function Oy(e,n){switch(oc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Si(Mt),ce(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return be(n),null;case 31:if(n.memoizedState!==null){if(xn(n),n.alternate===null)throw Error(l(340));Lr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(xn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Lr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $(Tt),null;case 4:return ce(),null;case 10:return Si(n.type),null;case 22:case 23:return xn(n),wc(),e!==null&&$(jr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Si(Mt),null;case 25:return null;default:return null}}function tp(e,n){switch(oc(n),n.tag){case 3:Si(Mt),ce();break;case 26:case 27:case 5:be(n);break;case 4:ce();break;case 31:n.memoizedState!==null&&xn(n);break;case 13:xn(n);break;case 19:$(Tt);break;case 10:Si(n.type);break;case 22:case 23:xn(n),wc(),e!==null&&$(jr);break;case 24:Si(Mt)}}function xa(e,n){try{var i=n.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 C=i.create,O=i.inst;a=C(),O.destroy=a}i=i.next}while(i!==g)}}catch(F){st(n,n.return,F)}}function ir(e,n,i){try{var a=n.updateQueue,g=a!==null?a.lastEffect:null;if(g!==null){var C=g.next;a=C;do{if((a.tag&e)===e){var O=a.inst,F=O.destroy;if(F!==void 0){O.destroy=void 0,g=n;var X=i,se=F;try{se()}catch(fe){st(g,X,fe)}}}a=a.next}while(a!==C)}}catch(fe){st(n,n.return,fe)}}function np(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{Vf(n,i)}catch(a){st(e,e.return,a)}}}function ip(e,n,i){i.props=Pr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){st(e,n,a)}}function Ea(e,n){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){st(e,n,g)}}function si(e,n){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(g){st(e,n,g)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(g){st(e,n,g)}else i.current=null}function rp(e){var n=e.type,i=e.memoizedProps,a=e.stateNode;try{e:switch(n){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){st(e,e.return,g)}}function tu(e,n,i){try{var a=e.stateNode;t0(a,e.type,i,n),a[It]=n}catch(g){st(e,e.return,g)}}function sp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ur(e.type)||e.tag===4}function nu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sp(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&&ur(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 iu(e,n,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(e),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Wt));else if(a!==4&&(a===27&&ur(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(iu(e,n,i),e=e.sibling;e!==null;)iu(e,n,i),e=e.sibling}function Gl(e,n,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(a!==4&&(a===27&&ur(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Gl(e,n,i),e=e.sibling;e!==null;)Gl(e,n,i),e=e.sibling}function ap(e){var n=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,g=n.attributes;g.length;)n.removeAttributeNode(g[0]);Gt(n,a,i),n[At]=e,n[It]=i}catch(C){st(e,e.return,C)}}var Ei=!1,Bt=!1,ru=!1,lp=typeof WeakSet=="function"?WeakSet:Set,zt=null;function By(e,n){if(e=e.containerInfo,Eu=fo,e=yf(e),Qo(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,C=a.focusNode;a=a.focusOffset;try{i.nodeType,C.nodeType}catch{i=null;break e}var O=0,F=-1,X=-1,se=0,fe=0,_e=e,le=null;t:for(;;){for(var oe;_e!==i||g!==0&&_e.nodeType!==3||(F=O+g),_e!==C||a!==0&&_e.nodeType!==3||(X=O+a),_e.nodeType===3&&(O+=_e.nodeValue.length),(oe=_e.firstChild)!==null;)le=_e,_e=oe;for(;;){if(_e===e)break t;if(le===i&&++se===g&&(F=O),le===C&&++fe===a&&(X=O),(oe=_e.nextSibling)!==null)break;_e=le,le=_e.parentNode}_e=oe}i=F===-1||X===-1?null:{start:F,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(ku={focusedElem:e,selectionRange:i},fo=!1,zt=n;zt!==null;)if(n=zt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,zt=e;else for(;zt!==null;){switch(n=zt,C=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.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&&C!==null){e=void 0,i=n,g=C.memoizedProps,C=C.memoizedState,a=i.stateNode;try{var Te=Pr(i.type,g);e=a.getSnapshotBeforeUpdate(Te,C),a.__reactInternalSnapshotBeforeUpdate=e}catch(Be){st(i,i.return,Be)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)Ru(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ru(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=n.sibling,e!==null){e.return=n.return,zt=e;break}zt=n.return}}function op(e,n,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Ai(e,i),a&4&&xa(5,i);break;case 1:if(Ai(e,i),a&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(O){st(i,i.return,O)}else{var g=Pr(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(g,n,e.__reactInternalSnapshotBeforeUpdate)}catch(O){st(i,i.return,O)}}a&64&&np(i),a&512&&Ea(i,i.return);break;case 3:if(Ai(e,i),a&64&&(e=i.updateQueue,e!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{Vf(e,n)}catch(O){st(i,i.return,O)}}break;case 27:n===null&&a&4&&ap(i);case 26:case 5:Ai(e,i),n===null&&a&4&&rp(i),a&512&&Ea(i,i.return);break;case 12:Ai(e,i);break;case 31:Ai(e,i),a&4&&hp(e,i);break;case 13:Ai(e,i),a&4&&fp(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=qy.bind(null,i),c0(e,i))));break;case 22:if(a=i.memoizedState!==null||Ei,!a){n=n!==null&&n.memoizedState!==null||Bt,g=Ei;var C=Bt;Ei=a,(Bt=n)&&!C?Ti(e,i,(i.subtreeFlags&8772)!==0):Ai(e,i),Ei=g,Bt=C}break;case 30:break;default:Ai(e,i)}}function cp(e){var n=e.alternate;n!==null&&(e.alternate=null,cp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Xr(n)),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 yt=null,on=!1;function ki(e,n,i){for(i=i.child;i!==null;)up(e,n,i),i=i.sibling}function up(e,n,i){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(bt,i)}catch{}switch(i.tag){case 26:Bt||si(i,n),ki(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Bt||si(i,n);var a=yt,g=on;ur(i.type)&&(yt=i.stateNode,on=!1),ki(e,n,i),Ba(i.stateNode),yt=a,on=g;break;case 5:Bt||si(i,n);case 6:if(a=yt,g=on,yt=null,ki(e,n,i),yt=a,on=g,yt!==null)if(on)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(i.stateNode)}catch(C){st(i,n,C)}else try{yt.removeChild(i.stateNode)}catch(C){st(i,n,C)}break;case 18:yt!==null&&(on?(e=yt,nm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ls(e)):nm(yt,i.stateNode));break;case 4:a=yt,g=on,yt=i.stateNode.containerInfo,on=!0,ki(e,n,i),yt=a,on=g;break;case 0:case 11:case 14:case 15:ir(2,i,n),Bt||ir(4,i,n),ki(e,n,i);break;case 1:Bt||(si(i,n),a=i.stateNode,typeof a.componentWillUnmount=="function"&&ip(i,n,a)),ki(e,n,i);break;case 21:ki(e,n,i);break;case 22:Bt=(a=Bt)||i.memoizedState!==null,ki(e,n,i),Bt=a;break;default:ki(e,n,i)}}function hp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ls(e)}catch(i){st(n,n.return,i)}}}function fp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ls(e)}catch(i){st(n,n.return,i)}}function jy(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new lp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new lp),n;default:throw Error(l(435,e.tag))}}function Vl(e,n){var i=jy(e);n.forEach(function(a){if(!i.has(a)){i.add(a);var g=$y.bind(null,e,a);a.then(g,g)}})}function cn(e,n){var i=n.deletions;if(i!==null)for(var a=0;a<i.length;a++){var g=i[a],C=e,O=n,F=O;e:for(;F!==null;){switch(F.tag){case 27:if(ur(F.type)){yt=F.stateNode,on=!1;break e}break;case 5:yt=F.stateNode,on=!1;break e;case 3:case 4:yt=F.stateNode.containerInfo,on=!0;break e}F=F.return}if(yt===null)throw Error(l(160));up(C,O,g),yt=null,on=!1,C=g.alternate,C!==null&&(C.return=null),g.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)dp(n,e),n=n.sibling}var Wn=null;function dp(e,n){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:cn(n,e),un(e),a&4&&(ir(3,e,e.return),xa(3,e),ir(5,e,e.return));break;case 1:cn(n,e),un(e),a&512&&(Bt||i===null||si(i,i.return)),a&64&&Ei&&(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=Wn;if(cn(n,e),un(e),a&512&&(Bt||i===null||si(i,i.return)),a&4){var C=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":C=g.getElementsByTagName("title")[0],(!C||C[Ln]||C[At]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=g.createElement(a),g.head.insertBefore(C,g.querySelector("head > title"))),Gt(C,a,i),C[At]=e,vt(C),a=C;break e;case"link":var O=dm("link","href",g).get(a+(i.href||""));if(O){for(var F=0;F<O.length;F++)if(C=O[F],C.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&C.getAttribute("rel")===(i.rel==null?null:i.rel)&&C.getAttribute("title")===(i.title==null?null:i.title)&&C.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){O.splice(F,1);break t}}C=g.createElement(a),Gt(C,a,i),g.head.appendChild(C);break;case"meta":if(O=dm("meta","content",g).get(a+(i.content||""))){for(F=0;F<O.length;F++)if(C=O[F],C.getAttribute("content")===(i.content==null?null:""+i.content)&&C.getAttribute("name")===(i.name==null?null:i.name)&&C.getAttribute("property")===(i.property==null?null:i.property)&&C.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&C.getAttribute("charset")===(i.charSet==null?null:i.charSet)){O.splice(F,1);break t}}C=g.createElement(a),Gt(C,a,i),g.head.appendChild(C);break;default:throw Error(l(468,a))}C[At]=e,vt(C),a=C}e.stateNode=a}else pm(g,e.type,e.stateNode);else e.stateNode=fm(g,a,e.memoizedProps);else C!==a?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,a===null?pm(g,e.type,e.stateNode):fm(g,a,e.memoizedProps)):a===null&&e.stateNode!==null&&tu(e,e.memoizedProps,i.memoizedProps)}break;case 27:cn(n,e),un(e),a&512&&(Bt||i===null||si(i,i.return)),i!==null&&a&4&&tu(e,e.memoizedProps,i.memoizedProps);break;case 5:if(cn(n,e),un(e),a&512&&(Bt||i===null||si(i,i.return)),e.flags&32){g=e.stateNode;try{Ui(g,"")}catch(Te){st(e,e.return,Te)}}a&4&&e.stateNode!=null&&(g=e.memoizedProps,tu(e,g,i!==null?i.memoizedProps:g)),a&1024&&(ru=!0);break;case 6:if(cn(n,e),un(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(Te){st(e,e.return,Te)}}break;case 3:if(oo=null,g=Wn,Wn=ao(n.containerInfo),cn(n,e),Wn=g,un(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Ls(n.containerInfo)}catch(Te){st(e,e.return,Te)}ru&&(ru=!1,pp(e));break;case 4:a=Wn,Wn=ao(e.stateNode.containerInfo),cn(n,e),un(e),Wn=a;break;case 12:cn(n,e),un(e);break;case 31:cn(n,e),un(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vl(e,a)));break;case 13:cn(n,e),un(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Kl=dt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vl(e,a)));break;case 22:g=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,se=Ei,fe=Bt;if(Ei=se||g,Bt=fe||X,cn(n,e),Bt=fe,Ei=se,un(e),a&8192)e:for(n=e.stateNode,n._visibility=g?n._visibility&-2:n._visibility|1,g&&(i===null||X||Ei||Bt||Ur(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){X=i=n;try{if(C=X.stateNode,g)O=C.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{F=X.stateNode;var _e=X.memoizedProps.style,le=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;F.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(Te){st(X,X.return,Te)}}}else if(n.tag===6){if(i===null){X=n;try{X.stateNode.nodeValue=g?"":X.memoizedProps}catch(Te){st(X,X.return,Te)}}}else if(n.tag===18){if(i===null){X=n;try{var oe=X.stateNode;g?im(oe,!0):im(X.stateNode,!1)}catch(Te){st(X,X.return,Te)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}a&4&&(a=e.updateQueue,a!==null&&(i=a.retryQueue,i!==null&&(a.retryQueue=null,Vl(e,i))));break;case 19:cn(n,e),un(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vl(e,a)));break;case 30:break;case 21:break;default:cn(n,e),un(e)}}function un(e){var n=e.flags;if(n&2){try{for(var i,a=e.return;a!==null;){if(sp(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var g=i.stateNode,C=nu(e);Gl(e,C,g);break;case 5:var O=i.stateNode;i.flags&32&&(Ui(O,""),i.flags&=-33);var F=nu(e);Gl(e,F,O);break;case 3:case 4:var X=i.stateNode.containerInfo,se=nu(e);iu(e,se,X);break;default:throw Error(l(161))}}catch(fe){st(e,e.return,fe)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function pp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;pp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Ai(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)op(e,n.alternate,n),n=n.sibling}function Ur(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:ir(4,n,n.return),Ur(n);break;case 1:si(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&ip(n,n.return,i),Ur(n);break;case 27:Ba(n.stateNode);case 26:case 5:si(n,n.return),Ur(n);break;case 22:n.memoizedState===null&&Ur(n);break;case 30:Ur(n);break;default:Ur(n)}e=e.sibling}}function Ti(e,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var a=n.alternate,g=e,C=n,O=C.flags;switch(C.tag){case 0:case 11:case 15:Ti(g,C,i),xa(4,C);break;case 1:if(Ti(g,C,i),a=C,g=a.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(se){st(a,a.return,se)}if(a=C,g=a.updateQueue,g!==null){var F=a.stateNode;try{var X=g.shared.hiddenCallbacks;if(X!==null)for(g.shared.hiddenCallbacks=null,g=0;g<X.length;g++)Gf(X[g],F)}catch(se){st(a,a.return,se)}}i&&O&64&&np(C),Ea(C,C.return);break;case 27:ap(C);case 26:case 5:Ti(g,C,i),i&&a===null&&O&4&&rp(C),Ea(C,C.return);break;case 12:Ti(g,C,i);break;case 31:Ti(g,C,i),i&&O&4&&hp(g,C);break;case 13:Ti(g,C,i),i&&O&4&&fp(g,C);break;case 22:C.memoizedState===null&&Ti(g,C,i),Ea(C,C.return);break;case 30:break;default:Ti(g,C,i)}n=n.sibling}}function su(e,n){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&ha(i))}function au(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ha(e))}function Kn(e,n,i,a){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)mp(e,n,i,a),n=n.sibling}function mp(e,n,i,a){var g=n.flags;switch(n.tag){case 0:case 11:case 15:Kn(e,n,i,a),g&2048&&xa(9,n);break;case 1:Kn(e,n,i,a);break;case 3:Kn(e,n,i,a),g&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ha(e)));break;case 12:if(g&2048){Kn(e,n,i,a),e=n.stateNode;try{var C=n.memoizedProps,O=C.id,F=C.onPostCommit;typeof F=="function"&&F(O,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){st(n,n.return,X)}}else Kn(e,n,i,a);break;case 31:Kn(e,n,i,a);break;case 13:Kn(e,n,i,a);break;case 23:break;case 22:C=n.stateNode,O=n.alternate,n.memoizedState!==null?C._visibility&2?Kn(e,n,i,a):ka(e,n):C._visibility&2?Kn(e,n,i,a):(C._visibility|=2,bs(e,n,i,a,(n.subtreeFlags&10256)!==0||!1)),g&2048&&su(O,n);break;case 24:Kn(e,n,i,a),g&2048&&au(n.alternate,n);break;default:Kn(e,n,i,a)}}function bs(e,n,i,a,g){for(g=g&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var C=e,O=n,F=i,X=a,se=O.flags;switch(O.tag){case 0:case 11:case 15:bs(C,O,F,X,g),xa(8,O);break;case 23:break;case 22:var fe=O.stateNode;O.memoizedState!==null?fe._visibility&2?bs(C,O,F,X,g):ka(C,O):(fe._visibility|=2,bs(C,O,F,X,g)),g&&se&2048&&su(O.alternate,O);break;case 24:bs(C,O,F,X,g),g&&se&2048&&au(O.alternate,O);break;default:bs(C,O,F,X,g)}n=n.sibling}}function ka(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=e,a=n,g=a.flags;switch(a.tag){case 22:ka(i,a),g&2048&&su(a.alternate,a);break;case 24:ka(i,a),g&2048&&au(a.alternate,a);break;default:ka(i,a)}n=n.sibling}}var Aa=8192;function Cs(e,n,i){if(e.subtreeFlags&Aa)for(e=e.child;e!==null;)gp(e,n,i),e=e.sibling}function gp(e,n,i){switch(e.tag){case 26:Cs(e,n,i),e.flags&Aa&&e.memoizedState!==null&&b0(i,Wn,e.memoizedState,e.memoizedProps);break;case 5:Cs(e,n,i);break;case 3:case 4:var a=Wn;Wn=ao(e.stateNode.containerInfo),Cs(e,n,i),Wn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Aa,Aa=16777216,Cs(e,n,i),Aa=a):Cs(e,n,i));break;default:Cs(e,n,i)}}function _p(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Ta(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];zt=a,yp(a,e)}_p(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vp(e),e=e.sibling}function vp(e){switch(e.tag){case 0:case 11:case 15:Ta(e),e.flags&2048&&ir(9,e,e.return);break;case 3:Ta(e);break;case 12:Ta(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Wl(e)):Ta(e);break;default:Ta(e)}}function Wl(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];zt=a,yp(a,e)}_p(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:ir(8,n,n.return),Wl(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,Wl(n));break;default:Wl(n)}e=e.sibling}}function yp(e,n){for(;zt!==null;){var i=zt;switch(i.tag){case 0:case 11:case 15:ir(8,i,n);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:ha(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,zt=a;else e:for(i=e;zt!==null;){a=zt;var g=a.sibling,C=a.return;if(cp(a),a===i){zt=null;break e}if(g!==null){g.return=C,zt=g;break e}zt=C}}}var Ny={getCacheForType:function(e){var n=qt(Mt),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return qt(Mt).controller.signal}},Hy=typeof WeakMap=="function"?WeakMap:Map,it=0,ct=null,Ge=null,Ye=0,rt=0,En=null,rr=!1,ws=!1,lu=!1,Ri=0,kt=0,sr=0,Fr=0,ou=0,kn=0,xs=0,Ra=null,hn=null,cu=!1,Kl=0,Sp=0,Yl=1/0,Xl=null,ar=null,Ht=0,lr=null,Es=null,Di=0,uu=0,hu=null,bp=null,Da=0,fu=null;function An(){return(it&2)!==0&&Ye!==0?Ye&-Ye:G.T!==null?vu():Cr()}function Cp(){if(kn===0)if((Ye&536870912)===0||Qe){var e=ui;ui<<=1,(ui&3932160)===0&&(ui=262144),kn=e}else kn=536870912;return e=wn.current,e!==null&&(e.flags|=32),kn}function fn(e,n,i){(e===ct&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(ks(e,0),or(e,Ye,kn,!1)),qn(e,i),((it&2)===0||e!==ct)&&(e===ct&&((it&2)===0&&(Fr|=i),kt===4&&or(e,Ye,kn,!1)),ai(e))}function wp(e,n,i){if((it&6)!==0)throw Error(l(327));var a=!i&&(n&127)===0&&(n&e.expiredLanes)===0||wt(e,n),g=a?Py(e,n):pu(e,n,!0),C=a;do{if(g===0){ws&&!a&&or(e,n,0,!1);break}else{if(i=e.current.alternate,C&&!zy(i)){g=pu(e,n,!1),C=!1;continue}if(g===2){if(C=n,e.errorRecoveryDisabledLanes&C)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){n=O;e:{var F=e;g=Ra;var X=F.current.memoizedState.isDehydrated;if(X&&(ks(F,O).flags|=256),O=pu(F,O,!1),O!==2){if(lu&&!X){F.errorRecoveryDisabledLanes|=C,Fr|=C,g=4;break e}C=hn,hn=g,C!==null&&(hn===null?hn=C:hn.push.apply(hn,C))}g=O}if(C=!1,g!==2)continue}}if(g===1){ks(e,0),or(e,n,0,!0);break}e:{switch(a=e,C=g,C){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:or(a,n,kn,!rr);break e;case 2:hn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(g=Kl+300-dt(),10<g)){if(or(a,n,kn,!rr),_n(a,0,!0)!==0)break e;Di=n,a.timeoutHandle=em(xp.bind(null,a,i,hn,Xl,cu,n,kn,Fr,xs,rr,C,"Throttled",-0,0),g);break e}xp(a,i,hn,Xl,cu,n,kn,Fr,xs,rr,C,null,-0,0)}}break}while(!0);ai(e)}function xp(e,n,i,a,g,C,O,F,X,se,fe,_e,le,oe){if(e.timeoutHandle=-1,_e=n.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wt},gp(n,C,_e);var Te=(C&62914560)===C?Kl-dt():(C&4194048)===C?Sp-dt():0;if(Te=C0(_e,Te),Te!==null){Di=C,e.cancelPendingCommit=Te(Lp.bind(null,e,n,C,i,a,g,O,F,X,fe,_e,null,le,oe)),or(e,C,O,!se);return}}Lp(e,n,C,i,a,g,O,F,X)}function zy(e){for(var n=e;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var a=0;a<i.length;a++){var g=i[a],C=g.getSnapshot;g=g.value;try{if(!bn(C(),g))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function or(e,n,i,a){n&=~ou,n&=~Fr,e.suspendedLanes|=n,e.pingedLanes&=~n,a&&(e.warmLanes|=n),a=e.expirationTimes;for(var g=n;0<g;){var C=31-nt(g),O=1<<C;a[C]=-1,g&=~O}i!==0&&$n(e,i,n)}function Ql(){return(it&6)===0?(Ma(0),!1):!0}function du(){if(Ge!==null){if(rt===0)var e=Ge.return;else e=Ge,yi=Or=null,Rc(e),gs=null,da=0,e=Ge;for(;e!==null;)tp(e.alternate,e),e=e.return;Ge=null}}function ks(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,r0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Di=0,du(),ct=e,Ge=i=_i(e.current,null),Ye=n,rt=0,En=null,rr=!1,ws=wt(e,n),lu=!1,xs=kn=ou=Fr=sr=kt=0,hn=Ra=null,cu=!1,(n&8)!==0&&(n|=n&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=n;0<a;){var g=31-nt(a),C=1<<g;n|=e[g],a&=~C}return Ri=n,vl(),i}function Ep(e,n){Pe=null,G.H=ba,n===ms||n===kl?(n=Uf(),rt=3):n===_c?(n=Uf(),rt=4):rt=n===Gc?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,En=n,Ge===null&&(kt=1,Pl(e,Bn(n,e.current)))}function kp(){var e=wn.current;return e===null?!0:(Ye&4194048)===Ye?zn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===zn:!1}function Ap(){var e=G.H;return G.H=ba,e===null?ba:e}function Tp(){var e=G.A;return G.A=Ny,e}function Jl(){kt=4,rr||(Ye&4194048)!==Ye&&wn.current!==null||(ws=!0),(sr&134217727)===0&&(Fr&134217727)===0||ct===null||or(ct,Ye,kn,!1)}function pu(e,n,i){var a=it;it|=2;var g=Ap(),C=Tp();(ct!==e||Ye!==n)&&(Xl=null,ks(e,n)),n=!1;var O=kt;e:do try{if(rt!==0&&Ge!==null){var F=Ge,X=En;switch(rt){case 8:du(),O=6;break e;case 3:case 2:case 9:case 6:wn.current===null&&(n=!0);var se=rt;if(rt=0,En=null,As(e,F,X,se),i&&ws){O=0;break e}break;default:se=rt,rt=0,En=null,As(e,F,X,se)}}Iy(),O=kt;break}catch(fe){Ep(e,fe)}while(!0);return n&&e.shellSuspendCounter++,yi=Or=null,it=a,G.H=g,G.A=C,Ge===null&&(ct=null,Ye=0,vl()),O}function Iy(){for(;Ge!==null;)Rp(Ge)}function Py(e,n){var i=it;it|=2;var a=Ap(),g=Tp();ct!==e||Ye!==n?(Xl=null,Yl=dt()+500,ks(e,n)):ws=wt(e,n);e:do try{if(rt!==0&&Ge!==null){n=Ge;var C=En;t:switch(rt){case 1:rt=0,En=null,As(e,n,C,1);break;case 2:case 9:if(If(C)){rt=0,En=null,Dp(n);break}n=function(){rt!==2&&rt!==9||ct!==e||(rt=7),ai(e)},C.then(n,n);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:If(C)?(rt=0,En=null,Dp(n)):(rt=0,En=null,As(e,n,C,7));break;case 5:var O=null;switch(Ge.tag){case 26:O=Ge.memoizedState;case 5:case 27:var F=Ge;if(O?mm(O):F.stateNode.complete){rt=0,En=null;var X=F.sibling;if(X!==null)Ge=X;else{var se=F.return;se!==null?(Ge=se,Zl(se)):Ge=null}break t}}rt=0,En=null,As(e,n,C,5);break;case 6:rt=0,En=null,As(e,n,C,6);break;case 8:du(),kt=6;break e;default:throw Error(l(462))}}Uy();break}catch(fe){Ep(e,fe)}while(!0);return yi=Or=null,G.H=a,G.A=g,it=i,Ge!==null?0:(ct=null,Ye=0,vl(),kt)}function Uy(){for(;Ge!==null&&!Vt();)Rp(Ge)}function Rp(e){var n=Zd(e.alternate,e,Ri);e.memoizedProps=e.pendingProps,n===null?Zl(e):Ge=n}function Dp(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=Wd(i,n,n.pendingProps,n.type,void 0,Ye);break;case 11:n=Wd(i,n,n.pendingProps,n.type.render,n.ref,Ye);break;case 5:Rc(n);default:tp(i,n),n=Ge=Tf(n,Ri),n=Zd(i,n,Ri)}e.memoizedProps=e.pendingProps,n===null?Zl(e):Ge=n}function As(e,n,i,a){yi=Or=null,Rc(n),gs=null,da=0;var g=n.return;try{if(Ry(e,g,n,i,Ye)){kt=1,Pl(e,Bn(i,e.current)),Ge=null;return}}catch(C){if(g!==null)throw Ge=g,C;kt=1,Pl(e,Bn(i,e.current)),Ge=null;return}n.flags&32768?(Qe||a===1?e=!0:ws||(Ye&536870912)!==0?e=!1:(rr=e=!0,(a===2||a===9||a===3||a===6)&&(a=wn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Mp(n,e)):Zl(n)}function Zl(e){var n=e;do{if((n.flags&32768)!==0){Mp(n,rr);return}e=n.return;var i=Ly(n.alternate,n,Ri);if(i!==null){Ge=i;return}if(n=n.sibling,n!==null){Ge=n;return}Ge=n=e}while(n!==null);kt===0&&(kt=5)}function Mp(e,n){do{var i=Oy(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),!n&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=i}while(e!==null);kt=6,Ge=null}function Lp(e,n,i,a,g,C,O,F,X){e.cancelPendingCommit=null;do eo();while(Ht!==0);if((it&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(C=n.lanes|n.childLanes,C|=nc,Qn(e,i,C,O,F,X),e===ct&&(Ge=ct=null,Ye=0),Es=n,lr=e,Di=i,uu=C,hu=g,bp=a,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Gy(Re,function(){return Hp(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||a){a=G.T,G.T=null,g=Y.p,Y.p=2,O=it,it|=4;try{By(e,n,i)}finally{it=O,Y.p=g,G.T=a}}Ht=1,Op(),Bp(),jp()}}function Op(){if(Ht===1){Ht=0;var e=lr,n=Es,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var a=Y.p;Y.p=2;var g=it;it|=4;try{dp(n,e);var C=ku,O=yf(e.containerInfo),F=C.focusedElem,X=C.selectionRange;if(O!==F&&F&&F.ownerDocument&&vf(F.ownerDocument.documentElement,F)){if(X!==null&&Qo(F)){var se=X.start,fe=X.end;if(fe===void 0&&(fe=se),"selectionStart"in F)F.selectionStart=se,F.selectionEnd=Math.min(fe,F.value.length);else{var _e=F.ownerDocument||document,le=_e&&_e.defaultView||window;if(le.getSelection){var oe=le.getSelection(),Te=F.textContent.length,Be=Math.min(X.start,Te),ot=X.end===void 0?Be:Math.min(X.end,Te);!oe.extend&&Be>ot&&(O=ot,ot=Be,Be=O);var ne=_f(F,Be),J=_f(F,ot);if(ne&&J&&(oe.rangeCount!==1||oe.anchorNode!==ne.node||oe.anchorOffset!==ne.offset||oe.focusNode!==J.node||oe.focusOffset!==J.offset)){var re=_e.createRange();re.setStart(ne.node,ne.offset),oe.removeAllRanges(),Be>ot?(oe.addRange(re),oe.extend(J.node,J.offset)):(re.setEnd(J.node,J.offset),oe.addRange(re))}}}}for(_e=[],oe=F;oe=oe.parentNode;)oe.nodeType===1&&_e.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<_e.length;F++){var pe=_e[F];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}fo=!!Eu,ku=Eu=null}finally{it=g,Y.p=a,G.T=i}}e.current=n,Ht=2}}function Bp(){if(Ht===2){Ht=0;var e=lr,n=Es,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var a=Y.p;Y.p=2;var g=it;it|=4;try{op(e,n.alternate,n)}finally{it=g,Y.p=a,G.T=i}}Ht=3}}function jp(){if(Ht===4||Ht===3){Ht=0,St();var e=lr,n=Es,i=Di,a=bp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ht=5:(Ht=0,Es=lr=null,Np(e,e.pendingLanes));var g=e.pendingLanes;if(g===0&&(ar=null),di(i),n=n.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(bt,n,void 0,(n.current.flags&128)===128)}catch{}if(a!==null){n=G.T,g=Y.p,Y.p=2,G.T=null;try{for(var C=e.onRecoverableError,O=0;O<a.length;O++){var F=a[O];C(F.value,{componentStack:F.stack})}}finally{G.T=n,Y.p=g}}(Di&3)!==0&&eo(),ai(e),g=e.pendingLanes,(i&261930)!==0&&(g&42)!==0?e===fu?Da++:(Da=0,fu=e):Da=0,Ma(0)}}function Np(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ha(n)))}function eo(){return Op(),Bp(),jp(),Hp()}function Hp(){if(Ht!==5)return!1;var e=lr,n=uu;uu=0;var i=di(Di),a=G.T,g=Y.p;try{Y.p=32>i?32:i,G.T=null,i=hu,hu=null;var C=lr,O=Di;if(Ht=0,Es=lr=null,Di=0,(it&6)!==0)throw Error(l(331));var F=it;if(it|=4,vp(C.current),mp(C,C.current,O,i),it=F,Ma(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(bt,C)}catch{}return!0}finally{Y.p=g,G.T=a,Np(e,n)}}function zp(e,n,i){n=Bn(i,n),n=$c(e.stateNode,n,2),e=er(e,n,2),e!==null&&(qn(e,2),ai(e))}function st(e,n,i){if(e.tag===3)zp(e,e,i);else for(;n!==null;){if(n.tag===3){zp(n,e,i);break}else if(n.tag===1){var a=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ar===null||!ar.has(a))){e=Bn(i,e),i=Id(2),a=er(n,i,2),a!==null&&(Pd(i,a,n,e),qn(a,2),ai(a));break}}n=n.return}}function mu(e,n,i){var a=e.pingCache;if(a===null){a=e.pingCache=new Hy;var g=new Set;a.set(n,g)}else g=a.get(n),g===void 0&&(g=new Set,a.set(n,g));g.has(i)||(lu=!0,g.add(i),e=Fy.bind(null,e,n,i),n.then(e,e))}function Fy(e,n,i){var a=e.pingCache;a!==null&&a.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ct===e&&(Ye&i)===i&&(kt===4||kt===3&&(Ye&62914560)===Ye&&300>dt()-Kl?(it&2)===0&&ks(e,0):ou|=i,xs===Ye&&(xs=0)),ai(e)}function Ip(e,n){n===0&&(n=Bi()),e=Dr(e,n),e!==null&&(qn(e,n),ai(e))}function qy(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Ip(e,i)}function $y(e,n){var i=0;switch(e.tag){case 31:case 13:var a=e.stateNode,g=e.memoizedState;g!==null&&(i=g.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(n),Ip(e,i)}function Gy(e,n){return Ke(e,n)}var to=null,Ts=null,gu=!1,no=!1,_u=!1,cr=0;function ai(e){e!==Ts&&e.next===null&&(Ts===null?to=Ts=e:Ts=Ts.next=e),no=!0,gu||(gu=!0,Wy())}function Ma(e,n){if(!_u&&no){_u=!0;do for(var i=!1,a=to;a!==null;){if(e!==0){var g=a.pendingLanes;if(g===0)var C=0;else{var O=a.suspendedLanes,F=a.pingedLanes;C=(1<<31-nt(42|e)+1)-1,C&=g&~(O&~F),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,qp(a,C))}else C=Ye,C=_n(a,a===ct?C:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(C&3)===0||wt(a,C)||(i=!0,qp(a,C));a=a.next}while(i);_u=!1}}function Vy(){Pp()}function Pp(){no=gu=!1;var e=0;cr!==0&&i0()&&(e=cr);for(var n=dt(),i=null,a=to;a!==null;){var g=a.next,C=Up(a,n);C===0?(a.next=null,i===null?to=g:i.next=g,g===null&&(Ts=i)):(i=a,(e!==0||(C&3)!==0)&&(no=!0)),a=g}Ht!==0&&Ht!==5||Ma(e),cr!==0&&(cr=0)}function Up(e,n){for(var i=e.suspendedLanes,a=e.pingedLanes,g=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var O=31-nt(C),F=1<<O,X=g[O];X===-1?((F&i)===0||(F&a)!==0)&&(g[O]=fi(F,n)):X<=n&&(e.expiredLanes|=F),C&=~F}if(n=ct,i=Ye,i=_n(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===n&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Dt(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||wt(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(a!==null&&Dt(a),di(i)){case 2:case 8:i=Ce;break;case 32:i=Re;break;case 268435456:i=Ne;break;default:i=Re}return a=Fp.bind(null,e),i=Ke(i,a),e.callbackPriority=n,e.callbackNode=i,n}return a!==null&&a!==null&&Dt(a),e.callbackPriority=2,e.callbackNode=null,2}function Fp(e,n){if(Ht!==0&&Ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(eo()&&e.callbackNode!==i)return null;var a=Ye;return a=_n(e,e===ct?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(wp(e,a,n),Up(e,dt()),e.callbackNode!=null&&e.callbackNode===i?Fp.bind(null,e):null)}function qp(e,n){if(eo())return null;wp(e,n,!0)}function Wy(){s0(function(){(it&6)!==0?Ke(he,Vy):Pp()})}function vu(){if(cr===0){var e=ds;e===0&&(e=ci,ci<<=1,(ci&261888)===0&&(ci=256)),cr=e}return cr}function $p(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qi(""+e)}function Gp(e,n){var i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,e.id&&i.setAttribute("form",e.id),n.parentNode.insertBefore(i,n),e=new FormData(e),i.parentNode.removeChild(i),e}function Ky(e,n,i,a,g){if(n==="submit"&&i&&i.stateNode===g){var C=$p((g[It]||null).action),O=a.submitter;O&&(n=(n=O[It]||null)?$p(n.formAction):O.getAttribute("formAction"),n!==null&&(C=n,O=null));var F=new is("action","action",null,a,g);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(cr!==0){var X=O?Gp(g,O):new FormData(g);zc(i,{pending:!0,data:X,method:g.method,action:C},null,X)}}else typeof C=="function"&&(F.preventDefault(),X=O?Gp(g,O):new FormData(g),zc(i,{pending:!0,data:X,method:g.method,action:C},C,X))},currentTarget:g}]})}}for(var yu=0;yu<tc.length;yu++){var Su=tc[yu],Yy=Su.toLowerCase(),Xy=Su[0].toUpperCase()+Su.slice(1);Vn(Yy,"on"+Xy)}Vn(Cf,"onAnimationEnd"),Vn(wf,"onAnimationIteration"),Vn(xf,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(fy,"onTransitionRun"),Vn(dy,"onTransitionStart"),Vn(py,"onTransitionCancel"),Vn(Ef,"onTransitionEnd"),ei("onMouseEnter",["mouseout","mouseover"]),ei("onMouseLeave",["mouseout","mouseover"]),ei("onPointerEnter",["pointerout","pointerover"]),ei("onPointerLeave",["pointerout","pointerover"]),Zn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Zn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Zn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Zn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Zn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Zn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var La="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(" "),Qy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(La));function Vp(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var a=e[i],g=a.event;a=a.listeners;e:{var C=void 0;if(n)for(var O=a.length-1;0<=O;O--){var F=a[O],X=F.instance,se=F.currentTarget;if(F=F.listener,X!==C&&g.isPropagationStopped())break e;C=F,g.currentTarget=se;try{C(g)}catch(fe){_l(fe)}g.currentTarget=null,C=X}else for(O=0;O<a.length;O++){if(F=a[O],X=F.instance,se=F.currentTarget,F=F.listener,X!==C&&g.isPropagationStopped())break e;C=F,g.currentTarget=se;try{C(g)}catch(fe){_l(fe)}g.currentTarget=null,C=X}}}}function Ve(e,n){var i=n[Mn];i===void 0&&(i=n[Mn]=new Set);var a=e+"__bubble";i.has(a)||(Wp(n,e,2,!1),i.add(a))}function bu(e,n,i){var a=0;n&&(a|=4),Wp(i,e,a,n)}var io="_reactListening"+Math.random().toString(36).slice(2);function Cu(e){if(!e[io]){e[io]=!0,Gs.forEach(function(i){i!=="selectionchange"&&(Qy.has(i)||bu(i,!1,e),bu(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[io]||(n[io]=!0,bu("selectionchange",!1,n))}}function Wp(e,n,i,a){switch(Cm(n)){case 2:var g=E0;break;case 8:g=k0;break;default:g=Hu}i=g.bind(null,n,i,e),g=void 0,!na||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(g=!0),a?g!==void 0?e.addEventListener(n,i,{capture:!0,passive:g}):e.addEventListener(n,i,!0):g!==void 0?e.addEventListener(n,i,{passive:g}):e.addEventListener(n,i,!1)}function wu(e,n,i,a,g){var C=a;if((n&1)===0&&(n&2)===0&&a!==null)e:for(;;){if(a===null)return;var O=a.tag;if(O===3||O===4){var F=a.stateNode.containerInfo;if(F===g)break;if(O===4)for(O=a.return;O!==null;){var X=O.tag;if((X===3||X===4)&&O.stateNode.containerInfo===g)return;O=O.return}for(;F!==null;){if(O=Ni(F),O===null)return;if(X=O.tag,X===5||X===6||X===26||X===27){a=C=O;continue e}F=F.parentNode}}a=a.return}ta(function(){var se=C,fe=ts(i),_e=[];e:{var le=kf.get(e);if(le!==void 0){var oe=is,Te=e;switch(e){case"keypress":if($i(i)===0)break e;case"keydown":case"keyup":oe=$v;break;case"focusin":Te="focus",oe=Ut;break;case"focusout":Te="blur",oe=Ut;break;case"beforeblur":case"afterblur":oe=Ut;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":oe=ml;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=ue;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Wv;break;case Cf:case wf:case xf:oe=Vo;break;case Ef:oe=Yv;break;case"scroll":case"scrollend":oe=Go;break;case"wheel":oe=Qv;break;case"copy":case"cut":case"paste":oe=Hv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=nf;break;case"toggle":case"beforetoggle":oe=Zv}var Be=(n&4)!==0,ot=!Be&&(e==="scroll"||e==="scrollend"),ne=Be?le!==null?le+"Capture":null:le;Be=[];for(var J=se,re;J!==null;){var pe=J;if(re=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||re===null||ne===null||(pe=Sn(J,ne),pe!=null&&Be.push(Oa(J,pe,re))),ot)break;J=J.return}0<Be.length&&(le=new oe(le,Te,null,i,fe),_e.push({event:le,listeners:Be}))}}if((n&7)===0){e:{if(le=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",le&&i!==Zs&&(Te=i.relatedTarget||i.fromElement)&&(Ni(Te)||Te[ji]))break e;if((oe||le)&&(le=fe.window===fe?fe:(le=fe.ownerDocument)?le.defaultView||le.parentWindow:window,oe?(Te=i.relatedTarget||i.toElement,oe=se,Te=Te?Ni(Te):null,Te!==null&&(ot=p(Te),Be=Te.tag,Te!==ot||Be!==5&&Be!==27&&Be!==6)&&(Te=null)):(oe=null,Te=se),oe!==Te)){if(Be=ml,pe="onMouseLeave",ne="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Be=nf,pe="onPointerLeave",ne="onPointerEnter",J="pointer"),ot=oe==null?le:zi(oe),re=Te==null?le:zi(Te),le=new Be(pe,J+"leave",oe,i,fe),le.target=ot,le.relatedTarget=re,pe=null,Ni(fe)===se&&(Be=new Be(ne,J+"enter",Te,i,fe),Be.target=re,Be.relatedTarget=ot,pe=Be),ot=pe,oe&&Te)t:{for(Be=Jy,ne=oe,J=Te,re=0,pe=ne;pe;pe=Be(pe))re++;pe=0;for(var Le=J;Le;Le=Be(Le))pe++;for(;0<re-pe;)ne=Be(ne),re--;for(;0<pe-re;)J=Be(J),pe--;for(;re--;){if(ne===J||J!==null&&ne===J.alternate){Be=ne;break t}ne=Be(ne),J=Be(J)}Be=null}else Be=null;oe!==null&&Kp(_e,le,oe,Be,!1),Te!==null&&ot!==null&&Kp(_e,ot,Te,Be,!0)}}e:{if(le=se?zi(se):window,oe=le.nodeName&&le.nodeName.toLowerCase(),oe==="select"||oe==="input"&&le.type==="file")var et=hf;else if(cf(le))if(ff)et=cy;else{et=ly;var De=ay}else oe=le.nodeName,!oe||oe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?se&&Qs(se.elementType)&&(et=hf):et=oy;if(et&&(et=et(e,se))){uf(_e,et,i,fe);break e}De&&De(e,le,se),e==="focusout"&&se&&le.type==="number"&&se.memoizedProps.value!=null&&yn(le,"number",le.value)}switch(De=se?zi(se):window,e){case"focusin":(cf(De)||De.contentEditable==="true")&&(ss=De,Jo=se,oa=null);break;case"focusout":oa=Jo=ss=null;break;case"mousedown":Zo=!0;break;case"contextmenu":case"mouseup":case"dragend":Zo=!1,Sf(_e,i,fe);break;case"selectionchange":if(hy)break;case"keydown":case"keyup":Sf(_e,i,fe)}var Ue;if(Ko)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else rs?lf(e,i)&&(Xe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Xe="onCompositionStart");Xe&&(rf&&i.locale!=="ko"&&(rs||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&rs&&(Ue=ns()):(Gn=fe,ia="value"in Gn?Gn.value:Gn.textContent,rs=!0)),De=ro(se,Xe),0<De.length&&(Xe=new tf(Xe,e,null,i,fe),_e.push({event:Xe,listeners:De}),Ue?Xe.data=Ue:(Ue=of(i),Ue!==null&&(Xe.data=Ue)))),(Ue=ty?ny(e,i):iy(e,i))&&(Xe=ro(se,"onBeforeInput"),0<Xe.length&&(De=new tf("onBeforeInput","beforeinput",null,i,fe),_e.push({event:De,listeners:Xe}),De.data=Ue)),Ky(_e,e,se,i,fe)}Vp(_e,n)})}function Oa(e,n,i){return{instance:e,listener:n,currentTarget:i}}function ro(e,n){for(var i=n+"Capture",a=[];e!==null;){var g=e,C=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||C===null||(g=Sn(e,i),g!=null&&a.unshift(Oa(e,g,C)),g=Sn(e,n),g!=null&&a.push(Oa(e,g,C))),e.tag===3)return a;e=e.return}return[]}function Jy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Kp(e,n,i,a,g){for(var C=n._reactName,O=[];i!==null&&i!==a;){var F=i,X=F.alternate,se=F.stateNode;if(F=F.tag,X!==null&&X===a)break;F!==5&&F!==26&&F!==27||se===null||(X=se,g?(se=Sn(i,C),se!=null&&O.unshift(Oa(i,se,X))):g||(se=Sn(i,C),se!=null&&O.push(Oa(i,se,X)))),i=i.return}O.length!==0&&e.push({event:n,listeners:O})}var Zy=/\r\n?/g,e0=/\u0000|\uFFFD/g;function Yp(e){return(typeof e=="string"?e:""+e).replace(Zy,`
|
|
49
|
-
`).replace(e0,"")}function Xp(e,n){return n=Yp(n),Yp(e)===n}function lt(e,n,i,a,g,C){switch(i){case"children":typeof a=="string"?n==="body"||n==="textarea"&&a===""||Ui(e,a):(typeof a=="number"||typeof a=="bigint")&&n!=="body"&&Ui(e,""+a);break;case"className":Pi(e,"class",a);break;case"tabIndex":Pi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Pi(e,i,a);break;case"style":dl(e,a,C);break;case"data":if(n!=="object"){Pi(e,"data",a);break}case"src":case"href":if(a===""&&(n!=="a"||i!=="href")){e.removeAttribute(i);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=qi(""+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 C=="function"&&(i==="formAction"?(n!=="input"&<(e,n,"name",g.name,g,null),lt(e,n,"formEncType",g.formEncType,g,null),lt(e,n,"formMethod",g.formMethod,g,null),lt(e,n,"formTarget",g.formTarget,g,null)):(lt(e,n,"encType",g.encType,g,null),lt(e,n,"method",g.method,g,null),lt(e,n,"target",g.target,g,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=qi(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Wt);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(l(61));if(i=a.__html,i!=null){if(g.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}i=qi(""+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),wr(e,"popover",a);break;case"xlinkActuate":Z(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Z(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Z(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Z(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Z(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Z(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Z(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Z(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Z(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":wr(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=Fi.get(i)||i,wr(e,i,a))}}function xu(e,n,i,a,g,C){switch(i){case"style":dl(e,a,C);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(g.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof a=="string"?Ui(e,a):(typeof a=="number"||typeof a=="bigint")&&Ui(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=Wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jn.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(g=i.endsWith("Capture"),n=i.slice(2,g?i.length-7:void 0),C=e[It]||null,C=C!=null?C[i]:null,typeof C=="function"&&e.removeEventListener(n,C,g),typeof a=="function")){typeof C!="function"&&C!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,a,g);break e}i in e?e[i]=a:a===!0?e.setAttribute(i,""):wr(e,i,a)}}}function Gt(e,n,i){switch(n){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,C;for(C in i)if(i.hasOwnProperty(C)){var O=i[C];if(O!=null)switch(C){case"src":a=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:lt(e,n,C,O,i,null)}}g&<(e,n,"srcSet",i.srcSet,i,null),a&<(e,n,"src",i.src,i,null);return;case"input":Ve("invalid",e);var F=C=O=g=null,X=null,se=null;for(a in i)if(i.hasOwnProperty(a)){var fe=i[a];if(fe!=null)switch(a){case"name":g=fe;break;case"type":O=fe;break;case"checked":X=fe;break;case"defaultChecked":se=fe;break;case"value":C=fe;break;case"defaultValue":F=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(l(137,n));break;default:lt(e,n,a,fe,i,null)}}Pt(e,C,F,X,se,O,g,!1);return;case"select":Ve("invalid",e),a=O=C=null;for(g in i)if(i.hasOwnProperty(g)&&(F=i[g],F!=null))switch(g){case"value":C=F;break;case"defaultValue":O=F;break;case"multiple":a=F;default:lt(e,n,g,F,i,null)}n=C,i=O,e.multiple=!!a,n!=null?pi(e,!!a,n,!1):i!=null&&pi(e,!!a,i,!0);return;case"textarea":Ve("invalid",e),C=g=a=null;for(O in i)if(i.hasOwnProperty(O)&&(F=i[O],F!=null))switch(O){case"value":a=F;break;case"defaultValue":g=F;break;case"children":C=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(91));break;default:lt(e,n,O,F,i,null)}es(e,a,g,C);return;case"option":for(X in i)if(i.hasOwnProperty(X)&&(a=i[X],a!=null))switch(X){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:lt(e,n,X,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<La.length;a++)Ve(La[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(se in i)if(i.hasOwnProperty(se)&&(a=i[se],a!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:lt(e,n,se,a,i,null)}return;default:if(Qs(n)){for(fe in i)i.hasOwnProperty(fe)&&(a=i[fe],a!==void 0&&xu(e,n,fe,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&<(e,n,F,a,i,null))}function t0(e,n,i,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,C=null,O=null,F=null,X=null,se=null,fe=null;for(oe in i){var _e=i[oe];if(i.hasOwnProperty(oe)&&_e!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":X=_e;default:a.hasOwnProperty(oe)||lt(e,n,oe,null,a,_e)}}for(var le in a){var oe=a[le];if(_e=i[le],a.hasOwnProperty(le)&&(oe!=null||_e!=null))switch(le){case"type":C=oe;break;case"name":g=oe;break;case"checked":se=oe;break;case"defaultChecked":fe=oe;break;case"value":O=oe;break;case"defaultValue":F=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,n));break;default:oe!==_e&<(e,n,le,oe,a,_e)}}Ys(e,O,F,X,se,fe,C,g);return;case"select":oe=O=F=le=null;for(C in i)if(X=i[C],i.hasOwnProperty(C)&&X!=null)switch(C){case"value":break;case"multiple":oe=X;default:a.hasOwnProperty(C)||lt(e,n,C,null,a,X)}for(g in a)if(C=a[g],X=i[g],a.hasOwnProperty(g)&&(C!=null||X!=null))switch(g){case"value":le=C;break;case"defaultValue":F=C;break;case"multiple":O=C;default:C!==X&<(e,n,g,C,a,X)}n=F,i=O,a=oe,le!=null?pi(e,!!i,le,!1):!!a!=!!i&&(n!=null?pi(e,!!i,n,!0):pi(e,!!i,i?[]:"",!1));return;case"textarea":oe=le=null;for(F in i)if(g=i[F],i.hasOwnProperty(F)&&g!=null&&!a.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:lt(e,n,F,null,a,g)}for(O in a)if(g=a[O],C=i[O],a.hasOwnProperty(O)&&(g!=null||C!=null))switch(O){case"value":le=g;break;case"defaultValue":oe=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(l(91));break;default:g!==C&<(e,n,O,g,a,C)}Xs(e,le,oe);return;case"option":for(var Te in i)if(le=i[Te],i.hasOwnProperty(Te)&&le!=null&&!a.hasOwnProperty(Te))switch(Te){case"selected":e.selected=!1;break;default:lt(e,n,Te,null,a,le)}for(X in a)if(le=a[X],oe=i[X],a.hasOwnProperty(X)&&le!==oe&&(le!=null||oe!=null))switch(X){case"selected":e.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:lt(e,n,X,le,a,oe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in i)le=i[Be],i.hasOwnProperty(Be)&&le!=null&&!a.hasOwnProperty(Be)&<(e,n,Be,null,a,le);for(se in a)if(le=a[se],oe=i[se],a.hasOwnProperty(se)&&le!==oe&&(le!=null||oe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(l(137,n));break;default:lt(e,n,se,le,a,oe)}return;default:if(Qs(n)){for(var ot in i)le=i[ot],i.hasOwnProperty(ot)&&le!==void 0&&!a.hasOwnProperty(ot)&&xu(e,n,ot,void 0,a,le);for(fe in a)le=a[fe],oe=i[fe],!a.hasOwnProperty(fe)||le===oe||le===void 0&&oe===void 0||xu(e,n,fe,le,a,oe);return}}for(var ne in i)le=i[ne],i.hasOwnProperty(ne)&&le!=null&&!a.hasOwnProperty(ne)&<(e,n,ne,null,a,le);for(_e in a)le=a[_e],oe=i[_e],!a.hasOwnProperty(_e)||le===oe||le==null&&oe==null||lt(e,n,_e,le,a,oe)}function Qp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function n0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,i=performance.getEntriesByType("resource"),a=0;a<i.length;a++){var g=i[a],C=g.transferSize,O=g.initiatorType,F=g.duration;if(C&&F&&Qp(O)){for(O=0,F=g.responseEnd,a+=1;a<i.length;a++){var X=i[a],se=X.startTime;if(se>F)break;var fe=X.transferSize,_e=X.initiatorType;fe&&Qp(_e)&&(X=X.responseEnd,O+=fe*(X<F?1:(F-se)/(X-se)))}if(--a,n+=8*(C+O)/(g.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Eu=null,ku=null;function so(e){return e.nodeType===9?e:e.ownerDocument}function Jp(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 Zp(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Au(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Tu=null;function i0(){var e=window.event;return e&&e.type==="popstate"?e===Tu?!1:(Tu=e,!0):(Tu=null,!1)}var em=typeof setTimeout=="function"?setTimeout:void 0,r0=typeof clearTimeout=="function"?clearTimeout:void 0,tm=typeof Promise=="function"?Promise:void 0,s0=typeof queueMicrotask=="function"?queueMicrotask:typeof tm<"u"?function(e){return tm.resolve(null).then(e).catch(a0)}:em;function a0(e){setTimeout(function(){throw e})}function ur(e){return e==="head"}function nm(e,n){var i=n,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),Ls(n);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")Ba(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Ba(i);for(var C=i.firstChild;C;){var O=C.nextSibling,F=C.nodeName;C[Ln]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=O}}else i==="body"&&Ba(e.ownerDocument.body);i=g}while(i);Ls(n)}function im(e,n){var i=e;e=0;do{var a=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(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 Ru(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Ru(i),Xr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function l0(e,n,i,a){for(;e.nodeType===1;){var g=i;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[Ln])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(C=e.getAttribute("rel"),C==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(C!==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(C=e.getAttribute("src"),(C!==(g.src==null?null:g.src)||e.getAttribute("type")!==(g.type==null?null:g.type)||e.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&C&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var C=g.name==null?null:""+g.name;if(g.type==="hidden"&&e.getAttribute("name")===C)return e}else return e;if(e=In(e.nextSibling),e===null)break}return null}function o0(e,n,i){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=In(e.nextSibling),e===null))return null;return e}function rm(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=In(e.nextSibling),e===null))return null;return e}function Du(e){return e.data==="$?"||e.data==="$~"}function Mu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function c0(e,n){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||i.readyState!=="loading")n();else{var a=function(){n(),i.removeEventListener("DOMContentLoaded",a)};i.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function In(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Lu=null;function sm(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(n===0)return In(e.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}e=e.nextSibling}return null}function am(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return e;n--}else i!=="/$"&&i!=="/&"||n++}e=e.previousSibling}return null}function lm(e,n,i){switch(n=so(i),e){case"html":if(e=n.documentElement,!e)throw Error(l(452));return e;case"head":if(e=n.head,!e)throw Error(l(453));return e;case"body":if(e=n.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Ba(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Xr(e)}var Pn=new Map,om=new Set;function ao(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Mi=Y.d;Y.d={f:u0,r:h0,D:f0,C:d0,L:p0,m:m0,X:_0,S:g0,M:v0};function u0(){var e=Mi.f(),n=Ql();return e||n}function h0(e){var n=Hi(e);n!==null&&n.tag===5&&n.type==="form"?Ed(n):Mi.r(e)}var Rs=typeof document>"u"?null:document;function cm(e,n,i){var a=Rs;if(a&&typeof n=="string"&&n){var g=an(n);g='link[rel="'+e+'"][href="'+g+'"]',typeof i=="string"&&(g+='[crossorigin="'+i+'"]'),om.has(g)||(om.add(g),e={rel:e,crossOrigin:i,href:n},a.querySelector(g)===null&&(n=a.createElement("link"),Gt(n,"link",e),vt(n),a.head.appendChild(n)))}}function f0(e){Mi.D(e),cm("dns-prefetch",e,null)}function d0(e,n){Mi.C(e,n),cm("preconnect",e,n)}function p0(e,n,i){Mi.L(e,n,i);var a=Rs;if(a&&e&&n){var g='link[rel="preload"][as="'+an(n)+'"]';n==="image"&&i&&i.imageSrcSet?(g+='[imagesrcset="'+an(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(g+='[imagesizes="'+an(i.imageSizes)+'"]')):g+='[href="'+an(e)+'"]';var C=g;switch(n){case"style":C=Ds(e);break;case"script":C=Ms(e)}Pn.has(C)||(e=u({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),Pn.set(C,e),a.querySelector(g)!==null||n==="style"&&a.querySelector(ja(C))||n==="script"&&a.querySelector(Na(C))||(n=a.createElement("link"),Gt(n,"link",e),vt(n),a.head.appendChild(n)))}}function m0(e,n){Mi.m(e,n);var i=Rs;if(i&&e){var a=n&&typeof n.as=="string"?n.as:"script",g='link[rel="modulepreload"][as="'+an(a)+'"][href="'+an(e)+'"]',C=g;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Ms(e)}if(!Pn.has(C)&&(e=u({rel:"modulepreload",href:e},n),Pn.set(C,e),i.querySelector(g)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Na(C)))return}a=i.createElement("link"),Gt(a,"link",e),vt(a),i.head.appendChild(a)}}}function g0(e,n,i){Mi.S(e,n,i);var a=Rs;if(a&&e){var g=Ii(a).hoistableStyles,C=Ds(e);n=n||"default";var O=g.get(C);if(!O){var F={loading:0,preload:null};if(O=a.querySelector(ja(C)))F.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":n},i),(i=Pn.get(C))&&Ou(e,i);var X=O=a.createElement("link");vt(X),Gt(X,"link",e),X._p=new Promise(function(se,fe){X.onload=se,X.onerror=fe}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,lo(O,n,a)}O={type:"stylesheet",instance:O,count:1,state:F},g.set(C,O)}}}function _0(e,n){Mi.X(e,n);var i=Rs;if(i&&e){var a=Ii(i).hoistableScripts,g=Ms(e),C=a.get(g);C||(C=i.querySelector(Na(g)),C||(e=u({src:e,async:!0},n),(n=Pn.get(g))&&Bu(e,n),C=i.createElement("script"),vt(C),Gt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(g,C))}}function v0(e,n){Mi.M(e,n);var i=Rs;if(i&&e){var a=Ii(i).hoistableScripts,g=Ms(e),C=a.get(g);C||(C=i.querySelector(Na(g)),C||(e=u({src:e,async:!0,type:"module"},n),(n=Pn.get(g))&&Bu(e,n),C=i.createElement("script"),vt(C),Gt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(g,C))}}function um(e,n,i,a){var g=(g=ve.current)?ao(g):null;if(!g)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=Ds(i.href),i=Ii(g).hoistableStyles,a=i.get(n),a||(a={type:"style",instance:null,count:0,state:null},i.set(n,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=Ds(i.href);var C=Ii(g).hoistableStyles,O=C.get(e);if(O||(g=g.ownerDocument||g,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(e,O),(C=g.querySelector(ja(e)))&&!C._p&&(O.instance=C,O.state.loading=5),Pn.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},Pn.set(e,i),C||y0(g,e,i,O.state))),n&&a===null)throw Error(l(528,""));return O}if(n&&a!==null)throw Error(l(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ms(i),i=Ii(g).hoistableScripts,a=i.get(n),a||(a={type:"script",instance:null,count:0,state:null},i.set(n,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Ds(e){return'href="'+an(e)+'"'}function ja(e){return'link[rel="stylesheet"]['+e+"]"}function hm(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function y0(e,n,i,a){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?a.loading=1:(n=e.createElement("link"),a.preload=n,n.addEventListener("load",function(){return a.loading|=1}),n.addEventListener("error",function(){return a.loading|=2}),Gt(n,"link",i),vt(n),e.head.appendChild(n))}function Ms(e){return'[src="'+an(e)+'"]'}function Na(e){return"script[async]"+e}function fm(e,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var a=e.querySelector('style[data-href~="'+an(i.href)+'"]');if(a)return n.instance=a,vt(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"),vt(a),Gt(a,"style",g),lo(a,i.precedence,e),n.instance=a;case"stylesheet":g=Ds(i.href);var C=e.querySelector(ja(g));if(C)return n.state.loading|=4,n.instance=C,vt(C),C;a=hm(i),(g=Pn.get(g))&&Ou(a,g),C=(e.ownerDocument||e).createElement("link"),vt(C);var O=C;return O._p=new Promise(function(F,X){O.onload=F,O.onerror=X}),Gt(C,"link",a),n.state.loading|=4,lo(C,i.precedence,e),n.instance=C;case"script":return C=Ms(i.src),(g=e.querySelector(Na(C)))?(n.instance=g,vt(g),g):(a=i,(g=Pn.get(C))&&(a=u({},i),Bu(a,g)),e=e.ownerDocument||e,g=e.createElement("script"),vt(g),Gt(g,"link",a),e.head.appendChild(g),n.instance=g);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(a=n.instance,n.state.loading|=4,lo(a,i.precedence,e));return n.instance}function lo(e,n,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=a.length?a[a.length-1]:null,C=g,O=0;O<a.length;O++){var F=a[O];if(F.dataset.precedence===n)C=F;else if(C!==g)break}C?C.parentNode.insertBefore(e,C.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(e,n.firstChild))}function Ou(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Bu(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var oo=null;function dm(e,n,i){if(oo===null){var a=new Map,g=oo=new Map;g.set(i,a)}else g=oo,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 C=i[g];if(!(C[Ln]||C[At]||e==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var O=C.getAttribute(n)||"";O=e+O;var F=a.get(O);F?F.push(C):a.set(O,[C])}}return a}function pm(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function S0(e,n,i){if(i===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function mm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function b0(e,n,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=Ds(a.href),C=n.querySelector(ja(g));if(C){n=C._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=co.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=C,vt(C);return}C=n.ownerDocument||n,a=hm(a),(g=Pn.get(g))&&Ou(a,g),C=C.createElement("link"),vt(C);var O=C;O._p=new Promise(function(F,X){O.onload=F,O.onerror=X}),Gt(C,"link",a),i.instance=C}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=co.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var ju=0;function C0(e,n){return e.stylesheets&&e.count===0&&ho(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&ho(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+n);0<e.imgBytes&&ju===0&&(ju=62500*n0());var g=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ho(e,e.stylesheets),e.unsuspend)){var C=e.unsuspend;e.unsuspend=null,C()}},(e.imgBytes>ju?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(g)}}:null}function co(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ho(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var uo=null;function ho(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uo=new Map,n.forEach(w0,e),uo=null,co.call(e))}function w0(e,n){if(!(n.state.loading&4)){var i=uo.get(e);if(i)var a=i.get(null);else{i=new Map,uo.set(e,i);for(var g=e.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<g.length;C++){var O=g[C];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(i.set(O.dataset.precedence,O),a=O)}a&&i.set(null,a)}g=n.instance,O=g.getAttribute("data-precedence"),C=i.get(O)||a,C===a&&i.set(null,g),i.set(O,g),this.count++,a=co.bind(this),g.addEventListener("load",a),g.addEventListener("error",a),C?C.parentNode.insertBefore(g,C.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(g,e.firstChild)),n.state.loading|=4}}var Ha={$$typeof:S,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function x0(e,n,i,a,g,C,O,F,X){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=tn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tn(0),this.hiddenUpdates=tn(null),this.identifierPrefix=a,this.onUncaughtError=g,this.onCaughtError=C,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function gm(e,n,i,a,g,C,O,F,X,se,fe,_e){return e=new x0(e,n,i,O,X,se,fe,_e,F),n=1,C===!0&&(n|=24),C=Cn(3,null,null,n),e.current=C,C.stateNode=e,n=pc(),n.refCount++,e.pooledCache=n,n.refCount++,C.memoizedState={element:a,isDehydrated:i,cache:n},vc(C),e}function _m(e){return e?(e=os,e):os}function vm(e,n,i,a,g,C){g=_m(g),a.context===null?a.context=g:a.pendingContext=g,a=Zi(n),a.payload={element:i},C=C===void 0?null:C,C!==null&&(a.callback=C),i=er(e,a,n),i!==null&&(fn(i,e,n),ma(i,e,n))}function ym(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Nu(e,n){ym(e,n),(e=e.alternate)&&ym(e,n)}function Sm(e){if(e.tag===13||e.tag===31){var n=Dr(e,67108864);n!==null&&fn(n,e,67108864),Nu(e,67108864)}}function bm(e){if(e.tag===13||e.tag===31){var n=An();n=Ie(n);var i=Dr(e,n);i!==null&&fn(i,e,n),Nu(e,n)}}var fo=!0;function E0(e,n,i,a){var g=G.T;G.T=null;var C=Y.p;try{Y.p=2,Hu(e,n,i,a)}finally{Y.p=C,G.T=g}}function k0(e,n,i,a){var g=G.T;G.T=null;var C=Y.p;try{Y.p=8,Hu(e,n,i,a)}finally{Y.p=C,G.T=g}}function Hu(e,n,i,a){if(fo){var g=zu(a);if(g===null)wu(e,n,a,po,i),wm(e,a);else if(T0(g,e,n,i,a))a.stopPropagation();else if(wm(e,a),n&4&&-1<A0.indexOf(e)){for(;g!==null;){var C=Hi(g);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var O=gn(C.pendingLanes);if(O!==0){var F=C;for(F.pendingLanes|=2,F.entangledLanes|=2;O;){var X=1<<31-nt(O);F.entanglements[1]|=X,O&=~X}ai(C),(it&6)===0&&(Yl=dt()+500,Ma(0))}}break;case 31:case 13:F=Dr(C,2),F!==null&&fn(F,C,2),Ql(),Nu(C,2)}if(C=zu(a),C===null&&wu(e,n,a,po,i),C===g)break;g=C}g!==null&&a.stopPropagation()}else wu(e,n,a,null,i)}}function zu(e){return e=ts(e),Iu(e)}var po=null;function Iu(e){if(po=null,e=Ni(e),e!==null){var n=p(e);if(n===null)e=null;else{var i=n.tag;if(i===13){if(e=f(n),e!==null)return e;e=null}else if(i===31){if(e=o(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return po=e,null}function Cm(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(Nt()){case he:return 2;case Ce:return 8;case Re:case je:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Pu=!1,hr=null,fr=null,dr=null,za=new Map,Ia=new Map,pr=[],A0="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 wm(e,n){switch(e){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":za.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ia.delete(n.pointerId)}}function Pa(e,n,i,a,g,C){return e===null||e.nativeEvent!==C?(e={blockedOn:n,domEventName:i,eventSystemFlags:a,nativeEvent:C,targetContainers:[g]},n!==null&&(n=Hi(n),n!==null&&Sm(n)),e):(e.eventSystemFlags|=a,n=e.targetContainers,g!==null&&n.indexOf(g)===-1&&n.push(g),e)}function T0(e,n,i,a,g){switch(n){case"focusin":return hr=Pa(hr,e,n,i,a,g),!0;case"dragenter":return fr=Pa(fr,e,n,i,a,g),!0;case"mouseover":return dr=Pa(dr,e,n,i,a,g),!0;case"pointerover":var C=g.pointerId;return za.set(C,Pa(za.get(C)||null,e,n,i,a,g)),!0;case"gotpointercapture":return C=g.pointerId,Ia.set(C,Pa(Ia.get(C)||null,e,n,i,a,g)),!0}return!1}function xm(e){var n=Ni(e.target);if(n!==null){var i=p(n);if(i!==null){if(n=i.tag,n===13){if(n=f(i),n!==null){e.blockedOn=n,Yr(e.priority,function(){bm(i)});return}}else if(n===31){if(n=o(i),n!==null){e.blockedOn=n,Yr(e.priority,function(){bm(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=zu(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);Zs=a,i.target.dispatchEvent(a),Zs=null}else return n=Hi(i),n!==null&&Sm(n),e.blockedOn=i,!1;n.shift()}return!0}function Em(e,n,i){mo(e)&&i.delete(n)}function R0(){Pu=!1,hr!==null&&mo(hr)&&(hr=null),fr!==null&&mo(fr)&&(fr=null),dr!==null&&mo(dr)&&(dr=null),za.forEach(Em),Ia.forEach(Em)}function go(e,n){e.blockedOn===n&&(e.blockedOn=null,Pu||(Pu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,R0)))}var _o=null;function km(e){_o!==e&&(_o=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){_o===e&&(_o=null);for(var n=0;n<e.length;n+=3){var i=e[n],a=e[n+1],g=e[n+2];if(typeof a!="function"){if(Iu(a||i)===null)continue;break}var C=Hi(i);C!==null&&(e.splice(n,3),n-=3,zc(C,{pending:!0,data:g,method:i.method,action:a},a,g))}}))}function Ls(e){function n(X){return go(X,e)}hr!==null&&go(hr,e),fr!==null&&go(fr,e),dr!==null&&go(dr,e),za.forEach(n),Ia.forEach(n);for(var i=0;i<pr.length;i++){var a=pr[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<pr.length&&(i=pr[0],i.blockedOn===null);)xm(i),i.blockedOn===null&&pr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var g=i[a],C=i[a+1],O=g[It]||null;if(typeof C=="function")O||km(i);else if(O){var F=null;if(C&&C.hasAttribute("formAction")){if(g=C,O=C[It]||null)F=O.formAction;else if(Iu(g)!==null)continue}else F=O.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),km(i)}}}function Am(){function e(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(O){return g=O})},focusReset:"manual",scroll:"manual"})}function n(){g!==null&&(g(),g=null),a||setTimeout(i,20)}function i(){if(!a&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,g=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(i,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),g!==null&&(g(),g=null)}}}function Uu(e){this._internalRoot=e}vo.prototype.render=Uu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var i=n.current,a=An();vm(i,a,e,n,null,null)},vo.prototype.unmount=Uu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;vm(e.current,2,null,e,null,null),Ql(),n[ji]=null}};function vo(e){this._internalRoot=e}vo.prototype.unstable_scheduleHydration=function(e){if(e){var n=Cr();e={blockedOn:null,target:e,priority:n};for(var i=0;i<pr.length&&n!==0&&n<pr[i].priority;i++);pr.splice(i,0,e),i===0&&xm(e)}};var Tm=r.version;if(Tm!=="19.2.6")throw Error(l(527,Tm,"19.2.6"));Y.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=h(n),e=e!==null?m(e):null,e=e===null?null:e.stateNode,e};var D0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yo.isDisabled&&yo.supportsFiber)try{bt=yo.inject(D0),Ct=yo}catch{}}return Fa.createRoot=function(e,n){if(!d(e))throw Error(l(299));var i=!1,a="",g=jd,C=Nd,O=Hd;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(g=n.onUncaughtError),n.onCaughtError!==void 0&&(C=n.onCaughtError),n.onRecoverableError!==void 0&&(O=n.onRecoverableError)),n=gm(e,1,!1,null,null,i,a,null,g,C,O,Am),e[ji]=n.current,Cu(e),new Uu(n)},Fa.hydrateRoot=function(e,n,i){if(!d(e))throw Error(l(299));var a=!1,g="",C=jd,O=Nd,F=Hd,X=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(F=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),n=gm(e,1,!0,n,i??null,a,g,X,C,O,F,Am),n.context=_m(null),i=n.current,a=An(),a=Ie(a),g=Zi(a),g.callback=null,er(i,g,a),i=a,n.current.lanes=i,qn(n,i),ai(n),e[ji]=n.current,Cu(e),new vo(n)},Fa.version="19.2.6",Fa}var Im;function F0(){if(Im)return $u.exports;Im=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),$u.exports=U0(),$u.exports}var q0=F0();const Wr=function(t,r){let d=t;const p=Ka[r];let f=null,o=0,c=null;const h=[],m={},u=function(D,k){o=d*4+17,f=(function(R){const B=new Array(R);for(let H=0;H<R;H+=1){B[H]=new Array(R);for(let U=0;U<R;U+=1)B[H][U]=null}return B})(o),y(0,0),y(o-7,0),y(0,o-7),E(),T(),v(D,k),d>=7&&b(D),c==null&&(c=A(d,p,h)),_(c,k)},y=function(D,k){for(let R=-1;R<=7;R+=1)if(!(D+R<=-1||o<=D+R))for(let B=-1;B<=7;B+=1)k+B<=-1||o<=k+B||(0<=R&&R<=6&&(B==0||B==6)||0<=B&&B<=6&&(R==0||R==6)||2<=R&&R<=4&&2<=B&&B<=4?f[D+R][k+B]=!0:f[D+R][k+B]=!1)},w=function(){let D=0,k=0;for(let R=0;R<8;R+=1){u(!0,R);const B=_r.getLostPoint(m);(R==0||D>B)&&(D=B,k=R)}return k},T=function(){for(let D=8;D<o-8;D+=1)f[D][6]==null&&(f[D][6]=D%2==0);for(let D=8;D<o-8;D+=1)f[6][D]==null&&(f[6][D]=D%2==0)},E=function(){const D=_r.getPatternPosition(d);for(let k=0;k<D.length;k+=1)for(let R=0;R<D.length;R+=1){const B=D[k],H=D[R];if(f[B][H]==null)for(let U=-2;U<=2;U+=1)for(let P=-2;P<=2;P+=1)U==-2||U==2||P==-2||P==2||U==0&&P==0?f[B+U][H+P]=!0:f[B+U][H+P]=!1}},b=function(D){const k=_r.getBCHTypeNumber(d);for(let R=0;R<18;R+=1){const B=!D&&(k>>R&1)==1;f[Math.floor(R/3)][R%3+o-8-3]=B}for(let R=0;R<18;R+=1){const B=!D&&(k>>R&1)==1;f[R%3+o-8-3][Math.floor(R/3)]=B}},v=function(D,k){const R=p<<3|k,B=_r.getBCHTypeInfo(R);for(let H=0;H<15;H+=1){const U=!D&&(B>>H&1)==1;H<6?f[H][8]=U:H<8?f[H+1][8]=U:f[o-15+H][8]=U}for(let H=0;H<15;H+=1){const U=!D&&(B>>H&1)==1;H<8?f[8][o-H-1]=U:H<9?f[8][15-H-1+1]=U:f[8][15-H-1]=U}f[o-8][8]=!D},_=function(D,k){let R=-1,B=o-1,H=7,U=0;const P=_r.getMaskFunction(k);for(let V=o-1;V>0;V-=2)for(V==6&&(V-=1);;){for(let K=0;K<2;K+=1)if(f[B][V-K]==null){let G=!1;U<D.length&&(G=(D[U]>>>H&1)==1),P(B,V-K)&&(G=!G),f[B][V-K]=G,H-=1,H==-1&&(U+=1,H=7)}if(B+=R,B<0||o<=B){B-=R,R=-R;break}}},S=function(D,k){let R=0,B=0,H=0;const U=new Array(k.length),P=new Array(k.length);for(let Y=0;Y<k.length;Y+=1){const ee=k[Y].dataCount,z=k[Y].totalCount-ee;B=Math.max(B,ee),H=Math.max(H,z),U[Y]=new Array(ee);for(let I=0;I<U[Y].length;I+=1)U[Y][I]=255&D.getBuffer()[I+R];R+=ee;const j=_r.getErrorCorrectPolynomial(z),$=Za(U[Y],j.getLength()-1).mod(j);P[Y]=new Array(j.getLength()-1);for(let I=0;I<P[Y].length;I+=1){const ie=I+$.getLength()-P[Y].length;P[Y][I]=ie>=0?$.getAt(ie):0}}let V=0;for(let Y=0;Y<k.length;Y+=1)V+=k[Y].totalCount;const K=new Array(V);let G=0;for(let Y=0;Y<B;Y+=1)for(let ee=0;ee<k.length;ee+=1)Y<U[ee].length&&(K[G]=U[ee][Y],G+=1);for(let Y=0;Y<H;Y+=1)for(let ee=0;ee<k.length;ee+=1)Y<P[ee].length&&(K[G]=P[ee][Y],G+=1);return K},A=function(D,k,R){const B=Pm.getRSBlocks(D,k),H=Um();for(let P=0;P<R.length;P+=1){const V=R[P];H.put(V.getMode(),4),H.put(V.getLength(),_r.getLengthInBits(V.getMode(),D)),V.write(H)}let U=0;for(let P=0;P<B.length;P+=1)U+=B[P].dataCount;if(H.getLengthInBits()>U*8)throw"code length overflow. ("+H.getLengthInBits()+">"+U*8+")";for(H.getLengthInBits()+4<=U*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=U*8||(H.put(236,8),H.getLengthInBits()>=U*8));)H.put(17,8);return S(H,B)};m.addData=function(D,k){k=k||"Byte";let R=null;switch(k){case"Numeric":R=$0(D);break;case"Alphanumeric":R=G0(D);break;case"Byte":R=V0(D);break;case"Kanji":R=W0(D);break;default:throw"mode:"+k}h.push(R),c=null},m.isDark=function(D,k){if(D<0||o<=D||k<0||o<=k)throw D+","+k;return f[D][k]},m.getModuleCount=function(){return o},m.make=function(){if(d<1){let D=1;for(;D<40;D++){const k=Pm.getRSBlocks(D,p),R=Um();for(let H=0;H<h.length;H++){const U=h[H];R.put(U.getMode(),4),R.put(U.getLength(),_r.getLengthInBits(U.getMode(),D)),U.write(R)}let B=0;for(let H=0;H<k.length;H++)B+=k[H].dataCount;if(R.getLengthInBits()<=B*8)break}d=D}u(!1,w())},m.createTableTag=function(D,k){D=D||2,k=typeof k>"u"?D*4:k;let R="";R+='<table style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: "+k+"px;",R+='">',R+="<tbody>";for(let B=0;B<m.getModuleCount();B+=1){R+="<tr>";for(let H=0;H<m.getModuleCount();H+=1)R+='<td style="',R+=" border-width: 0px; border-style: none;",R+=" border-collapse: collapse;",R+=" padding: 0px; margin: 0px;",R+=" width: "+D+"px;",R+=" height: "+D+"px;",R+=" background-color: ",R+=m.isDark(B,H)?"#000000":"#ffffff",R+=";",R+='"/>';R+="</tr>"}return R+="</tbody>",R+="</table>",R},m.createSvgTag=function(D,k,R,B){let H={};typeof arguments[0]=="object"&&(H=arguments[0],D=H.cellSize,k=H.margin,R=H.alt,B=H.title),D=D||2,k=typeof k>"u"?D*4:k,R=typeof R=="string"?{text:R}:R||{},R.text=R.text||null,R.id=R.text?R.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 U=m.getModuleCount()*D+k*2;let P,V,K,G,Y="",ee;for(ee="l"+D+",0 0,"+D+" -"+D+",0 0,-"+D+"z ",Y+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',Y+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',Y+=' viewBox="0 0 '+U+" "+U+'" ',Y+=' preserveAspectRatio="xMinYMin meet"',Y+=B.text||R.text?' role="img" aria-labelledby="'+L([B.id,R.id].join(" ").trim())+'"':"",Y+=">",Y+=B.text?'<title id="'+L(B.id)+'">'+L(B.text)+"</title>":"",Y+=R.text?'<description id="'+L(R.id)+'">'+L(R.text)+"</description>":"",Y+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Y+='<path d="',K=0;K<m.getModuleCount();K+=1)for(G=K*D+k,P=0;P<m.getModuleCount();P+=1)m.isDark(K,P)&&(V=P*D+k,Y+="M"+V+","+G+ee);return Y+='" stroke="transparent" fill="black"/>',Y+="</svg>",Y},m.createDataURL=function(D,k){D=D||2,k=typeof k>"u"?D*4:k;const R=m.getModuleCount()*D+k*2,B=k,H=R-k;return Q0(R,R,function(U,P){if(B<=U&&U<H&&B<=P&&P<H){const V=Math.floor((U-B)/D),K=Math.floor((P-B)/D);return m.isDark(K,V)?0:1}else return 1})},m.createImgTag=function(D,k,R){D=D||2,k=typeof k>"u"?D*4:k;const B=m.getModuleCount()*D+k*2;let H="";return H+="<img",H+=' src="',H+=m.createDataURL(D,k),H+='"',H+=' width="',H+=B,H+='"',H+=' height="',H+=B,H+='"',R&&(H+=' alt="',H+=L(R),H+='"'),H+="/>",H};const L=function(D){let k="";for(let R=0;R<D.length;R+=1){const B=D.charAt(R);switch(B){case"<":k+="<";break;case">":k+=">";break;case"&":k+="&";break;case'"':k+=""";break;default:k+=B;break}}return k},M=function(D){D=typeof D>"u"?2:D;const R=m.getModuleCount()*1+D*2,B=D,H=R-D;let U,P,V,K,G;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},ee={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<R;U+=2){for(V=Math.floor((U-B)/1),K=Math.floor((U+1-B)/1),P=0;P<R;P+=1)G="█",B<=P&&P<H&&B<=U&&U<H&&m.isDark(V,Math.floor((P-B)/1))&&(G=" "),B<=P&&P<H&&B<=U+1&&U+1<H&&m.isDark(K,Math.floor((P-B)/1))?G+=" ":G+="█",z+=D<1&&U+1>=H?ee[G]:Y[G];z+=`
|
|
50
|
-
`}return R%2&&D>0?z.substring(0,z.length-R-1)+Array(R+1).join("▀"):z.substring(0,z.length-1)};return m.createASCII=function(D,k){if(D=D||1,D<2)return M(k);D-=1,k=typeof k>"u"?D*2:k;const R=m.getModuleCount()*D+k*2,B=k,H=R-k;let U,P,V,K;const G=Array(D+1).join("██"),Y=Array(D+1).join(" ");let ee="",z="";for(U=0;U<R;U+=1){for(V=Math.floor((U-B)/D),z="",P=0;P<R;P+=1)K=1,B<=P&&P<H&&B<=U&&U<H&&m.isDark(V,Math.floor((P-B)/D))&&(K=0),z+=K?G:Y;for(V=0;V<D;V+=1)ee+=z+`
|
|
51
|
-
`}return ee.substring(0,ee.length-1)},m.renderTo2dContext=function(D,k){k=k||2;const R=m.getModuleCount();for(let B=0;B<R;B++)for(let H=0;H<R;H++)D.fillStyle=m.isDark(B,H)?"black":"white",D.fillRect(H*k,B*k,k,k)},m};Wr.stringToBytes=function(t){const r=[];for(let s=0;s<t.length;s+=1){const l=t.charCodeAt(s);r.push(l&255)}return r};Wr.createStringToBytes=function(t,r){const s=(function(){const d=Y0(t),p=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const o={};for(;;){const c=d.read();if(c==-1)break;const h=p(),m=p(),u=p(),y=String.fromCharCode(c<<8|h),w=m<<8|u;o[y]=w,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const p=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)p.push(o);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?p.push(c):(p.push(c>>>8),p.push(c&255)):p.push(l)}}return p}};const Qt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ka={L:1,M:0,Q:3,H:2},gr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},_r=(function(){const t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,s=7973,l=21522,d={},p=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;p(o)-p(r)>=0;)o^=r<<p(o)-p(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;p(o)-p(s)>=0;)o^=s<<p(o)-p(s);return f<<12|o},d.getPatternPosition=function(f){return t[f-1]},d.getMaskFunction=function(f){switch(f){case gr.PATTERN000:return function(o,c){return(o+c)%2==0};case gr.PATTERN001:return function(o,c){return o%2==0};case gr.PATTERN010:return function(o,c){return c%3==0};case gr.PATTERN011:return function(o,c){return(o+c)%3==0};case gr.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case gr.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case gr.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case gr.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let o=Za([1],0);for(let c=0;c<f;c+=1)o=o.multiply(Za([1,yr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case Qt.MODE_NUMBER:return 10;case Qt.MODE_ALPHA_NUM:return 9;case Qt.MODE_8BIT_BYTE:return 8;case Qt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case Qt.MODE_NUMBER:return 12;case Qt.MODE_ALPHA_NUM:return 11;case Qt.MODE_8BIT_BYTE:return 16;case Qt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case Qt.MODE_NUMBER:return 14;case Qt.MODE_ALPHA_NUM:return 13;case Qt.MODE_8BIT_BYTE:return 16;case Qt.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+o},d.getLostPoint=function(f){const o=f.getModuleCount();let c=0;for(let u=0;u<o;u+=1)for(let y=0;y<o;y+=1){let w=0;const T=f.isDark(u,y);for(let E=-1;E<=1;E+=1)if(!(u+E<0||o<=u+E))for(let b=-1;b<=1;b+=1)y+b<0||o<=y+b||E==0&&b==0||T==f.isDark(u+E,y+b)&&(w+=1);w>5&&(c+=3+w-5)}for(let u=0;u<o-1;u+=1)for(let y=0;y<o-1;y+=1){let w=0;f.isDark(u,y)&&(w+=1),f.isDark(u+1,y)&&(w+=1),f.isDark(u,y+1)&&(w+=1),f.isDark(u+1,y+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let u=0;u<o;u+=1)for(let y=0;y<o-6;y+=1)f.isDark(u,y)&&!f.isDark(u,y+1)&&f.isDark(u,y+2)&&f.isDark(u,y+3)&&f.isDark(u,y+4)&&!f.isDark(u,y+5)&&f.isDark(u,y+6)&&(c+=40);for(let u=0;u<o;u+=1)for(let y=0;y<o-6;y+=1)f.isDark(y,u)&&!f.isDark(y+1,u)&&f.isDark(y+2,u)&&f.isDark(y+3,u)&&f.isDark(y+4,u)&&!f.isDark(y+5,u)&&f.isDark(y+6,u)&&(c+=40);let h=0;for(let u=0;u<o;u+=1)for(let y=0;y<o;y+=1)f.isDark(y,u)&&(h+=1);const m=Math.abs(100*h/o/o-50)/5;return c+=m*10,c},d})(),yr=(function(){const t=new Array(256),r=new Array(256);for(let l=0;l<8;l+=1)t[l]=1<<l;for(let l=8;l<256;l+=1)t[l]=t[l-4]^t[l-5]^t[l-6]^t[l-8];for(let l=0;l<255;l+=1)r[t[l]]=l;const s={};return s.glog=function(l){if(l<1)throw"glog("+l+")";return r[l]},s.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return t[l]},s})(),Za=function(t,r){if(typeof t.length>"u")throw t.length+"/"+r;const s=(function(){let d=0;for(;d<t.length&&t[d]==0;)d+=1;const p=new Array(t.length-d+r);for(let f=0;f<t.length-d;f+=1)p[f]=t[f+d];return p})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const p=new Array(l.getLength()+d.getLength()-1);for(let f=0;f<l.getLength();f+=1)for(let o=0;o<d.getLength();o+=1)p[f+o]^=yr.gexp(yr.glog(l.getAt(f))+yr.glog(d.getAt(o)));return Za(p,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const p=yr.glog(l.getAt(0))-yr.glog(d.getAt(0)),f=new Array(l.getLength());for(let o=0;o<l.getLength();o+=1)f[o]=l.getAt(o);for(let o=0;o<d.getLength();o+=1)f[o]^=yr.gexp(yr.glog(d.getAt(o))+p);return Za(f,0).mod(d)},l},Pm=(function(){const t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(d,p){const f={};return f.totalCount=d,f.dataCount=p,f},s={},l=function(d,p){switch(p){case Ka.L:return t[(d-1)*4+0];case Ka.M:return t[(d-1)*4+1];case Ka.Q:return t[(d-1)*4+2];case Ka.H:return t[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,p){const f=l(d,p);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+p;const o=f.length/3,c=[];for(let h=0;h<o;h+=1){const m=f[h*3+0],u=f[h*3+1],y=f[h*3+2];for(let w=0;w<m;w+=1)c.push(r(u,y))}return c},s})(),Um=function(){const t=[];let r=0;const s={};return s.getBuffer=function(){return t},s.getAt=function(l){const d=Math.floor(l/8);return(t[d]>>>7-l%8&1)==1},s.put=function(l,d){for(let p=0;p<d;p+=1)s.putBit((l>>>d-p-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);t.length<=d&&t.push(0),l&&(t[d]|=128>>>r%8),r+=1},s},$0=function(t){const r=Qt.MODE_NUMBER,s=t,l={};l.getMode=function(){return r},l.getLength=function(f){return s.length},l.write=function(f){const o=s;let c=0;for(;c+2<o.length;)f.put(d(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?f.put(d(o.substring(c,c+1)),4):o.length-c==2&&f.put(d(o.substring(c,c+2)),7))};const d=function(f){let o=0;for(let c=0;c<f.length;c+=1)o=o*10+p(f.charAt(c));return o},p=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},G0=function(t){const r=Qt.MODE_ALPHA_NUM,s=t,l={};l.getMode=function(){return r},l.getLength=function(p){return s.length},l.write=function(p){const f=s;let o=0;for(;o+1<f.length;)p.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&p.put(d(f.charAt(o)),6)};const d=function(p){if("0"<=p&&p<="9")return p.charCodeAt(0)-48;if("A"<=p&&p<="Z")return p.charCodeAt(0)-65+10;switch(p){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+p}};return l},V0=function(t){const r=Qt.MODE_8BIT_BYTE,s=Wr.stringToBytes(t),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let p=0;p<s.length;p+=1)d.put(s[p],8)},l},W0=function(t){const r=Qt.MODE_KANJI,s=Wr.stringToBytes;(function(p,f){const o=s(p);if(o.length!=2||(o[0]<<8|o[1])!=f)throw"sjis not supported."})("友",38726);const l=s(t),d={};return d.getMode=function(){return r},d.getLength=function(p){return~~(l.length/2)},d.write=function(p){const f=l;let o=0;for(;o+1<f.length;){let c=(255&f[o])<<8|255&f[o+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(o+1)+"/"+c;c=(c>>>8&255)*192+(c&255),p.put(c,13),o+=2}if(o<f.length)throw"illegal char at "+(o+1)},d},r_=function(){const t=[],r={};return r.writeByte=function(s){t.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,l,d){l=l||0,d=d||s.length;for(let p=0;p<d;p+=1)r.writeByte(s[p+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return t},r.toString=function(){let s="";s+="[";for(let l=0;l<t.length;l+=1)l>0&&(s+=","),s+=t[l];return s+="]",s},r},K0=function(){let t=0,r=0,s=0,l="";const d={},p=function(o){l+=String.fromCharCode(f(o&63))},f=function(o){if(o<0)throw"n:"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw"n:"+o};return d.writeByte=function(o){for(t=t<<8|o&255,r+=8,s+=1;r>=6;)p(t>>>r-6),r-=6},d.flush=function(){if(r>0&&(p(t<<6-r),t=0,r=0),s%3!=0){const o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},Y0=function(t){const r=t;let s=0,l=0,d=0;const p={};p.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;l=l<<6|f(c.charCodeAt(0)),d+=6}const o=l>>>d-8&255;return d-=8,o};const f=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw"c:"+o};return p},X0=function(t,r){const s=t,l=r,d=new Array(t*r),p={};p.setPixel=function(h,m,u){d[m*s+h]=u},p.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(l),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(s),h.writeShort(l),h.writeByte(0);const m=2,u=o(m);h.writeByte(m);let y=0;for(;u.length-y>255;)h.writeByte(255),h.writeBytes(u,y,255),y+=255;h.writeByte(u.length-y),h.writeBytes(u,y,u.length-y),h.writeByte(0),h.writeString(";")};const f=function(h){const m=h;let u=0,y=0;const w={};return w.write=function(T,E){if(T>>>E)throw"length over";for(;u+E>=8;)m.writeByte(255&(T<<u|y)),E-=8-u,T>>>=8-u,y=0,u=0;y=T<<u|y,u=u+E},w.flush=function(){u>0&&m.writeByte(y)},w},o=function(h){const m=1<<h,u=(1<<h)+1;let y=h+1;const w=c();for(let _=0;_<m;_+=1)w.add(String.fromCharCode(_));w.add(String.fromCharCode(m)),w.add(String.fromCharCode(u));const T=r_(),E=f(T);E.write(m,y);let b=0,v=String.fromCharCode(d[b]);for(b+=1;b<d.length;){const _=String.fromCharCode(d[b]);b+=1,w.contains(v+_)?v=v+_:(E.write(w.indexOf(v),y),w.size()<4095&&(w.size()==1<<y&&(y+=1),w.add(v+_)),v=_)}return E.write(w.indexOf(v),y),E.write(u,y),E.flush(),T.toByteArray()},c=function(){const h={};let m=0;const u={};return u.add=function(y){if(u.contains(y))throw"dup key:"+y;h[y]=m,m+=1},u.size=function(){return m},u.indexOf=function(y){return h[y]},u.contains=function(y){return typeof h[y]<"u"},u};return p},Q0=function(t,r,s){const l=X0(t,r);for(let o=0;o<r;o+=1)for(let c=0;c<t;c+=1)l.setPixel(c,o,s(c,o));const d=r_();l.write(d);const p=K0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)p.writeByte(f[o]);return p.flush(),"data:image/gif;base64,"+p};Wr.stringToBytes;const el=[{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:"tester",label:"Tester",commandAgent:"tester",dispatchable:!0}],s_={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},Us=[...el,s_],J0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},Z0={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},a_=[J0,Z0],Bh=[...Us,...a_];el.map(t=>t.name);const l_=Us.map(t=>t.name);a_.map(t=>t.name);Bh.map(t=>t.name);Bh.filter(t=>t.dispatchable).map(t=>t.name);function e1(t){return l_.includes(t)}const t1="zh-CN",n1="pm-final-only",o_=[{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"}],i1=[{value:"round-final",label:"Round final reply"},{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function r1(){const t={};for(const r of l_)t[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:t,autoOrchestration:!0}}function s1({sidebar:t,children:r}){const[s,l]=te.useState(!1);return x.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[x.jsxs("aside",{className:"app-sidebar",children:[x.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>l(d=>!d)}),x.jsx("div",{className:"sidebar-content",children:t})]}),x.jsx("main",{className:"app-main",children:r})]})}function jo(t,r="Unknown error."){if(t instanceof Error)return t.message||r;if(typeof t=="string"&&t.trim())return t;if(t===void 0)return r;try{return JSON.stringify(t)}catch{return String(t)}}function ut(t,r,s){return`${t} failed. Reason: ${jo(r,s)}`}function Ao(t,r){return r.some(s=>t.startsWith(`${s} failed.`))?"":t}const ye={getAppPreferences(){return Se("/api/settings/preferences")},updateAppPreferences(t){return Se("/api/settings/preferences",{method:"PUT",body:JSON.stringify(t)})},getRuntimeDiagnostics(){return Se("/api/diagnostics/runtime")},getCurrentProject(){return Se("/api/projects/current")},pullCurrentProject(){return Se("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return Se("/api/projects/recent")},connectProject(t){return Se("/api/projects/connect",{method:"POST",body:JSON.stringify(t)})},listTasks(){return Se("/api/tasks")},createTask(t){return Se("/api/tasks",{method:"POST",body:JSON.stringify(t)})},cleanupTask(t){return Se(`/api/tasks/${encodeURIComponent(t)}/cleanup`,{method:"POST"})},getHarnessStatus(t){const r=new URLSearchParams({taskSlug:t});return Se(`/api/projects/harness?${r.toString()}`)},applyHarness(t){return Se("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(t)})},getHarnessFileContent(t,r){const s=new URLSearchParams({path:r,taskSlug:t});return Se(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(t,r,s){const l=new URLSearchParams({path:r,taskSlug:t});return Se(`/api/projects/harness/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(t,r){const s=new URLSearchParams({taskSlug:t});return r&&s.set("commit",r),Se(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return Se(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(t){return Se("/api/projects/harness/repository-diff/merge-to-current-branch",{method:"POST",body:JSON.stringify({taskSlug:t})})},getHarnessBootstrapStatus(t){const r=new URLSearchParams({taskSlug:t});return Se(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(t={}){return Se("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(t)})},restartHarnessBootstrap(t={}){return Se("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessBootstrap(t){return Se("/api/projects/harness/bootstrap/stop",{method:"POST",body:JSON.stringify(t)})},runHarnessBootstrap(t){return Se("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(t)})},getHarnessEngineerSession(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString()?`?${r.toString()}`:"";return Se(`/api/projects/harness/engineer/session${s}`)},ensureHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(t)})},startHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(t)})},resumeHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(t)})},restartHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/stop",{method:"POST",body:JSON.stringify(t)})},notifyHarnessEngineerHarnessUpdated(t={}){return Se("/api/projects/harness/engineer/session/notify-harness",{method:"POST",body:JSON.stringify(t)})},getHarnessFeedbackState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return Se(`/api/projects/harness/feedback${s?`?${s}`:""}`)},sendHarnessFeedback(t){return Se("/api/projects/harness/feedback/send",{method:"POST",body:JSON.stringify(t)})},startTaskHarnessRetrospective(t){return Se("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(t)})},getAutoMemoryState(t){const r=new URLSearchParams({taskSlug:t});return Se(`/api/projects/harness/memory?${r.toString()}`)},getMemoryFileContent(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return Se(`/api/projects/harness/memory/file?${s.toString()}`)},updateMemoryFileContent(t,r,s){const l=new URLSearchParams({taskSlug:t,path:r});return Se(`/api/projects/harness/memory/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},revertMemoryRun(t){return Se("/api/projects/harness/memory/revert",{method:"POST",body:JSON.stringify(t)})},retryMemoryReview(t){return Se("/api/projects/harness/memory/retry",{method:"POST",body:JSON.stringify(t)})},getTaskStatus(t){return Se(`/api/tasks/${encodeURIComponent(t)}/status`)},oneClickStart(t){return Se(`/api/tasks/${encodeURIComponent(t)}/one-click-start`,{method:"POST"})},getTaskWorkspaceState(t){return Se(`/api/tasks/${encodeURIComponent(t)}/workspace-state`)},getProjectRuntimeState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return Se(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(t){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions`)},startRoleSession(t,r,s={}){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(t,r,s={}){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(t,r,s={}){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(t){return Se(`/api/tasks/${encodeURIComponent(t)}/messages`)},markAllMessagesDone(t){return Se(`/api/tasks/${encodeURIComponent(t)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(t){return Se(`/api/tasks/${encodeURIComponent(t)}/messages/history`,{method:"DELETE"})},getOrchestrationState(t){return Se(`/api/tasks/${encodeURIComponent(t)}/orchestration`)},updateOrchestrationState(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(t){return Se(`/api/tasks/${encodeURIComponent(t)}/round`)},getGateReviewState(t){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review`)},updateGateReviewSettings(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/report`)},startTranslationSession(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(t,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),Se(`/api/translation/sessions/${encodeURIComponent(t)}/events?${l.toString()}`)},pollTranslationTaskFeed(t,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),Se(`/api/tasks/${encodeURIComponent(t)}/translation/feed?${l.toString()}`)},translateUserInput(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},translateLatestReply(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/latest-reply`,{method:"POST"})},sendTranslatedInput(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(t){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/clear`,{method:"POST"})},stopTranslationSession(t){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(t={}){return Se("/api/projects/translation/session/notify-harness",{method:"POST",body:JSON.stringify(t)})},retryTranslation(t,r){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(t){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(t){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/failures/retry`,{method:"POST"})},getTranslationState(){return Se("/api/translation/state")},getTranslatorSession(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString()?`?${r.toString()}`:"";return Se(`/api/translation/session${s}`)},ensureTranslatorSession(t={}){return Se("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(t)})},startTranslatorSession(t={}){return Se("/api/translation/session/start",{method:"POST",body:JSON.stringify(t)})},resumeTranslatorSession(t={}){return Se("/api/translation/session/resume",{method:"POST",body:JSON.stringify(t)})},restartTranslatorSession(t={}){return Se("/api/translation/session/restart",{method:"POST",body:JSON.stringify(t)})},stopTranslatorSession(t={}){return Se("/api/translation/session/stop",{method:"POST",body:JSON.stringify(t)})},browseTranslationSourceFiles(t={}){const r=new URLSearchParams;t.path&&r.set("path",t.path),t.query&&r.set("query",t.query),t.limit!==void 0&&r.set("limit",String(t.limit));const s=r.toString()?`?${r.toString()}`:"";return Se(`/api/translation/source-files${s}`)},createFileTranslation(t){return Se("/api/translation/files",{method:"POST",body:JSON.stringify(t)})},readFileTranslation(t){return Se(`/api/translation/files/${encodeURIComponent(t)}`)},createTranslationBootstrap(t){return Se("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(t)})},createTranslationMemoryUpdate(t){return Se("/api/translation/memory-update",{method:"POST",body:JSON.stringify(t)})},promoteTranslation(t,r){return Se(`/api/translation/files/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return Se("/api/gateway/status")},updateGatewaySettings(t){return Se("/api/gateway/settings",{method:"PUT",body:JSON.stringify(t)})},startGatewayQrLogin(){return Se("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(t={}){return Se("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(t)})},startGatewayLarkRegistration(){return Se("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return Se("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(t){return Se("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(t)})},resetGatewayBinding(){return Se("/api/gateway/binding/reset",{method:"POST"})},setGatewayConnection(t){return Se("/api/gateway/connection",{method:"PUT",body:JSON.stringify({enabled:t})})}};async function Se(t,r={}){var p,f,o;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const l=(r.method??"GET").toUpperCase();let d;try{d=await fetch(t,{...r,headers:s})}catch(c){throw new Error(`${l} ${t} could not reach the VCM backend. Reason: ${jo(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=a1(c),m=d.statusText?`${d.status} ${d.statusText}`:String(d.status),y=((p=h==null?void 0:h.error)!=null&&p.hint?`${h.error.message??"Backend error."} ${h.error.hint}`:(f=h==null?void 0:h.error)==null?void 0:f.message)??l1(c),w=(o=h==null?void 0:h.error)==null?void 0:o.runtime,T=w?` [backend ${w.version??"unknown"} pid=${w.pid??"unknown"} cwd=${w.cwd??"unknown"}]`:"";throw new Error(`${l} ${t} returned HTTP ${m}. ${y}${T}`)}return d.json()}function a1(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}function l1(t){const r=t.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const mh="vcm:ui-error-report",gh="vcm:ui-error-clear-actions",_h="vcm:ui-error-clear-message";function o1(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(mh,{detail:{message:r}}))}function c1(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(_h,{detail:{message:r}}))}function u1(t){t.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(gh,{detail:{actions:t}}))}function Li(t){const[r,s]=te.useState(t),l=te.useRef(t),d=te.useCallback(p=>{const f=l.current,o=typeof p=="function"?p(f):p;l.current=o,typeof o=="string"&&o.trim()?o1(o):typeof f=="string"&&f.trim()&&c1(f),s(o)},[]);return[r,d]}var Ku={exports:{}},Fm;function h1(){return Fm||(Fm=1,(function(t,r){(function(s,l){t.exports=l()})(self,(()=>(()=>{var s={};return(()=>{var l=s;Object.defineProperty(l,"__esModule",{value:!0}),l.FitAddon=void 0,l.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const p=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(p._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,p=d._renderService.dimensions;if(p.css.cell.width===0||p.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),u=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),y=h-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(y/p.css.cell.width)),rows:Math.max(1,Math.floor(u/p.css.cell.height))}}}})(),s})()))})(Ku)),Ku.exports}var f1=h1(),Yu={exports:{}},qm;function d1(){return qm||(qm=1,(function(t,r){(function(s,l){t.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{function c(m){try{const u=new URL(m),y=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return m.toLocaleLowerCase().startsWith(y.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(m,u,y,w={}){this._terminal=m,this._regex=u,this._handler=y,this._options=w}provideLinks(m,u){const y=h.computeLink(m,this._regex,this._terminal,this._handler);u(this._addCallbacks(y))}_addCallbacks(m){return m.map((u=>(u.leave=this._options.leave,u.hover=(y,w)=>{if(this._options.hover){const{range:T}=u;this._options.hover(y,w,T)}},u)))}};class h{static computeLink(u,y,w,T){const E=new RegExp(y.source,(y.flags||"")+"g"),[b,v]=h._getWindowedLineStrings(u-1,w),_=b.join("");let S;const A=[];for(;S=E.exec(_);){const L=S[0];if(!c(L))continue;const[M,D]=h._mapStrIdx(w,v,0,S.index),[k,R]=h._mapStrIdx(w,M,D,L.length);if(M===-1||D===-1||k===-1||R===-1)continue;const B={start:{x:D+1,y:M+1},end:{x:R,y:k+1}};A.push({range:B,text:L,activate:T})}return A}static _getWindowedLineStrings(u,y){let w,T=u,E=u,b=0,v="";const _=[];if(w=y.buffer.active.getLine(u)){const S=w.translateToString(!0);if(w.isWrapped&&S[0]!==" "){for(b=0;(w=y.buffer.active.getLine(--T))&&b<2048&&(v=w.translateToString(!0),b+=v.length,_.push(v),w.isWrapped&&v.indexOf(" ")===-1););_.reverse()}for(_.push(S),b=0;(w=y.buffer.active.getLine(++E))&&w.isWrapped&&b<2048&&(v=w.translateToString(!0),b+=v.length,_.push(v),v.indexOf(" ")===-1););}return[_,T]}static _mapStrIdx(u,y,w,T){const E=u.buffer.active,b=E.getNullCell();let v=w;for(;T;){const _=E.getLine(y);if(!_)return[-1,-1];for(let S=v;S<_.length;++S){_.getCell(S,b);const A=b.getChars();if(b.getWidth()&&(T-=A.length||1,S===_.length-1&&A==="")){const L=E.getLine(y+1);L&&L.isWrapped&&(L.getCell(0,b),b.getWidth()===2&&(T+=1))}if(T<0)return[y,S]}y++,v=0}return[y,v]}}o.LinkComputer=h}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var p={};return(()=>{var f=p;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const o=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(m,u){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(m=h,u={}){this._handler=m,this._options=u}activate(m){this._terminal=m;const u=this._options,y=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,y,this._handler,u))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),p})()))})(Yu)),Yu.exports}var p1=d1(),Xu={exports:{}},$m;function m1(){return $m||($m=1,(function(t,r){(function(s,l){t.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var M,D=arguments.length,k=D<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var R=_.length-1;R>=0;R--)(M=_[R])&&(k=(D<3?M(k):D>3?M(S,A,k):M(S,A))||k);return D>3&&k&&Object.defineProperty(S,A,k),k},m=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=c(9042),y=c(9924),w=c(844),T=c(4725),E=c(2585),b=c(3656);let v=o.AccessibilityManager=class extends w.Disposable{constructor(_,S,A,L){super(),this._terminal=_,this._coreBrowserService=A,this._renderService=L,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let M=0;M<this._terminal.rows;M++)this._rowElements[M]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[M]);if(this._topBoundaryFocusListener=M=>this._handleBoundaryFocus(M,0),this._bottomBoundaryFocusListener=M=>this._handleBoundaryFocus(M,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 y.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((M=>this._handleResize(M.rows)))),this.register(this._terminal.onRender((M=>this._refreshRows(M.start,M.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((M=>this._handleChar(M)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
52
|
-
`)))),this.register(this._terminal.onA11yTab((M=>this._handleTab(M)))),this.register(this._terminal.onKey((M=>this._handleKey(M.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let S=0;S<_;S++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
|
|
53
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,S){this._liveRegionDebouncer.refresh(_,S,this._terminal.rows)}_renderRows(_,S){const A=this._terminal.buffer,L=A.lines.length.toString();for(let M=_;M<=S;M++){const D=A.lines.get(A.ydisp+M),k=[],R=(D==null?void 0:D.translateToString(!0,void 0,void 0,k))||"",B=(A.ydisp+M+1).toString(),H=this._rowElements[M];H&&(R.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=R,this._rowColumns.set(H,k)),H.setAttribute("aria-posinset",B),H.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,S){const A=_.target,L=this._rowElements[S===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==L)return;let M,D;if(S===0?(M=A,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(M=this._rowElements.shift(),D=A,this._rowContainer.removeChild(M)),M.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:_.anchorNode,offset:_.anchorOffset},A={node:_.focusNode,offset:_.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 L=this._rowElements.slice(-1)[0];if(A.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(A={node:L,offset:((R=L.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(A.node))return;const M=({node:B,offset:H})=>{const U=B instanceof Text?B.parentNode:B;let P=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const V=this._rowColumns.get(U);if(!V)return console.warn("columns is null. Race condition?"),null;let K=H<V.length?V[H]:V.slice(-1)[0]+1;return K>=this._terminal.cols&&(++P,K=0),{row:P,column:K}},D=M(S),k=M(A);if(D&&k){if(D.row>k.row||D.row===k.row&&D.column>=k.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(k.row-D.row)*this._terminal.cols-D.column+k.column)}}_handleResize(_){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>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=v=h([m(1,E.IInstantiationService),m(2,T.ICoreBrowserService),m(3,T.IRenderService)],v)},3614:(f,o)=>{function c(y){return y.replace(/\r?\n/g,"\r")}function h(y,w){return w?"\x1B[200~"+y+"\x1B[201~":y}function m(y,w,T,E){y=h(y=c(y),T.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(y,!0),w.value=""}function u(y,w,T){const E=T.getBoundingClientRect(),b=y.clientX-E.left-10,v=y.clientY-E.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${b}px`,w.style.top=`${v}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(y,w){y.clipboardData&&y.clipboardData.setData("text/plain",w.selectionText),y.preventDefault()},o.handlePasteEvent=function(y,w,T,E){y.stopPropagation(),y.clipboardData&&m(y.clipboardData.getData("text/plain"),w,T,E)},o.paste=m,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(y,w,T,E,b){u(y,w,T),b&&E.rightClickSelect(y),w.value=E.selectionText,w.select()}},7239:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(m,u,y){this._css.set(m,u,y)}getCss(m,u){return this._css.get(m,u)}setColor(m,u,y){this._color.set(m,u,y)}getColor(m,u){return this._color.get(m,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,h,m,u){c.addEventListener(h,m,u);let y=!1;return{dispose:()=>{y||(y=!0,c.removeEventListener(h,m,u))}}}},3551:function(f,o,c){var h=this&&this.__decorate||function(v,_,S,A){var L,M=arguments.length,D=M<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,_,S,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(D=(M<3?L(D):M>3?L(_,S,D):L(_,S))||D);return M>3&&D&&Object.defineProperty(_,S,D),D},m=this&&this.__param||function(v,_){return function(S,A){_(S,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=c(3656),y=c(8460),w=c(844),T=c(2585),E=c(4725);let b=o.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(v,_,S,A,L){super(),this._element=v,this._mouseService=_,this._renderService=S,this._bufferService=A,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var M;this._lastMouseEvent=void 0,(M=this._activeProviderReplies)==null||M.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const S=v.composedPath();for(let A=0;A<S.length;A++){const L=S[A];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,_){var A,L;this._activeProviderReplies&&_||((A=this._activeProviderReplies)==null||A.forEach((M=>{M==null||M.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let S=!1;for(const[M,D]of this._linkProviderService.linkProviders.entries())_?(L=this._activeProviderReplies)!=null&&L.get(M)&&(S=this._checkLinkProviderResult(M,v,S)):D.provideLinks(v.y,(k=>{var B,H;if(this._isMouseOut)return;const R=k==null?void 0:k.map((U=>({link:U})));(B=this._activeProviderReplies)==null||B.set(M,R),S=this._checkLinkProviderResult(M,v,S),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,_){const S=new Set;for(let A=0;A<_.size;A++){const L=_.get(A);if(L)for(let M=0;M<L.length;M++){const D=L[M],k=D.link.range.start.y<v?0:D.link.range.start.x,R=D.link.range.end.y>v?this._bufferService.cols:D.link.range.end.x;for(let B=k;B<=R;B++){if(S.has(B)){L.splice(M--,1);break}S.add(B)}}}}_checkLinkProviderResult(v,_,S){var M;if(!this._activeProviderReplies)return S;const A=this._activeProviderReplies.get(v);let L=!1;for(let D=0;D<v;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(L=!0);if(!L&&A){const D=A.find((k=>this._linkAtPosition(k.link,_)));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 k=(M=this._activeProviderReplies.get(D))==null?void 0:M.find((R=>this._linkAtPosition(R.link,_)));if(k){S=!0,this._handleNewLink(k);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,_){this._currentLink&&this._lastMouseEvent&&(!v||!_||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(v.link,_)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var 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,L,M;(A=this._currentLink)!=null&&A.state&&((M=(L=this._currentLink)==null?void 0:L.state)==null?void 0:M.decorations.underline)!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.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,L=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=A&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(A,L),this._lastMouseEvent)){const M=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);M&&this._askForLink(M,!1)}}))))}_linkHover(v,_,S){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(S,_.text)}_fireUnderlineEvent(v,_){const S=v.range,A=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-A-1,S.end.x,S.end.y-A-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,_,S){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(S,_.text)}_linkAtPosition(v,_){const S=v.range.start.y*this._bufferService.cols+v.range.start.x,A=v.range.end.y*this._bufferService.cols+v.range.end.x,L=_.y*this._bufferService.cols+_.x;return S<=L&&L<=A}_positionFromMouseEvent(v,_,S){const A=S.getCoords(v,_,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,_,S,A,L){return{x1:v,y1:_,x2:S,y2:A,cols:this._bufferService.cols,fg:L}}};o.Linkifier=b=h([m(1,E.IMouseService),m(2,E.IRenderService),m(3,T.IBufferService),m(4,E.ILinkProviderService)],b)},9042:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,o,c){var h=this&&this.__decorate||function(E,b,v,_){var S,A=arguments.length,L=A<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,b,v,_);else for(var M=E.length-1;M>=0;M--)(S=E[M])&&(L=(A<3?S(L):A>3?S(b,v,L):S(b,v))||L);return A>3&&L&&Object.defineProperty(b,v,L),L},m=this&&this.__param||function(E,b){return function(v,_){b(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=c(511),y=c(2585);let w=o.OscLinkProvider=class{constructor(E,b,v){this._bufferService=E,this._optionsService=b,this._oscLinkService=v}provideLinks(E,b){var R;const v=this._bufferService.buffer.lines.get(E-1);if(!v)return void b(void 0);const _=[],S=this._optionsService.rawOptions.linkHandler,A=new u.CellData,L=v.getTrimmedLength();let M=-1,D=-1,k=!1;for(let B=0;B<L;B++)if(D!==-1||v.hasContent(B)){if(v.loadCell(B,A),A.hasExtendedAttrs()&&A.extended.urlId){if(D===-1){D=B,M=A.extended.urlId;continue}k=A.extended.urlId!==M}else D!==-1&&(k=!0);if(k||D!==-1&&B===L-1){const H=(R=this._oscLinkService.getLinkData(M))==null?void 0:R.uri;if(H){const U={start:{x:D+1,y:E},end:{x:B+(k||B!==L-1?0:1),y:E}};let P=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const V=new URL(H);["http:","https:"].includes(V.protocol)||(P=!0)}catch{P=!0}P||_.push({text:H,range:U,activate:(V,K)=>S?S.activate(V,K,U):T(0,K),hover:(V,K)=>{var G;return(G=S==null?void 0:S.hover)==null?void 0:G.call(S,V,K,U)},leave:(V,K)=>{var G;return(G=S==null?void 0:S.leave)==null?void 0:G.call(S,V,K,U)}})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(D=B,M=A.extended.urlId):(D=-1,M=-1)}}b(_)}};function T(E,b){if(confirm(`Do you want to navigate to ${b}?
|
|
54
|
-
|
|
55
|
-
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=w=h([m(0,y.IBufferService),m(1,y.IOptionsService),m(2,y.IOscLinkService)],w)},6193:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),m=c(3656),u=c(3551),y=c(9042),w=c(3730),T=c(1680),E=c(3107),b=c(5744),v=c(2950),_=c(1296),S=c(428),A=c(4269),L=c(5114),M=c(8934),D=c(3230),k=c(9312),R=c(4725),B=c(6731),H=c(8055),U=c(8969),P=c(8460),V=c(844),K=c(6114),G=c(8437),Y=c(2584),ee=c(7399),z=c(5941),j=c(9074),N=c(2585),$=c(5435),I=c(4567),ie=c(779);class me extends U.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Q={}){super(Q),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new V.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,ce)=>this.refresh(q,ce)))),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,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,V.toDisposable)((()=>{var q,ce;this._customKeyEventHandler=void 0,(ce=(q=this.element)==null?void 0:q.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const q of Q){let ce,ae="";switch(q.index){case 256:ce="foreground",ae="10";break;case 257:ce="background",ae="11";break;case 258:ce="cursor",ae="12";break;default:ce="ansi",ae="4;"+q.index}switch(q.type){case 0:const be=H.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${ae};${(0,z.toRgbString)(be)}${Y.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((Ee=>Ee.ansi[q.index]=H.channels.toColor(...q.color)));else{const Ee=ce;this._themeService.modifyColors((xe=>xe[Ee]=H.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Q;return(Q=this.textarea)==null?void 0:Q.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(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 Q=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(Q);if(!q)return;const ce=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,be=q.getWidth(ce),Ee=this._renderService.dimensions.css.cell.width*be,xe=this.buffer.y*this._renderService.dimensions.css.cell.height,de=ce*this._renderService.dimensions.css.cell.width;this.textarea.style.left=de+"px",this.textarea.style.top=xe+"px",this.textarea.style.width=Ee+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const Q=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,m.addDisposableDomListener)(this.element,"paste",Q)),K.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){var ce;if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ce=this.element)==null?void 0:ce.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Q.appendChild(this.element);const q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(ae=>this.updateCursorStyle(ae)))),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",y.promptLabel),K.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(L.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,m.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(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(A.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(M.MouseService),this._instantiationService.setService(R.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((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,q=this.element;function ce(Ee){const xe=Q._mouseService.getMouseReportCoords(Ee,Q.screenElement);if(!xe)return!1;let de,Me;switch(Ee.overrideType||Ee.type){case"mousemove":Me=32,Ee.buttons===void 0?(de=3,Ee.button!==void 0&&(de=Ee.button<3?Ee.button:3)):de=1&Ee.buttons?0:4&Ee.buttons?1:2&Ee.buttons?2:3;break;case"mouseup":Me=0,de=Ee.button<3?Ee.button:3;break;case"mousedown":Me=1,de=Ee.button<3?Ee.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(Ee)===!1||Q.viewport.getLinesScrolled(Ee)===0)return!1;Me=Ee.deltaY<0?0:1,de=4;break;default:return!1}return!(Me===void 0||de===void 0||de>4)&&Q.coreMouseService.triggerMouseEvent({col:xe.col,row:xe.row,x:xe.x,y:xe.y,button:de,action:Me,ctrl:Ee.ctrlKey,alt:Ee.altKey,shift:Ee.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},be={mouseup:Ee=>(ce(Ee),Ee.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(Ee)),wheel:Ee=>(ce(Ee),this.cancel(Ee,!0)),mousedrag:Ee=>{Ee.buttons&&ce(Ee)},mousemove:Ee=>{Ee.buttons||ce(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?ae.mousemove||(q.addEventListener("mousemove",be.mousemove),ae.mousemove=be.mousemove):(q.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&Ee?ae.wheel||(q.addEventListener("wheel",be.wheel,{passive:!1}),ae.wheel=be.wheel):(q.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&Ee?ae.mouseup||(ae.mouseup=be.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&Ee?ae.mousedrag||(ae.mousedrag=be.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(q,"mousedown",(Ee=>{if(Ee.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Ee))return ce(Ee),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(Ee)}))),this.register((0,m.addDisposableDomListener)(q,"wheel",(Ee=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Ee)===!1)return!1;if(!this.buffer.hasScrollback){const xe=this.viewport.getLinesScrolled(Ee);if(xe===0)return;const de=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Ee.deltaY<0?"A":"B");let Me="";for(let $e=0;$e<Math.abs(xe);$e++)Me+=de;return this.coreService.triggerDataEvent(Me,!0),this.cancel(Ee,!0)}return this.viewport.handleWheel(Ee)?this.cancel(Ee):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(q,"touchstart",(Ee=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Ee),this.cancel(Ee)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(q,"touchmove",(Ee=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Ee)?void 0:this.cancel(Ee)}),{passive:!1}))}refresh(Q,q){var ce;(ce=this._renderService)==null||ce.refreshRows(Q,q)}updateCursorStyle(Q){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(Q)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Q,q,ce=0){var ae;ce===1?(super.scrollLines(Q,q,ce),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,q,ce){this._selectionService.setSelection(Q,q,ce)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Q;(Q=this._selectionService)==null||Q.clearSelection()}selectAll(){var Q;(Q=this._selectionService)==null||Q.selectAll()}selectLines(Q,q){var ce;(ce=this._selectionService)==null||ce.selectLines(Q,q)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!q&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,ee.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),ce.type===3||ce.type===2){const ae=this.rows-1;return this.scrollLines(ce.type===2?-ae:ae),this.cancel(Q,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(ce.cancel&&this.cancel(Q,!0),!ce.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==Y.C0.ETX&&ce.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,q){const ce=Q.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||Q.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||Q.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?ce:ce&&(!q.keyCode||q.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)q=Q.charCode;else if(Q.which===null||Q.which===void 0)q=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;q=Q.which}return!(!q||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=Q.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(Q),!0}return!1}resize(Q,q){Q!==this.cols||q!==this.rows?super.resize(Q,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,q){var ce,ae;(ce=this._charSizeService)==null||ce.measure(),(ae=this.viewport)==null||ae.syncScrollArea(!0)}clear(){var Q;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Q=this.viewport)==null||Q.reset(),this.refresh(0,this.rows-1)}}reset(){var q,ce;this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Q;(Q=this._renderService)==null||Q.clearTextureAtlas()}_reportFocus(){var Q;(Q=this.element)!=null&&Q.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${ce};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),be=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${be};${ae}t`)}}cancel(Q,q){if(this.options.cancelEvents||q)return Q.preventDefault(),Q.stopPropagation(),!1}}o.Terminal=me},9924:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=u-this._lastRefreshMs,w=this._debounceThresholdMS-y;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,o,c){var h=this&&this.__decorate||function(v,_,S,A){var L,M=arguments.length,D=M<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,_,S,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(D=(M<3?L(D):M>3?L(_,S,D):L(_,S))||D);return M>3&&D&&Object.defineProperty(_,S,D),D},m=this&&this.__param||function(v,_){return function(S,A){_(S,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=c(3656),y=c(4725),w=c(8460),T=c(844),E=c(2585);let b=o.Viewport=class extends T.Disposable{constructor(v,_,S,A,L,M,D,k){super(),this._viewportElement=v,this._scrollArea=_,this._bufferService=S,this._optionsService=A,this._charSizeService=L,this._renderService=M,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 w.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((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(v){if(v)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(v,_){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&S<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const _=this._getPixelsScrolled(v);return _!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(v,_){var k;let S,A="";const L=[],M=_??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let R=v;R<M;R++){const B=D.get(R);if(!B)continue;const H=(k=D.get(R+1))==null?void 0:k.isWrapped;if(A+=B.translateToString(!H),!H||R===D.length-1){const U=document.createElement("div");U.textContent=A,L.push(U),A.length>0&&(S=U),A=""}}return{bufferElements:L,cursorElement:S}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(v,_){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&_.altKey||S==="ctrl"&&_.ctrlKey||S==="shift"&&_.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const _=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}};o.Viewport=b=h([m(2,E.IBufferService),m(3,E.IOptionsService),m(4,y.ICharSizeService),m(5,y.IRenderService),m(6,y.ICoreBrowserService),m(7,y.IThemeService)],b)},3107:function(f,o,c){var h=this&&this.__decorate||function(E,b,v,_){var S,A=arguments.length,L=A<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,b,v,_);else for(var M=E.length-1;M>=0;M--)(S=E[M])&&(L=(A<3?S(L):A>3?S(b,v,L):S(b,v))||L);return A>3&&L&&Object.defineProperty(b,v,L),L},m=this&&this.__param||function(E,b){return function(v,_){b(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=c(4725),y=c(844),w=c(2585);let T=o.BufferDecorationRenderer=class extends y.Disposable{constructor(E,b,v,_,S){super(),this._screenElement=E,this._bufferService=b,this._coreBrowserService=v,this._decorationService=_,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,y.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){var _;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((_=E==null?void 0:E.options)==null?void 0:_.layer)==="top"),b.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=E.options.x??0;return v&&v>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(E,b),b}_refreshStyle(E){const b=E.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let v=this._decorationElements.get(E);v||(v=this._createElement(E),E.element=v,this._decorationElements.set(E,v),this._container.appendChild(v),E.onDispose((()=>{this._decorationElements.delete(E),v.remove()}))),v.style.top=b*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(v)}}_refreshXPosition(E,b=E.element){if(!b)return;const v=E.options.x??0;(E.options.anchor||"left")==="right"?b.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){var b;(b=this._decorationElements.get(E))==null||b.remove(),this._decorationElements.delete(E),E.dispose()}};o.BufferDecorationRenderer=T=h([m(1,w.IBufferService),m(2,u.ICoreBrowserService),m(3,w.IDecorationService),m(4,u.IRenderService)],T)},5871:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,m){return h>=c.startBufferLine-this._linePadding[m||"full"]&&h<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,o,c){var h=this&&this.__decorate||function(S,A,L,M){var D,k=arguments.length,R=k<3?A:M===null?M=Object.getOwnPropertyDescriptor(A,L):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,A,L,M);else for(var B=S.length-1;B>=0;B--)(D=S[B])&&(R=(k<3?D(R):k>3?D(A,L,R):D(A,L))||R);return k>3&&R&&Object.defineProperty(A,L,R),R},m=this&&this.__param||function(S,A){return function(L,M){A(L,M,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=c(5871),y=c(4725),w=c(844),T=c(2585),E={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let _=o.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,A,L,M,D,k,R){var H;super(),this._viewportElement=S,this._screenElement=A,this._bufferService=L,this._decorationService=M,this._renderService=D,this._optionsService=k,this._coreBrowserService=R,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(H=this._viewportElement.parentElement)==null||H.insertBefore(this._canvas,this._viewportElement);const 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,w.toDisposable)((()=>{var U;(U=this._canvas)==null||U.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const S=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=S,b.center=A,b.right=S,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=b.left,v.right=b.left+b.center}_refreshDrawHeightConstants(){E.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);E.left=A,E.center=A,E.right=A}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const A of this._decorationService.decorations)this._colorZoneStore.addDecoration(A);this._ctx.lineWidth=1;const 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(v[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-E[S.position||"full"]/2),b[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[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})))}};o.OverviewRulerRenderer=_=h([m(2,T.IBufferService),m(3,T.IDecorationService),m(4,y.IRenderService),m(5,T.IOptionsService),m(6,y.ICoreBrowserService)],_)},2950:function(f,o,c){var h=this&&this.__decorate||function(E,b,v,_){var S,A=arguments.length,L=A<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,b,v,_);else for(var M=E.length-1;M>=0;M--)(S=E[M])&&(L=(A<3?S(L):A>3?S(b,v,L):S(b,v))||L);return A>3&&L&&Object.defineProperty(b,v,L),L},m=this&&this.__param||function(E,b){return function(v,_){b(v,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=c(4725),y=c(2585),w=c(2584);let T=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,b,v,_,S,A){this._textarea=E,this._compositionView=b,this._bufferService=v,this._optionsService=_,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,v=b.replace(E,"");this._dataAlreadySent=v,b.length>E.length?this._coreService.triggerDataEvent(v,!0):b.length<E.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):b.length===E.length&&b!==E&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const A=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(A.width,1)+"px",this._textarea.style.height=Math.max(A.height,1)+"px",this._textarea.style.lineHeight=A.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=T=h([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,y.ICoreService),m(5,u.IRenderService)],T)},9806:(f,o)=>{function c(h,m,u){const y=u.getBoundingClientRect(),w=h.getComputedStyle(u),T=parseInt(w.getPropertyValue("padding-left")),E=parseInt(w.getPropertyValue("padding-top"));return[m.clientX-y.left-T,m.clientY-y.top-E]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,m,u,y,w,T,E,b,v){if(!T)return;const _=c(h,m,u);return _?(_[0]=Math.ceil((_[0]+(v?E/2:0))/E),_[1]=Math.ceil(_[1]/b),_[0]=Math.min(Math.max(_[0],1),y+(v?1:0)),_[1]=Math.min(Math.max(_[1],1),w),_):void 0}},9504:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function m(b,v,_,S){const A=b-u(b,_),L=v-u(v,_),M=Math.abs(A-L)-(function(D,k,R){let B=0;const H=D-u(D,R),U=k-u(k,R);for(let P=0;P<Math.abs(H-U);P++){const V=y(D,k)==="A"?-1:1,K=R.buffer.lines.get(H+V*P);K!=null&&K.isWrapped&&B++}return B})(b,v,_);return E(M,T(y(b,v),S))}function u(b,v){let _=0,S=v.buffer.lines.get(b),A=S==null?void 0:S.isWrapped;for(;A&&b>=0&&b<v.rows;)_++,S=v.buffer.lines.get(--b),A=S==null?void 0:S.isWrapped;return _}function y(b,v){return b>v?"A":"B"}function w(b,v,_,S,A,L){let M=b,D=v,k="";for(;M!==_||D!==S;)M+=A?1:-1,A&&M>L.cols-1?(k+=L.buffer.translateBufferLineToString(D,!1,b,M),M=0,b=0,D++):!A&&M<0&&(k+=L.buffer.translateBufferLineToString(D,!1,0,b+1),M=L.cols-1,b=M,D--);return k+L.buffer.translateBufferLineToString(D,!1,b,M)}function T(b,v){const _=v?"O":"[";return h.C0.ESC+_+b}function E(b,v){b=Math.floor(b);let _="";for(let S=0;S<b;S++)_+=v;return _}o.moveToCellSequence=function(b,v,_,S){const A=_.buffer.x,L=_.buffer.y;if(!_.buffer.hasScrollback)return(function(k,R,B,H,U,P){return m(R,H,U,P).length===0?"":E(w(k,R,k,R-u(R,U),!1,U).length,T("D",P))})(A,L,0,v,_,S)+m(L,v,_,S)+(function(k,R,B,H,U,P){let V;V=m(R,H,U,P).length>0?H-u(H,U):R;const K=H,G=(function(Y,ee,z,j,N,$){let I;return I=m(z,j,N,$).length>0?j-u(j,N):ee,Y<z&&I<=j||Y>=z&&I<j?"C":"D"})(k,R,B,H,U,P);return E(w(k,V,B,K,G==="C",U).length,T(G,P))})(A,L,b,v,_,S);let M;if(L===v)return M=A>b?"D":"C",E(Math.abs(A-b),T(M,S));M=L>v?"D":"C";const D=Math.abs(L-v);return E((function(k,R){return R.cols-k})(L>v?b:A,_)+(D-1)*_.cols+1+((L>v?A:b)-1),T(M,S))}},1296:function(f,o,c){var h=this&&this.__decorate||function(P,V,K,G){var Y,ee=arguments.length,z=ee<3?V:G===null?G=Object.getOwnPropertyDescriptor(V,K):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,V,K,G);else for(var j=P.length-1;j>=0;j--)(Y=P[j])&&(z=(ee<3?Y(z):ee>3?Y(V,K,z):Y(V,K))||z);return ee>3&&z&&Object.defineProperty(V,K,z),z},m=this&&this.__param||function(P,V){return function(K,G){V(K,G,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=c(3787),y=c(2550),w=c(2223),T=c(6171),E=c(6052),b=c(4725),v=c(8055),_=c(8460),S=c(844),A=c(2585),L="xterm-dom-renderer-owner-",M="xterm-rows",D="xterm-fg-",k="xterm-bg-",R="xterm-focus",B="xterm-selection";let H=1,U=o.DomRenderer=class extends S.Disposable{constructor(P,V,K,G,Y,ee,z,j,N,$,I,ie,me){super(),this._terminal=P,this._document=V,this._element=K,this._screenElement=G,this._viewportElement=Y,this._helperContainer=ee,this._linkifier2=z,this._charSizeService=N,this._optionsService=$,this._bufferService=I,this._coreBrowserService=ie,this._themeService=me,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(M),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((ve=>this._injectCss(ve)))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ve=>this._handleLinkHover(ve)))),this.register(this._linkifier2.onHideLinkUnderline((ve=>this._handleLinkLeave(ve)))),this.register((0,S.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const V=`${this._terminalSelector} .${M} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=V,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let V=`${this._terminalSelector} .${M} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;V+=`${this._terminalSelector} .${M} .xterm-dim { color: ${v.color.multiplyOpacity(P.foreground,.5).css};}`,V+=`${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 K=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;V+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,V+=`@keyframes ${G} { 50% { box-shadow: none; }}`,V+=`@keyframes ${Y} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,V+=`${this._terminalSelector} .${M}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${M}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${M}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,V+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,z]of P.ansi.entries())V+=`${this._terminalSelector} .${D}${ee} { color: ${z.css}; }${this._terminalSelector} .${D}${ee}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${ee} { background-color: ${z.css}; }`;V+=`${this._terminalSelector} .${D}${w.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(P.background).css}; }${this._terminalSelector} .${D}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${k}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=V}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,V){for(let K=this._rowElements.length;K<=V;K++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>V;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,V){this._refreshRowElements(P,V),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(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,V,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,V,K),this.renderRows(0,this._bufferService.rows-1),!P||!V)return;this._selectionRenderModel.update(this._terminal,P,V,K);const G=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(K){const N=P[0]>V[0];j.appendChild(this._createSelectionElement(ee,N?V[0]:P[0],N?P[0]:V[0],z-ee+1))}else{const N=G===ee?P[0]:0,$=ee===Y?V[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(ee,N,$));const I=z-ee-1;if(j.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,I)),ee!==z){const ie=Y===z?V[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,ie))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,V,K,G=1){const Y=this._document.createElement("div"),ee=V*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(K-V);return ee+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-ee),Y.style.height=G*this.dimensions.css.cell.height+"px",Y.style.top=P*this.dimensions.css.cell.height+"px",Y.style.left=`${ee}px`,Y.style.width=`${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 P of this._rowElements)P.replaceChildren()}renderRows(P,V){const K=this._bufferService.buffer,G=K.ybase+K.y,Y=Math.min(K.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=V;N++){const $=N+K.ydisp,I=this._rowElements[N],ie=K.lines.get($);if(!I||!ie)break;I.replaceChildren(...this._rowFactory.createRow(ie,$,$===G,z,j,Y,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,V,K,G,Y,ee){K<0&&(P=0),G<0&&(V=0);const z=this._bufferService.rows-1;K=Math.max(Math.min(K,z),0),G=Math.max(Math.min(G,z),0),Y=Math.min(Y,this._bufferService.cols);const j=this._bufferService.buffer,N=j.ybase+j.y,$=Math.min(j.x,Y-1),I=this._optionsService.rawOptions.cursorBlink,ie=this._optionsService.rawOptions.cursorStyle,me=this._optionsService.rawOptions.cursorInactiveStyle;for(let ve=K;ve<=G;++ve){const Q=ve+j.ydisp,q=this._rowElements[ve],ce=j.lines.get(Q);if(!q||!ce)break;q.replaceChildren(...this._rowFactory.createRow(ce,Q,Q===N,ie,me,$,I,this.dimensions.css.cell.width,this._widthCache,ee?ve===K?P:0:-1,ee?(ve===G?V:Y)-1:-1))}}};o.DomRenderer=U=h([m(7,A.IInstantiationService),m(8,b.ICharSizeService),m(9,A.IOptionsService),m(10,A.IBufferService),m(11,b.ICoreBrowserService),m(12,b.IThemeService)],U)},3787:function(f,o,c){var h=this&&this.__decorate||function(M,D,k,R){var B,H=arguments.length,U=H<3?D:R===null?R=Object.getOwnPropertyDescriptor(D,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(M,D,k,R);else for(var P=M.length-1;P>=0;P--)(B=M[P])&&(U=(H<3?B(U):H>3?B(D,k,U):B(D,k))||U);return H>3&&U&&Object.defineProperty(D,k,U),U},m=this&&this.__param||function(M,D){return function(k,R){D(k,R,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=c(2223),y=c(643),w=c(511),T=c(2585),E=c(8055),b=c(4725),v=c(4269),_=c(6171),S=c(3734);let A=o.DomRendererRowFactory=class{constructor(M,D,k,R,B,H,U){this._document=M,this._characterJoinerService=D,this._optionsService=k,this._coreBrowserService=R,this._coreService=B,this._decorationService=H,this._themeService=U,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(M,D,k){this._selectionStart=M,this._selectionEnd=D,this._columnSelectMode=k}createRow(M,D,k,R,B,H,U,P,V,K,G){const Y=[],ee=this._characterJoinerService.getJoinedCharacters(D),z=this._themeService.colors;let j,N=M.getNoBgTrimmedLength();k&&N<H+1&&(N=H+1);let $=0,I="",ie=0,me=0,ve=0,Q=!1,q=0,ce=!1,ae=0;const be=[],Ee=K!==-1&&G!==-1;for(let xe=0;xe<N;xe++){M.loadCell(xe,this._workCell);let de=this._workCell.getWidth();if(de===0)continue;let Me=!1,$e=xe,Ae=this._workCell;if(ee.length>0&&xe===ee[0][0]){Me=!0;const qe=ee.shift();Ae=new v.JoinedCellData(this._workCell,M.translateToString(!0,qe[0],qe[1]),qe[1]-qe[0]),$e=qe[1]-1,de=Ae.getWidth()}const ge=this._isCellInSelection(xe,D),He=k&&xe===H,Ke=Ee&&xe>=K&&xe<=G;let Dt=!1;this._decorationService.forEachDecorationAtCell(xe,D,void 0,(qe=>{Dt=!0}));let Vt=Ae.getChars()||y.WHITESPACE_CELL_CHAR;if(Vt===" "&&(Ae.isUnderline()||Ae.isOverline())&&(Vt=" "),ae=de*P-V.get(Vt,Ae.isBold(),Ae.isItalic()),j){if($&&(ge&&ce||!ge&&!ce&&Ae.bg===ie)&&(ge&&ce&&z.selectionForeground||Ae.fg===me)&&Ae.extended.ext===ve&&Ke===Q&&ae===q&&!He&&!Me&&!Dt){Ae.isInvisible()?I+=y.WHITESPACE_CELL_CHAR:I+=Vt,$++;continue}$&&(j.textContent=I),j=this._document.createElement("span"),$=0,I=""}else j=this._document.createElement("span");if(ie=Ae.bg,me=Ae.fg,ve=Ae.extended.ext,Q=Ke,q=ae,ce=ge,Me&&H>=xe&&H<=$e&&(H=xe),!this._coreService.isCursorHidden&&He&&this._coreService.isCursorInitialized){if(be.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&be.push("xterm-cursor-blink"),be.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":be.push("xterm-cursor-outline");break;case"block":be.push("xterm-cursor-block");break;case"bar":be.push("xterm-cursor-bar");break;case"underline":be.push("xterm-cursor-underline")}}if(Ae.isBold()&&be.push("xterm-bold"),Ae.isItalic()&&be.push("xterm-italic"),Ae.isDim()&&be.push("xterm-dim"),I=Ae.isInvisible()?y.WHITESPACE_CELL_CHAR:Ae.getChars()||y.WHITESPACE_CELL_CHAR,Ae.isUnderline()&&(be.push(`xterm-underline-${Ae.extended.underlineStyle}`),I===" "&&(I=" "),!Ae.isUnderlineColorDefault()))if(Ae.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Ae.getUnderlineColor()).join(",")})`;else{let qe=Ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ae.isBold()&&qe<8&&(qe+=8),j.style.textDecorationColor=z.ansi[qe].css}Ae.isOverline()&&(be.push("xterm-overline"),I===" "&&(I=" ")),Ae.isStrikethrough()&&be.push("xterm-strikethrough"),Ke&&(j.style.textDecoration="underline");let St=Ae.getFgColor(),dt=Ae.getFgColorMode(),Nt=Ae.getBgColor(),he=Ae.getBgColorMode();const Ce=!!Ae.isInverse();if(Ce){const qe=St;St=Nt,Nt=qe;const bt=dt;dt=he,he=bt}let Re,je,Ne,_t=!1;switch(this._decorationService.forEachDecorationAtCell(xe,D,void 0,(qe=>{qe.options.layer!=="top"&&_t||(qe.backgroundColorRGB&&(he=50331648,Nt=qe.backgroundColorRGB.rgba>>8&16777215,Re=qe.backgroundColorRGB),qe.foregroundColorRGB&&(dt=50331648,St=qe.foregroundColorRGB.rgba>>8&16777215,je=qe.foregroundColorRGB),_t=qe.options.layer==="top")})),!_t&&ge&&(Re=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Nt=Re.rgba>>8&16777215,he=50331648,_t=!0,z.selectionForeground&&(dt=50331648,St=z.selectionForeground.rgba>>8&16777215,je=z.selectionForeground)),_t&&be.push("xterm-decoration-top"),he){case 16777216:case 33554432:Ne=z.ansi[Nt],be.push(`xterm-bg-${Nt}`);break;case 50331648:Ne=E.channels.toColor(Nt>>16,Nt>>8&255,255&Nt),this._addStyle(j,`background-color:#${L((Nt>>>0).toString(16),"0",6)}`);break;default:Ce?(Ne=z.foreground,be.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ne=z.background}switch(Re||Ae.isDim()&&(Re=E.color.multiplyOpacity(Ne,.5)),dt){case 16777216:case 33554432:Ae.isBold()&&St<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(St+=8),this._applyMinimumContrast(j,Ne,z.ansi[St],Ae,Re,void 0)||be.push(`xterm-fg-${St}`);break;case 50331648:const qe=E.channels.toColor(St>>16&255,St>>8&255,255&St);this._applyMinimumContrast(j,Ne,qe,Ae,Re,je)||this._addStyle(j,`color:#${L(St.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Ne,z.foreground,Ae,Re,je)||Ce&&be.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}be.length&&(j.className=be.join(" "),be.length=0),He||Me||Dt?j.textContent=I:$++,ae!==this.defaultSpacing&&(j.style.letterSpacing=`${ae}px`),Y.push(j),xe=$e}return j&&$&&(j.textContent=I),Y}_applyMinimumContrast(M,D,k,R,B,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const U=this._getContrastCache(R);let P;if(B||H||(P=U.getColor(D.rgba,k.rgba)),P===void 0){const V=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);P=E.color.ensureContrastRatio(B||D,H||k,V),U.setColor((B||D).rgba,(H||k).rgba,P??null)}return!!P&&(this._addStyle(M,`color:${P.css}`),!0)}_getContrastCache(M){return M.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(M,D){M.setAttribute("style",`${M.getAttribute("style")||""}${D};`)}_isCellInSelection(M,D){const k=this._selectionStart,R=this._selectionEnd;return!(!k||!R)&&(this._columnSelectMode?k[0]<=R[0]?M>=k[0]&&D>=k[1]&&M<R[0]&&D<=R[1]:M<k[0]&&D>=k[1]&&M>=R[0]&&D<=R[1]:D>k[1]&&D<R[1]||k[1]===R[1]&&D===k[1]&&M>=k[0]&&M<R[0]||k[1]<R[1]&&D===R[1]&&M<R[0]||k[1]<R[1]&&D===k[1]&&M>=k[0])}};function L(M,D,k){for(;M.length<k;)M=D+M;return M}o.DomRendererRowFactory=A=h([m(1,b.ICharacterJoinerService),m(2,T.IOptionsService),m(3,b.ICoreBrowserService),m(4,T.ICoreService),m(5,T.IDecorationService),m(6,b.IThemeService)],A)},2550:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=c.createElement("span");m.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const y=c.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const w=c.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[m,u,y,w],this._container.appendChild(m),this._container.appendChild(u),this._container.appendChild(y),this._container.appendChild(w),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,m,u){c===this._font&&h===this._fontSize&&m===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=m,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,m){let u=0;if(!h&&!m&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const T=this._measure(c,0);return T>0&&(this._flat[u]=T),T}let y=c;h&&(y+="B"),m&&(y+="I");let w=this._holey.get(y);if(w===void 0){let T=0;h&&(T|=1),m&&(T|=2),w=this._measure(c,T),w>0&&this._holey.set(y,w)}return w}_measure(c,h){const m=this._measureElements[h];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,o)=>{function c(m){return 57508<=m&&m<=57558}function h(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},o.isEmoji=h,o.allowRescaling=function(m,u,y,w){return u===1&&y>Math.ceil(1.5*w)&&m!==void 0&&m>255&&!h(m)&&!c(m)&&!(function(T){return 57344<=T&&T<=63743})(m)},o.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(u){return 9472<=u&&u<=9631})(m)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(m,u,y=0){return(m-(2*Math.round(u)-y))%(2*Math.round(u))}},6052:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,u,y,w=!1){if(this.selectionStart=u,this.selectionEnd=y,!u||!y||u[0]===y[0]&&u[1]===y[1])return void this.clear();const T=m.buffers.active.ydisp,E=u[1]-T,b=y[1]-T,v=Math.max(E,0),_=Math.min(b,m.rows-1);v>=m.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=E,this.viewportEndRow=b,this.viewportCappedStartRow=v,this.viewportCappedEndRow=_,this.startCol=u[0],this.endCol=y[0])}isCellSelected(m,u,y){return!!this.hasSelection&&(y-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&y>=this.viewportCappedStartRow&&u<this.endCol&&y<=this.viewportCappedEndRow:u<this.startCol&&y>=this.viewportCappedStartRow&&u>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var M,D=arguments.length,k=D<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var R=_.length-1;R>=0;R--)(M=_[R])&&(k=(D<3?M(k):D>3?M(S,A,k):M(S,A))||k);return D>3&&k&&Object.defineProperty(S,A,k),k},m=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=c(2585),y=c(8460),w=c(844);let T=o.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,S,A){super(),this._optionsService=A,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new b(_,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};o.CharSizeService=T=h([m(2,u.IOptionsService)],T);class E extends w.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 b extends E{constructor(S,A,L){super(),this._document=S,this._parentElement=A,this._optionsService=L,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class v extends E{constructor(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,o,c){var h=this&&this.__decorate||function(v,_,S,A){var L,M=arguments.length,D=M<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,_,S,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(D=(M<3?L(D):M>3?L(_,S,D):L(_,S))||D);return M>3&&D&&Object.defineProperty(_,S,D),D},m=this&&this.__param||function(v,_){return function(S,A){_(S,A,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=c(3734),y=c(643),w=c(511),T=c(2585);class E extends u.AttributeData{constructor(_,S,A){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=S,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=E;let b=o.CharacterJoinerService=class c_{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(_){const S={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(S),S.id}deregister(_){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===_)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(_);if(!S||S.length===0)return[];const A=[],L=S.translateToString(!0);let M=0,D=0,k=0,R=S.getFg(0),B=S.getBg(0);for(let H=0;H<S.getTrimmedLength();H++)if(S.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==B){if(H-M>1){const U=this._getJoinedRanges(L,k,D,S,M);for(let P=0;P<U.length;P++)A.push(U[P])}M=H,k=D,R=this._workCell.fg,B=this._workCell.bg}D+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-M>1){const H=this._getJoinedRanges(L,k,D,S,M);for(let U=0;U<H.length;U++)A.push(H[U])}return A}_getJoinedRanges(_,S,A,L,M){const D=_.substring(S,A);let k=[];try{k=this._characterJoiners[0].handler(D)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const B=this._characterJoiners[R].handler(D);for(let H=0;H<B.length;H++)c_._mergeRanges(k,B[H])}catch(B){console.error(B)}return this._stringRangesToCellRanges(k,L,M),k}_stringRangesToCellRanges(_,S,A){let L=0,M=!1,D=0,k=_[L];if(k){for(let R=A;R<this._bufferService.cols;R++){const B=S.getWidth(R),H=S.getString(R).length||y.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!M&&k[0]<=D&&(k[0]=R,M=!0),k[1]<=D){if(k[1]=R,k=_[++L],!k)break;k[0]<=D?(k[0]=R,M=!0):M=!1}D+=H}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(_,S){let A=!1;for(let L=0;L<_.length;L++){const M=_[L];if(A){if(S[1]<=M[0])return _[L-1][1]=S[1],_;if(S[1]<=M[1])return _[L-1][1]=Math.max(S[1],M[1]),_.splice(L,1),_;_.splice(L,1),L--}else{if(S[1]<=M[0])return _.splice(L,0,S),_;if(S[1]<=M[1])return M[0]=Math.min(S[0],M[0]),_;S[0]<M[1]&&(M[0]=Math.min(S[0],M[0]),A=!0)}}return A?_[_.length-1][1]=S[1]:_.push(S),_}};o.CharacterJoinerService=b=h([m(0,T.IBufferService)],b)},5114:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),m=c(8460),u=c(3656);class y extends h.Disposable{constructor(E,b,v){super(),this._textarea=E,this._window=b,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((_=>this._screenDprMonitor.setWindow(_)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(E){this._window!==E&&(this._window=E,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=y;class w extends h.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(E){this._parentWindow=E,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var E;this._outerListener&&((E=this._resolutionMediaMatchList)==null||E.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=c(844);class m extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const w=this.linkProviders.indexOf(y);w!==-1&&this.linkProviders.splice(w,1)}}}}o.LinkProviderService=m},8934:function(f,o,c){var h=this&&this.__decorate||function(T,E,b,v){var _,S=arguments.length,A=S<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(T,E,b,v);else for(var L=T.length-1;L>=0;L--)(_=T[L])&&(A=(S<3?_(A):S>3?_(E,b,A):_(E,b))||A);return S>3&&A&&Object.defineProperty(E,b,A),A},m=this&&this.__param||function(T,E){return function(b,v){E(b,v,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=c(4725),y=c(9806);let w=o.MouseService=class{constructor(T,E){this._renderService=T,this._charSizeService=E}getCoords(T,E,b,v,_){return(0,y.getCoords)(window,T,E,b,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(T,E){const b=(0,y.getCoordsRelativeToElement)(window,T,E);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};o.MouseService=w=h([m(0,u.IRenderService),m(1,u.ICharSizeService)],w)},3230:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var M,D=arguments.length,k=D<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var R=_.length-1;R>=0;R--)(M=_[R])&&(k=(D<3?M(k):D>3?M(S,A,k):M(S,A))||k);return D>3&&k&&Object.defineProperty(S,A,k),k},m=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=c(6193),y=c(4725),w=c(8460),T=c(844),E=c(7226),b=c(2585);let v=o.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,S,A,L,M,D,k,R){super(),this._rowCount=_,this._charSizeService=L,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new T.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((B,H)=>this._renderRows(B,H)),k),this.register(this._renderDebouncer),this.register(k.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(M.onDecorationRegistered((()=>this._fullRefresh()))),this.register(M.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(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,S),this.register(k.onWindowChange((B=>this._registerIntersectionObserver(B,S))))}_registerIntersectionObserver(_,S){if("IntersectionObserver"in _){const A=new _.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});A.observe(S),this._observerDisposable.value=(0,T.toDisposable)((()=>A.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(_,S,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,S,this._rowCount))}_renderRows(_,S){this._renderer.value&&(_=Math.min(_,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(_,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:_,end:S}),this._onRender.fire({start:_,end:S}),this._isNextRenderRedrawOnly=!0)}resize(_,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _,S;this._renderer.value&&((S=(_=this._renderer.value).clearTextureAtlas)==null||S.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var A;return(A=this._renderer.value)==null?void 0:A.handleResize(_,S)})):this._renderer.value.handleResize(_,S),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)==null||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)==null||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)==null||_.handleFocus()}handleSelectionChanged(_,S,A){var L;this._selectionState.start=_,this._selectionState.end=S,this._selectionState.columnSelectMode=A,(L=this._renderer.value)==null||L.handleSelectionChanged(_,S,A)}handleCursorMove(){var _;(_=this._renderer.value)==null||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)==null||_.clear()}};o.RenderService=v=h([m(2,b.IOptionsService),m(3,y.ICharSizeService),m(4,b.IDecorationService),m(5,b.IBufferService),m(6,y.ICoreBrowserService),m(7,y.IThemeService)],v)},9312:function(f,o,c){var h=this&&this.__decorate||function(k,R,B,H){var U,P=arguments.length,V=P<3?R:H===null?H=Object.getOwnPropertyDescriptor(R,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(k,R,B,H);else for(var K=k.length-1;K>=0;K--)(U=k[K])&&(V=(P<3?U(V):P>3?U(R,B,V):U(R,B))||V);return P>3&&V&&Object.defineProperty(R,B,V),V},m=this&&this.__param||function(k,R){return function(B,H){R(B,H,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=c(9806),y=c(9504),w=c(456),T=c(4725),E=c(8460),b=c(844),v=c(6114),_=c(4841),S=c(511),A=c(2585),L=" ",M=new RegExp(L,"g");let D=o.SelectionService=class extends b.Disposable{constructor(k,R,B,H,U,P,V,K,G){super(),this._element=k,this._screenElement=R,this._linkifier=B,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=V,this._renderService=K,this._coreBrowserService=G,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 E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=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 w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const k=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!k||!R||k[0]===R[0]&&k[1]===R[1])}get selectionText(){const k=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!k||!R)return"";const B=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(k[0]===R[0])return"";const U=k[0]<R[0]?k[0]:R[0],P=k[0]<R[0]?R[0]:k[0];for(let V=k[1];V<=R[1];V++){const K=B.translateBufferLineToString(V,!0,U,P);H.push(K)}}else{const U=k[1]===R[1]?R[0]:void 0;H.push(B.translateBufferLineToString(k[1],!0,k[0],U));for(let P=k[1]+1;P<=R[1]-1;P++){const V=B.lines.get(P),K=B.translateBufferLineToString(P,!0);V!=null&&V.isWrapped?H[H.length-1]+=K:H.push(K)}if(k[1]!==R[1]){const P=B.lines.get(R[1]),V=B.translateBufferLineToString(R[1],!0,0,R[0]);P&&P.isWrapped?H[H.length-1]+=V:H.push(V)}}return H.map((U=>U.replace(M," "))).join(v.isWindows?`\r
|
|
56
|
-
`:`
|
|
57
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&k&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(k){const R=this._getMouseBufferCoords(k),B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(B&&H&&R)&&this._areCoordsInSelection(R,B,H)}isCellInSelection(k,R){const B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!B||!H)&&this._areCoordsInSelection([k,R],B,H)}_areCoordsInSelection(k,R,B){return k[1]>R[1]&&k[1]<B[1]||R[1]===B[1]&&k[1]===R[1]&&k[0]>=R[0]&&k[0]<B[0]||R[1]<B[1]&&k[1]===B[1]&&k[0]<B[0]||R[1]<B[1]&&k[1]===R[1]&&k[0]>=R[0]}_selectWordAtCursor(k,R){var U,P;const B=(P=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:P.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(k);return!!H&&(this._selectWordAt(H,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,R){this._model.clearSelection(),k=Math.max(k,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const R=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(k){let R=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=B?0:(R>B&&(R-=B),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(k){return v.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const R=this._getMouseBufferCoords(k);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(k){return k.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const H=B.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const R=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const H=(0,y.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,B=!(!k||!R||k[0]===R[0]&&k[1]===R[1]);B?k&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,R,B)):this._oldHasSelection&&this._fireOnSelectionChange(k,R,B)}_fireOnSelectionChange(k,R,B){this._oldSelectionStart=k,this._oldSelectionEnd=R,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(k,R){let B=R;for(let H=0;R>=H;H++){const U=k.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:U>1&&R!==H&&(B+=U-1)}return B}setSelection(k,R,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,R],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,R,B=!0,H=!0){if(k[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,P=U.lines.get(k[1]);if(!P)return;const V=U.translateBufferLineToString(k[1],!1);let K=this._convertViewportColToCharacterIndex(P,k[0]),G=K;const Y=k[0]-K;let ee=0,z=0,j=0,N=0;if(V.charAt(K)===" "){for(;K>0&&V.charAt(K-1)===" ";)K--;for(;G<V.length&&V.charAt(G+1)===" ";)G++}else{let ie=k[0],me=k[0];P.getWidth(ie)===0&&(ee++,ie--),P.getWidth(me)===2&&(z++,me++);const ve=P.getString(me).length;for(ve>1&&(N+=ve-1,G+=ve-1);ie>0&&K>0&&!this._isCharWordSeparator(P.loadCell(ie-1,this._workCell));){P.loadCell(ie-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,ie--):Q>1&&(j+=Q-1,K-=Q-1),K--,ie--}for(;me<P.length&&G+1<V.length&&!this._isCharWordSeparator(P.loadCell(me+1,this._workCell));){P.loadCell(me+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,me++):Q>1&&(N+=Q-1,G+=Q-1),G++,me++}}G++;let $=K+Y-ee+j,I=Math.min(this._bufferService.cols,G-K+ee+z-j-N);if(R||V.slice(K,G).trim()!==""){if(B&&$===0&&P.getCodePoint(0)!==32){const ie=U.lines.get(k[1]-1);if(ie&&P.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const me=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(me){const ve=this._bufferService.cols-me.start;$-=ve,I+=ve}}}if(H&&$+I===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const ie=U.lines.get(k[1]+1);if(ie!=null&&ie.isWrapped&&ie.getCodePoint(0)!==32){const me=this._getWordAt([0,k[1]+1],!1,!1,!0);me&&(I+=me.length)}}return{start:$,length:I}}}_selectWordAt(k,R){const B=this._getWordAt(k,R);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[B.start,k[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(k){const R=this._getWordAt(k,!0);if(R){let B=k[1];for(;R.start<0;)R.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,B]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const R=this._bufferService.buffer.getWrappedRangeForLine(k),B={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=D=h([m(3,A.IBufferService),m(4,A.ICoreService),m(5,T.IMouseService),m(6,A.IOptionsService),m(7,T.IRenderService),m(8,T.ICoreBrowserService)],D)},4725:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,o,c){var h=this&&this.__decorate||function(D,k,R,B){var H,U=arguments.length,P=U<3?k:B===null?B=Object.getOwnPropertyDescriptor(k,R):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(D,k,R,B);else for(var V=D.length-1;V>=0;V--)(H=D[V])&&(P=(U<3?H(P):U>3?H(k,R,P):H(k,R))||P);return U>3&&P&&Object.defineProperty(k,R,P),P},m=this&&this.__param||function(D,k){return function(R,B){k(R,B,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),y=c(8055),w=c(8460),T=c(844),E=c(2585),b=y.css.toColor("#ffffff"),v=y.css.toColor("#000000"),_=y.css.toColor("#ffffff"),S=y.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let R=0;R<216;R++){const B=k[R/36%6|0],H=k[R/6%6|0],U=k[R%6];D.push({css:y.channels.toCss(B,H,U),rgba:y.channels.toRgba(B,H,U)})}for(let R=0;R<24;R++){const B=8+10*R;D.push({css:y.channels.toCss(B,B,B),rgba:y.channels.toRgba(B,B,B)})}return D})());let L=o.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 w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:v,cursor:_,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:y.color.blend(v,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:y.color.blend(v,A),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const k=this._colors;if(k.foreground=M(D.foreground,b),k.background=M(D.background,v),k.cursor=M(D.cursor,_),k.cursorAccent=M(D.cursorAccent,S),k.selectionBackgroundTransparent=M(D.selectionBackground,A),k.selectionBackgroundOpaque=y.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=M(D.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=y.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=D.selectionForeground?M(D.selectionForeground,y.NULL_COLOR):void 0,k.selectionForeground===y.NULL_COLOR&&(k.selectionForeground=void 0),y.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=y.color.opacity(k.selectionBackgroundTransparent,.3)),y.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=y.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=M(D.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=M(D.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=M(D.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=M(D.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=M(D.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=M(D.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=M(D.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=M(D.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=M(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=M(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=M(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=M(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=M(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=M(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=M(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=M(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const R=Math.min(k.ansi.length-16,D.extendedAnsi.length);for(let B=0;B<R;B++)k.ansi[B+16]=M(D.extendedAnsi[B],o.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 k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}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 M(D,k){if(D!==void 0)try{return y.css.toColor(D)}catch{}return k}o.ThemeService=L=h([m(0,E.IOptionsService)],L)},6349:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=c(8460),m=c(844);class u extends m.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const T=new Array(w);for(let E=0;E<Math.min(w,this.length);E++)T[E]=this._array[this._getCyclicIndex(E)];this._array=T,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let T=this._length;T<w;T++)this._array[T]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,T){this._array[this._getCyclicIndex(w)]=T}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,T,...E){if(T){for(let b=w;b<this._length-T;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+T)];this._length-=T,this.onDeleteEmitter.fire({index:w,amount:T})}for(let b=this._length-1;b>=w;b--)this._array[this._getCyclicIndex(b+E.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<E.length;b++)this._array[this._getCyclicIndex(w+b)]=E[b];if(E.length&&this.onInsertEmitter.fire({index:w,amount:E.length}),this._length+E.length>this._maxLength){const b=this._length+E.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=E.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,T,E){if(!(T<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let v=T-1;v>=0;v--)this.set(w+v+E,this.get(w+v));const b=w+T+E-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<T;b++)this.set(w+b+E,this.get(w+b))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}o.CircularList=u},1439:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(h,m=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const y in h)u[y]=m<=1?h[y]:h[y]&&c(h[y],m-1);return u}},8055:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,m=0,u=0;var y,w,T,E,b;function v(S){const A=S.toString(16);return A.length<2?"0"+A:A}function _(S,A){return S<A?(A+.05)/(S+.05):(S+.05)/(A+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(A,L,M,D){return D!==void 0?`#${v(A)}${v(L)}${v(M)}${v(D)}`:`#${v(A)}${v(L)}${v(M)}`},S.toRgba=function(A,L,M,D=255){return(A<<24|L<<16|M<<8|D)>>>0},S.toColor=function(A,L,M,D){return{css:S.toCss(A,L,M,D),rgba:S.toRgba(A,L,M,D)}}})(y||(o.channels=y={})),(function(S){function A(L,M){return u=Math.round(255*M),[c,h,m]=b.toChannels(L.rgba),{css:y.toCss(c,h,m,u),rgba:y.toRgba(c,h,m,u)}}S.blend=function(L,M){if(u=(255&M.rgba)/255,u===1)return{css:M.css,rgba:M.rgba};const D=M.rgba>>24&255,k=M.rgba>>16&255,R=M.rgba>>8&255,B=L.rgba>>24&255,H=L.rgba>>16&255,U=L.rgba>>8&255;return c=B+Math.round((D-B)*u),h=H+Math.round((k-H)*u),m=U+Math.round((R-U)*u),{css:y.toCss(c,h,m),rgba:y.toRgba(c,h,m)}},S.isOpaque=function(L){return(255&L.rgba)==255},S.ensureContrastRatio=function(L,M,D){const k=b.ensureContrastRatio(L.rgba,M.rgba,D);if(k)return y.toColor(k>>24&255,k>>16&255,k>>8&255)},S.opaque=function(L){const M=(255|L.rgba)>>>0;return[c,h,m]=b.toChannels(M),{css:y.toCss(c,h,m),rgba:M}},S.opacity=A,S.multiplyOpacity=function(L,M){return u=255&L.rgba,A(L,u*M/255)},S.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(w||(o.color=w={})),(function(S){let A,L;try{const M=document.createElement("canvas");M.width=1,M.height=1;const D=M.getContext("2d",{willReadFrequently:!0});D&&(A=D,A.globalCompositeOperation="copy",L=A.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(M){if(M.match(/#[\da-f]{3,8}/i))switch(M.length){case 4:return c=parseInt(M.slice(1,2).repeat(2),16),h=parseInt(M.slice(2,3).repeat(2),16),m=parseInt(M.slice(3,4).repeat(2),16),y.toColor(c,h,m);case 5:return c=parseInt(M.slice(1,2).repeat(2),16),h=parseInt(M.slice(2,3).repeat(2),16),m=parseInt(M.slice(3,4).repeat(2),16),u=parseInt(M.slice(4,5).repeat(2),16),y.toColor(c,h,m,u);case 7:return{css:M,rgba:(parseInt(M.slice(1),16)<<8|255)>>>0};case 9:return{css:M,rgba:parseInt(M.slice(1),16)>>>0}}const D=M.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]),m=parseInt(D[3]),u=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),y.toColor(c,h,m,u);if(!A||!L)throw new Error("css.toColor: Unsupported css format");if(A.fillStyle=L,A.fillStyle=M,typeof A.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(A.fillRect(0,0,1,1),[c,h,m,u]=A.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(c,h,m,u),css:M}}})(T||(o.css=T={})),(function(S){function A(L,M,D){const k=L/255,R=M/255,B=D/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}S.relativeLuminance=function(L){return A(L>>16&255,L>>8&255,255&L)},S.relativeLuminance2=A})(E||(o.rgb=E={})),(function(S){function A(M,D,k){const R=M>>24&255,B=M>>16&255,H=M>>8&255;let U=D>>24&255,P=D>>16&255,V=D>>8&255,K=_(E.relativeLuminance2(U,P,V),E.relativeLuminance2(R,B,H));for(;K<k&&(U>0||P>0||V>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),V-=Math.max(0,Math.ceil(.1*V)),K=_(E.relativeLuminance2(U,P,V),E.relativeLuminance2(R,B,H));return(U<<24|P<<16|V<<8|255)>>>0}function L(M,D,k){const R=M>>24&255,B=M>>16&255,H=M>>8&255;let U=D>>24&255,P=D>>16&255,V=D>>8&255,K=_(E.relativeLuminance2(U,P,V),E.relativeLuminance2(R,B,H));for(;K<k&&(U<255||P<255||V<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),V=Math.min(255,V+Math.ceil(.1*(255-V))),K=_(E.relativeLuminance2(U,P,V),E.relativeLuminance2(R,B,H));return(U<<24|P<<16|V<<8|255)>>>0}S.blend=function(M,D){if(u=(255&D)/255,u===1)return D;const k=D>>24&255,R=D>>16&255,B=D>>8&255,H=M>>24&255,U=M>>16&255,P=M>>8&255;return c=H+Math.round((k-H)*u),h=U+Math.round((R-U)*u),m=P+Math.round((B-P)*u),y.toRgba(c,h,m)},S.ensureContrastRatio=function(M,D,k){const R=E.relativeLuminance(M>>8),B=E.relativeLuminance(D>>8);if(_(R,B)<k){if(B<R){const P=A(M,D,k),V=_(R,E.relativeLuminance(P>>8));if(V<k){const K=L(M,D,k);return V>_(R,E.relativeLuminance(K>>8))?P:K}return P}const H=L(M,D,k),U=_(R,E.relativeLuminance(H>>8));if(U<k){const P=A(M,D,k);return U>_(R,E.relativeLuminance(P>>8))?H:P}return H}},S.reduceLuminance=A,S.increaseLuminance=L,S.toChannels=function(M){return[M>>24&255,M>>16&255,M>>8&255,255&M]}})(b||(o.rgba=b={})),o.toPaddedHex=v,o.contrastRatio=_},8969:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),m=c(2585),u=c(4348),y=c(7866),w=c(744),T=c(7302),E=c(6975),b=c(8460),v=c(1753),_=c(1480),S=c(7994),A=c(9282),L=c(5435),M=c(5981),D=c(2660);let k=!1;class R extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((H=>{var U;(U=this._onScrollApi)==null||U.fire(H.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(H){for(const U in H)this.optionsService.options[U]=H[U]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new T.OptionsService(H)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(y.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new M.WriteBuffer(((U,P)=>this._inputHandler.parse(U,P)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,U){this._writeBuffer.write(H,U)}writeSync(H,U){this._logService.logLevel<=m.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(H,U)}input(H,U=!0){this.coreService.triggerDataEvent(H,U)}resize(H,U){isNaN(H)||isNaN(U)||(H=Math.max(H,w.MINIMUM_COLS),U=Math.max(U,w.MINIMUM_ROWS),this._bufferService.resize(H,U))}scroll(H,U=!1){this._bufferService.scroll(H,U)}scrollLines(H,U,P){this._bufferService.scrollLines(H,U,P)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const U=H-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(H,U){return this._inputHandler.registerEscHandler(H,U)}registerDcsHandler(H,U){return this._inputHandler.registerDcsHandler(H,U)}registerCsiHandler(H,U){return this._inputHandler.registerCsiHandler(H,U)}registerOscHandler(H,U){return this._inputHandler.registerOscHandler(H,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?H=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(A.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,A.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const U of H)U.dispose()}))}}}o.CoreTerminal=R},8460:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const m=[];for(let u=0;u<this._listeners.length;u++)m.push(this._listeners[u]);for(let u=0;u<m.length;u++)m[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,h){return c((m=>h.fire(m)))},o.runAndSubscribe=function(c,h){return h(void 0),c((m=>h(m)))}},5435:function(f,o,c){var h=this&&this.__decorate||function(ee,z,j,N){var $,I=arguments.length,ie=I<3?z:N===null?N=Object.getOwnPropertyDescriptor(z,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(ee,z,j,N);else for(var me=ee.length-1;me>=0;me--)($=ee[me])&&(ie=(I<3?$(ie):I>3?$(z,j,ie):$(z,j))||ie);return I>3&&ie&&Object.defineProperty(z,j,ie),ie},m=this&&this.__param||function(ee,z){return function(j,N){z(j,N,ee)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=c(2584),y=c(7116),w=c(2015),T=c(844),E=c(482),b=c(8437),v=c(8460),_=c(643),S=c(511),A=c(3734),L=c(2585),M=c(1480),D=c(6242),k=c(6351),R=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(ee,z){if(ee>24)return z.setWinLines||!1;switch(ee){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 P;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let V=0;class K extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,$,I,ie,me,ve,Q=new w.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=ie,this._coreMouseService=me,this._unicodeService=ve,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ce.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,ce,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ce,data:ae})})),this._parser.setDcsHandlerFallback(((q,ce,ae)=>{ce==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ce,payload:ae})})),this._parser.setPrintHandler(((q,ce,ae)=>this.print(q,ce,ae))),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 y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(((q,ce)=>this.requestStatusString(q,ce))))}_preserveStack(z,j,N,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=N,this._parseStack.position=$}_logSlowResolvingAsync(z){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([z,new Promise(((j,N)=>setTimeout((()=>N("#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 N,$=this._activeBuffer.x,I=this._activeBuffer.y,ie=0;const me=this._parseStack.paused;if(me){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(N),N;$=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>H&&(ie=this._parseStack.position+H)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,(q=>String.fromCharCode(q))).join("")}"`),typeof z=="string"?z.split("").map((q=>q.charCodeAt(0))):z),this._parseBuffer.length<z.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(z.length,H))),me||this._dirtyRowTracker.clearRange(),z.length>H)for(let q=ie;q<z.length;q+=H){const ce=q+H<z.length?q+H:z.length,ae=typeof z=="string"?this._stringDecoder.decode(z.substring(q,ce),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,ce),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ae))return this._preserveStack($,I,ae,q),this._logSlowResolvingAsync(N),N}else if(!me){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,q))return this._preserveStack($,I,q,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===$&&this._activeBuffer.y===I||this._onCursorMove.fire();const ve=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(ve,this._bufferService.rows-1))}print(z,j,N){let $,I;const ie=this._charsetService.charset,me=this._optionsService.rawOptions.screenReaderMode,ve=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,ce=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let be=this._parser.precedingJoinState;for(let Ee=j;Ee<N;++Ee){if($=z[Ee],$<127&&ie){const $e=ie[String.fromCharCode($)];$e&&($=$e.charCodeAt(0))}const xe=this._unicodeService.charProperties($,be);I=M.UnicodeService.extractWidth(xe);const de=M.UnicodeService.extractShouldJoin(xe),Me=de?M.UnicodeService.extractWidth(be):0;if(be=xe,me&&this._onA11yChar.fire((0,E.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-Me>ve){if(Q){const $e=ae;let Ae=this._activeBuffer.x-Me;for(this._activeBuffer.x=Me,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),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Me>0&&ae instanceof b.BufferLine&&ae.copyCellsFrom($e,Ae,0,Me,!1);Ae<ve;)$e.setCellFromCodepoint(Ae++,0,1,ce)}else if(this._activeBuffer.x=ve-1,I===2)continue}if(de&&this._activeBuffer.x){const $e=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-$e,$,I);for(let Ae=I-Me;--Ae>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(q&&(ae.insertCells(this._activeBuffer.x,I-Me,this._activeBuffer.getNullCell(ce)),ae.getWidth(ve-1)===2&&ae.setCellFromCodepoint(ve-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,ce)),ae.setCellFromCodepoint(this._activeBuffer.x++,$,I,ce),I>0)for(;--I;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=be,this._activeBuffer.x<ve&&N-j>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,ce),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,(N=>!U(N.params[0],this._optionsService.rawOptions.windowOptions)||j(N)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new k.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,N,$=!1,I=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);ie.replaceCells(j,N,this._activeBuffer.getNullCell(this._eraseAttrData()),I),$&&(ie.isWrapped=!1)}_resetBufferLine(z,j=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),N.isWrapped=!1)}eraseInDisplay(z,j=!1){let N;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);N<this._bufferService.rows;N++)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(z,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 N=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;j--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;j--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(z){this._restrictCursor();const 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(b.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 N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.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 N=z.params[0]||1,$=M.UnicodeService.extractWidth(j),I=this._activeBuffer.x-$,ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),me=new Uint32Array(ie.length*N);let ve=0;for(let q=0;q<ie.length;){const ce=ie.codePointAt(q)||0;me[ve++]=ce,q+=ce>65535?2:1}let Q=ve;for(let q=1;q<N;++q)me.copyWithin(Q,0,ve),Q+=ve;return this.print(me,0,Q),!0}sendDeviceAttributesPrimary(z){return z.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let 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,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.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 N=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:I}=this._coreMouseService,ie=this._coreService,{buffers:me,cols:ve}=this._bufferService,{active:Q,alt:q}=me,ce=this._optionsService.rawOptions,ae=de=>de?1:2,be=z.params[0];return Ee=be,xe=j?be===2?4:be===4?ae(ie.modes.insertMode):be===12?3:be===20?ae(ce.convertEol):0:be===1?ae(N.applicationCursorKeys):be===3?ce.windowOptions.setWinLines?ve===80?2:ve===132?1:0:0:be===6?ae(N.origin):be===7?ae(N.wraparound):be===8?3:be===9?ae($==="X10"):be===12?ae(ce.cursorBlink):be===25?ae(!ie.isCursorHidden):be===45?ae(N.reverseWraparound):be===66?ae(N.applicationKeypad):be===67?4:be===1e3?ae($==="VT200"):be===1002?ae($==="DRAG"):be===1003?ae($==="ANY"):be===1004?ae(N.sendFocus):be===1005?4:be===1006?ae(I==="SGR"):be===1015?4:be===1016?ae(I==="SGR_PIXELS"):be===1048?1:be===47||be===1047||be===1049?ae(Q===q):be===2004?ae(N.bracketedPasteMode):0,ie.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${Ee};${xe}$y`),!0;var Ee,xe}_updateAttrColor(z,j,N,$,I){return j===2?(z|=50331648,z&=-16777216,z|=A.AttributeData.fromColorRGB([N,$,I])):j===5&&(z&=-50331904,z|=33554432|255&N),z}_extractColor(z,j,N){const $=[0,0,-1,0,0,0];let I=0,ie=0;do{if($[ie+I]=z.params[j+ie],z.hasSubParams(j+ie)){const me=z.getSubParams(j+ie);let ve=0;do $[1]===5&&(I=1),$[ie+ve+1+I]=me[ve];while(++ve<me.length&&ve+ie+1+I<$.length);break}if($[1]===5&&ie+I>=2||$[1]===2&&ie+I>=5)break;$[1]&&(I=1)}while(++ie+j<z.length&&ie+I<$.length);for(let me=2;me<$.length;++me)$[me]===-1&&($[me]=0);switch($[0]){case 38:N.fg=this._updateAttrColor(N.fg,$[1],$[3],$[4],$[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,$[1],$[3],$[4],$[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,$[1],$[3],$[4],$[5])}return 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=b.DEFAULT_ATTR_DATA.fg,z.bg=b.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 N;const $=this._curAttrData;for(let I=0;I<j;I++)N=z.params[I],N>=30&&N<=37?($.fg&=-50331904,$.fg|=16777216|N-30):N>=40&&N<=47?($.bg&=-50331904,$.bg|=16777216|N-40):N>=90&&N<=97?($.fg&=-50331904,$.fg|=16777224|N-90):N>=100&&N<=107?($.bg&=-50331904,$.bg|=16777224|N-100):N===0?this._processSGR0($):N===1?$.fg|=134217728:N===3?$.bg|=67108864:N===4?($.fg|=268435456,this._processUnderline(z.hasSubParams(I)?z.getSubParams(I)[0]:1,$)):N===5?$.fg|=536870912:N===7?$.fg|=67108864:N===8?$.fg|=1073741824:N===9?$.fg|=2147483648:N===2?$.bg|=134217728:N===21?this._processUnderline(2,$):N===22?($.fg&=-134217729,$.bg&=-134217729):N===23?$.bg&=-67108865:N===24?($.fg&=-268435457,this._processUnderline(0,$)):N===25?$.fg&=-536870913:N===27?$.fg&=-67108865:N===28?$.fg&=-1073741825:N===29?$.fg&=2147483647:N===39?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):N===49?($.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?I+=this._extractColor(z,I,$):N===53?$.bg|=1073741824:N===55?$.bg&=-1073741825:N===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):N===100?($.fg&=-67108864,$.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${j};${N}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${j};${N}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.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 N=j%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(z){const j=z.params[0]||1;let N;return(z.length<2||(N=z.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(z){if(!U(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:j!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${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=[],N=z.split(";");for(;N.length>1;){const $=N.shift(),I=N.shift();if(/^\d+$/.exec($)){const ie=parseInt($);if(Y(ie))if(I==="?")j.push({type:0,index:ie});else{const me=(0,R.parseColor)(I);me&&j.push({type:1,index:ie,color:me})}}}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 N=z.split(":");let $;const I=N.findIndex((ie=>ie.startsWith("id=")));return I!==-1&&($=N[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri: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 N=z.split(";");for(let $=0;$<N.length&&!(j>=this._specialColors.length);++$,++j)if(N[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const I=(0,R.parseColor)(N[$]);I&&this._onColor.fire([{type:1,index:this._specialColors[j],color:I}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const j=[],N=z.split(";");for(let $=0;$<N.length;++$)if(/^\d+$/.exec(N[$])){const I=parseInt(N[$]);Y(I)&&j.push({type:2,index:I})}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,y.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(B[z[0]],y.CHARSETS[z[1]]||y.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=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.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 N=this._activeBuffer.ybase+this._activeBuffer.y+j,$=this._activeBuffer.lines.get(N);$&&($.fill(z),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const N=this._bufferService.buffer,$=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${I}${u.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}o.InputHandler=K;let G=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){ee<this.start?this.start=ee:ee>this.end&&(this.end=ee)}markRangeDirty(ee,z){ee>z&&(V=ee,ee=z,z=V),ee<this.start&&(this.start=ee),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(ee){return 0<=ee&&ee<256}G=h([m(0,L.IBufferService)],G)},844:(f,o)=>{function c(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,u,y){this._data[m]||(this._data[m]={}),this._data[m][u]=y}get(m,u){return this._data[m]?this._data[m][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,m,u,y,w){this._data.get(h,m)||this._data.set(h,m,new c),this._data.get(h,m).set(u,y,w)}get(h,m,u,y){var w;return(w=this._data.get(h,m))==null?void 0:w.get(u,y)}clear(){this._data.clear()}}},6114:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const m=this._getKey(h);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,m){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let m=0,u=this._array.length-1;for(;u>=m;){let y=m+u>>1;const w=this._getKey(this._array[y]);if(w>h)u=y-1;else{if(!(w<h)){for(;y>0&&this._getKey(this._array[y-1])===h;)y--;return y}m=y+1}}return m}}},7226:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let T=0,E=0,b=w.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),E=Math.max(T,E),v=w.timeRemaining(),1.5*E>v)return b-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-T))}ms`),void this._start();b=v}this.clear()}}class u extends m{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const T=Date.now()+w;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.updateWindowsModeWrappedState=function(m){const u=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),y=u==null?void 0:u.get(m.cols-1),w=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);w&&y&&(w.isWrapped=y[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&y[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,y=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=y}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),m=c(7226),u=c(3734),y=c(8437),w=c(4634),T=c(511),E=c(643),b=c(4863),v=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(_,S,A){this._hasScrollback=_,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=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,S){return new y.BufferLine(this._bufferService.cols,this.getNullCell(_),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const S=_+this._optionsService.rawOptions.scrollback;return S>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:S}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=y.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(_))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(_,S){const A=this.getNullCell(y.DEFAULT_ATTR_DATA);let L=0;const M=this._getCorrectBufferLength(S);if(M>this.lines.maxLength&&(this.lines.maxLength=M),this.lines.length>0){if(this._cols<_)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(_,A);let D=0;if(this._rows<S)for(let k=this._rows;k<S;k++)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 y.BufferLine(_,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 y.BufferLine(_,A)));else for(let k=this._rows;k>S;k--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(M<this.lines.maxLength){const k=this.lines.length-M;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=M}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,S-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(_,S),this._cols>_))for(let D=0;D<this.lines.length;D++)L+=+this.lines.get(D).resize(_,A);this._cols=_,this._rows=S,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,S){this._cols!==_&&(_>this._cols?this._reflowLarger(_,S):this._reflowSmaller(_,S))}_reflowLarger(_,S){const A=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(A.length>0){const L=(0,w.reflowLargerCreateNewLayout)(this.lines,A);(0,w.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(_,S,L.countRemoved)}}_reflowLargerAdjustViewport(_,S,A){const L=this.getNullCell(y.DEFAULT_ATTR_DATA);let M=A;for(;M-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new y.BufferLine(_,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(_,S){const A=this.getNullCell(y.DEFAULT_ATTR_DATA),L=[];let M=0;for(let D=this.lines.length-1;D>=0;D--){let k=this.lines.get(D);if(!k||!k.isWrapped&&k.getTrimmedLength()<=_)continue;const R=[k];for(;k.isWrapped&&D>0;)k=this.lines.get(--D),R.unshift(k);const B=this.ybase+this.y;if(B>=D&&B<D+R.length)continue;const H=R[R.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(R,this._cols,_),P=U.length-R.length;let V;V=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const K=[];for(let N=0;N<P;N++){const $=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);K.push($)}K.length>0&&(L.push({start:D+R.length+M,newLines:K}),M+=K.length),R.push(...K);let G=U.length-1,Y=U[G];Y===0&&(G--,Y=U[G]);let ee=R.length-P-1,z=H;for(;ee>=0;){const N=Math.min(z,Y);if(R[G]===void 0)break;if(R[G].copyCellsFrom(R[ee],z-N,Y-N,N,!0),Y-=N,Y===0&&(G--,Y=U[G]),z-=N,z===0){ee--;const $=Math.max(ee,0);z=(0,w.getWrappedLineTrimmedLength)(R,$,this._cols)}}for(let N=0;N<R.length;N++)U[N]<_&&R[N].setCell(U[N],A);let j=P-V;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+M)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+S-1)}if(L.length>0){const D=[],k=[];for(let G=0;G<this.lines.length;G++)k.push(this.lines.get(G));const R=this.lines.length;let B=R-1,H=0,U=L[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+M);let P=0;for(let G=Math.min(this.lines.maxLength-1,R+M-1);G>=0;G--)if(U&&U.start>B+P){for(let Y=U.newLines.length-1;Y>=0;Y--)this.lines.set(G--,U.newLines[Y]);G++,D.push({index:B+1,amount:U.newLines.length}),P+=U.newLines.length,U=L[++H]}else this.lines.set(G,k[B--]);let V=0;for(let G=D.length-1;G>=0;G--)D[G].index+=V,this.lines.onInsertEmitter.fire(D[G]),V+=D[G].amount;const K=Math.max(0,R+M-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(_,S,A=0,L){const M=this.lines.get(_);return M?M.translateToString(S,A,L):""}getWrappedRangeForLine(_){let S=_,A=_;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(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===_&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const S=new b.Marker(_);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(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),m=c(511),u=c(643),y=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class T{constructor(b,v,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const S=v||m.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let A=0;A<b;++A)this.setCell(A,S);this.length=b}get(b){const v=this._data[3*b+0],_=2097151&v;return[this._data[3*b+1],2097152&v?this._combined[b]:_?(0,y.stringFromCodePoint)(_):"",v>>22,2097152&v?this._combined[b].charCodeAt(this._combined[b].length-1):_]}set(b,v){this._data[3*b+1]=v[u.CHAR_DATA_ATTR_INDEX],v[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=v[1],this._data[3*b+0]=2097152|b|v[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=v[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const v=this._data[3*b+0];return 2097152&v?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&v}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const v=this._data[3*b+0];return 2097152&v?this._combined[b]:2097151&v?(0,y.stringFromCodePoint)(2097151&v):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,v){return w=3*b,v.content=this._data[w+0],v.fg=this._data[w+1],v.bg=this._data[w+2],2097152&v.content&&(v.combinedData=this._combined[b]),268435456&v.bg&&(v.extended=this._extendedAttrs[b]),v}setCell(b,v){2097152&v.content&&(this._combined[b]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[b]=v.extended),this._data[3*b+0]=v.content,this._data[3*b+1]=v.fg,this._data[3*b+2]=v.bg}setCellFromCodepoint(b,v,_,S){268435456&S.bg&&(this._extendedAttrs[b]=S.extended),this._data[3*b+0]=v|_<<22,this._data[3*b+1]=S.fg,this._data[3*b+2]=S.bg}addCodepointToCell(b,v,_){let S=this._data[3*b+0];2097152&S?this._combined[b]+=(0,y.stringFromCodePoint)(v):2097151&S?(this._combined[b]=(0,y.stringFromCodePoint)(2097151&S)+(0,y.stringFromCodePoint)(v),S&=-2097152,S|=2097152):S=v|4194304,_&&(S&=-12582913,S|=_<<22),this._data[3*b+0]=S}insertCells(b,v,_){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),v<this.length-b){const S=new m.CellData;for(let A=this.length-b-v-1;A>=0;--A)this.setCell(b+v+A,this.loadCell(b+A,S));for(let A=0;A<v;++A)this.setCell(b+A,_)}else for(let S=b;S<this.length;++S)this.setCell(S,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(b,v,_){if(b%=this.length,v<this.length-b){const S=new m.CellData;for(let A=0;A<this.length-b-v;++A)this.setCell(b+A,this.loadCell(b+v+A,S));for(let A=this.length-v;A<this.length;++A)this.setCell(A,_)}else for(let S=b;S<this.length;++S)this.setCell(S,_);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,_)}replaceCells(b,v,_,S=!1){if(S)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,_);b<v&&b<this.length;)this.isProtected(b)||this.setCell(b,_),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,_);b<v&&b<this.length;)this.setCell(b++,_)}resize(b,v){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const S=new Uint32Array(_);S.set(this._data),this._data=S}for(let S=this.length;S<b;++S)this.setCell(S,v)}else{this._data=this._data.subarray(0,_);const S=Object.keys(this._combined);for(let L=0;L<S.length;L++){const M=parseInt(S[L],10);M>=b&&delete this._combined[M]}const A=Object.keys(this._extendedAttrs);for(let L=0;L<A.length;L++){const M=parseInt(A[L],10);M>=b&&delete this._extendedAttrs[M]}}return this.length=b,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,v=!1){if(v)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,b);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const v in b._combined)this._combined[v]=b._combined[v];this._extendedAttrs={};for(const v in b._extendedAttrs)this._extendedAttrs[v]=b._extendedAttrs[v];this.isWrapped=b.isWrapped}clone(){const b=new T(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const v in this._combined)b._combined[v]=this._combined[v];for(const v in this._extendedAttrs)b._extendedAttrs[v]=this._extendedAttrs[v];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,v,_,S,A){const L=b._data;if(A)for(let D=S-1;D>=0;D--){for(let k=0;k<3;k++)this._data[3*(_+D)+k]=L[3*(v+D)+k];268435456&L[3*(v+D)+2]&&(this._extendedAttrs[_+D]=b._extendedAttrs[v+D])}else for(let D=0;D<S;D++){for(let k=0;k<3;k++)this._data[3*(_+D)+k]=L[3*(v+D)+k];268435456&L[3*(v+D)+2]&&(this._extendedAttrs[_+D]=b._extendedAttrs[v+D])}const M=Object.keys(b._combined);for(let D=0;D<M.length;D++){const k=parseInt(M[D],10);k>=v&&(this._combined[k-v+_]=b._combined[k])}}translateToString(b,v,_,S){v=v??0,_=_??this.length,b&&(_=Math.min(_,this.getTrimmedLength())),S&&(S.length=0);let A="";for(;v<_;){const L=this._data[3*v+0],M=2097151&L,D=2097152&L?this._combined[v]:M?(0,y.stringFromCodePoint)(M):u.WHITESPACE_CELL_CHAR;if(A+=D,S)for(let k=0;k<D.length;++k)S.push(v);v+=L>>22||1}return S&&S.push(v),A}}o.BufferLine=T},4841:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,o)=>{function c(h,m,u){if(m===h.length-1)return h[m].getTrimmedLength();const y=!h[m].hasContent(u-1)&&h[m].getWidth(u-1)===1,w=h[m+1].getWidth(0)===2;return y&&w?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,m,u,y,w){const T=[];for(let E=0;E<h.length-1;E++){let b=E,v=h.get(++b);if(!v.isWrapped)continue;const _=[h.get(E)];for(;b<h.length&&v.isWrapped;)_.push(v),v=h.get(++b);if(y>=E&&y<b){E+=_.length-1;continue}let S=0,A=c(_,S,m),L=1,M=0;for(;L<_.length;){const k=c(_,L,m),R=k-M,B=u-A,H=Math.min(R,B);_[S].copyCellsFrom(_[L],M,A,H,!1),A+=H,A===u&&(S++,A=0),M+=H,M===k&&(L++,M=0),A===0&&S!==0&&_[S-1].getWidth(u-1)===2&&(_[S].copyCellsFrom(_[S-1],u-1,A++,1,!1),_[S-1].setCell(u-1,w))}_[S].replaceCells(A,u,w);let D=0;for(let k=_.length-1;k>0&&(k>S||_[k].getTrimmedLength()===0);k--)D++;D>0&&(T.push(E+_.length-D),T.push(D)),E+=_.length-1}return T},o.reflowLargerCreateNewLayout=function(h,m){const u=[];let y=0,w=m[y],T=0;for(let E=0;E<h.length;E++)if(w===E){const b=m[++y];h.onDeleteEmitter.fire({index:E-T,amount:b}),E+=b-1,T+=b,w=m[++y]}else u.push(E);return{layout:u,countRemoved:T}},o.reflowLargerApplyNewLayout=function(h,m){const u=[];for(let y=0;y<m.length;y++)u.push(h.get(m[y]));for(let y=0;y<u.length;y++)h.set(y,u[y]);h.length=m.length},o.reflowSmallerGetNewLineLengths=function(h,m,u){const y=[],w=h.map(((v,_)=>c(h,_,m))).reduce(((v,_)=>v+_));let T=0,E=0,b=0;for(;b<w;){if(w-b<u){y.push(w-b);break}T+=u;const v=c(h,E,m);T>v&&(T-=v,E++);const _=h[E].getWidth(T-1)===2;_&&T--;const S=_?u-1:u;y.push(S),b+=S}return y},o.getWrappedLineTrimmedLength=c},5295:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),m=c(844),u=c(9092);class y extends m.Disposable{constructor(T,E){super(),this._optionsService=T,this._bufferService=E,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(T,E){this._normal.resize(T,E),this._alt.resize(T,E),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}o.BufferSet=y},511:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=c(482),m=c(643),u=c(3734);class y extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const E=new y;return E.setFromCharData(T),E}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(T){this.fg=T[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(T[m.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(T[m.CHAR_DATA_CHAR_INDEX].length===2){const b=T[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const v=T[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(b-55296)+v-56320+65536|T[m.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=T[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[m.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=T[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=y},643:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=c(8460),m=c(844);class u{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}o.Marker=u,u._nextId=1},7116:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,o)=>{var c,h,m;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
58
|
-
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(o.C0=c={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(h||(o.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(m||(o.C1_ESCAPED=m={}))},7399:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=c(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(u,y,w,T){const E={type:0,cancel:!1,key:void 0},b=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?E.key=y?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?E.key=y?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?E.key=y?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(E.key=y?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:E.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(E.key=h.C0.ESC+E.key);break;case 9:if(u.shiftKey){E.key=h.C0.ESC+"[Z";break}E.key=h.C0.HT,E.cancel=!0;break;case 13:E.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,E.cancel=!0;break;case 27:E.key=h.C0.ESC,u.altKey&&(E.key=h.C0.ESC+h.C0.ESC),E.cancel=!0;break;case 37:if(u.metaKey)break;b?(E.key=h.C0.ESC+"[1;"+(b+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(w?"b":"[1;5D"))):E.key=y?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;b?(E.key=h.C0.ESC+"[1;"+(b+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(w?"f":"[1;5C"))):E.key=y?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;b?(E.key=h.C0.ESC+"[1;"+(b+1)+"A",w||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=y?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;b?(E.key=h.C0.ESC+"[1;"+(b+1)+"B",w||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=y?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(E.key=h.C0.ESC+"[2~");break;case 46:E.key=b?h.C0.ESC+"[3;"+(b+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=b?h.C0.ESC+"[1;"+(b+1)+"H":y?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=b?h.C0.ESC+"[1;"+(b+1)+"F":y?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?E.type=2:u.ctrlKey?E.key=h.C0.ESC+"[5;"+(b+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?E.type=3:u.ctrlKey?E.key=h.C0.ESC+"[6;"+(b+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=b?h.C0.ESC+"[1;"+(b+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=b?h.C0.ESC+"[1;"+(b+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=b?h.C0.ESC+"[1;"+(b+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=b?h.C0.ESC+"[1;"+(b+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=b?h.C0.ESC+"[15;"+(b+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=b?h.C0.ESC+"[17;"+(b+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=b?h.C0.ESC+"[18;"+(b+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=b?h.C0.ESC+"[19;"+(b+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=b?h.C0.ESC+"[20;"+(b+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=b?h.C0.ESC+"[21;"+(b+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=b?h.C0.ESC+"[23;"+(b+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=b?h.C0.ESC+"[24;"+(b+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!T||!u.altKey||u.metaKey)!w||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?E.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(E.key=h.C0.US),u.key==="@"&&(E.key=h.C0.NUL)):u.keyCode===65&&(E.type=1);else{const v=m[u.keyCode],_=v==null?void 0:v[u.shiftKey?1:0];if(_)E.key=h.C0.ESC+_;else if(u.keyCode>=65&&u.keyCode<=90){const S=u.ctrlKey?u.keyCode-64:u.keyCode+32;let A=String.fromCharCode(S);u.shiftKey&&(A=A.toUpperCase()),E.key=h.C0.ESC+A}else if(u.keyCode===32)E.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let S=u.code.slice(3,4);u.shiftKey||(S=S.toLowerCase()),E.key=h.C0.ESC+S,E.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?E.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?E.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?E.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?E.key=h.C0.DEL:u.keyCode===219?E.key=h.C0.ESC:u.keyCode===220?E.key=h.C0.FS:u.keyCode===221&&(E.key=h.C0.GS)}return E}},482:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,m=c.length){let u="";for(let y=h;y<m;++y){let w=c[y];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const m=c.length;if(!m)return 0;let u=0,y=0;if(this._interim){const w=c.charCodeAt(y++);56320<=w&&w<=57343?h[u++]=1024*(this._interim-55296)+w-56320+65536:(h[u++]=this._interim,h[u++]=w),this._interim=0}for(let w=y;w<m;++w){const T=c.charCodeAt(w);if(55296<=T&&T<=56319){if(++w>=m)return this._interim=T,u;const E=c.charCodeAt(w);56320<=E&&E<=57343?h[u++]=1024*(T-55296)+E-56320+65536:(h[u++]=T,h[u++]=E)}else T!==65279&&(h[u++]=T)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const m=c.length;if(!m)return 0;let u,y,w,T,E=0,b=0,v=0;if(this.interim[0]){let A=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let M,D=0;for(;(M=63&this.interim[++D])&&D<4;)L<<=6,L|=M;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=k-D;for(;v<R;){if(v>=m)return 0;if(M=c[v++],(192&M)!=128){v--,A=!0;break}this.interim[D++]=M,L<<=6,L|=63&M}A||(k===2?L<128?v--:h[E++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[E++]=L):L<65536||L>1114111||(h[E++]=L)),this.interim.fill(0)}const _=m-4;let S=v;for(;S<m;){for(;!(!(S<_)||128&(u=c[S])||128&(y=c[S+1])||128&(w=c[S+2])||128&(T=c[S+3]));)h[E++]=u,h[E++]=y,h[E++]=w,h[E++]=T,S+=4;if(u=c[S++],u<128)h[E++]=u;else if((224&u)==192){if(S>=m)return this.interim[0]=u,E;if(y=c[S++],(192&y)!=128){S--;continue}if(b=(31&u)<<6|63&y,b<128){S--;continue}h[E++]=b}else if((240&u)==224){if(S>=m)return this.interim[0]=u,E;if(y=c[S++],(192&y)!=128){S--;continue}if(S>=m)return this.interim[0]=u,this.interim[1]=y,E;if(w=c[S++],(192&w)!=128){S--;continue}if(b=(15&u)<<12|(63&y)<<6|63&w,b<2048||b>=55296&&b<=57343||b===65279)continue;h[E++]=b}else if((248&u)==240){if(S>=m)return this.interim[0]=u,E;if(y=c[S++],(192&y)!=128){S--;continue}if(S>=m)return this.interim[0]=u,this.interim[1]=y,E;if(w=c[S++],(192&w)!=128){S--;continue}if(S>=m)return this.interim[0]=u,this.interim[1]=y,this.interim[2]=w,E;if(T=c[S++],(192&T)!=128){S--;continue}if(b=(7&u)<<18|(63&y)<<12|(63&w)<<6|63&T,b<65536||b>1114111)continue;h[E++]=b}}return E}}},225:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=c(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;o.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let w=0;w<m.length;++w)y.fill(0,m[w][0],m[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?y[w]:(function(T,E){let b,v=0,_=E.length-1;if(T<E[0][0]||T>E[_][1])return!1;for(;_>=v;)if(b=v+_>>1,T>E[b][1])v=b+1;else{if(!(T<E[b][0]))return!0;_=b-1}return!1})(w,u)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,T){let E=this.wcwidth(w),b=E===0&&T!==0;if(b){const v=h.UnicodeService.extractWidth(T);v===0?b=!1:v>E&&(E=v)}return h.UnicodeService.createPropertyValue(0,E,b)}}},5981:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=c(8460),m=c(844);class u extends m.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,T){if(T!==void 0&&this._syncCalls>T)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,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+=w.length,this._writeBuffer.push(w),this._callbacks.push(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(T)}_innerWrite(w=0,T=!0){const E=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],v=this._action(b,T);if(v){const S=A=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(E,A);return void v.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(S)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=u},5941:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function m(u,y){const w=u.toString(16),T=w.length<2?"0"+w:w;switch(y){case 4:return w[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}o.parseColor=function(u){if(!u)return;let y=u.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const w=c.exec(y);if(w){const T=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/T*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/T*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/T*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),h.exec(y)&&[3,6,9,12].includes(y.length))){const w=y.length/3,T=[0,0,0];for(let E=0;E<3;++E){const b=parseInt(y.slice(w*E,w*E+w),16);T[E]=w===1?b<<4:w===2?b:w===3?b>>4:b>>8}return T}},o.toRgbString=function(u,y=16){const[w,T,E]=u;return`rgb:${m(w,y)}/${m(T,y)}/${m(E,y)}`}},5770:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),m=c(8742),u=c(5770),y=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(T,E){this._handlers[T]===void 0&&(this._handlers[T]=[]);const b=this._handlers[T];return b.push(E),{dispose:()=>{const v=b.indexOf(E);v!==-1&&b.splice(v,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(T,E){if(this.reset(),this._ident=T,this._active=this._handlers[T]||y,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(T,E,b){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(T,E,b);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(T,E,b))}unhook(T,E=!0){if(this._active.length){let b=!1,v=this._active.length-1,_=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,b=E,_=this._stack.fallThrough,this._stack.paused=!1),!_&&b===!1){for(;v>=0&&(b=this._active[v].unhook(T),b!==!0);v--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,b;v--}for(;v>=0;v--)if(b=this._active[v].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",T);this._active=y,this._ident=0}};const w=new m.Params;w.addParam(0),o.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=w,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():w,this._data="",this._hitLimit=!1}put(T,E,b){this._hitLimit||(this._data+=(0,h.utf32ToString)(T,E,b),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let E=!1;if(this._hitLimit)E=!1;else if(T&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((b=>(this._params=w,this._data="",this._hitLimit=!1,b)));return this._params=w,this._data="",this._hitLimit=!1,E}}},2015:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),m=c(8742),u=c(6242),y=c(6351);class w{constructor(v){this.table=new Uint8Array(v)}setDefault(v,_){this.table.fill(v<<4|_)}add(v,_,S,A){this.table[_<<8|v]=S<<4|A}addMany(v,_,S,A){for(let L=0;L<v.length;L++)this.table[_<<8|v[L]]=S<<4|A}}o.TransitionTable=w;const T=160;o.VT500_TRANSITION_TABLE=(function(){const b=new w(4095),v=Array.apply(null,Array(256)).map(((D,k)=>k)),_=(D,k)=>v.slice(D,k),S=_(32,127),A=_(0,24);A.push(25),A.push.apply(A,_(28,32));const L=_(0,14);let M;for(M in b.setDefault(1,0),b.addMany(S,0,2,0),L)b.addMany([24,26,153,154],M,3,0),b.addMany(_(128,144),M,3,0),b.addMany(_(144,152),M,3,0),b.add(156,M,0,0),b.add(27,M,11,1),b.add(157,M,4,8),b.addMany([152,158,159],M,0,7),b.add(155,M,11,3),b.add(144,M,11,9);return b.addMany(A,0,3,0),b.addMany(A,1,3,1),b.add(127,1,0,1),b.addMany(A,8,0,8),b.addMany(A,3,3,3),b.add(127,3,0,3),b.addMany(A,4,3,4),b.add(127,4,0,4),b.addMany(A,6,3,6),b.addMany(A,5,3,5),b.add(127,5,0,5),b.addMany(A,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(S,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(_(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(S,7,0,7),b.addMany(A,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(_(64,127),3,7,0),b.addMany(_(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(_(48,60),4,8,4),b.addMany(_(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(_(32,64),6,0,6),b.add(127,6,0,6),b.addMany(_(64,127),6,0,0),b.addMany(_(32,48),3,9,5),b.addMany(_(32,48),5,9,5),b.addMany(_(48,64),5,0,6),b.addMany(_(64,127),5,7,0),b.addMany(_(32,48),4,9,5),b.addMany(_(32,48),1,9,2),b.addMany(_(32,48),2,9,2),b.addMany(_(48,127),2,10,0),b.addMany(_(48,80),1,10,0),b.addMany(_(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(_(96,127),1,10,0),b.add(80,1,11,9),b.addMany(A,9,0,9),b.add(127,9,0,9),b.addMany(_(28,32),9,0,9),b.addMany(_(32,48),9,9,12),b.addMany(_(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(A,11,0,11),b.addMany(_(32,128),11,0,11),b.addMany(_(28,32),11,0,11),b.addMany(A,10,0,10),b.add(127,10,0,10),b.addMany(_(28,32),10,0,10),b.addMany(_(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(_(32,48),10,9,12),b.addMany(A,12,0,12),b.add(127,12,0,12),b.addMany(_(28,32),12,0,12),b.addMany(_(32,48),12,9,12),b.addMany(_(48,64),12,0,11),b.addMany(_(64,127),12,12,13),b.addMany(_(64,127),10,12,13),b.addMany(_(64,127),9,12,13),b.addMany(A,13,13,13),b.addMany(S,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(T,0,2,0),b.add(T,8,5,8),b.add(T,6,0,6),b.add(T,11,0,11),b.add(T,13,13,13),b})();class E extends h.Disposable{constructor(v=o.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,S,A)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,S)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,_=[64,126]){let S=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=v.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<v.intermediates.length;++L){const M=v.intermediates.charCodeAt(L);if(32>M||M>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=M}}if(v.final.length!==1)throw new Error("final must be a single byte");const A=v.final.charCodeAt(0);if(_[0]>A||A>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return S<<=8,S|=A,S}identToString(v){const _=[];for(;v;)_.push(String.fromCharCode(255&v)),v>>=8;return _.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,_){const S=this._identifier(v,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const A=this._escHandlers[S];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,_){this._executeHandlers[v.charCodeAt(0)]=_}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,_){const S=this._identifier(v);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const A=this._csiHandlers[S];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,_){return this._dcsParser.registerHandler(this._identifier(v),_)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,_){return this._oscParser.registerHandler(v,_)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(v,_,S,A,L){this._parseStack.state=v,this._parseStack.handlers=_,this._parseStack.handlerPos=S,this._parseStack.transition=A,this._parseStack.chunkPos=L}parse(v,_,S){let A,L=0,M=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 k=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&R>-1){for(;R>=0&&(A=k[R](this._params),A!==!0);R--)if(A instanceof Promise)return this._parseStack.handlerPos=R,A}this._parseStack.handlers=[];break;case 4:if(S===!1&&R>-1){for(;R>=0&&(A=k[R](),A!==!0);R--)if(A instanceof Promise)return this._parseStack.handlerPos=R,A}this._parseStack.handlers=[];break;case 6:if(L=v[this._parseStack.chunkPos],A=this._dcsParser.unhook(L!==24&&L!==26,S),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=v[this._parseStack.chunkPos],A=this._oscParser.end(L!==24&&L!==26,S),A)return A;L===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 k=D;k<_;++k){switch(L=v[k],M=this._transitions.table[this.currentState<<8|(L<160?L:T)],M>>4){case 2:for(let P=k+1;;++P){if(P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|L];let B=R?R.length-1:-1;for(;B>=0&&(A=R[B](this._params),A!==!0);B--)if(A instanceof Promise)return this._preserveStack(3,R,B,M,k),A;B<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<_&&(L=v[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const H=this._escHandlers[this._collect<<8|L];let U=H?H.length-1:-1;for(;U>=0&&(A=H[U](),A!==!0);U--)if(A instanceof Promise)return this._preserveStack(4,H,U,M,k),A;U<0&&this._escHandlerFb(this._collect<<8|L),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|L,this._params);break;case 13:for(let P=k+1;;++P)if(P>=_||(L=v[P])===24||L===26||L===27||L>127&&L<T){this._dcsParser.put(v,k,P),k=P-1;break}break;case 14:if(A=this._dcsParser.unhook(L!==24&&L!==26),A)return this._preserveStack(6,[],0,M,k),A;L===27&&(M|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let P=k+1;;P++)if(P>=_||(L=v[P])<32||L>127&&L<T){this._oscParser.put(v,k,P),k=P-1;break}break;case 6:if(A=this._oscParser.end(L!==24&&L!==26),A)return this._preserveStack(5,[],0,M,k),A;L===27&&(M|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&M}}}o.EscapeSequenceParser=E},6242:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),m=c(482),u=[];o.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,w){this._handlers[y]===void 0&&(this._handlers[y]=[]);const T=this._handlers[y];return T.push(w),{dispose:()=>{const E=T.indexOf(w);E!==-1&&T.splice(E,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].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 y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,w,T){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(y,w,T);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(y,w,T))}start(){this.reset(),this._state=1}put(y,w,T){if(this._state!==3){if(this._state===1)for(;w<T;){const E=y[w++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&T-w>0&&this._put(y,w,T)}}end(y,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,E=this._active.length-1,b=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,T=w,b=this._stack.fallThrough,this._stack.paused=!1),!b&&T===!1){for(;E>=0&&(T=this._active[E].end(y),T!==!0);E--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,T;E--}for(;E>=0;E--)if(T=this._active[E].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",y);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,w,T){this._hitLimit||(this._data+=(0,m.utf32ToString)(y,w,T),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let w=!1;if(this._hitLimit)w=!1;else if(y&&(w=this._handler(this._data),w instanceof Promise))return w.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,w}}},8742:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(u){const y=new h;if(!u.length)return y;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const T=u[w];if(Array.isArray(T))for(let E=0;E<T.length;++E)y.addSubParam(T[E]);else y.addParam(T)}return y}constructor(u=32,y=32){if(this.maxLength=u,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(y),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 y=0;y<this.length;++y){u.push(this.params[y]);const w=this._subParamsIdx[y]>>8,T=255&this._subParamsIdx[y];T-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,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 y=this._subParamsIdx[u]>>8,w=255&this._subParamsIdx[u];return w-y>0?this._subParams.subarray(y,w):null}getSubParamsAll(){const u={};for(let y=0;y<this.length;++y){const w=this._subParamsIdx[y]>>8,T=255&this._subParamsIdx[y];T-w>0&&(u[y]=this._subParams.slice(w,T))}return u}addDigit(u){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,T=w[y-1];w[y-1]=~T?Math.min(10*T+u,c):u}}o.Params=h},5741:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const m={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(m),h.dispose=()=>this._wrappedAddonDispose(m),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){h=m;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),m=c(511);o.BufferApiView=class{constructor(u,y){this._buffer=u,this.type=y}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 y=this._buffer.lines.get(u);if(y)return new h.BufferLineApiView(y)}getNullCell(){return new m.CellData}}},3785:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,u){if(!(m<0||m>=this._line.length))return u?(this._line.loadCell(m,u),u):this._line.loadCell(m,new h.CellData)}translateToString(m,u,y){return this._line.translateToString(m,u,y)}}},8285:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),m=c(8460),u=c(844);class y extends u.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=y},7975:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(m=>h(m.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((m,u)=>h(m,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,o,c){var h=this&&this.__decorate||function(b,v,_,S){var A,L=arguments.length,M=L<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,v,_,S);else for(var D=b.length-1;D>=0;D--)(A=b[D])&&(M=(L<3?A(M):L>3?A(v,_,M):A(v,_))||M);return L>3&&M&&Object.defineProperty(v,_,M),M},m=this&&this.__param||function(b,v){return function(_,S){v(_,S,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=c(8460),y=c(844),w=c(5295),T=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let E=o.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(b){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(b.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(b,this))}resize(b,v){this.cols=b,this.rows=v,this.buffers.resize(b,v),this._onResize.fire({cols:b,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,v=!1){const _=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===b.fg&&S.getBg(0)===b.bg||(S=_.getBlankLine(b,v),this._cachedBlankLine=S),S.isWrapped=v;const A=_.ybase+_.scrollTop,L=_.ybase+_.scrollBottom;if(_.scrollTop===0){const M=_.lines.isFull;L===_.lines.length-1?M?_.lines.recycle().copyFrom(S):_.lines.push(S.clone()):_.lines.splice(L+1,0,S.clone()),M?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const M=L-A+1;_.lines.shiftElements(A+1,M-1,-1),_.lines.set(L,S.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(b,v,_){const S=this.buffer;if(b<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else b+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const A=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+b,S.ybase),0),A!==S.ydisp&&(v||this._onScroll.fire(S.ydisp))}};o.BufferService=E=h([m(0,T.IOptionsService)],E)},7994:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,o,c){var h=this&&this.__decorate||function(S,A,L,M){var D,k=arguments.length,R=k<3?A:M===null?M=Object.getOwnPropertyDescriptor(A,L):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,A,L,M);else for(var B=S.length-1;B>=0;B--)(D=S[B])&&(R=(k<3?D(R):k>3?D(A,L,R):D(A,L))||R);return k>3&&R&&Object.defineProperty(A,L,R),R},m=this&&this.__param||function(S,A){return function(L,M){A(L,M,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=c(2585),y=c(8460),w=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 E(S,A){let L=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(L|=64,L|=S.action):(L|=3&S.button,4&S.button&&(L|=64),8&S.button&&(L|=128),S.action===32?L|=32:S.action!==0||A||(L|=3)),L}const b=String.fromCharCode,v={DEFAULT:S=>{const A=[E(S,!1)+32,S.col+32,S.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${b(A[0])}${b(A[1])}${b(A[2])}`},SGR:S=>{const A=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.col};${S.row}${A}`},SGR_PIXELS:S=>{const A=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.x};${S.y}${A}`}};let _=o.CoreMouseService=class extends w.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 y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(T))this.addProtocol(L,T[L]);for(const L of Object.keys(v))this.addEncoding(L,v[L]);this.reset()}addProtocol(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,L){if(L){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}};o.CoreMouseService=_=h([m(0,u.IBufferService),m(1,u.ICoreService)],_)},6975:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var M,D=arguments.length,k=D<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var R=_.length-1;R>=0;R--)(M=_[R])&&(k=(D<3?M(k):D>3?M(S,A,k):M(S,A))||k);return D>3&&k&&Object.defineProperty(S,A,k),k},m=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=c(1439),y=c(8460),w=c(844),T=c(2585),E=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=o.CoreService=class extends w.Disposable{constructor(_,S,A){super(),this._bufferService=_,this._logService=S,this._optionsService=A,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(b)}reset(){this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(b)}triggerDataEvent(_,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 "${_}"`,(()=>_.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(_))}};o.CoreService=v=h([m(0,T.IBufferService),m(1,T.ILogService),m(2,T.IOptionsService)],v)},9074:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),m=c(8460),u=c(844),y=c(6106);let w=0,T=0;class E extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((_=>_==null?void 0:_.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const S=new b(_);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 _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,S,A){let L=0,M=0;for(const D of this._decorations.getKeyIterator(S))L=D.options.x??0,M=L+(D.options.width??1),_>=L&&_<M&&(!A||(D.options.layer??"bottom")===A)&&(yield D)}forEachDecorationAtCell(_,S,A,L){this._decorations.forEachByKey(S,(M=>{w=M.options.x??0,T=w+(M.options.width??1),_>=w&&_<T&&(!A||(M.options.layer??"bottom")===A)&&L(M)}))}}o.DecorationService=E;class b extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(_){super(),this.options=_,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),m=c(8343);class u{constructor(...w){this._entries=new Map;for(const[T,E]of w)this.set(T,E)}set(w,T){const E=this._entries.get(w);return this._entries.set(w,T),E}forEach(w){for(const[T,E]of this._entries.entries())w(T,E)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(y,w){this._services.set(y,w)}getService(y){return this._services.get(y)}createInstance(y,...w){const T=(0,m.getServiceDependencies)(y).sort(((v,_)=>v.index-_.index)),E=[];for(const v of T){const _=this._services.get(v.id);if(!_)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${v.id}.`);E.push(_)}const b=T.length>0?T[0].index:w.length;if(w.length!==b)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${b+1} conflicts with ${w.length} static arguments`);return new y(...w,...E)}}},7866:function(f,o,c){var h=this&&this.__decorate||function(b,v,_,S){var A,L=arguments.length,M=L<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,v,_,S);else for(var D=b.length-1;D>=0;D--)(A=b[D])&&(M=(L<3?A(M):L>3?A(v,_,M):A(v,_))||M);return L>3&&M&&Object.defineProperty(v,_,M),M},m=this&&this.__param||function(b,v){return function(_,S){v(_,S,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=c(844),y=c(2585),w={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let T,E=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let v=0;v<b.length;v++)typeof b[v]=="function"&&(b[v]=b[v]())}_log(b,v,_){this._evalLazyOptionalParams(_),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,..._)}trace(b,...v){var _;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))??console.log,b,v)}debug(b,...v){var _;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))??console.log,b,v)}info(b,...v){var _;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))??console.info,b,v)}warn(b,...v){var _;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))??console.warn,b,v)}error(b,...v){var _;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))??console.error,b,v)}};o.LogService=E=h([m(0,y.IOptionsService)],E),o.setTraceLogger=function(b){T=b},o.traceCall=function(b,v,_){if(typeof _.value!="function")throw new Error("not supported");const S=_.value;_.value=function(...A){if(T.logLevel!==y.LogLevelEnum.TRACE)return S.apply(this,A);T.trace(`GlyphRenderer#${S.name}(${A.map((M=>JSON.stringify(M))).join(", ")})`);const L=S.apply(this,A);return T.trace(`GlyphRenderer#${S.name} return`,L),L}}},7302:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),m=c(844),u=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const y=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends m.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...o.DEFAULT_OPTIONS};for(const v in E)if(v in b)try{const _=E[v];b[v]=this._sanitizeAndValidateOption(v,_)}catch(_){console.error(_)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,b){return this.onOptionChange((v=>{v===E&&b(this.rawOptions[E])}))}onMultipleOptionChange(E,b){return this.onOptionChange((v=>{E.indexOf(v)!==-1&&b()}))}_setupOptions(){const E=v=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},b=(v,_)=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);_=this._sanitizeAndValidateOption(v,_),this.rawOptions[v]!==_&&(this.rawOptions[v]=_,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const _={get:E.bind(this,v),set:b.bind(this,v)};Object.defineProperty(this.options,v,_)}}_sanitizeAndValidateOption(E,b){switch(E){case"cursorStyle":if(b||(b=o.DEFAULT_OPTIONS[E]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${E}`);break;case"wordSeparator":b||(b=o.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=y.includes(b)?b:o.DEFAULT_OPTIONS[E];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${E} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${E} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}o.OptionsService=w},2660:function(f,o,c){var h=this&&this.__decorate||function(w,T,E,b){var v,_=arguments.length,S=_<3?T:b===null?b=Object.getOwnPropertyDescriptor(T,E):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,T,E,b);else for(var A=w.length-1;A>=0;A--)(v=w[A])&&(S=(_<3?v(S):_>3?v(T,E,S):v(T,E))||S);return _>3&&S&&Object.defineProperty(T,E,S),S},m=this&&this.__param||function(w,T){return function(E,b){T(E,b,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=c(2585);let y=o.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const T=this._bufferService.buffer;if(w.id===void 0){const A=T.addMarker(T.ybase+T.y),L={data:w,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(L,A))),this._dataByLinkId.set(L.id,L),L.id}const E=w,b=this._getEntryIdKey(E),v=this._entriesWithId.get(b);if(v)return this.addLineToLink(v.id,T.ybase+T.y),v.id;const _=T.addMarker(T.ybase+T.y),S={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(S,_))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(w,T){const E=this._dataByLinkId.get(w);if(E&&E.lines.every((b=>b.line!==T))){const b=this._bufferService.buffer.addMarker(T);E.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(E,b)))}}getLinkData(w){var T;return(T=this._dataByLinkId.get(w))==null?void 0:T.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,T){const E=w.lines.indexOf(T);E!==-1&&(w.lines.splice(E,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};o.OscLinkService=y=h([m(0,u.IBufferService)],y)},8343:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(m){return m[h]||[]},o.createDecorator=function(m){if(o.serviceRegistry.has(m))return o.serviceRegistry.get(m);const u=function(y,w,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,b,v){b[c]===b?b[h].push({id:E,index:v}):(b[h]=[{id:E,index:v}],b[c]=b)})(u,y,T)};return u.toString=()=>m,o.serviceRegistry.set(m,u),u}},2585:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var m;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(m||(o.LogLevelEnum=m={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=c(8460),m=c(225);class u{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,T,E=!1){return(16777215&w)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new m.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let T=0,E=0;const b=w.length;for(let v=0;v<b;++v){let _=w.charCodeAt(v);if(55296<=_&&_<=56319){if(++v>=b)return T+this.wcwidth(_);const L=w.charCodeAt(v);56320<=L&&L<=57343?_=1024*(_-55296)+L-56320+65536:T+=this.wcwidth(L)}const S=this.charProperties(_,E);let A=u.extractWidth(S);u.extractShouldJoin(S)&&(A-=u.extractWidth(E)),T+=A,E=S}return T}charProperties(w,T){return this._activeProvider.charProperties(w,T)}}o.UnicodeService=u}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var p={};return(()=>{var f=p;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const o=d(9042),c=d(3236),h=d(844),m=d(5741),u=d(8285),y=d(7975),w=d(7090),T=["cols","rows"];class E extends h.Disposable{constructor(v){super(),this._core=this.register(new c.Terminal(v)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const _=A=>this._core.options[A],S=(A,L)=>{this._checkReadonlyOptions(A),this._core.options[A]=L};for(const A in this._core.options){const L={get:_.bind(this,A),set:S.bind(this,A)};Object.defineProperty(this._publicOptions,A,L)}}_checkReadonlyOptions(v){if(T.includes(v))throw new Error(`Option "${v}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new y.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const _ in v)this._publicOptions[_]=v[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,_=!0){this._core.input(v,_)}resize(v,_){this._verifyIntegers(v,_),this._core.resize(v,_)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,_,S){this._verifyIntegers(v,_,S),this._core.select(v,_,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,_){this._verifyIntegers(v,_),this._core.selectLines(v,_)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,_){this._core.write(v,_)}writeln(v,_){this._core.write(v),this._core.write(`\r
|
|
59
|
-
`,_)}paste(v){this._core.paste(v)}refresh(v,_){this._verifyIntegers(v,_),this._core.refresh(v,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return o}_verifyIntegers(...v){for(const _ of v)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const _ of v)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}f.Terminal=E})(),p})()))})(Xu)),Xu.exports}var g1=m1();class _1{constructor(r,s){Rm(this,"socket");const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`;this.socket=new WebSocket(d),this.socket.addEventListener("message",p=>{var o,c,h;let f;try{f=JSON.parse(p.data)}catch(m){(o=s.onError)==null||o.call(s,`Terminal message parse failed for session ${r}. Reason: ${jo(m)}`);return}f.type==="output"?s.onOutput(f.data):f.type==="error"?(c=s.onError)==null||c.call(s,f.message):(h=s.onStatus)==null||h.call(s,f)}),this.socket.addEventListener("error",()=>{var p;(p=s.onError)==null||p.call(s,`Terminal WebSocket connection failed for session ${r}. URL: ${d}. Check that the VCM backend is running and the session still exists.`)})}sendInput(r){this.send({type:"input",data:r})}resize(r,s){this.send({type:"resize",cols:r,rows:s})}close(){this.socket.close()}send(r){const s=JSON.stringify(r);if(this.socket.readyState===WebSocket.OPEN){this.socket.send(s);return}this.socket.addEventListener("open",()=>this.socket.send(s),{once:!0})}}function No({sessionId:t,active:r=!0,onEvent:s}){const l=te.useRef(null),d=te.useRef(null),p=te.useRef(null),f=te.useRef(null),o=te.useRef(null),c=te.useRef(""),h=te.useRef(""),m=te.useRef(r),u=te.useRef(s),[y,w]=te.useState("idle");function T(v){w(v),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null,w("idle")},1600)}async function E(){const v=f.current,_=Gm(v,c.current,h.current);if(!_){T("empty"),v==null||v.focus();return}T(await Wm(_)?"copied":"failed"),v==null||v.focus()}function b(v={}){const _=l.current,S=d.current,A=p.current,L=f.current;if(!_||!S||!A||!L)return!1;const M=_.getBoundingClientRect();return M.width<Km||M.height<Ym||(A.fit(),L.cols<Xm||L.rows<Qm)?!1:(S.resize(L.cols,L.rows),v.focus&&L.focus(),!0)}return te.useEffect(()=>{u.current=s},[s]),te.useEffect(()=>{m.current=r},[r]),te.useEffect(()=>{var V;if(!l.current)return;const v=new g1.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:C1}),_=new f1.FitAddon;v.loadAddon(_),v.loadAddon(new p1.WebLinksAddon),v.open(l.current),f.current=v,p.current=_;const S=v.onSelectionChange(()=>{const K=v.getSelection();K&&(c.current=K,h.current="")}),A=v.parser.registerOscHandler(52,K=>{const G=S1(K);return G?(h.current=G,u_(G).then(Y=>{T(Y?"copied":"ready")}),!0):!1}),L=K=>{const G=Gm(v,c.current,h.current);!G||!K.clipboardData||(K.clipboardData.setData("text/plain",G),K.preventDefault(),T("copied"))};(V=v.element)==null||V.addEventListener("copy",L),v.attachCustomKeyEventHandler(K=>{if(!y1(K))return!0;const G=v.getSelection()||c.current;return G?(K.preventDefault(),K.stopPropagation(),Wm(G).then(Y=>{T(Y?"copied":"failed")}),!1):!0});const M=l.current.getBoundingClientRect();M.width>=Km&&M.height>=Ym&&_.fit();const D=new _1(t,{onOutput(K){v.write(K)},onStatus(K){var G;(G=u.current)==null||G.call(u,K.type)},onError(K){var G;v.writeln(`\r
|
|
60
|
-
[VCM] ${K}`),(G=u.current)==null||G.call(u,K)}});d.current=D,v.cols>=Xm&&v.rows>=Qm&&D.resize(v.cols,v.rows);const k=v.onData(K=>{D.sendInput(K)});let R=0,B=0,H=0;const U=()=>{R&&window.cancelAnimationFrame(R),R=window.requestAnimationFrame(()=>{R=0,b({focus:m.current})})},P=new ResizeObserver(()=>{U()});return P.observe(l.current),B=window.requestAnimationFrame(U),H=window.setTimeout(U,120),()=>{var K;R&&window.cancelAnimationFrame(R),B&&window.cancelAnimationFrame(B),H&&window.clearTimeout(H),P.disconnect(),(K=v.element)==null||K.removeEventListener("copy",L),S.dispose(),A.dispose(),k.dispose(),D.close(),v.dispose(),d.current=null,f.current=null,p.current=null}},[t]),te.useEffect(()=>{if(!r)return;const v=[],_=[];return v.push(window.requestAnimationFrame(()=>{b({focus:!0}),v.push(window.requestAnimationFrame(()=>b({focus:!0})))})),_.push(window.setTimeout(()=>b({focus:!0}),160)),_.push(window.setTimeout(()=>b({focus:!0}),360)),()=>{for(const S of v)window.cancelAnimationFrame(S);for(const S of _)window.clearTimeout(S)}},[r]),te.useEffect(()=>{const v=()=>{m.current&&b()};return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]),te.useEffect(()=>()=>{o.current!==null&&window.clearTimeout(o.current)},[]),x.jsxs("div",{className:"terminal-frame-shell",children:[x.jsx("div",{className:"terminal-frame",ref:l,onClick:()=>{var v;return(v=f.current)==null?void 0:v.focus()}}),x.jsx("button",{type:"button",className:`terminal-copy-button is-${y}`,title:"Copy selected terminal text",onMouseDown:Vm,onPointerDown:Vm,onClick:()=>void E(),children:v1(y)})]})}function v1(t){return t==="copied"?"Copied":t==="empty"?"No selection":t==="failed"?"Copy failed":t==="ready"?"Copy ready":"Copy"}function Gm(t,r,s){return(t==null?void 0:t.getSelection())||s||r}function y1(t){return t.type==="keydown"&&t.metaKey&&!t.ctrlKey&&!t.altKey&&t.key.toLowerCase()==="c"}function S1(t){const r=t.split(";"),s=r.length>=2?r.slice(1).join(";"):"";if(!s||s==="?")return null;try{const l=window.atob(s),d=new Uint8Array(l.length);for(let p=0;p<l.length;p+=1)d[p]=l.charCodeAt(p);return new TextDecoder().decode(d)}catch{return null}}function Vm(t){t.preventDefault(),t.stopPropagation()}async function Wm(t){return await u_(t)?!0:b1(t)}async function u_(t){var r;try{if((r=navigator.clipboard)!=null&&r.writeText)return await navigator.clipboard.writeText(t),!0}catch{return!1}return!1}function b1(t){const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.top="0",r.style.left="-9999px",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{return document.execCommand("copy")}finally{r.remove()}}const Km=160,Ym=80,Xm=20,Qm=5,C1={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"},h_=[{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"}],f_=[{value:"default",label:"Default",description:"Account default"},{value:"fable",label:"Fable",description:"Claude Fable"},{value:"opus",label:"Opus",description:"Latest Opus"},{value:"sonnet",label:"Sonnet",description:"Latest Sonnet"}],w1=[{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"}],d_=[...w1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function Yn({status:t}){return x.jsx("span",{className:`status-badge status-${t}`,children:t.replaceAll("_"," ")})}function jh({role:t,session:r,permissionMode:s,model:l,effort:d,busy:p=!1,onPermissionModeChange:f,onModelChange:o,onEffortChange:c,onStart:h,onResume:m,onStop:u,onRestart:y,onNotifyHarnessUpdated:w}){const T=(r==null?void 0:r.status)==="running",E=!!(r!=null&&r.claudeSessionId&&!T),b=!T&&!(r!=null&&r.claudeSessionId),v=!!(r!=null&&r.harnessOutdated);return x.jsxs("div",{className:"session-controls",children:[x.jsxs("label",{className:"session-option-field permission-mode-field",children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:s,onChange:_=>f(_.target.value),children:h_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field model-field",children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:l,onChange:_=>o(_.target.value),children:f_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field effort-field",children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:d,onChange:_=>c(_.target.value),children:d_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("div",{className:"session-toolbar",children:[x.jsx("button",{type:"button",disabled:p||!b,onClick:h,children:"Start"}),x.jsx("button",{type:"button",disabled:p||!E,onClick:m,children:"Resume"}),x.jsx("button",{type:"button",disabled:p||!r,onClick:y,children:"Restart"}),x.jsx("button",{type:"button",disabled:p||!r,onClick:u,children:"Stop"})]}),v?x.jsxs("div",{className:"session-harness-notice",children:[x.jsx(Yn,{status:"outdated"}),x.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),x.jsx("button",{type:"button",disabled:p||!T||!w,onClick:w,children:"Notify role"})]}):null]})}function x1({busy:t,effort:r,model:s,open:l,permissionMode:d,taskSlug:p,bootstrapStatus:f,engineerSession:o,status:c,feedbackState:h,memoryState:m,onClose:u,onEffortChange:y,onModelChange:w,onPermissionModeChange:T,onEngineerResume:E,onEngineerRestart:b,onEngineerStart:v,onEngineerStop:_,onEngineerNotifyHarnessUpdated:S,onSendFeedback:A,onOpenRepositoryDiff:L,onReviewTaskHarness:M,onRefresh:D,onMemoryStateChange:k}){const[R,B]=te.useState(null),[H,U]=te.useState(!1),[P,V]=te.useState(null),[K,G]=te.useState(""),[Y,ee]=te.useState(!1),[z,j]=te.useState(!1),[,N]=Li(null),[$,I]=te.useState(null),ie=(c==null?void 0:c.files)??[],me=ie.filter(ge=>ge.kind.startsWith("agent-")),ve=me.filter(ge=>Jm(ge)),Q=me.filter(ge=>!Jm(ge)),q=ie.filter(ge=>ge.kind.startsWith("skill-")),ce=ie.filter(ge=>ge.kind.startsWith("tool-")),ae=ie.filter(ge=>ge.kind==="root-claude"||ge.kind==="gitignore"||ge.kind==="pull-request-template"),be=!!(P&&K!==P.content);te.useEffect(()=>{l||(B(null),U(!1),V(null),G(""),ee(!1),N(null))},[ie,l,R]),te.useEffect(()=>{if(!l||!R||!p||R.startsWith("memory-review:"))return;let ge=!1;return j(!0),N(null),ee(!1),(H?ye.getMemoryFileContent(p,R).then(Ke=>({path:Ke.path,title:Ke.title,content:Ke.content,editable:Ke.editable,source:"memory"})):ye.getHarnessFileContent(p,R).then(Ke=>({path:Ke.path,title:Ke.title,content:Ke.content,editable:Ke.editable,readonlyReason:Ke.readonlyReason,source:"harness"}))).then(Ke=>{ge||(V(Ke),G(Ke.content))}).catch(Ke=>{ge||N(ut(`Load harness file ${R}`,Ke))}).finally(()=>{ge||j(!1)}),()=>{ge=!0}},[l,H,R,p]);async function Ee(){if(!(!P||!P.editable||!be||!p)){j(!0),N(null);try{if(P.source==="memory"){const ge=await ye.updateMemoryFileContent(p,P.path,{content:K}),He=await ye.getMemoryFileContent(p,P.path);V({path:He.path,title:He.title,content:He.content,editable:!0,source:"memory"}),G(He.content),k(ge)}else{const ge=await ye.updateHarnessFileContent(p,P.path,{content:K});V({path:ge.file.path,title:ge.file.title,content:ge.file.content,editable:ge.file.editable,readonlyReason:ge.file.readonlyReason,source:"harness"}),G(ge.file.content)}ee(!1),D()}catch(ge){N(ut(`Save harness file ${P.path}`,ge))}finally{j(!1)}}}function xe(){B(null),U(!1),V(null),G(""),ee(!1),N(null)}async function de(ge){N(null);try{await R1(ge),I(ge),window.setTimeout(()=>{I(He=>He===ge?null:He)},1200)}catch(He){N(ut(`Copy harness file path ${ge}`,He))}}function Me(ge){const He=`memory-review:${ge.runId}`;B(He),U(!1),V({path:ge.runId,title:`Memory Diff: ${ge.runId}`,content:ge.diff||"No memory diff was recorded.",editable:!1,readonlyReason:`Applied by ${ge.source}. Status: ${ge.status}.`,source:"memory-diff"}),G(ge.diff||"No memory diff was recorded."),ee(!1)}async function $e(ge){if(!(!p||!ge.canRevert||!window.confirm(`Revert memory changes from ${ge.runId}?`))){j(!0),N(null);try{const He=await ye.revertMemoryRun({taskSlug:p,runId:ge.runId});k(He),xe()}catch(He){N(ut(`Revert memory review ${ge.runId}`,He))}finally{j(!1)}}}async function Ae(){if(p){j(!0),N(null);try{k(await ye.retryMemoryReview({taskSlug:p}))}catch(ge){N(ut("Retry Auto Memory review",ge))}finally{j(!1)}}}return l?x.jsx(x.Fragment,{children:x.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:x.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[x.jsxs("header",{className:"harness-studio-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Harness Studio"}),p?null:x.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),x.jsxs("div",{className:"harness-studio-header-actions",children:[x.jsx("button",{type:"button",disabled:t||!p,onClick:M,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:t,onClick:L,children:"Review Diff"}),x.jsx("button",{type:"button",disabled:t,onClick:D,children:"Refresh"}),x.jsx("button",{type:"button",onClick:u,children:"Close"})]})]}),x.jsxs("div",{className:"harness-studio-layout",children:[x.jsx("aside",{className:R?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:R?x.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[x.jsxs("header",{className:"harness-studio-file-editor-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:(P==null?void 0:P.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(P==null?void 0:P.path)??R})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[P?x.jsx(Yn,{status:P.editable?"ok":"unknown"}):null,Y?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:z||!p||!(P!=null&&P.editable)||!be,onClick:()=>void Ee(),children:"Save"}),x.jsx("button",{type:"button",disabled:z,onClick:()=>{G((P==null?void 0:P.content)??""),ee(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:z||!p||!(P!=null&&P.editable),onClick:()=>ee(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:xe,children:"Return"})]})]}),P!=null&&P.readonlyReason?x.jsx("p",{className:"muted",children:P.readonlyReason}):null,x.jsx("textarea",{className:Y?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:K,spellCheck:!1,readOnly:!Y,disabled:z,onChange:ge=>G(ge.target.value)})]}):x.jsxs("div",{className:"harness-studio-left-scroll",children:[x.jsx(qa,{title:"VCM Roles",files:ve,selectedPath:R,copiedPath:$,onCopy:ge=>void de(ge),onSelect:ge=>{U(!1),B(ge)}}),x.jsx(qa,{title:"Auxiliary Roles",files:Q,selectedPath:R,copiedPath:$,onCopy:ge=>void de(ge),onSelect:ge=>{U(!1),B(ge)}}),x.jsx(k1,{state:m,busy:z,copiedPath:$,onCopy:ge=>void de(ge),onSelect:ge=>{U(!0),B(ge)},onViewDiff:Me,onRevert:ge=>void $e(ge),onRetry:()=>void Ae()}),x.jsx(E1,{state:h,busy:t,taskSlug:p,onSend:A}),x.jsx(tl,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(Os,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),x.jsx(Os,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),x.jsx(Os,{label:"Managed files",value:String(ie.length)}),x.jsx(Os,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),x.jsx(Os,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),x.jsx(Os,{label:"Engineer",value:Zm(o)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(ge=>x.jsx("li",{children:ge},ge))}):null]})}),x.jsx(qa,{title:"Skills",files:q,selectedPath:R,copiedPath:$,onCopy:ge=>void de(ge),onSelect:ge=>{U(!1),B(ge)},collapsible:!0}),x.jsx(qa,{title:"Root Context",files:ae,selectedPath:R,copiedPath:$,onCopy:ge=>void de(ge),onSelect:ge=>{U(!1),B(ge)},collapsible:!0}),x.jsx(qa,{title:"Tools",files:ce,selectedPath:R,copiedPath:$,onCopy:ge=>void de(ge),onSelect:ge=>{U(!1),B(ge)},collapsible:!0}),x.jsx(tl,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(ge=>x.jsxs("li",{children:[x.jsx("span",{children:ge.path??ge.label}),x.jsx(Yn,{status:ge.status})]},ge.key)))??x.jsx("li",{children:x.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),x.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[x.jsxs("div",{className:"harness-studio-engineer-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:"Harness Engineer"}),x.jsx("p",{className:"muted",children:Zm(o)})]}),x.jsx(Yn,{status:(o==null?void 0:o.status)??"unknown"})]}),x.jsx(jh,{role:"harness-engineer",session:o??void 0,permissionMode:d,model:s,effort:r,busy:t,onPermissionModeChange:T,onModelChange:w,onEffortChange:y,onStart:v,onResume:E,onRestart:b,onStop:_,onNotifyHarnessUpdated:S}),x.jsx("div",{className:"harness-engineer-terminal",children:(o==null?void 0:o.status)==="running"?x.jsx(No,{sessionId:o.id,active:l},o.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:o!=null&&o.claudeSessionId?"Resume this task Harness Engineer session.":"Start this task Harness Engineer session."})]})})]})]})]})})}):null}function Os({label:t,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:t}),x.jsx("strong",{children:r})]})}function E1({state:t,busy:r,taskSlug:s,onSend:l}){return x.jsx(tl,{title:`Harness Feedback Inbox (${(t==null?void 0:t.queuedCount)??0})`,children:x.jsx("ul",{className:"harness-studio-doc-list",children:t!=null&&t.pending.length?t.pending.map(d=>x.jsxs("li",{children:[x.jsx("span",{title:d.path,children:d.title}),x.jsx("code",{children:d.reporterRole??"unknown"}),x.jsx("button",{type:"button",title:"Send this feedback to Harness Engineer",disabled:r||!s,onClick:()=>l(d.path),children:"Send"})]},d.path)):x.jsx("li",{children:x.jsx("span",{children:"No pending harness feedback."})})})})}function qa({title:t,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:p,collapsible:f=!1}){const o=x.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(c=>x.jsxs("li",{className:c.path===s?"selected":void 0,children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:c.path,onClick:()=>p(c.path),children:c.path}),x.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${c.path}`,onClick:()=>d(c.path),children:l===c.path?"Copied":"Copy"}),x.jsx(Yn,{status:c.action})]},c.path)):x.jsx("li",{children:x.jsx("span",{children:"No files."})})});return f?x.jsx(tl,{title:t,children:o}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:t}),o]})}function k1({state:t,busy:r,copiedPath:s,onCopy:l,onSelect:d,onViewDiff:p,onRevert:f,onRetry:o}){var c,h;return x.jsxs(tl,{title:"Memory",children:[x.jsxs("div",{className:"harness-memory-status",children:[x.jsx("span",{children:"Status"}),x.jsx(Yn,{status:T1(t==null?void 0:t.status)}),(c=t==null?void 0:t.active)!=null&&c.currentRole?x.jsxs("span",{className:"muted",children:["Collecting ",t.active.currentRole]}):null,(h=t==null?void 0:t.active)!=null&&h.error?x.jsx("p",{className:"warnings",children:t.active.error}):null,(t==null?void 0:t.status)==="failed"?x.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,onClick:o,children:"Retry"}):null]}),x.jsx("ol",{className:"harness-studio-file-list",children:(t==null?void 0:t.files.map(m=>x.jsxs("li",{children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:m.path,onClick:()=>d(m.path),children:m.path}),x.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${m.path}`,onClick:()=>l(m.path),children:s===m.path?"Copied":"Copy"}),x.jsx("span",{className:"muted",children:A1(m.sizeBytes)})]},m.path)))??x.jsx("li",{children:x.jsx("span",{children:"No memory files."})})}),t!=null&&t.runs.length?x.jsxs("div",{className:"harness-memory-runs",children:[x.jsx("h4",{children:"Applied History"}),x.jsx("ol",{className:"harness-studio-file-list",children:t.runs.map(m=>x.jsxs("li",{children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",onClick:()=>p(m),children:m.runId}),x.jsx(Yn,{status:m.status==="applied"?"ok":m.status==="failed"?"failed":"unknown"}),m.canRevert?x.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,onClick:()=>f(m),children:"Revert"}):null]},m.runId))})]}):null]})}function tl({title:t,children:r}){return x.jsxs("details",{className:"harness-studio-section harness-studio-collapsible-section",children:[x.jsxs("summary",{children:[x.jsx("h3",{children:t}),x.jsx("span",{children:"Show"})]}),x.jsx("div",{className:"harness-studio-collapsible-content",children:r})]})}function Jm(t){return t.kind==="agent-project-manager"||t.kind==="agent-architect"||t.kind==="agent-coder"||t.kind==="agent-tester"||t.kind==="agent-gate-reviewer"}function Zm(t){return t?t.status==="running"?`${t.status} / ${t.activityStatus??"idle"}`:t.status:"not started"}function A1(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}function T1(t){return t==="collecting"||t==="reviewing"?"running":t==="failed"?"failed":t==="idle"?"ok":"unknown"}async function R1(t){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(t);return}const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function D1({open:t,taskSlug:r,onClose:s}){var k;const[l,d]=te.useState(null),[p,f]=te.useState(null),[o,c]=te.useState(null),[h,m]=te.useState(null),[u,y]=te.useState(null),[w,T]=te.useState(!1),[E,b]=te.useState(!1),[,v]=Li(null),[_,S]=te.useState(null),A=te.useMemo(()=>(l==null?void 0:l.files.find(R=>R.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function L(R=p){var B;T(!0),v(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await ye.getRepositoryDiff(r,R);d(H),m(null),f(((B=H.commit)==null?void 0:B.sha)??null),c(U=>{var P;return U&&H.files.some(V=>V.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){v(ut(R?`Load commit diff ${R}`:"Load latest commit diff",H))}finally{T(!1)}}te.useEffect(()=>{t&&(f(null),S(null),L(null))},[t,r]);async function M(R){y(R),v(null);try{if(!r)throw new Error("Create or select a task before reviewing file diffs.");const B=await ye.getRepositoryFileDiff(r,R);m(B),c(R)}catch(B){v(ut(`Load task file diff for ${R}`,B))}finally{y(null)}}async function D(){if(v(null),S(null),!r){v("Create or select a task before merging the task branch.");return}if(!l){v("Load the commit diff before merging the task branch.");return}const R=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.targetBranch}?`,"","VCM will run a fast-forward merge only.","The merge will fail if the task worktree or connected repository has uncommitted changes.","If the connected repository branch has diverged, rebase or merge manually first.","","Commits:",...R].join(`
|
|
61
|
-
`))){b(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);S(H.changed?`Merged ${H.sourceBranch} into ${H.targetBranch} at ${H.afterSha.slice(0,12)}.`:`${H.targetBranch} already includes ${H.sourceBranch}.`),f(null),await L(null)}catch(H){v(ut("Merge task branch to connected repository branch",H))}finally{b(!1)}}}return t?x.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:x.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[x.jsxs("header",{className:"repository-diff-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Commit Diff"}),x.jsx("p",{children:l?`${((k=l.commit)==null?void 0:k.shortSha)??"HEAD"} · ${l.summary.totalFiles} files · +${l.summary.additions} / -${l.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),x.jsxs("div",{className:"repository-diff-header-actions",children:[x.jsxs("label",{className:"repository-diff-commit-picker",children:[x.jsx("span",{children:"Commit"}),x.jsx("select",{value:p??"",disabled:w||!(l!=null&&l.commits.length),onChange:R=>{const B=R.target.value||null;f(B),L(B)},children:l==null?void 0:l.commits.map(R=>x.jsxs("option",{value:R.sha,children:[R.shortSha," · ",R.subject]},R.sha))})]}),x.jsx("button",{type:"button",disabled:w,onClick:()=>void L(),children:"Refresh"}),x.jsx("button",{type:"button",disabled:w||E||!r||!(l!=null&&l.commits.length),onClick:()=>void D(),children:E?"Merging...":"Merge to Main"}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),_?x.jsx("p",{className:"success-banner",children:_}):null,l!=null&&l.warnings.length?x.jsx("ul",{className:"warnings repository-diff-warnings",children:l.warnings.map(R=>x.jsx("li",{children:R},R))}):null,x.jsxs("div",{className:"repository-diff-body",children:[x.jsxs("aside",{className:"repository-diff-sidebar",children:[x.jsx(M1,{report:l,busy:w}),x.jsxs("ol",{className:"repository-diff-file-list",children:[l==null?void 0:l.files.map(R=>x.jsx("li",{className:[(A==null?void 0:A.path)===R.path&&!h?"selected":"",(h==null?void 0:h.path)===R.path?"task-diff-selected":""].filter(Boolean).join(" "),children:x.jsxs("div",{className:"repository-diff-file-row",children:[x.jsxs("button",{className:"repository-diff-file-select",type:"button",onClick:()=>{m(null),c(R.path)},children:[x.jsx("span",{children:R.path}),x.jsxs("small",{children:[yh(R.status)," · ",eg(R.stage)," · ",vh(R.category)]})]}),x.jsx("button",{className:"repository-diff-task-file-button",type:"button",disabled:u===R.path,title:"View this file diff across the whole task worktree",onClick:()=>void M(R.path),children:u===R.path?"...":"Task diff"})]})},R.path)),l&&l.files.length===0?x.jsx("li",{className:"repository-diff-empty",children:l.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),x.jsx("main",{className:"repository-diff-main",children:h?x.jsx(L1,{diff:h,onClose:()=>m(null)}):A?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:A.path}),x.jsxs("p",{children:[vh(A.category)," · ",yh(A.status)," · ",eg(A.stage)]})]}),x.jsxs("span",{className:"repository-diff-stats",children:["+",A.additions," / -",A.deletions]})]}),A.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,A.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${A.path} diff`,children:p_(A.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:w?"Loading commit diff...":"No diff selected."})})]})]})}):null}function M1({report:t,busy:r}){var l;const s=t==null?void 0:t.summary;return x.jsxs("div",{className:"repository-diff-summary",children:[x.jsx("strong",{children:r?"Loading":t?"Commit changes":"Not loaded"}),s?x.jsxs(x.Fragment,{children:[x.jsxs("span",{children:[s.harnessFiles," harness files"]}),x.jsxs("span",{children:[s.productCodeFiles," product code files"]}),x.jsxs("span",{children:[s.committedFiles," committed files"]}),x.jsxs("span",{children:[(t==null?void 0:t.commits.length)??0," branch commits"]}),x.jsx("span",{children:((l=t==null?void 0:t.commit)==null?void 0:l.subject)??"HEAD"})]}):null]})}function L1({diff:t,onClose:r}){const s=t.file;return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:t.path}),x.jsxs("p",{children:["Task diff · ",t.targetBranch," ",t.baseSha.slice(0,12)," → ",t.sourceBranch," worktree ",t.headSha.slice(0,12)]})]}),x.jsxs("div",{className:"repository-diff-task-file-actions",children:[s?x.jsxs("span",{className:"repository-diff-stats",children:["+",s.additions," / -",s.deletions]}):null,x.jsx("button",{type:"button",onClick:r,children:"Commit diff"})]})]}),t.warnings.length>0?x.jsx("ul",{className:"warnings repository-diff-warnings",children:t.warnings.map(l=>x.jsx("li",{children:l},l))}):null,s?x.jsxs(x.Fragment,{children:[x.jsxs("p",{className:"muted",children:[vh(s.category)," · ",yh(s.status)," · whole task comparison"]}),s.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,s.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${t.path} task diff`,children:p_(s.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function vh(t){switch(t){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 eg(t){return t.replaceAll("_"," ")}function yh(t){return t.replaceAll("_"," ")}function p_(t){return t.split(`
|
|
62
|
-
`).filter(r=>!B1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${O1(r)}`,children:r||" "},`${s}:${r}`))}function O1(t){return t.startsWith("+")&&!t.startsWith("+++")?"repository-diff-line-added":t.startsWith("-")&&!t.startsWith("---")?"repository-diff-line-deleted":t.startsWith("@@")?"repository-diff-line-hunk":"repository-diff-line-context"}function B1(t){return t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("new file mode ")||t.startsWith("deleted file mode ")||t.startsWith("similarity index ")||t.startsWith("rename from ")||t.startsWith("rename to ")||t.startsWith("--- ")||t.startsWith("+++ ")}function j1({busy:t,effort:r,model:s,open:l,permissionMode:d,session:p,onClose:f,onEffortChange:o,onModelChange:c,onPermissionModeChange:h,onResume:m,onRestart:u,onStart:y,onStop:w,onNotifyHarnessUpdated:T}){return l?x.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:x.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[x.jsxs("header",{className:"translator-session-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Translator Session"}),x.jsx("p",{children:N1(p)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(jh,{role:"translator",session:p??void 0,permissionMode:d,model:s,effort:r,busy:t,onPermissionModeChange:h,onModelChange:c,onEffortChange:o,onStart:y,onResume:m,onRestart:u,onStop:w,onNotifyHarnessUpdated:T}),x.jsx("div",{className:"translator-session-terminal",children:(p==null?void 0:p.status)==="running"?x.jsx(No,{sessionId:p.id,active:l},p.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"translator"}),x.jsx("span",{children:p!=null&&p.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function N1(t){if(!t)return"not started";const r=t.status==="running"?` · ${t.activityStatus??"idle"}`:"";return`${t.status}${r}`}function H1(t,r){const s={};return(t[t.length-1]===""?[...t,""]:t).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const z1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,I1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P1={};function tg(t,r){return(P1.jsx?I1:z1).test(t)}const U1=/[ \t\n\f\r]/g;function F1(t){return typeof t=="object"?t.type==="text"?ng(t.value):!1:ng(t)}function ng(t){return t.replace(U1,"")===""}class sl{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}sl.prototype.normal={};sl.prototype.property={};sl.prototype.space=void 0;function m_(t,r){const s={},l={};for(const d of t)Object.assign(s,d.property),Object.assign(l,d.normal);return new sl(s,l,r)}function Sh(t){return t.toLowerCase()}class pn{constructor(r,s){this.attribute=s,this.property=r}}pn.prototype.attribute="";pn.prototype.booleanish=!1;pn.prototype.boolean=!1;pn.prototype.commaOrSpaceSeparated=!1;pn.prototype.commaSeparated=!1;pn.prototype.defined=!1;pn.prototype.mustUseProperty=!1;pn.prototype.number=!1;pn.prototype.overloadedBoolean=!1;pn.prototype.property="";pn.prototype.spaceSeparated=!1;pn.prototype.space=void 0;let q1=0;const Fe=Kr(),jt=Kr(),bh=Kr(),we=Kr(),ft=Kr(),zs=Kr(),Tn=Kr();function Kr(){return 2**++q1}const Ch=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:jt,commaOrSpaceSeparated:Tn,commaSeparated:zs,number:we,overloadedBoolean:bh,spaceSeparated:ft},Symbol.toStringTag,{value:"Module"})),Qu=Object.keys(Ch);class Nh extends pn{constructor(r,s,l,d){let p=-1;if(super(r,s),ig(this,"space",d),typeof l=="number")for(;++p<Qu.length;){const f=Qu[p];ig(this,Qu[p],(l&Ch[f])===Ch[f])}}}Nh.prototype.defined=!0;function ig(t,r,s){s&&(t[r]=s)}function Fs(t){const r={},s={};for(const[l,d]of Object.entries(t.properties)){const p=new Nh(l,t.transform(t.attributes||{},l),d,t.space);t.mustUseProperty&&t.mustUseProperty.includes(l)&&(p.mustUseProperty=!0),r[l]=p,s[Sh(l)]=l,s[Sh(p.attribute)]=l}return new sl(r,s,t.space)}const g_=Fs({properties:{ariaActiveDescendant:null,ariaAtomic:jt,ariaAutoComplete:null,ariaBusy:jt,ariaChecked:jt,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:ft,ariaCurrent:null,ariaDescribedBy:ft,ariaDetails:null,ariaDisabled:jt,ariaDropEffect:ft,ariaErrorMessage:null,ariaExpanded:jt,ariaFlowTo:ft,ariaGrabbed:jt,ariaHasPopup:null,ariaHidden:jt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ft,ariaLevel:we,ariaLive:null,ariaModal:jt,ariaMultiLine:jt,ariaMultiSelectable:jt,ariaOrientation:null,ariaOwns:ft,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:jt,ariaReadOnly:jt,ariaRelevant:null,ariaRequired:jt,ariaRoleDescription:ft,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:jt,ariaSetSize:we,ariaSort:null,ariaValueMax:we,ariaValueMin:we,ariaValueNow:we,ariaValueText:null,role:null},transform(t,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function __(t,r){return r in t?t[r]:r}function v_(t,r){return __(t,r.toLowerCase())}const $1=Fs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zs,acceptCharset:ft,accessKey:ft,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:ft,autoFocus:Fe,autoPlay:Fe,blocking:ft,capture:null,charSet:null,checked:Fe,cite:null,className:ft,cols:we,colSpan:null,content:null,contentEditable:jt,controls:Fe,controlsList:ft,coords:we|zs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:bh,draggable:jt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:ft,height:we,hidden:bh,high:we,href:null,hrefLang:null,htmlFor:ft,httpEquiv:ft,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:ft,itemRef:ft,itemScope:Fe,itemType:ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,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:Fe,optimum:we,pattern:null,ping:ft,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:ft,required:Fe,reversed:Fe,rows:we,rowSpan:we,sandbox:ft,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:jt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:we,step:null,style:null,tabIndex:we,target:null,title:null,translate:null,type:null,typeMustMatch:Fe,useMap:null,value:jt,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ft,axis:null,background:null,bgColor:null,border:we,borderColor:null,bottomMargin:we,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:jt,standby:null,summary:null,text:null,topMargin:we,valueType:null,version:null,vAlign:null,vLink:null,vSpace:we,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Fe,disableRemotePlayback:Fe,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:v_}),G1=Fs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Tn,accentHeight:we,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:we,amplitude:we,arabicForm:null,ascent:we,attributeName:null,attributeType:null,azimuth:we,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:we,by:null,calcMode:null,capHeight:we,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:we,diffuseConstant:we,direction:null,display:null,dur:null,divisor:we,dominantBaseline:null,download:Fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:we,enableBackground:null,end:null,event:null,exponent:we,externalResourcesRequired:null,fill:null,fillOpacity:we,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:zs,g2:zs,glyphName:zs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:we,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:we,horizOriginX:we,horizOriginY:we,id:null,ideographic:we,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:we,k:we,k1:we,k2:we,k3:we,k4:we,kernelMatrix:Tn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:we,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:we,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:we,overlineThickness:we,paintOrder:null,panose1:null,path:null,pathLength:we,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ft,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Tn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Tn,rev:Tn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Tn,requiredFeatures:Tn,requiredFonts:Tn,requiredFormats:Tn,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:we,specularExponent:we,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:we,strikethroughThickness:we,string:null,stroke:null,strokeDashArray:Tn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:we,strokeOpacity:we,strokeWidth:null,style:null,surfaceScale:we,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Tn,tabIndex:we,tableValues:null,target:null,targetX:we,targetY:we,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Tn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:we,underlineThickness:we,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:we,values:null,vAlphabetic:we,vMathematical:we,vectorEffect:null,vHanging:we,vIdeographic:we,version:null,vertAdvY:we,vertOriginX:we,vertOriginY:we,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:we,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:__}),y_=Fs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,r){return"xlink:"+r.slice(5).toLowerCase()}}),S_=Fs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:v_}),b_=Fs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,r){return"xml:"+r.slice(3).toLowerCase()}}),V1={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"},W1=/[A-Z]/g,rg=/-[a-z]/g,K1=/^data[-\w.:]+$/i;function Y1(t,r){const s=Sh(r);let l=r,d=pn;if(s in t.normal)return t.property[t.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&K1.test(r)){if(r.charAt(4)==="-"){const p=r.slice(5).replace(rg,Q1);l="data"+p.charAt(0).toUpperCase()+p.slice(1)}else{const p=r.slice(4);if(!rg.test(p)){let f=p.replace(W1,X1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Nh}return new d(l,r)}function X1(t){return"-"+t.toLowerCase()}function Q1(t){return t.charAt(1).toUpperCase()}const J1=m_([g_,$1,y_,S_,b_],"html"),Hh=m_([g_,G1,y_,S_,b_],"svg");function Z1(t){return t.join(" ").trim()}var Bs={},Ju,sg;function eS(){if(sg)return Ju;sg=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,p=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
63
|
-
`,h="/",m="*",u="",y="comment",w="declaration";function T(b,v){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];v=v||{};var _=1,S=1;function A(V){var K=V.match(r);K&&(_+=K.length);var G=V.lastIndexOf(c);S=~G?V.length-G:S+V.length}function L(){var V={line:_,column:S};return function(K){return K.position=new M(V),R(),K}}function M(V){this.start=V,this.end={line:_,column:S},this.source=v.source}M.prototype.content=b;function D(V){var K=new Error(v.source+":"+_+":"+S+": "+V);if(K.reason=V,K.filename=v.source,K.line=_,K.column=S,K.source=b,!v.silent)throw K}function k(V){var K=V.exec(b);if(K){var G=K[0];return A(G),b=b.slice(G.length),K}}function R(){k(s)}function B(V){var K;for(V=V||[];K=H();)K!==!1&&V.push(K);return V}function H(){var V=L();if(!(h!=b.charAt(0)||m!=b.charAt(1))){for(var K=2;u!=b.charAt(K)&&(m!=b.charAt(K)||h!=b.charAt(K+1));)++K;if(K+=2,u===b.charAt(K-1))return D("End of comment missing");var G=b.slice(2,K-2);return S+=2,A(G),b=b.slice(K),S+=2,V({type:y,comment:G})}}function U(){var V=L(),K=k(l);if(K){if(H(),!k(d))return D("property missing ':'");var G=k(p),Y=V({type:w,property:E(K[0].replace(t,u)),value:G?E(G[0].replace(t,u)):u});return k(f),Y}}function P(){var V=[];B(V);for(var K;K=U();)K!==!1&&(V.push(K),B(V));return V}return R(),P()}function E(b){return b?b.replace(o,u):u}return Ju=T,Ju}var ag;function tS(){if(ag)return Bs;ag=1;var t=Bs&&Bs.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.default=s;const r=t(eS());function s(l,d){let p=null;if(!l||typeof l!="string")return p;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:m}=c;o?d(h,m,c):m&&(p=p||{},p[h]=m)}),p}return Bs}var $a={},lg;function nS(){if(lg)return $a;lg=1,Object.defineProperty($a,"__esModule",{value:!0}),$a.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,p=function(h){return!h||s.test(h)||t.test(h)},f=function(h,m){return m.toUpperCase()},o=function(h,m){return"".concat(m,"-")},c=function(h,m){return m===void 0&&(m={}),p(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(d,o):h=h.replace(l,o),h.replace(r,f))};return $a.camelCase=c,$a}var Ga,og;function iS(){if(og)return Ga;og=1;var t=Ga&&Ga.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=t(tS()),s=nS();function l(d,p){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,p)]=c)}),f}return l.default=l,Ga=l,Ga}var rS=iS();const sS=i_(rS),C_=w_("end"),zh=w_("start");function w_(t){return r;function r(s){const l=s&&s.position&&s.position[t]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function aS(t){const r=zh(t),s=C_(t);if(r&&s)return{start:r,end:s}}function Ya(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?cg(t.position):"start"in t||"end"in t?cg(t):"line"in t||"column"in t?wh(t):""}function wh(t){return ug(t&&t.line)+":"+ug(t&&t.column)}function cg(t){return wh(t&&t.start)+"-"+wh(t&&t.end)}function ug(t){return t&&typeof t=="number"?t:1}class Zt extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=s,s=void 0);let d="",p={},f=!1;if(s&&("line"in s&&"column"in s?p={place:s}:"start"in s&&"end"in s?p={place:s}:"type"in s?p={ancestors:[s],place:s.position}:p={...s}),typeof r=="string"?d=r:!p.cause&&r&&(f=!0,d=r.message,p.cause=r),!p.ruleId&&!p.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?p.ruleId=l:(p.source=l.slice(0,c),p.ruleId=l.slice(c+1))}if(!p.place&&p.ancestors&&p.ancestors){const c=p.ancestors[p.ancestors.length-1];c&&(p.place=c.position)}const o=p.place&&"start"in p.place?p.place.start:p.place;this.ancestors=p.ancestors||void 0,this.cause=p.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=Ya(p.place)||"1:1",this.place=p.place||void 0,this.reason=this.message,this.ruleId=p.ruleId||void 0,this.source=p.source||void 0,this.stack=f&&p.cause&&typeof p.cause.stack=="string"?p.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zt.prototype.file="";Zt.prototype.name="";Zt.prototype.reason="";Zt.prototype.message="";Zt.prototype.stack="";Zt.prototype.column=void 0;Zt.prototype.line=void 0;Zt.prototype.ancestors=void 0;Zt.prototype.cause=void 0;Zt.prototype.fatal=void 0;Zt.prototype.place=void 0;Zt.prototype.ruleId=void 0;Zt.prototype.source=void 0;const Ih={}.hasOwnProperty,lS=new Map,oS=/[A-Z]/g,cS=new Set(["table","tbody","thead","tfoot","tr"]),uS=new Set(["td","th"]),x_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function hS(t,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=yS(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=vS(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Hh:J1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},p=E_(d,t,void 0);return p&&typeof p!="string"?p:d.create(t,d.Fragment,{children:p||void 0},void 0)}function E_(t,r,s){if(r.type==="element")return fS(t,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return dS(t,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return mS(t,r,s);if(r.type==="mdxjsEsm")return pS(t,r);if(r.type==="root")return gS(t,r,s);if(r.type==="text")return _S(t,r)}function fS(t,r,s){const l=t.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Hh,t.schema=d),t.ancestors.push(r);const p=A_(t,r.tagName,!1),f=SS(t,r);let o=Uh(t,r);return cS.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!F1(c):!0})),k_(t,f,p,r),Ph(f,o),t.ancestors.pop(),t.schema=l,t.create(r,p,f,s)}function dS(t,r){if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];return l.type,t.evaluater.evaluateExpression(l.expression)}nl(t,r.position)}function pS(t,r){if(r.data&&r.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(r.data.estree);nl(t,r.position)}function mS(t,r,s){const l=t.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Hh,t.schema=d),t.ancestors.push(r);const p=r.name===null?t.Fragment:A_(t,r.name,!0),f=bS(t,r),o=Uh(t,r);return k_(t,f,p,r),Ph(f,o),t.ancestors.pop(),t.schema=l,t.create(r,p,f,s)}function gS(t,r,s){const l={};return Ph(l,Uh(t,r)),t.create(r,t.Fragment,l,s)}function _S(t,r){return r.value}function k_(t,r,s,l){typeof s!="string"&&s!==t.Fragment&&t.passNode&&(r.node=l)}function Ph(t,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(t.children=s)}}function vS(t,r,s){return l;function l(d,p,f,o){const h=Array.isArray(f.children)?s:r;return o?h(p,f,o):h(p,f)}}function yS(t,r){return s;function s(l,d,p,f){const o=Array.isArray(p.children),c=zh(l);return r(d,p,f,o,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function SS(t,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&Ih.call(r.properties,d)){const p=CS(t,d,r.properties[d]);if(p){const[f,o]=p;t.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&uS.has(r.tagName)?l=o:s[f]=o}}if(l){const p=s.style||(s.style={});p[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return s}function bS(t,r){const s={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&t.evaluater){const p=l.data.estree.body[0];p.type;const f=p.expression;f.type;const o=f.properties[0];o.type,Object.assign(s,t.evaluater.evaluateExpression(o.argument))}else nl(t,r.position);else{const d=l.name;let p;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&t.evaluater){const o=l.value.data.estree.body[0];o.type,p=t.evaluater.evaluateExpression(o.expression)}else nl(t,r.position);else p=l.value===null?!0:l.value;s[d]=p}return s}function Uh(t,r){const s=[];let l=-1;const d=t.passKeys?new Map:lS;for(;++l<r.children.length;){const p=r.children[l];let f;if(t.passKeys){const c=p.type==="element"?p.tagName:p.type==="mdxJsxFlowElement"||p.type==="mdxJsxTextElement"?p.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const o=E_(t,p,f);o!==void 0&&s.push(o)}return s}function CS(t,r,s){const l=Y1(t.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?H1(s):Z1(s)),l.property==="style"){let d=typeof s=="object"?s:wS(t,String(s));return t.stylePropertyNameCase==="css"&&(d=xS(d)),["style",d]}return[t.elementAttributeNameCase==="react"&&l.space?V1[l.property]||l.property:l.attribute,s]}}function wS(t,r){try{return sS(r,{reactCompat:!0})}catch(s){if(t.ignoreInvalidStyle)return{};const l=s,d=new Zt("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=t.filePath||void 0,d.url=x_+"#cannot-parse-style-attribute",d}}function A_(t,r,s){let l;if(!s)l={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let p=-1,f;for(;++p<d.length;){const o=tg(d[p])?{type:"Identifier",name:d[p]}:{type:"Literal",value:d[p]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(p&&o.type==="Literal"),optional:!1}:o}l=f}else l=tg(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return Ih.call(t.components,d)?t.components[d]:d}if(t.evaluater)return t.evaluater.evaluateExpression(l);nl(t)}function nl(t,r){const s=new Zt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=x_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function xS(t){const r={};let s;for(s in t)Ih.call(t,s)&&(r[ES(s)]=t[s]);return r}function ES(t){let r=t.replace(oS,kS);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function kS(t){return"-"+t.toLowerCase()}const Zu={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"]},AS={};function Fh(t,r){const s=AS,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return T_(t,l,d)}function T_(t,r,s){if(TS(t)){if("value"in t)return t.type==="html"&&!s?"":t.value;if(r&&"alt"in t&&t.alt)return t.alt;if("children"in t)return hg(t.children,r,s)}return Array.isArray(t)?hg(t,r,s):""}function hg(t,r,s){const l=[];let d=-1;for(;++d<t.length;)l[d]=T_(t[d],r,s);return l.join("")}function TS(t){return!!(t&&typeof t=="object")}const fg=document.createElement("i");function qh(t){const r="&"+t+";";fg.innerHTML=r;const s=fg.textContent;return s.charCodeAt(s.length-1)===59&&t!=="semi"||s===r?!1:s}function Rn(t,r,s,l){const d=t.length;let p=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,l.length<1e4)f=Array.from(l),f.unshift(r,s),t.splice(...f);else for(s&&t.splice(r,s);p<l.length;)f=l.slice(p,p+1e4),f.unshift(r,0),t.splice(...f),p+=1e4,r+=1e4}function Un(t,r){return t.length>0?(Rn(t,t.length,0,r),t):r}const dg={}.hasOwnProperty;function R_(t){const r={};let s=-1;for(;++s<t.length;)RS(r,t[s]);return r}function RS(t,r){let s;for(s in r){const d=(dg.call(t,s)?t[s]:void 0)||(t[s]={}),p=r[s];let f;if(p)for(f in p){dg.call(d,f)||(d[f]=[]);const o=p[f];DS(d[f],Array.isArray(o)?o:o?[o]:[])}}}function DS(t,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?t:l).push(r[s]);Rn(t,0,0,l)}function D_(t,r){const s=Number.parseInt(t,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 Xn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=Sr(/[A-Za-z]/),Jt=Sr(/[\dA-Za-z]/),MS=Sr(/[#-'*+\--9=?A-Z^-~]/);function To(t){return t!==null&&(t<32||t===127)}const xh=Sr(/\d/),LS=Sr(/[\dA-Fa-f]/),OS=Sr(/[!-/:-@[-`{-~]/);function Oe(t){return t!==null&&t<-2}function ht(t){return t!==null&&(t<0||t===32)}function We(t){return t===-2||t===-1||t===32}const Ho=Sr(new RegExp("\\p{P}|\\p{S}","u")),Vr=Sr(/\s/);function Sr(t){return r;function r(s){return s!==null&&s>-1&&t.test(String.fromCharCode(s))}}function qs(t){const r=[];let s=-1,l=0,d=0;for(;++s<t.length;){const p=t.charCodeAt(s);let f="";if(p===37&&Jt(t.charCodeAt(s+1))&&Jt(t.charCodeAt(s+2)))d=2;else if(p<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(p))||(f=String.fromCharCode(p));else if(p>55295&&p<57344){const o=t.charCodeAt(s+1);p<56320&&o>56319&&o<57344?(f=String.fromCharCode(p,o),d=1):f="�"}else f=String.fromCharCode(p);f&&(r.push(t.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+t.slice(l)}function Ze(t,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let p=0;return f;function f(c){return We(c)?(t.enter(s),o(c)):r(c)}function o(c){return We(c)&&p++<d?(t.consume(c),o):(t.exit(s),r(c))}}const BS={tokenize:jS};function jS(t){const r=t.attempt(this.parser.constructs.contentInitial,l,d);let s;return r;function l(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ze(t,r,"linePrefix")}function d(o){return t.enter("paragraph"),p(o)}function p(o){const c=t.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(o)}function f(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return Oe(o)?(t.consume(o),t.exit("chunkText"),p):(t.consume(o),f)}}const NS={tokenize:HS},pg={tokenize:zS};function HS(t){const r=this,s=[];let l=0,d,p,f;return o;function o(S){if(l<s.length){const A=s[l];return r.containerState=A[1],t.attempt(A[0].continuation,c,h)(S)}return h(S)}function c(S){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&_();const A=r.events.length;let L=A,M;for(;L--;)if(r.events[L][0]==="exit"&&r.events[L][1].type==="chunkFlow"){M=r.events[L][1].end;break}v(l);let D=A;for(;D<r.events.length;)r.events[D][1].end={...M},D++;return Rn(r.events,L+1,0,r.events.slice(A)),r.events.length=D,h(S)}return o(S)}function h(S){if(l===s.length){if(!d)return y(S);if(d.currentConstruct&&d.currentConstruct.concrete)return T(S);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},t.check(pg,m,u)(S)}function m(S){return d&&_(),v(l),y(S)}function u(S){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,T(S)}function y(S){return r.containerState={},t.attempt(pg,w,T)(S)}function w(S){return l++,s.push([r.currentConstruct,r.containerState]),y(S)}function T(S){if(S===null){d&&_(),v(0),t.consume(S);return}return d=d||r.parser.flow(r.now()),t.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:p}),E(S)}function E(S){if(S===null){b(t.exit("chunkFlow"),!0),v(0),t.consume(S);return}return Oe(S)?(t.consume(S),b(t.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(t.consume(S),E)}function b(S,A){const L=r.sliceStream(S);if(A&&L.push(null),S.previous=p,p&&(p.next=S),p=S,d.defineSkip(S.start),d.write(L),r.parser.lazy[S.start.line]){let M=d.events.length;for(;M--;)if(d.events[M][1].start.offset<f&&(!d.events[M][1].end||d.events[M][1].end.offset>f))return;const D=r.events.length;let k=D,R,B;for(;k--;)if(r.events[k][0]==="exit"&&r.events[k][1].type==="chunkFlow"){if(R){B=r.events[k][1].end;break}R=!0}for(v(l),M=D;M<r.events.length;)r.events[M][1].end={...B},M++;Rn(r.events,k+1,0,r.events.slice(D)),r.events.length=M}}function v(S){let A=s.length;for(;A-- >S;){const L=s[A];r.containerState=L[1],L[0].exit.call(r,t)}s.length=S}function _(){d.write([null]),p=void 0,d=void 0,r.containerState._closeFlow=void 0}}function zS(t,r,s){return Ze(t,t.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Is(t){if(t===null||ht(t)||Vr(t))return 1;if(Ho(t))return 2}function zo(t,r,s){const l=[];let d=-1;for(;++d<t.length;){const p=t[d].resolveAll;p&&!l.includes(p)&&(r=p(r,s),l.push(p))}return r}const Eh={name:"attention",resolveAll:IS,tokenize:PS};function IS(t,r){let s=-1,l,d,p,f,o,c,h,m;for(;++s<t.length;)if(t[s][0]==="enter"&&t[s][1].type==="attentionSequence"&&t[s][1]._close){for(l=s;l--;)if(t[l][0]==="exit"&&t[l][1].type==="attentionSequence"&&t[l][1]._open&&r.sliceSerialize(t[l][1]).charCodeAt(0)===r.sliceSerialize(t[s][1]).charCodeAt(0)){if((t[l][1]._close||t[s][1]._open)&&(t[s][1].end.offset-t[s][1].start.offset)%3&&!((t[l][1].end.offset-t[l][1].start.offset+t[s][1].end.offset-t[s][1].start.offset)%3))continue;c=t[l][1].end.offset-t[l][1].start.offset>1&&t[s][1].end.offset-t[s][1].start.offset>1?2:1;const u={...t[l][1].end},y={...t[s][1].start};mg(u,-c),mg(y,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...t[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...t[s][1].start},end:y},p={type:c>1?"strongText":"emphasisText",start:{...t[l][1].end},end:{...t[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...o.end}},t[l][1].end={...f.start},t[s][1].start={...o.end},h=[],t[l][1].end.offset-t[l][1].start.offset&&(h=Un(h,[["enter",t[l][1],r],["exit",t[l][1],r]])),h=Un(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",p,r]]),h=Un(h,zo(r.parser.constructs.insideSpan.null,t.slice(l+1,s),r)),h=Un(h,[["exit",p,r],["enter",o,r],["exit",o,r],["exit",d,r]]),t[s][1].end.offset-t[s][1].start.offset?(m=2,h=Un(h,[["enter",t[s][1],r],["exit",t[s][1],r]])):m=0,Rn(t,l-1,s-l+3,h),s=l+h.length-m-2;break}}for(s=-1;++s<t.length;)t[s][1].type==="attentionSequence"&&(t[s][1].type="data");return t}function PS(t,r){const s=this.parser.constructs.attentionMarkers.null,l=this.previous,d=Is(l);let p;return f;function f(c){return p=c,t.enter("attentionSequence"),o(c)}function o(c){if(c===p)return t.consume(c),o;const h=t.exit("attentionSequence"),m=Is(c),u=!m||m===2&&d||s.includes(c),y=!d||d===2&&m||s.includes(l);return h._open=!!(p===42?u:u&&(d||!y)),h._close=!!(p===42?y:y&&(m||!u)),r(c)}}function mg(t,r){t.column+=r,t.offset+=r,t._bufferIndex+=r}const US={name:"autolink",tokenize:FS};function FS(t,r,s){let l=0;return d;function d(w){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),p}function p(w){return sn(w)?(t.consume(w),f):w===64?s(w):h(w)}function f(w){return w===43||w===45||w===46||Jt(w)?(l=1,o(w)):h(w)}function o(w){return w===58?(t.consume(w),l=0,c):(w===43||w===45||w===46||Jt(w))&&l++<32?(t.consume(w),o):(l=0,h(w))}function c(w){return w===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),r):w===null||w===32||w===60||To(w)?s(w):(t.consume(w),c)}function h(w){return w===64?(t.consume(w),m):MS(w)?(t.consume(w),h):s(w)}function m(w){return Jt(w)?u(w):s(w)}function u(w){return w===46?(t.consume(w),l=0,m):w===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),r):y(w)}function y(w){if((w===45||Jt(w))&&l++<63){const T=w===45?y:u;return t.consume(w),T}return s(w)}}const al={partial:!0,tokenize:qS};function qS(t,r,s){return l;function l(p){return We(p)?Ze(t,d,"linePrefix")(p):d(p)}function d(p){return p===null||Oe(p)?r(p):s(p)}}const M_={continuation:{tokenize:GS},exit:VS,name:"blockQuote",tokenize:$S};function $S(t,r,s){const l=this;return d;function d(f){if(f===62){const o=l.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(f),t.exit("blockQuoteMarker"),p}return s(f)}function p(f){return We(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),r):(t.exit("blockQuotePrefix"),r(f))}}function GS(t,r,s){const l=this;return d;function d(f){return We(f)?Ze(t,p,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):p(f)}function p(f){return t.attempt(M_,r,s)(f)}}function VS(t){t.exit("blockQuote")}const L_={name:"characterEscape",tokenize:WS};function WS(t,r,s){return l;function l(p){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(p),t.exit("escapeMarker"),d}function d(p){return OS(p)?(t.enter("characterEscapeValue"),t.consume(p),t.exit("characterEscapeValue"),t.exit("characterEscape"),r):s(p)}}const O_={name:"characterReference",tokenize:KS};function KS(t,r,s){const l=this;let d=0,p,f;return o;function o(u){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(u),t.exit("characterReferenceMarker"),c}function c(u){return u===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(u),t.exit("characterReferenceMarkerNumeric"),h):(t.enter("characterReferenceValue"),p=31,f=Jt,m(u))}function h(u){return u===88||u===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(u),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),p=6,f=LS,m):(t.enter("characterReferenceValue"),p=7,f=xh,m(u))}function m(u){if(u===59&&d){const y=t.exit("characterReferenceValue");return f===Jt&&!qh(l.sliceSerialize(y))?s(u):(t.enter("characterReferenceMarker"),t.consume(u),t.exit("characterReferenceMarker"),t.exit("characterReference"),r)}return f(u)&&d++<p?(t.consume(u),m):s(u)}}const gg={partial:!0,tokenize:XS},_g={concrete:!0,name:"codeFenced",tokenize:YS};function YS(t,r,s){const l=this,d={partial:!0,tokenize:L};let p=0,f=0,o;return c;function c(M){return h(M)}function h(M){const D=l.events[l.events.length-1];return p=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=M,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),m(M)}function m(M){return M===o?(f++,t.consume(M),m):f<3?s(M):(t.exit("codeFencedFenceSequence"),We(M)?Ze(t,u,"whitespace")(M):u(M))}function u(M){return M===null||Oe(M)?(t.exit("codeFencedFence"),l.interrupt?r(M):t.check(gg,E,A)(M)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||Oe(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),u(M)):We(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ze(t,w,"whitespace")(M)):M===96&&M===o?s(M):(t.consume(M),y)}function w(M){return M===null||Oe(M)?u(M):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),T(M))}function T(M){return M===null||Oe(M)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),u(M)):M===96&&M===o?s(M):(t.consume(M),T)}function E(M){return t.attempt(d,A,b)(M)}function b(M){return t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),v}function v(M){return p>0&&We(M)?Ze(t,_,"linePrefix",p+1)(M):_(M)}function _(M){return M===null||Oe(M)?t.check(gg,E,A)(M):(t.enter("codeFlowValue"),S(M))}function S(M){return M===null||Oe(M)?(t.exit("codeFlowValue"),_(M)):(t.consume(M),S)}function A(M){return t.exit("codeFenced"),r(M)}function L(M,D,k){let R=0;return B;function B(K){return M.enter("lineEnding"),M.consume(K),M.exit("lineEnding"),H}function H(K){return M.enter("codeFencedFence"),We(K)?Ze(M,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):U(K)}function U(K){return K===o?(M.enter("codeFencedFenceSequence"),P(K)):k(K)}function P(K){return K===o?(R++,M.consume(K),P):R>=f?(M.exit("codeFencedFenceSequence"),We(K)?Ze(M,V,"whitespace")(K):V(K)):k(K)}function V(K){return K===null||Oe(K)?(M.exit("codeFencedFence"),D(K)):k(K)}}}function XS(t,r,s){const l=this;return d;function d(f){return f===null?s(f):(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),p)}function p(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}const eh={name:"codeIndented",tokenize:JS},QS={partial:!0,tokenize:ZS};function JS(t,r,s){const l=this;return d;function d(h){return t.enter("codeIndented"),Ze(t,p,"linePrefix",5)(h)}function p(h){const m=l.events[l.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Oe(h)?t.attempt(QS,f,c)(h):(t.enter("codeFlowValue"),o(h))}function o(h){return h===null||Oe(h)?(t.exit("codeFlowValue"),f(h)):(t.consume(h),o)}function c(h){return t.exit("codeIndented"),r(h)}}function ZS(t,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):Oe(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),d):Ze(t,p,"linePrefix",5)(f)}function p(f){const o=l.events[l.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):Oe(f)?d(f):s(f)}}const eb={name:"codeText",previous:nb,resolve:tb,tokenize:ib};function tb(t){let r=t.length-4,s=3,l,d;if((t[s][1].type==="lineEnding"||t[s][1].type==="space")&&(t[r][1].type==="lineEnding"||t[r][1].type==="space")){for(l=s;++l<r;)if(t[l][1].type==="codeTextData"){t[s][1].type="codeTextPadding",t[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(l=s-1,r++;++l<=r;)d===void 0?l!==r&&t[l][1].type!=="lineEnding"&&(d=l):(l===r||t[l][1].type==="lineEnding")&&(t[d][1].type="codeTextData",l!==d+2&&(t[d][1].end=t[l-1][1].end,t.splice(d+2,l-d-2),r-=l-d-2,l=d+2),d=void 0);return t}function nb(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ib(t,r,s){let l=0,d,p;return f;function f(u){return t.enter("codeText"),t.enter("codeTextSequence"),o(u)}function o(u){return u===96?(t.consume(u),l++,o):(t.exit("codeTextSequence"),c(u))}function c(u){return u===null?s(u):u===32?(t.enter("space"),t.consume(u),t.exit("space"),c):u===96?(p=t.enter("codeTextSequence"),d=0,m(u)):Oe(u)?(t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),c):(t.enter("codeTextData"),h(u))}function h(u){return u===null||u===32||u===96||Oe(u)?(t.exit("codeTextData"),c(u)):(t.consume(u),h)}function m(u){return u===96?(t.consume(u),d++,m):d===l?(t.exit("codeTextSequence"),t.exit("codeText"),r(u)):(p.type="codeTextData",h(u))}}class rb{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const l=s??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,s,l){const d=s||0;this.setCursor(Math.trunc(r));const p=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Va(this.left,l),p.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Va(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Va(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);Va(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Va(this.left,s.reverse())}}}function Va(t,r){let s=0;if(r.length<1e4)t.push(...r);else for(;s<r.length;)t.push(...r.slice(s,s+1e4)),s+=1e4}function B_(t){const r={};let s=-1,l,d,p,f,o,c,h;const m=new rb(t);for(;++s<m.length;){for(;s in r;)s=r[s];if(l=m.get(s),s&&l[1].type==="chunkFlow"&&m.get(s-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,p=0,p<c.length&&c[p][1].type==="lineEndingBlank"&&(p+=2),p<c.length&&c[p][1].type==="content"))for(;++p<c.length&&c[p][1].type!=="content";)c[p][1].type==="chunkText"&&(c[p][1]._isInFirstContentOfListItem=!0,p++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,sb(m,s)),s=r[s],h=!0);else if(l[1]._container){for(p=s,d=void 0;p--;)if(f=m.get(p),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(m.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=p);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(l[1].end={...m.get(d)[1].start},o=m.slice(d,s),o.unshift(l),m.splice(d,s-d+1,o))}}return Rn(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function sb(t,r){const s=t.get(r)[1],l=t.get(r)[2];let d=r-1;const p=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],h={};let m,u,y=-1,w=s,T=0,E=0;const b=[E];for(;w;){for(;t.get(++d)[1]!==w;);p.push(d),w._tokenizer||(m=l.sliceStream(w),w.next||m.push(null),u&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(m),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=w,w=w.next}for(w=s;++y<o.length;)o[y][0]==="exit"&&o[y-1][0]==="enter"&&o[y][1].type===o[y-1][1].type&&o[y][1].start.line!==o[y][1].end.line&&(E=y+1,b.push(E),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):b.pop(),y=b.length;y--;){const v=o.slice(b[y],b[y+1]),_=p.pop();c.push([_,_+v.length-1]),t.splice(_,2,v)}for(c.reverse(),y=-1;++y<c.length;)h[T+c[y][0]]=T+c[y][1],T+=c[y][1]-c[y][0]-1;return h}const ab={resolve:ob,tokenize:cb},lb={partial:!0,tokenize:ub};function ob(t){return B_(t),t}function cb(t,r){let s;return l;function l(o){return t.enter("content"),s=t.enter("chunkContent",{contentType:"content"}),d(o)}function d(o){return o===null?p(o):Oe(o)?t.check(lb,f,p)(o):(t.consume(o),d)}function p(o){return t.exit("chunkContent"),t.exit("content"),r(o)}function f(o){return t.consume(o),t.exit("chunkContent"),s.next=t.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function ub(t,r,s){const l=this;return d;function d(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Ze(t,p,"linePrefix")}function p(f){if(f===null||Oe(f))return s(f);const o=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):t.interrupt(l.parser.constructs.flow,s,r)(f)}}function j_(t,r,s,l,d,p,f,o,c){const h=c||Number.POSITIVE_INFINITY;let m=0;return u;function u(v){return v===60?(t.enter(l),t.enter(d),t.enter(p),t.consume(v),t.exit(p),y):v===null||v===32||v===41||To(v)?s(v):(t.enter(l),t.enter(f),t.enter(o),t.enter("chunkString",{contentType:"string"}),E(v))}function y(v){return v===62?(t.enter(p),t.consume(v),t.exit(p),t.exit(d),t.exit(l),r):(t.enter(o),t.enter("chunkString",{contentType:"string"}),w(v))}function w(v){return v===62?(t.exit("chunkString"),t.exit(o),y(v)):v===null||v===60||Oe(v)?s(v):(t.consume(v),v===92?T:w)}function T(v){return v===60||v===62||v===92?(t.consume(v),w):w(v)}function E(v){return!m&&(v===null||v===41||ht(v))?(t.exit("chunkString"),t.exit(o),t.exit(f),t.exit(l),r(v)):m<h&&v===40?(t.consume(v),m++,E):v===41?(t.consume(v),m--,E):v===null||v===32||v===40||To(v)?s(v):(t.consume(v),v===92?b:E)}function b(v){return v===40||v===41||v===92?(t.consume(v),E):E(v)}}function N_(t,r,s,l,d,p){const f=this;let o=0,c;return h;function h(w){return t.enter(l),t.enter(d),t.consume(w),t.exit(d),t.enter(p),m}function m(w){return o>999||w===null||w===91||w===93&&!c||w===94&&!o&&"_hiddenFootnoteSupport"in f.parser.constructs?s(w):w===93?(t.exit(p),t.enter(d),t.consume(w),t.exit(d),t.exit(l),r):Oe(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),m):(t.enter("chunkString",{contentType:"string"}),u(w))}function u(w){return w===null||w===91||w===93||Oe(w)||o++>999?(t.exit("chunkString"),m(w)):(t.consume(w),c||(c=!We(w)),w===92?y:u)}function y(w){return w===91||w===92||w===93?(t.consume(w),o++,u):u(w)}}function H_(t,r,s,l,d,p){let f;return o;function o(y){return y===34||y===39||y===40?(t.enter(l),t.enter(d),t.consume(y),t.exit(d),f=y===40?41:y,c):s(y)}function c(y){return y===f?(t.enter(d),t.consume(y),t.exit(d),t.exit(l),r):(t.enter(p),h(y))}function h(y){return y===f?(t.exit(p),c(f)):y===null?s(y):Oe(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),Ze(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===f||y===null||Oe(y)?(t.exit("chunkString"),h(y)):(t.consume(y),y===92?u:m)}function u(y){return y===f||y===92?(t.consume(y),m):m(y)}}function Xa(t,r){let s;return l;function l(d){return Oe(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),s=!0,l):We(d)?Ze(t,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const hb={name:"definition",tokenize:db},fb={partial:!0,tokenize:pb};function db(t,r,s){const l=this;let d;return p;function p(w){return t.enter("definition"),f(w)}function f(w){return N_.call(l,t,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function o(w){return d=Xn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),w===58?(t.enter("definitionMarker"),t.consume(w),t.exit("definitionMarker"),c):s(w)}function c(w){return ht(w)?Xa(t,h)(w):h(w)}function h(w){return j_(t,m,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return t.attempt(fb,u,u)(w)}function u(w){return We(w)?Ze(t,y,"whitespace")(w):y(w)}function y(w){return w===null||Oe(w)?(t.exit("definition"),l.parser.defined.push(d),r(w)):s(w)}}function pb(t,r,s){return l;function l(o){return ht(o)?Xa(t,d)(o):s(o)}function d(o){return H_(t,p,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function p(o){return We(o)?Ze(t,f,"whitespace")(o):f(o)}function f(o){return o===null||Oe(o)?r(o):s(o)}}const mb={name:"hardBreakEscape",tokenize:gb};function gb(t,r,s){return l;function l(p){return t.enter("hardBreakEscape"),t.consume(p),d}function d(p){return Oe(p)?(t.exit("hardBreakEscape"),r(p)):s(p)}}const _b={name:"headingAtx",resolve:vb,tokenize:yb};function vb(t,r){let s=t.length-2,l=3,d,p;return t[l][1].type==="whitespace"&&(l+=2),s-2>l&&t[s][1].type==="whitespace"&&(s-=2),t[s][1].type==="atxHeadingSequence"&&(l===s-1||s-4>l&&t[s-2][1].type==="whitespace")&&(s-=l+1===s?2:4),s>l&&(d={type:"atxHeadingText",start:t[l][1].start,end:t[s][1].end},p={type:"chunkText",start:t[l][1].start,end:t[s][1].end,contentType:"text"},Rn(t,l,s-l+1,[["enter",d,r],["enter",p,r],["exit",p,r],["exit",d,r]])),t}function yb(t,r,s){let l=0;return d;function d(m){return t.enter("atxHeading"),p(m)}function p(m){return t.enter("atxHeadingSequence"),f(m)}function f(m){return m===35&&l++<6?(t.consume(m),f):m===null||ht(m)?(t.exit("atxHeadingSequence"),o(m)):s(m)}function o(m){return m===35?(t.enter("atxHeadingSequence"),c(m)):m===null||Oe(m)?(t.exit("atxHeading"),r(m)):We(m)?Ze(t,o,"whitespace")(m):(t.enter("atxHeadingText"),h(m))}function c(m){return m===35?(t.consume(m),c):(t.exit("atxHeadingSequence"),o(m))}function h(m){return m===null||m===35||ht(m)?(t.exit("atxHeadingText"),o(m)):(t.consume(m),h)}}const Sb=["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"],vg=["pre","script","style","textarea"],bb={concrete:!0,name:"htmlFlow",resolveTo:xb,tokenize:Eb},Cb={partial:!0,tokenize:Ab},wb={partial:!0,tokenize:kb};function xb(t){let r=t.length;for(;r--&&!(t[r][0]==="enter"&&t[r][1].type==="htmlFlow"););return r>1&&t[r-2][1].type==="linePrefix"&&(t[r][1].start=t[r-2][1].start,t[r+1][1].start=t[r-2][1].start,t.splice(r-2,2)),t}function Eb(t,r,s){const l=this;let d,p,f,o,c;return h;function h(I){return m(I)}function m(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),u}function u(I){return I===33?(t.consume(I),y):I===47?(t.consume(I),p=!0,E):I===63?(t.consume(I),d=3,l.interrupt?r:j):sn(I)?(t.consume(I),f=String.fromCharCode(I),b):s(I)}function y(I){return I===45?(t.consume(I),d=2,w):I===91?(t.consume(I),d=5,o=0,T):sn(I)?(t.consume(I),d=4,l.interrupt?r:j):s(I)}function w(I){return I===45?(t.consume(I),l.interrupt?r:j):s(I)}function T(I){const ie="CDATA[";return I===ie.charCodeAt(o++)?(t.consume(I),o===ie.length?l.interrupt?r:U:T):s(I)}function E(I){return sn(I)?(t.consume(I),f=String.fromCharCode(I),b):s(I)}function b(I){if(I===null||I===47||I===62||ht(I)){const ie=I===47,me=f.toLowerCase();return!ie&&!p&&vg.includes(me)?(d=1,l.interrupt?r(I):U(I)):Sb.includes(f.toLowerCase())?(d=6,ie?(t.consume(I),v):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):p?_(I):S(I))}return I===45||Jt(I)?(t.consume(I),f+=String.fromCharCode(I),b):s(I)}function v(I){return I===62?(t.consume(I),l.interrupt?r:U):s(I)}function _(I){return We(I)?(t.consume(I),_):B(I)}function S(I){return I===47?(t.consume(I),B):I===58||I===95||sn(I)?(t.consume(I),A):We(I)?(t.consume(I),S):B(I)}function A(I){return I===45||I===46||I===58||I===95||Jt(I)?(t.consume(I),A):L(I)}function L(I){return I===61?(t.consume(I),M):We(I)?(t.consume(I),L):S(I)}function M(I){return I===null||I===60||I===61||I===62||I===96?s(I):I===34||I===39?(t.consume(I),c=I,D):We(I)?(t.consume(I),M):k(I)}function D(I){return I===c?(t.consume(I),c=null,R):I===null||Oe(I)?s(I):(t.consume(I),D)}function k(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ht(I)?L(I):(t.consume(I),k)}function R(I){return I===47||I===62||We(I)?S(I):s(I)}function B(I){return I===62?(t.consume(I),H):s(I)}function H(I){return I===null||Oe(I)?U(I):We(I)?(t.consume(I),H):s(I)}function U(I){return I===45&&d===2?(t.consume(I),G):I===60&&d===1?(t.consume(I),Y):I===62&&d===4?(t.consume(I),N):I===63&&d===3?(t.consume(I),j):I===93&&d===5?(t.consume(I),z):Oe(I)&&(d===6||d===7)?(t.exit("htmlFlowData"),t.check(Cb,$,P)(I)):I===null||Oe(I)?(t.exit("htmlFlowData"),P(I)):(t.consume(I),U)}function P(I){return t.check(wb,V,$)(I)}function V(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),K}function K(I){return I===null||Oe(I)?P(I):(t.enter("htmlFlowData"),U(I))}function G(I){return I===45?(t.consume(I),j):U(I)}function Y(I){return I===47?(t.consume(I),f="",ee):U(I)}function ee(I){if(I===62){const ie=f.toLowerCase();return vg.includes(ie)?(t.consume(I),N):U(I)}return sn(I)&&f.length<8?(t.consume(I),f+=String.fromCharCode(I),ee):U(I)}function z(I){return I===93?(t.consume(I),j):U(I)}function j(I){return I===62?(t.consume(I),N):I===45&&d===2?(t.consume(I),j):U(I)}function N(I){return I===null||Oe(I)?(t.exit("htmlFlowData"),$(I)):(t.consume(I),N)}function $(I){return t.exit("htmlFlow"),r(I)}}function kb(t,r,s){const l=this;return d;function d(f){return Oe(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),p):s(f)}function p(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}function Ab(t,r,s){return l;function l(d){return t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),t.attempt(al,r,s)}}const Tb={name:"htmlText",tokenize:Rb};function Rb(t,r,s){const l=this;let d,p,f;return o;function o(j){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(j),c}function c(j){return j===33?(t.consume(j),h):j===47?(t.consume(j),L):j===63?(t.consume(j),S):sn(j)?(t.consume(j),k):s(j)}function h(j){return j===45?(t.consume(j),m):j===91?(t.consume(j),p=0,T):sn(j)?(t.consume(j),_):s(j)}function m(j){return j===45?(t.consume(j),w):s(j)}function u(j){return j===null?s(j):j===45?(t.consume(j),y):Oe(j)?(f=u,Y(j)):(t.consume(j),u)}function y(j){return j===45?(t.consume(j),w):u(j)}function w(j){return j===62?G(j):j===45?y(j):u(j)}function T(j){const N="CDATA[";return j===N.charCodeAt(p++)?(t.consume(j),p===N.length?E:T):s(j)}function E(j){return j===null?s(j):j===93?(t.consume(j),b):Oe(j)?(f=E,Y(j)):(t.consume(j),E)}function b(j){return j===93?(t.consume(j),v):E(j)}function v(j){return j===62?G(j):j===93?(t.consume(j),v):E(j)}function _(j){return j===null||j===62?G(j):Oe(j)?(f=_,Y(j)):(t.consume(j),_)}function S(j){return j===null?s(j):j===63?(t.consume(j),A):Oe(j)?(f=S,Y(j)):(t.consume(j),S)}function A(j){return j===62?G(j):S(j)}function L(j){return sn(j)?(t.consume(j),M):s(j)}function M(j){return j===45||Jt(j)?(t.consume(j),M):D(j)}function D(j){return Oe(j)?(f=D,Y(j)):We(j)?(t.consume(j),D):G(j)}function k(j){return j===45||Jt(j)?(t.consume(j),k):j===47||j===62||ht(j)?R(j):s(j)}function R(j){return j===47?(t.consume(j),G):j===58||j===95||sn(j)?(t.consume(j),B):Oe(j)?(f=R,Y(j)):We(j)?(t.consume(j),R):G(j)}function B(j){return j===45||j===46||j===58||j===95||Jt(j)?(t.consume(j),B):H(j)}function H(j){return j===61?(t.consume(j),U):Oe(j)?(f=H,Y(j)):We(j)?(t.consume(j),H):R(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(t.consume(j),d=j,P):Oe(j)?(f=U,Y(j)):We(j)?(t.consume(j),U):(t.consume(j),V)}function P(j){return j===d?(t.consume(j),d=void 0,K):j===null?s(j):Oe(j)?(f=P,Y(j)):(t.consume(j),P)}function V(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ht(j)?R(j):(t.consume(j),V)}function K(j){return j===47||j===62||ht(j)?R(j):s(j)}function G(j){return j===62?(t.consume(j),t.exit("htmlTextData"),t.exit("htmlText"),r):s(j)}function Y(j){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),ee}function ee(j){return We(j)?Ze(t,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return t.enter("htmlTextData"),f(j)}}const $h={name:"labelEnd",resolveAll:Ob,resolveTo:Bb,tokenize:jb},Db={tokenize:Nb},Mb={tokenize:Hb},Lb={tokenize:zb};function Ob(t){let r=-1;const s=[];for(;++r<t.length;){const l=t[r][1];if(s.push(t[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const d=l.type==="labelImage"?4:2;l.type="data",r+=d}}return t.length!==s.length&&Rn(t,0,t.length,s),t}function Bb(t,r){let s=t.length,l=0,d,p,f,o;for(;s--;)if(d=t[s][1],p){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;t[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(t[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(p=s,d.type!=="labelLink")){l=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:t[p][1].type==="labelLink"?"link":"image",start:{...t[p][1].start},end:{...t[t.length-1][1].end}},h={type:"label",start:{...t[p][1].start},end:{...t[f][1].end}},m={type:"labelText",start:{...t[p+l+2][1].end},end:{...t[f-2][1].start}};return o=[["enter",c,r],["enter",h,r]],o=Un(o,t.slice(p+1,p+l+3)),o=Un(o,[["enter",m,r]]),o=Un(o,zo(r.parser.constructs.insideSpan.null,t.slice(p+l+4,f-3),r)),o=Un(o,[["exit",m,r],t[f-2],t[f-1],["exit",h,r]]),o=Un(o,t.slice(f+1)),o=Un(o,[["exit",c,r]]),Rn(t,p,t.length,o),t}function jb(t,r,s){const l=this;let d=l.events.length,p,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){p=l.events[d][1];break}return o;function o(y){return p?p._inactive?u(y):(f=l.parser.defined.includes(Xn(l.sliceSerialize({start:p.end,end:l.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(y),t.exit("labelMarker"),t.exit("labelEnd"),c):s(y)}function c(y){return y===40?t.attempt(Db,m,f?m:u)(y):y===91?t.attempt(Mb,m,f?h:u)(y):f?m(y):u(y)}function h(y){return t.attempt(Lb,m,u)(y)}function m(y){return r(y)}function u(y){return p._balanced=!0,s(y)}}function Nb(t,r,s){return l;function l(u){return t.enter("resource"),t.enter("resourceMarker"),t.consume(u),t.exit("resourceMarker"),d}function d(u){return ht(u)?Xa(t,p)(u):p(u)}function p(u){return u===41?m(u):j_(t,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ht(u)?Xa(t,c)(u):m(u)}function o(u){return s(u)}function c(u){return u===34||u===39||u===40?H_(t,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):m(u)}function h(u){return ht(u)?Xa(t,m)(u):m(u)}function m(u){return u===41?(t.enter("resourceMarker"),t.consume(u),t.exit("resourceMarker"),t.exit("resource"),r):s(u)}}function Hb(t,r,s){const l=this;return d;function d(o){return N_.call(l,t,p,f,"reference","referenceMarker","referenceString")(o)}function p(o){return l.parser.defined.includes(Xn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function zb(t,r,s){return l;function l(p){return t.enter("reference"),t.enter("referenceMarker"),t.consume(p),t.exit("referenceMarker"),d}function d(p){return p===93?(t.enter("referenceMarker"),t.consume(p),t.exit("referenceMarker"),t.exit("reference"),r):s(p)}}const Ib={name:"labelStartImage",resolveAll:$h.resolveAll,tokenize:Pb};function Pb(t,r,s){const l=this;return d;function d(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),p}function p(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),f):s(o)}function f(o){return o===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(o):r(o)}}const Ub={name:"labelStartLink",resolveAll:$h.resolveAll,tokenize:Fb};function Fb(t,r,s){const l=this;return d;function d(f){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelLink"),p}function p(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(f):r(f)}}const th={name:"lineEnding",tokenize:qb};function qb(t,r){return s;function s(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Ze(t,r,"linePrefix")}}const Eo={name:"thematicBreak",tokenize:$b};function $b(t,r,s){let l=0,d;return p;function p(h){return t.enter("thematicBreak"),f(h)}function f(h){return d=h,o(h)}function o(h){return h===d?(t.enter("thematicBreakSequence"),c(h)):l>=3&&(h===null||Oe(h))?(t.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(t.consume(h),l++,c):(t.exit("thematicBreakSequence"),We(h)?Ze(t,o,"whitespace")(h):o(h))}}const dn={continuation:{tokenize:Kb},exit:Xb,name:"list",tokenize:Wb},Gb={partial:!0,tokenize:Qb},Vb={partial:!0,tokenize:Yb};function Wb(t,r,s){const l=this,d=l.events[l.events.length-1];let p=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return o;function o(w){const T=l.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!l.containerState.marker||w===l.containerState.marker:xh(w)){if(l.containerState.type||(l.containerState.type=T,t.enter(T,{_container:!0})),T==="listUnordered")return t.enter("listItemPrefix"),w===42||w===45?t.check(Eo,s,h)(w):h(w);if(!l.interrupt||w===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(w)}return s(w)}function c(w){return xh(w)&&++f<10?(t.consume(w),c):(!l.interrupt||f<2)&&(l.containerState.marker?w===l.containerState.marker:w===41||w===46)?(t.exit("listItemValue"),h(w)):s(w)}function h(w){return t.enter("listItemMarker"),t.consume(w),t.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||w,t.check(al,l.interrupt?s:m,t.attempt(Gb,y,u))}function m(w){return l.containerState.initialBlankLine=!0,p++,y(w)}function u(w){return We(w)?(t.enter("listItemPrefixWhitespace"),t.consume(w),t.exit("listItemPrefixWhitespace"),y):s(w)}function y(w){return l.containerState.size=p+l.sliceSerialize(t.exit("listItemPrefix"),!0).length,r(w)}}function Kb(t,r,s){const l=this;return l.containerState._closeFlow=void 0,t.check(al,d,p);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Ze(t,r,"listItemIndent",l.containerState.size+1)(o)}function p(o){return l.containerState.furtherBlankLines||!We(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,t.attempt(Vb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Ze(t,t.attempt(dn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Yb(t,r,s){const l=this;return Ze(t,d,"listItemIndent",l.containerState.size+1);function d(p){const f=l.events[l.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===l.containerState.size?r(p):s(p)}}function Xb(t){t.exit(this.containerState.type)}function Qb(t,r,s){const l=this;return Ze(t,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(p){const f=l.events[l.events.length-1];return!We(p)&&f&&f[1].type==="listItemPrefixWhitespace"?r(p):s(p)}}const yg={name:"setextUnderline",resolveTo:Jb,tokenize:Zb};function Jb(t,r){let s=t.length,l,d,p;for(;s--;)if(t[s][0]==="enter"){if(t[s][1].type==="content"){l=s;break}t[s][1].type==="paragraph"&&(d=s)}else t[s][1].type==="content"&&t.splice(s,1),!p&&t[s][1].type==="definition"&&(p=s);const f={type:"setextHeading",start:{...t[l][1].start},end:{...t[t.length-1][1].end}};return t[d][1].type="setextHeadingText",p?(t.splice(d,0,["enter",f,r]),t.splice(p+1,0,["exit",t[l][1],r]),t[l][1].end={...t[p][1].end}):t[l][1]=f,t.push(["exit",f,r]),t}function Zb(t,r,s){const l=this;let d;return p;function p(h){let m=l.events.length,u;for(;m--;)if(l.events[m][1].type!=="lineEnding"&&l.events[m][1].type!=="linePrefix"&&l.events[m][1].type!=="content"){u=l.events[m][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||u)?(t.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return t.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===d?(t.consume(h),o):(t.exit("setextHeadingLineSequence"),We(h)?Ze(t,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Oe(h)?(t.exit("setextHeadingLine"),r(h)):s(h)}}const eC={tokenize:tC};function tC(t){const r=this,s=t.attempt(al,l,t.attempt(this.parser.constructs.flowInitial,d,Ze(t,t.attempt(this.parser.constructs.flow,d,t.attempt(ab,d)),"linePrefix")));return s;function l(p){if(p===null){t.consume(p);return}return t.enter("lineEndingBlank"),t.consume(p),t.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(p){if(p===null){t.consume(p);return}return t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),r.currentConstruct=void 0,s}}const nC={resolveAll:I_()},iC=z_("string"),rC=z_("text");function z_(t){return{resolveAll:I_(t==="text"?sC:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[t],p=s.attempt(d,f,o);return f;function f(m){return h(m)?p(m):o(m)}function o(m){if(m===null){s.consume(m);return}return s.enter("data"),s.consume(m),c}function c(m){return h(m)?(s.exit("data"),p(m)):(s.consume(m),c)}function h(m){if(m===null)return!0;const u=d[m];let y=-1;if(u)for(;++y<u.length;){const w=u[y];if(!w.previous||w.previous.call(l,l.previous))return!0}return!1}}}function I_(t){return r;function r(s,l){let d=-1,p;for(;++d<=s.length;)p===void 0?s[d]&&s[d][1].type==="data"&&(p=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==p+2&&(s[p][1].end=s[d-1][1].end,s.splice(p+2,d-p-2),d=p+2),p=void 0);return t?t(s,l):s}}function sC(t,r){let s=0;for(;++s<=t.length;)if((s===t.length||t[s][1].type==="lineEnding")&&t[s-1][1].type==="data"){const l=t[s-1][1],d=r.sliceStream(l);let p=d.length,f=-1,o=0,c;for(;p--;){const h=d[p];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(h===-2)c=!0,o++;else if(h!==-1){p++;break}}if(r._contentTypeTextTrailing&&s===t.length&&(o=0),o){const h={type:s===t.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:p?f:l.start._bufferIndex+f,_index:l.start._index+p,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...h.start},l.start.offset===l.end.offset?Object.assign(l,h):(t.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return t}const aC={42:dn,43:dn,45:dn,48:dn,49:dn,50:dn,51:dn,52:dn,53:dn,54:dn,55:dn,56:dn,57:dn,62:M_},lC={91:hb},oC={[-2]:eh,[-1]:eh,32:eh},cC={35:_b,42:Eo,45:[yg,Eo],60:bb,61:yg,95:Eo,96:_g,126:_g},uC={38:O_,92:L_},hC={[-5]:th,[-4]:th,[-3]:th,33:Ib,38:O_,42:Eh,60:[US,Tb],91:Ub,92:[mb,L_],93:$h,95:Eh,96:eb},fC={null:[Eh,nC]},dC={null:[42,95]},pC={null:[]},mC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dC,contentInitial:lC,disable:pC,document:aC,flow:cC,flowInitial:oC,insideSpan:fC,string:uC,text:hC},Symbol.toStringTag,{value:"Module"}));function gC(t,r,s){let l={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},p=[];let f=[],o=[];const c={attempt:D(L),check:D(M),consume:_,enter:S,exit:A,interrupt:D(M,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:T,parser:t,previous:null,sliceSerialize:y,sliceStream:w,write:u};let m=r.tokenize.call(h,c);return r.resolveAll&&p.push(r),h;function u(H){return f=Un(f,H),b(),f[f.length-1]!==null?[]:(k(r,0),h.events=zo(p,h.events,h),h.events)}function y(H,U){return vC(w(H),U)}function w(H){return _C(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:V,offset:K}=l;return{_bufferIndex:H,_index:U,line:P,column:V,offset:K}}function E(H){d[H.line]=H.column,B()}function b(){let H;for(;l._index<f.length;){const U=f[l._index];if(typeof U=="string")for(H=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===H&&l._bufferIndex<U.length;)v(U.charCodeAt(l._bufferIndex));else v(U)}}function v(H){m=m(H)}function _(H){Oe(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,B()):H!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===f[l._index].length&&(l._bufferIndex=-1,l._index++)),h.previous=H}function S(H,U){const P=U||{};return P.type=H,P.start=T(),h.events.push(["enter",P,h]),o.push(P),P}function A(H){const U=o.pop();return U.end=T(),h.events.push(["exit",U,h]),U}function L(H,U){k(H,U.from)}function M(H,U){U.restore()}function D(H,U){return P;function P(V,K,G){let Y,ee,z,j;return Array.isArray(V)?$(V):"tokenize"in V?$([V]):N(V);function N(ve){return Q;function Q(q){const ce=q!==null&&ve[q],ae=q!==null&&ve.null,be=[...Array.isArray(ce)?ce:ce?[ce]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return $(be)(q)}}function $(ve){return Y=ve,ee=0,ve.length===0?G:I(ve[ee])}function I(ve){return Q;function Q(q){return j=R(),z=ve,ve.partial||(h.currentConstruct=ve),ve.name&&h.parser.constructs.disable.null.includes(ve.name)?me():ve.tokenize.call(U?Object.assign(Object.create(h),U):h,c,ie,me)(q)}}function ie(ve){return H(z,j),K}function me(ve){return j.restore(),++ee<Y.length?I(Y[ee]):G}}}function k(H,U){H.resolveAll&&!p.includes(H)&&p.push(H),H.resolve&&Rn(h.events,U,h.events.length-U,H.resolve(h.events.slice(U),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function R(){const H=T(),U=h.previous,P=h.currentConstruct,V=h.events.length,K=Array.from(o);return{from:V,restore:G};function G(){l=H,h.previous=U,h.currentConstruct=P,h.events.length=V,o=K,B()}}function B(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function _C(t,r){const s=r.start._index,l=r.start._bufferIndex,d=r.end._index,p=r.end._bufferIndex;let f;if(s===d)f=[t[s].slice(l,p)];else{if(f=t.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}p>0&&f.push(t[d].slice(0,p))}return f}function vC(t,r){let s=-1;const l=[];let d;for(;++s<t.length;){const p=t[s];let f;if(typeof p=="string")f=p;else switch(p){case-5:{f="\r";break}case-4:{f=`
|
|
64
|
-
`;break}case-3:{f=`\r
|
|
65
|
-
`;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(p)}d=p===-2,l.push(f)}return l.join("")}function yC(t){const l={constructs:R_([mC,...(t||{}).extensions||[]]),content:d(BS),defined:[],document:d(NS),flow:d(eC),lazy:{},string:d(iC),text:d(rC)};return l;function d(p){return f;function f(o){return gC(l,p,o)}}}function SC(t){for(;!B_(t););return t}const Sg=/[\0\t\n\r]/g;function bC(){let t=1,r="",s=!0,l;return d;function d(p,f,o){const c=[];let h,m,u,y,w;for(p=r+(typeof p=="string"?p.toString():new TextDecoder(f||void 0).decode(p)),u=0,r="",s&&(p.charCodeAt(0)===65279&&u++,s=void 0);u<p.length;){if(Sg.lastIndex=u,h=Sg.exec(p),y=h&&h.index!==void 0?h.index:p.length,w=p.charCodeAt(y),!h){r=p.slice(u);break}if(w===10&&u===y&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),u<y&&(c.push(p.slice(u,y)),t+=y-u),w){case 0:{c.push(65533),t++;break}case 9:{for(m=Math.ceil(t/4)*4,c.push(-2);t++<m;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:l=!0,t=1}u=y+1}return o&&(l&&c.push(-5),r&&c.push(r),c.push(null)),c}}const CC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wC(t){return t.replace(CC,xC)}function xC(t,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),p=d===120||d===88;return D_(s.slice(p?2:1),p?16:10)}return qh(s)||t}const P_={}.hasOwnProperty;function EC(t,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),kC(s)(SC(yC(s).document().write(bC()(t,r,!0))))}function kC(t){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p(He),autolinkProtocol:R,autolinkEmail:R,atxHeading:p(Me),blockQuote:p(ae),characterEscape:R,characterReference:R,codeFenced:p(be),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:p(be,f),codeText:p(Ee,f),codeTextData:R,data:R,codeFlowValue:R,definition:p(xe),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:p(de),hardBreakEscape:p($e),hardBreakTrailing:p($e),htmlFlow:p(Ae,f),htmlFlowData:R,htmlText:p(Ae,f),htmlTextData:R,image:p(ge),label:f,link:p(He),listItem:p(Dt),listItemValue:y,listOrdered:p(Ke,u),listUnordered:p(Ke),paragraph:p(Vt),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:p(Me),strong:p(St),thematicBreak:p(Nt)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ce,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ve,characterReference:Q,codeFenced:c(b),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:B,codeIndented:c(v),codeText:c(K),codeTextData:B,data:B,definition:c(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:B,htmlText:c(V),htmlTextData:B,image:c(Y),label:z,labelText:ee,lineEnding:H,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:j,resourceTitleString:N,resource:$,setextHeading:c(k),setextHeadingLineSequence:D,setextHeadingText:M,strong:c(),thematicBreak:c()}};U_(r,(t||{}).mdastExtensions||[]);const s={};return l;function l(he){let Ce={type:"root",children:[]};const Re={stack:[Ce],tokenStack:[],config:r,enter:o,exit:h,buffer:f,resume:m,data:s},je=[];let Ne=-1;for(;++Ne<he.length;)if(he[Ne][1].type==="listOrdered"||he[Ne][1].type==="listUnordered")if(he[Ne][0]==="enter")je.push(Ne);else{const _t=je.pop();Ne=d(he,_t,Ne)}for(Ne=-1;++Ne<he.length;){const _t=r[he[Ne][0]];P_.call(_t,he[Ne][1].type)&&_t[he[Ne][1].type].call(Object.assign({sliceSerialize:he[Ne][2].sliceSerialize},Re),he[Ne][1])}if(Re.tokenStack.length>0){const _t=Re.tokenStack[Re.tokenStack.length-1];(_t[1]||bg).call(Re,void 0,_t[0])}for(Ce.position={start:vr(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:vr(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<r.transforms.length;)Ce=r.transforms[Ne](Ce)||Ce;return Ce}function d(he,Ce,Re){let je=Ce-1,Ne=-1,_t=!1,qe,bt,Ct,xt;for(;++je<=Re;){const nt=he[je];switch(nt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{nt[0]==="enter"?Ne++:Ne--,xt=void 0;break}case"lineEndingBlank":{nt[0]==="enter"&&(qe&&!xt&&!Ne&&!Ct&&(Ct=je),xt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xt=void 0}if(!Ne&&nt[0]==="enter"&&nt[1].type==="listItemPrefix"||Ne===-1&&nt[0]==="exit"&&(nt[1].type==="listUnordered"||nt[1].type==="listOrdered")){if(qe){let mn=je;for(bt=void 0;mn--;){const en=he[mn];if(en[1].type==="lineEnding"||en[1].type==="lineEndingBlank"){if(en[0]==="exit")continue;bt&&(he[bt][1].type="lineEndingBlank",_t=!0),en[1].type="lineEnding",bt=mn}else if(!(en[1].type==="linePrefix"||en[1].type==="blockQuotePrefix"||en[1].type==="blockQuotePrefixWhitespace"||en[1].type==="blockQuoteMarker"||en[1].type==="listItemIndent"))break}Ct&&(!bt||Ct<bt)&&(qe._spread=!0),qe.end=Object.assign({},bt?he[bt][1].start:nt[1].end),he.splice(bt||je,0,["exit",qe,nt[2]]),je++,Re++}if(nt[1].type==="listItemPrefix"){const mn={type:"listItem",_spread:!1,start:Object.assign({},nt[1].start),end:void 0};qe=mn,he.splice(je,0,["enter",mn,nt[2]]),je++,Re++,Ct=void 0,xt=!0}}}return he[Ce][1]._spread=_t,Re}function p(he,Ce){return Re;function Re(je){o.call(this,he(je),je),Ce&&Ce.call(this,je)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(he,Ce,Re){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ce,Re||void 0]),he.position={start:vr(Ce.start),end:void 0}}function c(he){return Ce;function Ce(Re){he&&he.call(this,Re),h.call(this,Re)}}function h(he,Ce){const Re=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==he.type&&(Ce?Ce.call(this,he,je[0]):(je[1]||bg).call(this,he,je[0]));else throw new Error("Cannot close `"+he.type+"` ("+Ya({start:he.start,end:he.end})+"): it’s not open");Re.position.end=vr(he.end)}function m(){return Fh(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function y(he){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function w(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=he}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=he}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/(\r?\n|\r)$/g,"")}function _(he){const Ce=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Ce,Re.identifier=Xn(this.sliceSerialize(he)).toLowerCase()}function S(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function A(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function L(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Re=this.sliceSerialize(he).length;Ce.depth=Re}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function D(he){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function R(he){const Re=this.stack[this.stack.length-1].children;let je=Re[Re.length-1];(!je||je.type!=="text")&&(je=dt(),je.position={start:vr(he.start),end:void 0},Re.push(je)),this.stack.push(je)}function B(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=vr(he.end)}function H(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=Ce.children[Ce.children.length-1];Re.position.end=vr(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Ce.type)&&(R.call(this,he),B.call(this,he))}function U(){this.data.atHardBreak=!0}function P(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function V(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function K(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function G(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Y(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function ee(he){const Ce=this.sliceSerialize(he),Re=this.stack[this.stack.length-2];Re.label=wC(Ce),Re.identifier=Xn(Ce).toLowerCase()}function z(){const he=this.stack[this.stack.length-1],Ce=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const je=he.children;Re.children=je}else Re.alt=Ce}function j(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function N(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ie(he){const Ce=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Ce,Re.identifier=Xn(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function me(he){this.data.characterReferenceType=he.type}function ve(he){const Ce=this.sliceSerialize(he),Re=this.data.characterReferenceType;let je;Re?(je=D_(Ce,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=qh(Ce);const Ne=this.stack[this.stack.length-1];Ne.value+=je}function Q(he){const Ce=this.stack.pop();Ce.position.end=vr(he.end)}function q(he){B.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(he)}function ce(he){B.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(he)}function ae(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function Ae(){return{type:"html",value:""}}function ge(){return{type:"image",title:null,url:"",alt:null}}function He(){return{type:"link",title:null,url:"",children:[]}}function Ke(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Dt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Vt(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function dt(){return{type:"text",value:""}}function Nt(){return{type:"thematicBreak"}}}function vr(t){return{line:t.line,column:t.column,offset:t.offset}}function U_(t,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?U_(t,l):AC(t,l)}}function AC(t,r){let s;for(s in r)if(P_.call(r,s))switch(s){case"canContainEols":{const l=r[s];l&&t[s].push(...l);break}case"transforms":{const l=r[s];l&&t[s].push(...l);break}case"enter":case"exit":{const l=r[s];l&&Object.assign(t[s],l);break}}}function bg(t,r){throw t?new Error("Cannot close `"+t.type+"` ("+Ya({start:t.start,end:t.end})+"): a different token (`"+r.type+"`, "+Ya({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Ya({start:r.start,end:r.end})+") is still open")}function TC(t){const r=this;r.parser=s;function s(l){return EC(l,{...r.data("settings"),...t,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function RC(t,r){const s={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(r),!0)};return t.patch(r,s),t.applyData(r,s)}function DC(t,r){const s={type:"element",tagName:"br",properties:{},children:[]};return t.patch(r,s),[t.applyData(r,s),{type:"text",value:`
|
|
66
|
-
`}]}function MC(t,r){const s=r.value?r.value+`
|
|
67
|
-
`:"",l={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(l.className=["language-"+d[0]]);let p={type:"element",tagName:"code",properties:l,children:[{type:"text",value:s}]};return r.meta&&(p.data={meta:r.meta}),t.patch(r,p),p=t.applyData(r,p),p={type:"element",tagName:"pre",properties:{},children:[p]},t.patch(r,p),p}function LC(t,r){const s={type:"element",tagName:"del",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function OC(t,r){const s={type:"element",tagName:"em",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function BC(t,r){const s=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),d=qs(l.toLowerCase()),p=t.footnoteOrder.indexOf(l);let f,o=t.footnoteCounts.get(l);o===void 0?(o=0,t.footnoteOrder.push(l),f=t.footnoteOrder.length):f=p+1,o+=1,t.footnoteCounts.set(l,o);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};t.patch(r,c);const h={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(r,h),t.applyData(r,h)}function jC(t,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function NC(t,r){if(t.options.allowDangerousHtml){const s={type:"raw",value:r.value};return t.patch(r,s),t.applyData(r,s)}}function F_(t,r){const s=r.referenceType;let l="]";if(s==="collapsed"?l+="[]":s==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const d=t.all(r),p=d[0];p&&p.type==="text"?p.value="["+p.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=l:d.push({type:"text",value:l}),d}function HC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return F_(t,r);const d={src:qs(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(d.title=l.title);const p={type:"element",tagName:"img",properties:d,children:[]};return t.patch(r,p),t.applyData(r,p)}function zC(t,r){const s={src:qs(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return t.patch(r,l),t.applyData(r,l)}function IC(t,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};t.patch(r,s);const l={type:"element",tagName:"code",properties:{},children:[s]};return t.patch(r,l),t.applyData(r,l)}function PC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return F_(t,r);const d={href:qs(l.url||"")};l.title!==null&&l.title!==void 0&&(d.title=l.title);const p={type:"element",tagName:"a",properties:d,children:t.all(r)};return t.patch(r,p),t.applyData(r,p)}function UC(t,r){const s={href:qs(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function FC(t,r,s){const l=t.all(r),d=s?qC(s):q_(r),p={},f=[];if(typeof r.checked=="boolean"){const m=l[0];let u;m&&m.type==="element"&&m.tagName==="p"?u=m:(u={type:"element",tagName:"p",properties:{},children:[]},l.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),p.className=["task-list-item"]}let o=-1;for(;++o<l.length;){const m=l[o];(d||o!==0||m.type!=="element"||m.tagName!=="p")&&f.push({type:"text",value:`
|
|
68
|
-
`}),m.type==="element"&&m.tagName==="p"&&!d?f.push(...m.children):f.push(m)}const c=l[l.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
|
|
69
|
-
`});const h={type:"element",tagName:"li",properties:p,children:f};return t.patch(r,h),t.applyData(r,h)}function qC(t){let r=!1;if(t.type==="list"){r=t.spread||!1;const s=t.children;let l=-1;for(;!r&&++l<s.length;)r=q_(s[l])}return r}function q_(t){const r=t.spread;return r??t.children.length>1}function $C(t,r){const s={},l=t.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<l.length;){const f=l[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const p={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:t.wrap(l,!0)};return t.patch(r,p),t.applyData(r,p)}function GC(t,r){const s={type:"element",tagName:"p",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function VC(t,r){const s={type:"root",children:t.wrap(t.all(r))};return t.patch(r,s),t.applyData(r,s)}function WC(t,r){const s={type:"element",tagName:"strong",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function KC(t,r){const s=t.all(r),l=s.shift(),d=[];if(l){const f={type:"element",tagName:"thead",properties:{},children:t.wrap([l],!0)};t.patch(r.children[0],f),d.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:t.wrap(s,!0)},o=zh(r.children[1]),c=C_(r.children[r.children.length-1]);o&&c&&(f.position={start:o,end:c}),d.push(f)}const p={type:"element",tagName:"table",properties:{},children:t.wrap(d,!0)};return t.patch(r,p),t.applyData(r,p)}function YC(t,r,s){const l=s?s.children:void 0,p=(l?l.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,o=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<o;){const u=r.children[c],y={},w=f?f[c]:void 0;w&&(y.align=w);let T={type:"element",tagName:p,properties:y,children:[]};u&&(T.children=t.all(u),t.patch(u,T),T=t.applyData(u,T)),h.push(T)}const m={type:"element",tagName:"tr",properties:{},children:t.wrap(h,!0)};return t.patch(r,m),t.applyData(r,m)}function XC(t,r){const s={type:"element",tagName:"td",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}const Cg=9,wg=32;function QC(t){const r=String(t),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const p=[];for(;l;)p.push(xg(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return p.push(xg(r.slice(d),d>0,!1)),p.join("")}function xg(t,r,s){let l=0,d=t.length;if(r){let p=t.codePointAt(l);for(;p===Cg||p===wg;)l++,p=t.codePointAt(l)}if(s){let p=t.codePointAt(d-1);for(;p===Cg||p===wg;)d--,p=t.codePointAt(d-1)}return d>l?t.slice(l,d):""}function JC(t,r){const s={type:"text",value:QC(String(r.value))};return t.patch(r,s),t.applyData(r,s)}function ZC(t,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(r,s),t.applyData(r,s)}const ew={blockquote:RC,break:DC,code:MC,delete:LC,emphasis:OC,footnoteReference:BC,heading:jC,html:NC,imageReference:HC,image:zC,inlineCode:IC,linkReference:PC,link:UC,listItem:FC,list:$C,paragraph:GC,root:VC,strong:WC,table:KC,tableCell:XC,tableRow:YC,text:JC,thematicBreak:ZC,toml:So,yaml:So,definition:So,footnoteDefinition:So};function So(){}const $_=-1,Io=0,Qa=1,Ro=2,Gh=3,Vh=4,Wh=5,Kh=6,G_=7,V_=8,tw=typeof self=="object"?self:globalThis,Eg=(t,r)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new tw[t](r)},nw=(t,r)=>{const s=(d,p)=>(t.set(p,d),d),l=d=>{if(t.has(d))return t.get(d);const[p,f]=r[d];switch(p){case Io:case $_:return s(f,d);case Qa:{const o=s([],d);for(const c of f)o.push(l(c));return o}case Ro:{const o=s({},d);for(const[c,h]of f)o[l(c)]=l(h);return o}case Gh:return s(new Date(f),d);case Vh:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case Wh:{const o=s(new Map,d);for(const[c,h]of f)o.set(l(c),l(h));return o}case Kh:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case G_:{const{name:o,message:c}=f;return s(Eg(o,c),d)}case V_:return s(BigInt(f),d);case"BigInt":return s(Object(BigInt(f)),d);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:o}=new Uint8Array(f);return s(new DataView(o),f)}}return s(Eg(p,f),d)};return l},kg=t=>nw(new Map,t)(0),js="",{toString:iw}={},{keys:rw}=Object,Wa=t=>{const r=typeof t;if(r!=="object"||!t)return[Io,r];const s=iw.call(t).slice(8,-1);switch(s){case"Array":return[Qa,js];case"Object":return[Ro,js];case"Date":return[Gh,js];case"RegExp":return[Vh,js];case"Map":return[Wh,js];case"Set":return[Kh,js];case"DataView":return[Qa,s]}return s.includes("Array")?[Qa,s]:s.includes("Error")?[G_,s]:[Ro,s]},bo=([t,r])=>t===Io&&(r==="function"||r==="symbol"),sw=(t,r,s,l)=>{const d=(f,o)=>{const c=l.push(f)-1;return s.set(o,c),c},p=f=>{if(s.has(f))return s.get(f);let[o,c]=Wa(f);switch(o){case Io:{let m=f;switch(c){case"bigint":o=V_,m=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return d([$_],f)}return d([o,m],f)}case Qa:{if(c){let y=f;return c==="DataView"?y=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(y=new Uint8Array(f)),d([c,[...y]],f)}const m=[],u=d([o,m],f);for(const y of f)m.push(p(y));return u}case Ro:{if(c)switch(c){case"BigInt":return d([c,f.toString()],f);case"Boolean":case"Number":case"String":return d([c,f.valueOf()],f)}if(r&&"toJSON"in f)return p(f.toJSON());const m=[],u=d([o,m],f);for(const y of rw(f))(t||!bo(Wa(f[y])))&&m.push([p(y),p(f[y])]);return u}case Gh:return d([o,f.toISOString()],f);case Vh:{const{source:m,flags:u}=f;return d([o,{source:m,flags:u}],f)}case Wh:{const m=[],u=d([o,m],f);for(const[y,w]of f)(t||!(bo(Wa(y))||bo(Wa(w))))&&m.push([p(y),p(w)]);return u}case Kh:{const m=[],u=d([o,m],f);for(const y of f)(t||!bo(Wa(y)))&&m.push(p(y));return u}}const{message:h}=f;return d([o,{name:c,message:h}],f)};return p},Ag=(t,{json:r,lossy:s}={})=>{const l=[];return sw(!(r||s),!!r,new Map,l)(t),l},Do=typeof structuredClone=="function"?(t,r)=>r&&("json"in r||"lossy"in r)?kg(Ag(t,r)):structuredClone(t):(t,r)=>kg(Ag(t,r));function aw(t,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function lw(t,r){return"Back to reference "+(t+1)+(r>1?"-"+r:"")}function ow(t){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",s=t.options.footnoteBackContent||aw,l=t.options.footnoteBackLabel||lw,d=t.options.footnoteLabel||"Footnotes",p=t.options.footnoteLabelTagName||"h2",f=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<t.footnoteOrder.length;){const h=t.footnoteById.get(t.footnoteOrder[c]);if(!h)continue;const m=t.all(h),u=String(h.identifier).toUpperCase(),y=qs(u.toLowerCase());let w=0;const T=[],E=t.footnoteCounts.get(u);for(;E!==void 0&&++w<=E;){T.length>0&&T.push({type:"text",value:" "});let _=typeof s=="string"?s:s(c,w);typeof _=="string"&&(_={type:"text",value:_}),T.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+y+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(c,w),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const b=m[m.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const _=b.children[b.children.length-1];_&&_.type==="text"?_.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...T)}else m.push(...T);const v={type:"element",tagName:"li",properties:{id:r+"fn-"+y},children:t.wrap(m,!0)};t.patch(h,v),o.push(v)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:p,properties:{...Do(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
|
|
70
|
-
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
|
|
71
|
-
`}]}}const Po=(function(t){if(t==null)return fw;if(typeof t=="function")return Uo(t);if(typeof t=="object")return Array.isArray(t)?cw(t):uw(t);if(typeof t=="string")return hw(t);throw new Error("Expected function, string, or object as test")});function cw(t){const r=[];let s=-1;for(;++s<t.length;)r[s]=Po(t[s]);return Uo(l);function l(...d){let p=-1;for(;++p<r.length;)if(r[p].apply(this,d))return!0;return!1}}function uw(t){const r=t;return Uo(s);function s(l){const d=l;let p;for(p in t)if(d[p]!==r[p])return!1;return!0}}function hw(t){return Uo(r);function r(s){return s&&s.type===t}}function Uo(t){return r;function r(s,l,d){return!!(dw(s)&&t.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function fw(){return!0}function dw(t){return t!==null&&typeof t=="object"&&"type"in t}const W_=[],pw=!0,kh=!1,mw="skip";function K_(t,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const p=Po(d),f=l?-1:1;o(t,void 0,[])();function o(c,h,m){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const w=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return y;function y(){let w=W_,T,E,b;if((!r||p(c,h,m[m.length-1]||void 0))&&(w=gw(s(c,m)),w[0]===kh))return w;if("children"in c&&c.children){const v=c;if(v.children&&w[0]!==mw)for(E=(l?v.children.length:-1)+f,b=m.concat(v);E>-1&&E<v.children.length;){const _=v.children[E];if(T=o(_,E,b)(),T[0]===kh)return T;E=typeof T[1]=="number"?T[1]:E+f}}return w}}}function gw(t){return Array.isArray(t)?t:typeof t=="number"?[pw,t]:t==null?W_:[t]}function Yh(t,r,s,l){let d,p,f;typeof r=="function"&&typeof s!="function"?(p=void 0,f=r,d=s):(p=r,f=s,d=l),K_(t,p,o,d);function o(c,h){const m=h[h.length-1],u=m?m.children.indexOf(c):void 0;return f(c,u,m)}}const Ah={}.hasOwnProperty,_w={};function vw(t,r){const s=r||_w,l=new Map,d=new Map,p=new Map,f={...ew,...s.handlers},o={all:h,applyData:Sw,definitionById:l,footnoteById:d,footnoteCounts:p,footnoteOrder:[],handlers:f,one:c,options:s,patch:yw,wrap:Cw};return Yh(t,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const u=m.type==="definition"?l:d,y=String(m.identifier).toUpperCase();u.has(y)||u.set(y,m)}}),o;function c(m,u){const y=m.type,w=o.handlers[y];if(Ah.call(o.handlers,y)&&w)return w(o,m,u);if(o.options.passThrough&&o.options.passThrough.includes(y)){if("children"in m){const{children:E,...b}=m,v=Do(b);return v.children=o.all(m),v}return Do(m)}return(o.options.unknownHandler||bw)(o,m,u)}function h(m){const u=[];if("children"in m){const y=m.children;let w=-1;for(;++w<y.length;){const T=o.one(y[w],m);if(T){if(w&&y[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=Tg(T.value)),!Array.isArray(T)&&T.type==="element")){const E=T.children[0];E&&E.type==="text"&&(E.value=Tg(E.value))}Array.isArray(T)?u.push(...T):u.push(T)}}}return u}}function yw(t,r){t.position&&(r.position=aS(t))}function Sw(t,r){let s=r;if(t&&t.data){const l=t.data.hName,d=t.data.hChildren,p=t.data.hProperties;if(typeof l=="string")if(s.type==="element")s.tagName=l;else{const f="children"in s?s.children:[s];s={type:"element",tagName:l,properties:{},children:f}}s.type==="element"&&p&&Object.assign(s.properties,Do(p)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function bw(t,r){const s=r.data||{},l="value"in r&&!(Ah.call(s,"hProperties")||Ah.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function Cw(t,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
|
|
72
|
-
`});++l<t.length;)l&&s.push({type:"text",value:`
|
|
73
|
-
`}),s.push(t[l]);return r&&t.length>0&&s.push({type:"text",value:`
|
|
74
|
-
`}),s}function Tg(t){let r=0,s=t.charCodeAt(r);for(;s===9||s===32;)r++,s=t.charCodeAt(r);return t.slice(r)}function Rg(t,r){const s=vw(t,r),l=s.one(t,void 0),d=ow(s),p=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return d&&p.children.push({type:"text",value:`
|
|
75
|
-
`},d),p}function ww(t,r){return t&&"run"in t?async function(s,l){const d=Rg(s,{file:l,...r});await t.run(d,l)}:function(s,l){return Rg(s,{file:l,...t||r})}}function Dg(t){if(t)throw t}var nh,Mg;function xw(){if(Mg)return nh;Mg=1;var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},p=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var m=t.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&t.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!u)return!1;var y;for(y in h);return typeof y>"u"||t.call(h,y)},f=function(h,m){s&&m.name==="__proto__"?s(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},o=function(h,m){if(m==="__proto__")if(t.call(h,m)){if(l)return l(h,m).value}else return;return h[m]};return nh=function c(){var h,m,u,y,w,T,E=arguments[0],b=1,v=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},b=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});b<v;++b)if(h=arguments[b],h!=null)for(m in h)u=o(E,m),y=o(h,m),E!==y&&(_&&y&&(p(y)||(w=d(y)))?(w?(w=!1,T=u&&d(u)?u:[]):T=u&&p(u)?u:{},f(E,{name:m,newValue:c(_,T,y)})):typeof y<"u"&&f(E,{name:m,newValue:y}));return E},nh}var Ew=xw();const ih=i_(Ew);function Th(t){if(typeof t!="object"||t===null)return!1;const r=Object.getPrototypeOf(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function kw(){const t=[],r={run:s,use:l};return r;function s(...d){let p=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);o(null,...d);function o(c,...h){const m=t[++p];let u=-1;if(c){f(c);return}for(;++u<d.length;)(h[u]===null||h[u]===void 0)&&(h[u]=d[u]);d=h,m?Aw(m,o)(...h):f(null,...h)}}function l(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return t.push(d),r}}function Aw(t,r){let s;return l;function l(...f){const o=t.length>f.length;let c;o&&f.push(d);try{c=t.apply(this,f)}catch(h){const m=h;if(o&&s)throw m;return d(m)}o||(c&&c.then&&typeof c.then=="function"?c.then(p,d):c instanceof Error?d(c):p(c))}function d(f,...o){s||(s=!0,r(f,...o))}function p(f){d(null,f)}}const li={basename:Tw,dirname:Rw,extname:Dw,join:Mw,sep:"/"};function Tw(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');ll(t);let s=0,l=-1,d=t.length,p;if(r===void 0||r.length===0||r.length>t.length){for(;d--;)if(t.codePointAt(d)===47){if(p){s=d+1;break}}else l<0&&(p=!0,l=d+1);return l<0?"":t.slice(s,l)}if(r===t)return"";let f=-1,o=r.length-1;for(;d--;)if(t.codePointAt(d)===47){if(p){s=d+1;break}}else f<0&&(p=!0,f=d+1),o>-1&&(t.codePointAt(d)===r.codePointAt(o--)?o<0&&(l=d):(o=-1,l=f));return s===l?l=f:l<0&&(l=t.length),t.slice(s,l)}function Rw(t){if(ll(t),t.length===0)return".";let r=-1,s=t.length,l;for(;--s;)if(t.codePointAt(s)===47){if(l){r=s;break}}else l||(l=!0);return r<0?t.codePointAt(0)===47?"/":".":r===1&&t.codePointAt(0)===47?"//":t.slice(0,r)}function Dw(t){ll(t);let r=t.length,s=-1,l=0,d=-1,p=0,f;for(;r--;){const o=t.codePointAt(r);if(o===47){if(f){l=r+1;break}continue}s<0&&(f=!0,s=r+1),o===46?d<0?d=r:p!==1&&(p=1):d>-1&&(p=-1)}return d<0||s<0||p===0||p===1&&d===s-1&&d===l+1?"":t.slice(d,s)}function Mw(...t){let r=-1,s;for(;++r<t.length;)ll(t[r]),t[r]&&(s=s===void 0?t[r]:s+"/"+t[r]);return s===void 0?".":Lw(s)}function Lw(t){ll(t);const r=t.codePointAt(0)===47;let s=Ow(t,!r);return s.length===0&&!r&&(s="."),s.length>0&&t.codePointAt(t.length-1)===47&&(s+="/"),r?"/"+s:s}function Ow(t,r){let s="",l=0,d=-1,p=0,f=-1,o,c;for(;++f<=t.length;){if(f<t.length)o=t.codePointAt(f);else{if(o===47)break;o=47}if(o===47){if(!(d===f-1||p===1))if(d!==f-1&&p===2){if(s.length<2||l!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",l=0):(s=s.slice(0,c),l=s.length-1-s.lastIndexOf("/")),d=f,p=0;continue}}else if(s.length>0){s="",l=0,d=f,p=0;continue}}r&&(s=s.length>0?s+"/..":"..",l=2)}else s.length>0?s+="/"+t.slice(d+1,f):s=t.slice(d+1,f),l=f-d-1;d=f,p=0}else o===46&&p>-1?p++:p=-1}return s}function ll(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Bw={cwd:jw};function jw(){return"/"}function Rh(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Nw(t){if(typeof t=="string")t=new URL(t);else if(!Rh(t)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(t.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Hw(t)}function Hw(t){if(t.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=t.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const l=r.codePointAt(s+2);if(l===70||l===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const rh=["history","path","basename","stem","extname","dirname"];class Y_{constructor(r){let s;r?Rh(r)?s={path:r}:typeof r=="string"||zw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Bw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<rh.length;){const p=rh[l];p in s&&s[p]!==void 0&&s[p]!==null&&(this[p]=p==="history"?[...s[p]]:s[p])}let d;for(d in s)rh.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?li.basename(this.path):void 0}set basename(r){ah(r,"basename"),sh(r,"basename"),this.path=li.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?li.dirname(this.path):void 0}set dirname(r){Lg(this.basename,"dirname"),this.path=li.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?li.extname(this.path):void 0}set extname(r){if(sh(r,"extname"),Lg(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=li.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Rh(r)&&(r=Nw(r)),ah(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?li.basename(this.path,this.extname):void 0}set stem(r){ah(r,"stem"),sh(r,"stem"),this.path=li.join(this.dirname||"",r+(this.extname||""))}fail(r,s,l){const d=this.message(r,s,l);throw d.fatal=!0,d}info(r,s,l){const d=this.message(r,s,l);return d.fatal=void 0,d}message(r,s,l){const d=new Zt(r,s,l);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function sh(t,r){if(t&&t.includes(li.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+li.sep+"`")}function ah(t,r){if(!t)throw new Error("`"+r+"` cannot be empty")}function Lg(t,r){if(!t)throw new Error("Setting `"+r+"` requires `path` to be set too")}function zw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Iw=(function(t){const l=this.constructor.prototype,d=l[t],p=function(){return d.apply(p,arguments)};return Object.setPrototypeOf(p,l),p}),Pw={}.hasOwnProperty;class Xh extends Iw{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=kw()}copy(){const r=new Xh;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(ih(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(ch("data",this.frozen),this.namespace[r]=s,this):Pw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(ch("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const d=s.call(r,...l);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Co(r),l=this.parser||this.Parser;return lh("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),lh("process",this.parser||this.Parser),oh("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(p,f){const o=Co(r),c=l.parse(o);l.run(c,o,function(m,u,y){if(m||!u||!y)return h(m);const w=u,T=l.stringify(w,y);qw(T)?y.value=T:y.result=T,h(m,y)});function h(m,u){m||!u?f(m):p?p(u):s(void 0,u)}}}processSync(r){let s=!1,l;return this.freeze(),lh("processSync",this.parser||this.Parser),oh("processSync",this.compiler||this.Compiler),this.process(r,d),Bg("processSync","process",s),l;function d(p,f){s=!0,Dg(p),l=f}}run(r,s,l){Og(r),this.freeze();const d=this.transformers;return!l&&typeof s=="function"&&(l=s,s=void 0),l?p(void 0,l):new Promise(p);function p(f,o){const c=Co(s);d.run(r,c,h);function h(m,u,y){const w=u||r;m?o(m):f?f(w):l(void 0,w,y)}}}runSync(r,s){let l=!1,d;return this.run(r,s,p),Bg("runSync","run",l),d;function p(f,o){Dg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=Co(s),d=this.compiler||this.Compiler;return oh("stringify",d),Og(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(ch("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?o(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function p(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...u]=h;c(m,u)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(h.plugins),h.settings&&(d.settings=ih(!0,d.settings,h.settings))}function o(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const u=h[m];p(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,m){let u=-1,y=-1;for(;++u<l.length;)if(l[u][0]===h){y=u;break}if(y===-1)l.push([h,...m]);else if(m.length>0){let[w,...T]=m;const E=l[y][1];Th(E)&&Th(w)&&(w=ih(!0,E,w)),l[y]=[h,w,...T]}}}}const Uw=new Xh().freeze();function lh(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function oh(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function ch(t,r){if(r)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Og(t){if(!Th(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Bg(t,r,s){if(!s)throw new Error("`"+t+"` finished async. Use `"+r+"` instead")}function Co(t){return Fw(t)?t:new Y_(t)}function Fw(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function qw(t){return typeof t=="string"||$w(t)}function $w(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Gw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",jg=[],Ng={allowDangerousHtml:!0},Vw=/^(https?|ircs?|mailto|xmpp)$/i,Ww=[{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 X_(t){const r=Kw(t),s=Yw(t);return Xw(r.runSync(r.parse(s),s),t)}function Kw(t){const r=t.rehypePlugins||jg,s=t.remarkPlugins||jg,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Ng}:Ng;return Uw().use(TC).use(s).use(ww,l).use(r)}function Yw(t){const r=t.children||"",s=new Y_;return typeof r=="string"&&(s.value=r),s}function Xw(t,r){const s=r.allowedElements,l=r.allowElement,d=r.components,p=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||Qw;for(const m of Ww)Object.hasOwn(r,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Gw+m.id,void 0);return Yh(t,h),hS(t,{Fragment:x.Fragment,components:d,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function h(m,u,y){if(m.type==="raw"&&y&&typeof u=="number")return f?y.children.splice(u,1):y.children[u]={type:"text",value:m.value},u;if(m.type==="element"){let w;for(w in Zu)if(Object.hasOwn(Zu,w)&&Object.hasOwn(m.properties,w)){const T=m.properties[w],E=Zu[w];(E===null||E.includes(m.tagName))&&(m.properties[w]=c(String(T||""),w,m))}}if(m.type==="element"){let w=s?!s.includes(m.tagName):p?p.includes(m.tagName):!1;if(!w&&l&&typeof u=="number"&&(w=!l(m,u,y)),w&&y&&typeof u=="number")return o&&m.children?y.children.splice(u,1,...m.children):y.children.splice(u,1),u}}}function Qw(t){const r=t.indexOf(":"),s=t.indexOf("?"),l=t.indexOf("#"),d=t.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||l!==-1&&r>l||Vw.test(t.slice(0,r))?t:""}function Hg(t,r){const s=String(t);if(typeof r!="string")throw new TypeError("Expected character");let l=0,d=s.indexOf(r);for(;d!==-1;)l++,d=s.indexOf(r,d+r.length);return l}function Jw(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Zw(t,r,s){const d=Po((s||{}).ignore||[]),p=ex(r);let f=-1;for(;++f<p.length;)K_(t,"text",o);function o(h,m){let u=-1,y;for(;++u<m.length;){const w=m[u],T=y?y.children:void 0;if(d(w,T?T.indexOf(w):void 0,y))return;y=w}if(y)return c(h,m)}function c(h,m){const u=m[m.length-1],y=p[f][0],w=p[f][1];let T=0;const b=u.children.indexOf(h);let v=!1,_=[];y.lastIndex=0;let S=y.exec(h.value);for(;S;){const A=S.index,L={index:S.index,input:S.input,stack:[...m,h]};let M=w(...S,L);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?y.lastIndex=A+1:(T!==A&&_.push({type:"text",value:h.value.slice(T,A)}),Array.isArray(M)?_.push(...M):M&&_.push(M),T=A+S[0].length,v=!0),!y.global)break;S=y.exec(h.value)}return v?(T<h.value.length&&_.push({type:"text",value:h.value.slice(T)}),u.children.splice(b,1,..._)):_=[h],b+_.length}}function ex(t){const r=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!t[0]||Array.isArray(t[0])?t:[t];let l=-1;for(;++l<s.length;){const d=s[l];r.push([tx(d[0]),nx(d[1])])}return r}function tx(t){return typeof t=="string"?new RegExp(Jw(t),"g"):t}function nx(t){return typeof t=="function"?t:function(){return t}}const uh="phrasing",hh=["autolink","link","image","label"];function ix(){return{transforms:[ux],enter:{literalAutolink:sx,literalAutolinkEmail:fh,literalAutolinkHttp:fh,literalAutolinkWww:fh},exit:{literalAutolink:cx,literalAutolinkEmail:ox,literalAutolinkHttp:ax,literalAutolinkWww:lx}}}function rx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:uh,notInConstruct:hh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:uh,notInConstruct:hh},{character:":",before:"[ps]",after:"\\/",inConstruct:uh,notInConstruct:hh}]}}function sx(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function fh(t){this.config.enter.autolinkProtocol.call(this,t)}function ax(t){this.config.exit.autolinkProtocol.call(this,t)}function lx(t){this.config.exit.data.call(this,t);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(t)}function ox(t){this.config.exit.autolinkEmail.call(this,t)}function cx(t){this.exit(t)}function ux(t){Zw(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),fx]],{ignore:["link","linkReference"]})}function hx(t,r,s,l,d){let p="";if(!Q_(d)||(/^w/i.test(r)&&(s=r+s,r="",p="http://"),!dx(s)))return!1;const f=px(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:p+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[o,{type:"text",value:f[1]}]:o}function fx(t,r,s,l){return!Q_(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function dx(t){const r=t.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 px(t){const r=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!r)return[t,void 0];t=t.slice(0,r.index);let s=r[0],l=s.indexOf(")");const d=Hg(t,"(");let p=Hg(t,")");for(;l!==-1&&d>p;)t+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),p++;return[t,s]}function Q_(t,r){const s=t.input.charCodeAt(t.index-1);return(t.index===0||Vr(s)||Ho(s))&&(!r||s!==47)}J_.peek=wx;function mx(){this.buffer()}function gx(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function _x(){this.buffer()}function vx(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function yx(t){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Xn(this.sliceSerialize(t)).toLowerCase(),s.label=r}function Sx(t){this.exit(t)}function bx(t){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Xn(this.sliceSerialize(t)).toLowerCase(),s.label=r}function Cx(t){this.exit(t)}function wx(){return"["}function J_(t,r,s,l){const d=s.createTracker(l);let p=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return p+=d.move(s.safe(s.associationId(t),{after:"]",before:p})),o(),f(),p+=d.move("]"),p}function xx(){return{enter:{gfmFootnoteCallString:mx,gfmFootnoteCall:gx,gfmFootnoteDefinitionLabelString:_x,gfmFootnoteDefinition:vx},exit:{gfmFootnoteCallString:yx,gfmFootnoteCall:Sx,gfmFootnoteDefinitionLabelString:bx,gfmFootnoteDefinition:Cx}}}function Ex(t){let r=!1;return t&&t.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:J_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,p,f){const o=p.createTracker(f);let c=o.move("[^");const h=p.enter("footnoteDefinition"),m=p.enter("label");return c+=o.move(p.safe(p.associationId(l),{before:c,after:"]"})),m(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
|
|
76
|
-
`:" ")+p.indentLines(p.containerFlow(l,o.current()),r?Z_:kx))),h(),c}}function kx(t,r,s){return r===0?t:Z_(t,r,s)}function Z_(t,r,s){return(s?"":" ")+t}const Ax=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ev.peek=Lx;function Tx(){return{canContainEols:["delete"],enter:{strikethrough:Dx},exit:{strikethrough:Mx}}}function Rx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ax}],handlers:{delete:ev}}}function Dx(t){this.enter({type:"delete",children:[]},t)}function Mx(t){this.exit(t)}function ev(t,r,s,l){const d=s.createTracker(l),p=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(t,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),p(),f}function Lx(){return"~"}function Ox(t){return t.length}function Bx(t,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||Ox,p=[],f=[],o=[],c=[];let h=0,m=-1;for(;++m<t.length;){const E=[],b=[];let v=-1;for(t[m].length>h&&(h=t[m].length);++v<t[m].length;){const _=jx(t[m][v]);if(s.alignDelimiters!==!1){const S=d(_);b[v]=S,(c[v]===void 0||S>c[v])&&(c[v]=S)}E.push(_)}f[m]=E,o[m]=b}let u=-1;if(typeof l=="object"&&"length"in l)for(;++u<h;)p[u]=zg(l[u]);else{const E=zg(l);for(;++u<h;)p[u]=E}u=-1;const y=[],w=[];for(;++u<h;){const E=p[u];let b="",v="";E===99?(b=":",v=":"):E===108?b=":":E===114&&(v=":");let _=s.alignDelimiters===!1?1:Math.max(1,c[u]-b.length-v.length);const S=b+"-".repeat(_)+v;s.alignDelimiters!==!1&&(_=b.length+_+v.length,_>c[u]&&(c[u]=_),w[u]=_),y[u]=S}f.splice(1,0,y),o.splice(1,0,w),m=-1;const T=[];for(;++m<f.length;){const E=f[m],b=o[m];u=-1;const v=[];for(;++u<h;){const _=E[u]||"";let S="",A="";if(s.alignDelimiters!==!1){const L=c[u]-(b[u]||0),M=p[u];M===114?S=" ".repeat(L):M===99?L%2?(S=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(S=" ".repeat(L/2),A=S):A=" ".repeat(L)}s.delimiterStart!==!1&&!u&&v.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&_==="")&&(s.delimiterStart!==!1||u)&&v.push(" "),s.alignDelimiters!==!1&&v.push(S),v.push(_),s.alignDelimiters!==!1&&v.push(A),s.padding!==!1&&v.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&v.push("|")}T.push(s.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return T.join(`
|
|
77
|
-
`)}function jx(t){return t==null?"":String(t)}function zg(t){const r=typeof t=="string"?t.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function Nx(t,r,s,l){const d=s.enter("blockquote"),p=s.createTracker(l);p.move("> "),p.shift(2);const f=s.indentLines(s.containerFlow(t,p.current()),Hx);return d(),f}function Hx(t,r,s){return">"+(s?"":" ")+t}function zx(t,r){return Ig(t,r.inConstruct,!0)&&!Ig(t,r.notInConstruct,!1)}function Ig(t,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let l=-1;for(;++l<r.length;)if(t.includes(r[l]))return!0;return!1}function Pg(t,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
|
|
78
|
-
`&&zx(s.stack,s.unsafe[d]))return/[ \t]/.test(l.before)?"":" ";return`\\
|
|
79
|
-
`}function Ix(t,r){const s=String(t);let l=s.indexOf(r),d=l,p=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===d?++p>f&&(f=p):p=1,d=l+r.length,l=s.indexOf(r,d);return f}function Px(t,r){return!!(r.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Ux(t){const r=t.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function Fx(t,r,s,l){const d=Ux(s),p=t.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Px(t,s)){const u=s.enter("codeIndented"),y=s.indentLines(p,qx);return u(),y}const o=s.createTracker(l),c=d.repeat(Math.max(Ix(p,d)+1,3)),h=s.enter("codeFenced");let m=o.move(c);if(t.lang){const u=s.enter(`codeFencedLang${f}`);m+=o.move(s.safe(t.lang,{before:m,after:" ",encode:["`"],...o.current()})),u()}if(t.lang&&t.meta){const u=s.enter(`codeFencedMeta${f}`);m+=o.move(" "),m+=o.move(s.safe(t.meta,{before:m,after:`
|
|
80
|
-
`,encode:["`"],...o.current()})),u()}return m+=o.move(`
|
|
81
|
-
`),p&&(m+=o.move(p+`
|
|
82
|
-
`)),m+=o.move(c),h(),m}function qx(t,r,s){return(s?"":" ")+t}function Qh(t){const r=t.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function $x(t,r,s,l){const d=Qh(s),p=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("[");return h+=c.move(s.safe(s.associationId(t),{before:h,after:"]",...c.current()})),h+=c.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(t.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(t.url,{before:h,after:t.title?" ":`
|
|
83
|
-
`,...c.current()}))),o(),t.title&&(o=s.enter(`title${p}`),h+=c.move(" "+d),h+=c.move(s.safe(t.title,{before:h,after:d,...c.current()})),h+=c.move(d),o()),f(),h}function Gx(t){const r=t.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function il(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Mo(t,r,s){const l=Is(t),d=Is(r);return l===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}tv.peek=Vx;function tv(t,r,s,l){const d=Gx(s),p=s.enter("emphasis"),f=s.createTracker(l),o=f.move(d);let c=f.move(s.containerPhrasing(t,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),m=Mo(l.before.charCodeAt(l.before.length-1),h,d);m.inside&&(c=il(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=Mo(l.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+il(u));const w=f.move(d);return p(),s.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},o+c+w}function Vx(t,r,s){return s.options.emphasis||"*"}function Wx(t,r){let s=!1;return Yh(t,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,kh}),!!((!t.depth||t.depth<3)&&Fh(t)&&(r.options.setext||s))}function Kx(t,r,s,l){const d=Math.max(Math.min(6,t.depth||1),1),p=s.createTracker(l);if(Wx(t,s)){const m=s.enter("headingSetext"),u=s.enter("phrasing"),y=s.containerPhrasing(t,{...p.current(),before:`
|
|
84
|
-
`,after:`
|
|
85
|
-
`});return u(),m(),y+`
|
|
86
|
-
`+(d===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
87
|
-
`))+1))}const f="#".repeat(d),o=s.enter("headingAtx"),c=s.enter("phrasing");p.move(f+" ");let h=s.containerPhrasing(t,{before:"# ",after:`
|
|
88
|
-
`,...p.current()});return/^[\t ]/.test(h)&&(h=il(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),o(),h}nv.peek=Yx;function nv(t){return t.value||""}function Yx(){return"<"}iv.peek=Xx;function iv(t,r,s,l){const d=Qh(s),p=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("![");return h+=c.move(s.safe(t.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(t.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(t.url,{before:h,after:t.title?" ":")",...c.current()}))),o(),t.title&&(o=s.enter(`title${p}`),h+=c.move(" "+d),h+=c.move(s.safe(t.title,{before:h,after:d,...c.current()})),h+=c.move(d),o()),h+=c.move(")"),f(),h}function Xx(){return"!"}rv.peek=Qx;function rv(t,r,s,l){const d=t.referenceType,p=s.enter("imageReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("![");const h=s.safe(t.alt,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const m=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(t),{before:c,after:"]",...o.current()});return f(),s.stack=m,p(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Qx(){return"!"}sv.peek=Jx;function sv(t,r,s){let l=t.value||"",d="`",p=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(l);)d+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++p<s.unsafe.length;){const f=s.unsafe[p],o=s.compilePattern(f);let c;if(f.atBreak)for(;c=o.exec(l);){let h=c.index;l.charCodeAt(h)===10&&l.charCodeAt(h-1)===13&&h--,l=l.slice(0,h)+" "+l.slice(c.index+1)}}return d+l+d}function Jx(){return"`"}function av(t,r){const s=Fh(t);return!!(!r.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(s===t.url||"mailto:"+s===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}lv.peek=Zx;function lv(t,r,s,l){const d=Qh(s),p=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(av(t,s)){const m=s.stack;s.stack=[],o=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(t,{before:u,after:">",...f.current()})),u+=f.move(">"),o(),s.stack=m,u}o=s.enter("link"),c=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(t,{before:h,after:"](",...f.current()})),h+=f.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(t.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=s.enter("destinationRaw"),h+=f.move(s.safe(t.url,{before:h,after:t.title?" ":")",...f.current()}))),c(),t.title&&(c=s.enter(`title${p}`),h+=f.move(" "+d),h+=f.move(s.safe(t.title,{before:h,after:d,...f.current()})),h+=f.move(d),c()),h+=f.move(")"),o(),h}function Zx(t,r,s){return av(t,s)?"<":"["}ov.peek=eE;function ov(t,r,s,l){const d=t.referenceType,p=s.enter("linkReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("[");const h=s.containerPhrasing(t,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const m=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(t),{before:c,after:"]",...o.current()});return f(),s.stack=m,p(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function eE(){return"["}function Jh(t){const r=t.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function tE(t){const r=Jh(t),s=t.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 nE(t){const r=t.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function cv(t){const r=t.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function iE(t,r,s,l){const d=s.enter("list"),p=s.bulletCurrent;let f=t.ordered?nE(s):Jh(s);const o=t.ordered?f==="."?")":".":tE(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!t.ordered){const m=t.children?t.children[0]:void 0;if((f==="*"||f==="-")&&m&&(!m.children||!m.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(c=!0),cv(s)===f&&m){let u=-1;for(;++u<t.children.length;){const y=t.children[u];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=o),s.bulletCurrent=f;const h=s.containerFlow(t,l);return s.bulletLastUsed=f,s.bulletCurrent=p,d(),h}function rE(t){const r=t.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 sE(t,r,s,l){const d=rE(s);let p=s.bulletCurrent||Jh(s);r&&r.type==="list"&&r.ordered&&(p=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(t))+p);let f=p.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||t.spread))&&(f=Math.ceil(f/4)*4);const o=s.createTracker(l);o.move(p+" ".repeat(f-p.length)),o.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(t,o.current()),m);return c(),h;function m(u,y,w){return y?(w?"":" ".repeat(f))+u:(w?p:p+" ".repeat(f-p.length))+u}}function aE(t,r,s,l){const d=s.enter("paragraph"),p=s.enter("phrasing"),f=s.containerPhrasing(t,l);return p(),d(),f}const lE=Po(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function oE(t,r,s,l){return(t.children.some(function(f){return lE(f)})?s.containerPhrasing:s.containerFlow).call(s,t,l)}function cE(t){const r=t.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}uv.peek=uE;function uv(t,r,s,l){const d=cE(s),p=s.enter("strong"),f=s.createTracker(l),o=f.move(d+d);let c=f.move(s.containerPhrasing(t,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),m=Mo(l.before.charCodeAt(l.before.length-1),h,d);m.inside&&(c=il(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=Mo(l.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+il(u));const w=f.move(d+d);return p(),s.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},o+c+w}function uE(t,r,s){return s.options.strong||"*"}function hE(t,r,s,l){return s.safe(t.value,l)}function fE(t){const r=t.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 dE(t,r,s){const l=(cv(s)+(s.options.ruleSpaces?" ":"")).repeat(fE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const hv={blockquote:Nx,break:Pg,code:Fx,definition:$x,emphasis:tv,hardBreak:Pg,heading:Kx,html:nv,image:iv,imageReference:rv,inlineCode:sv,link:lv,linkReference:ov,list:iE,listItem:sE,paragraph:aE,root:oE,strong:uv,text:hE,thematicBreak:dE};function pE(){return{enter:{table:mE,tableData:Ug,tableHeader:Ug,tableRow:_E},exit:{codeText:vE,table:gE,tableData:dh,tableHeader:dh,tableRow:dh}}}function mE(t){const r=t._align;this.enter({type:"table",align:r.map(function(s){return s==="none"?null:s}),children:[]},t),this.data.inTable=!0}function gE(t){this.exit(t),this.data.inTable=void 0}function _E(t){this.enter({type:"tableRow",children:[]},t)}function dh(t){this.exit(t)}function Ug(t){this.enter({type:"tableCell",children:[]},t)}function vE(t){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,yE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(t)}function yE(t,r){return r==="|"?r:t}function SE(t){const r=t||{},s=r.tableCellPadding,l=r.tablePipeAlign,d=r.stringLength,p=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
89
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:f,tableCell:c,tableRow:o}};function f(w,T,E,b){return h(m(w,E,b),w.align)}function o(w,T,E,b){const v=u(w,E,b),_=h([v]);return _.slice(0,_.indexOf(`
|
|
90
|
-
`))}function c(w,T,E,b){const v=E.enter("tableCell"),_=E.enter("phrasing"),S=E.containerPhrasing(w,{...b,before:p,after:p});return _(),v(),S}function h(w,T){return Bx(w,{align:T,alignDelimiters:l,padding:s,stringLength:d})}function m(w,T,E){const b=w.children;let v=-1;const _=[],S=T.enter("table");for(;++v<b.length;)_[v]=u(b[v],T,E);return S(),_}function u(w,T,E){const b=w.children;let v=-1;const _=[],S=T.enter("tableRow");for(;++v<b.length;)_[v]=c(b[v],w,T,E);return S(),_}function y(w,T,E){let b=hv.inlineCode(w,T,E);return E.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function bE(){return{exit:{taskListCheckValueChecked:Fg,taskListCheckValueUnchecked:Fg,paragraph:wE}}}function CE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:xE}}}function Fg(t){const r=this.stack[this.stack.length-2];r.type,r.checked=t.type==="taskListCheckValueChecked"}function wE(t){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const l=s.children[0];if(l&&l.type==="text"){const d=r.children;let p=-1,f;for(;++p<d.length;){const o=d[p];if(o.type==="paragraph"){f=o;break}}f===s&&(l.value=l.value.slice(1),l.value.length===0?s.children.shift():s.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,s.position.start=Object.assign({},l.position.start)))}}this.exit(t)}function xE(t,r,s,l){const d=t.children[0],p=typeof t.checked=="boolean"&&d&&d.type==="paragraph",f="["+(t.checked?"x":" ")+"] ",o=s.createTracker(l);p&&o.move(f);let c=hv.listItem(t,r,s,{...l,...o.current()});return p&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(m){return m+f}}function EE(){return[ix(),xx(),Tx(),pE(),bE()]}function kE(t){return{extensions:[rx(),Ex(t),Rx(),SE(t),CE()]}}const AE={tokenize:OE,partial:!0},fv={tokenize:BE,partial:!0},dv={tokenize:jE,partial:!0},pv={tokenize:NE,partial:!0},TE={tokenize:HE,partial:!0},mv={name:"wwwAutolink",tokenize:ME,previous:_v},gv={name:"protocolAutolink",tokenize:LE,previous:vv},Oi={name:"emailAutolink",tokenize:DE,previous:yv},oi={};function RE(){return{text:oi}}let qr=48;for(;qr<123;)oi[qr]=Oi,qr++,qr===58?qr=65:qr===91&&(qr=97);oi[43]=Oi;oi[45]=Oi;oi[46]=Oi;oi[95]=Oi;oi[72]=[Oi,gv];oi[104]=[Oi,gv];oi[87]=[Oi,mv];oi[119]=[Oi,mv];function DE(t,r,s){const l=this;let d,p;return f;function f(u){return!Dh(u)||!yv.call(l,l.previous)||Zh(l.events)?s(u):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(u))}function o(u){return Dh(u)?(t.consume(u),o):u===64?(t.consume(u),c):s(u)}function c(u){return u===46?t.check(TE,m,h)(u):u===45||u===95||Jt(u)?(p=!0,t.consume(u),c):m(u)}function h(u){return t.consume(u),d=!0,c}function m(u){return p&&d&&sn(l.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),r(u)):s(u)}}function ME(t,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!_v.call(l,l.previous)||Zh(l.events)?s(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(AE,t.attempt(fv,t.attempt(dv,p),s),s)(f))}function p(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),r(f)}}function LE(t,r,s){const l=this;let d="",p=!1;return f;function f(u){return(u===72||u===104)&&vv.call(l,l.previous)&&!Zh(l.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),t.consume(u),o):s(u)}function o(u){if(sn(u)&&d.length<5)return d+=String.fromCodePoint(u),t.consume(u),o;if(u===58){const y=d.toLowerCase();if(y==="http"||y==="https")return t.consume(u),c}return s(u)}function c(u){return u===47?(t.consume(u),p?h:(p=!0,c)):s(u)}function h(u){return u===null||To(u)||ht(u)||Vr(u)||Ho(u)?s(u):t.attempt(fv,t.attempt(dv,m),s)(u)}function m(u){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),r(u)}}function OE(t,r,s){let l=0;return d;function d(f){return(f===87||f===119)&&l<3?(l++,t.consume(f),d):f===46&&l===3?(t.consume(f),p):s(f)}function p(f){return f===null?s(f):r(f)}}function BE(t,r,s){let l,d,p;return f;function f(h){return h===46||h===95?t.check(pv,c,o)(h):h===null||ht(h)||Vr(h)||h!==45&&Ho(h)?c(h):(p=!0,t.consume(h),f)}function o(h){return h===95?l=!0:(d=l,l=void 0),t.consume(h),f}function c(h){return d||l||!p?s(h):r(h)}}function jE(t,r){let s=0,l=0;return d;function d(f){return f===40?(s++,t.consume(f),d):f===41&&l<s?p(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?t.check(pv,r,p)(f):f===null||ht(f)||Vr(f)?r(f):(t.consume(f),d)}function p(f){return f===41&&l++,t.consume(f),d}}function NE(t,r,s){return l;function l(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),l):o===38?(t.consume(o),p):o===93?(t.consume(o),d):o===60||o===null||ht(o)||Vr(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ht(o)||Vr(o)?r(o):l(o)}function p(o){return sn(o)?f(o):s(o)}function f(o){return o===59?(t.consume(o),l):sn(o)?(t.consume(o),f):s(o)}}function HE(t,r,s){return l;function l(p){return t.consume(p),d}function d(p){return Jt(p)?s(p):r(p)}}function _v(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ht(t)}function vv(t){return!sn(t)}function yv(t){return!(t===47||Dh(t))}function Dh(t){return t===43||t===45||t===46||t===95||Jt(t)}function Zh(t){let r=t.length,s=!1;for(;r--;){const l=t[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){s=!0;break}if(l._gfmAutolinkLiteralWalkedInto){s=!1;break}}return t.length>0&&!s&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const zE={tokenize:VE,partial:!0};function IE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:qE,continuation:{tokenize:$E},exit:GE}},text:{91:{name:"gfmFootnoteCall",tokenize:FE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PE,resolveTo:UE}}}}function PE(t,r,s){const l=this;let d=l.events.length;const p=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let f;for(;d--;){const c=l.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!f||!f._balanced)return s(c);const h=Xn(l.sliceSerialize({start:f.end,end:l.now()}));return h.codePointAt(0)!==94||!p.includes(h.slice(1))?s(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),r(c))}}function UE(t,r){let s=t.length;for(;s--;)if(t[s][1].type==="labelImage"&&t[s][0]==="enter"){t[s][1];break}t[s+1][1].type="data",t[s+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},t[s+3][1].start),end:Object.assign({},t[t.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},t[s+3][1].end),end:Object.assign({},t[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const p={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},t[t.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},p.start),end:Object.assign({},p.end)},o=[t[s+1],t[s+2],["enter",l,r],t[s+3],t[s+4],["enter",d,r],["exit",d,r],["enter",p,r],["enter",f,r],["exit",f,r],["exit",p,r],t[t.length-2],t[t.length-1],["exit",l,r]];return t.splice(s,t.length-s+1,...o),t}function FE(t,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let p=0,f;return o;function o(u){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?s(u):(t.enter("gfmFootnoteCallMarker"),t.consume(u),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",h)}function h(u){if(p>999||u===93&&!f||u===null||u===91||ht(u))return s(u);if(u===93){t.exit("chunkString");const y=t.exit("gfmFootnoteCallString");return d.includes(Xn(l.sliceSerialize(y)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),r):s(u)}return ht(u)||(f=!0),p++,t.consume(u),u===92?m:h}function m(u){return u===91||u===92||u===93?(t.consume(u),p++,h):h(u)}}function qE(t,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let p,f=0,o;return c;function c(T){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(T){return T===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",m):s(T)}function m(T){if(f>999||T===93&&!o||T===null||T===91||ht(T))return s(T);if(T===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return p=Xn(l.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),y}return ht(T)||(o=!0),f++,t.consume(T),T===92?u:m}function u(T){return T===91||T===92||T===93?(t.consume(T),f++,m):m(T)}function y(T){return T===58?(t.enter("definitionMarker"),t.consume(T),t.exit("definitionMarker"),d.includes(p)||d.push(p),Ze(t,w,"gfmFootnoteDefinitionWhitespace")):s(T)}function w(T){return r(T)}}function $E(t,r,s){return t.check(al,r,t.attempt(zE,r,s))}function GE(t){t.exit("gfmFootnoteDefinition")}function VE(t,r,s){const l=this;return Ze(t,d,"gfmFootnoteDefinitionIndent",5);function d(p){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(p):s(p)}}function WE(t){let s=(t||{}).singleTilde;const l={name:"strikethrough",tokenize:p,resolveAll:d};return s==null&&(s=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function d(f,o){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let h=c;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[c][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[c][1].end)},u={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[c][1].start)},y=[["enter",m,o],["enter",f[h][1],o],["exit",f[h][1],o],["enter",u,o]],w=o.parser.constructs.insideSpan.null;w&&Rn(y,y.length,0,zo(w,f.slice(h+1,c),o)),Rn(y,y.length,0,[["exit",u,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",m,o]]),Rn(f,h-1,c-h+3,y),c=h+y.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function p(f,o,c){const h=this.previous,m=this.events;let u=0;return y;function y(T){return h===126&&m[m.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const E=Is(h);if(T===126)return u>1?c(T):(f.consume(T),u++,w);if(u<2&&!s)return c(T);const b=f.exit("strikethroughSequenceTemporary"),v=Is(T);return b._open=!v||v===2&&!!E,b._close=!E||E===2&&!!v,o(T)}}}class KE{constructor(){this.map=[]}add(r,s,l){YE(this,r,s,l)}consume(r){if(this.map.sort(function(p,f){return p[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const l=[];for(;s>0;)s-=1,l.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];l.push(r.slice()),r.length=0;let d=l.pop();for(;d;){for(const p of d)r.push(p);d=l.pop()}this.map.length=0}}function YE(t,r,s,l){let d=0;if(!(s===0&&l.length===0)){for(;d<t.map.length;){if(t.map[d][0]===r){t.map[d][1]+=s,t.map[d][2].push(...l);return}d+=1}t.map.push([r,s,l])}}function XE(t,r){let s=!1;const l=[];for(;r<t.length;){const d=t[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&l.push(t[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(t[r-1][1].type==="tableDelimiterMarker"){const p=l.length-1;l[p]=l[p]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return l}function QE(){return{flow:{null:{name:"table",tokenize:JE,resolveAll:ZE}}}}function JE(t,r,s){const l=this;let d=0,p=0,f;return o;function o(B){let H=l.events.length-1;for(;H>-1;){const V=l.events[H][1].type;if(V==="lineEnding"||V==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?M:c;return P===M&&l.parser.lazy[l.now().line]?s(B):P(B)}function c(B){return t.enter("tableHead"),t.enter("tableRow"),h(B)}function h(B){return B===124||(f=!0,p+=1),m(B)}function m(B){return B===null?s(B):Oe(B)?p>1?(p=0,l.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),w):s(B):We(B)?Ze(t,m,"whitespace")(B):(p+=1,f&&(f=!1,d+=1),B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),f=!0,m):(t.enter("data"),u(B)))}function u(B){return B===null||B===124||ht(B)?(t.exit("data"),m(B)):(t.consume(B),B===92?y:u)}function y(B){return B===92||B===124?(t.consume(B),u):u(B)}function w(B){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(B):(t.enter("tableDelimiterRow"),f=!1,We(B)?Ze(t,T,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):T(B))}function T(B){return B===45||B===58?b(B):B===124?(f=!0,t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),E):L(B)}function E(B){return We(B)?Ze(t,b,"whitespace")(B):b(B)}function b(B){return B===58?(p+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),v):B===45?(p+=1,v(B)):B===null||Oe(B)?A(B):L(B)}function v(B){return B===45?(t.enter("tableDelimiterFiller"),_(B)):L(B)}function _(B){return B===45?(t.consume(B),_):B===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(B),t.exit("tableDelimiterMarker"),S):(t.exit("tableDelimiterFiller"),S(B))}function S(B){return We(B)?Ze(t,A,"whitespace")(B):A(B)}function A(B){return B===124?T(B):B===null||Oe(B)?!f||d!==p?L(B):(t.exit("tableDelimiterRow"),t.exit("tableHead"),r(B)):L(B)}function L(B){return s(B)}function M(B){return t.enter("tableRow"),D(B)}function D(B){return B===124?(t.enter("tableCellDivider"),t.consume(B),t.exit("tableCellDivider"),D):B===null||Oe(B)?(t.exit("tableRow"),r(B)):We(B)?Ze(t,D,"whitespace")(B):(t.enter("data"),k(B))}function k(B){return B===null||B===124||ht(B)?(t.exit("data"),D(B)):(t.consume(B),B===92?R:k)}function R(B){return B===92||B===124?(t.consume(B),k):k(B)}}function ZE(t,r){let s=-1,l=!0,d=0,p=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,h,m,u;const y=new KE;for(;++s<t.length;){const w=t[s],T=w[1];w[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(qg(y,r,c,h,m),m=void 0,c=0),h={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},y.add(s,0,[["enter",h,r]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(l=!0,u=void 0,p=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,m={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},y.add(s,0,[["enter",m,r]])),d=T.type==="tableDelimiterRow"?2:m?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(p[1]!==0&&(f[0]=f[1],u=wo(y,r,p,d,void 0,u),p=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(l?l=!1:(p[1]!==0&&(f[0]=f[1],u=wo(y,r,p,d,void 0,u)),p=f,f=[p[1],s,0,0])):T.type==="tableHead"?(o=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,p[1]!==0?(f[0]=f[1],u=wo(y,r,p,d,s,u)):f[1]!==0&&(u=wo(y,r,f,d,s,u)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&qg(y,r,c,h,m),y.consume(r.events),s=-1;++s<r.events.length;){const w=r.events[s];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=XE(r.events,s))}return t}function wo(t,r,s,l,d,p){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(p.end=Object.assign({},Ns(r.events,s[0])),t.add(s[0],0,[["exit",p,r]]));const c=Ns(r.events,s[1]);if(p={type:f,start:Object.assign({},c),end:Object.assign({},c)},t.add(s[1],0,[["enter",p,r]]),s[2]!==0){const h=Ns(r.events,s[2]),m=Ns(r.events,s[3]),u={type:o,start:Object.assign({},h),end:Object.assign({},m)};if(t.add(s[2],0,[["enter",u,r]]),l!==2){const y=r.events[s[2]],w=r.events[s[3]];if(y[1].end=Object.assign({},w[1].end),y[1].type="chunkText",y[1].contentType="text",s[3]>s[2]+1){const T=s[2]+1,E=s[3]-s[2]-1;t.add(T,E,[])}}t.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(p.end=Object.assign({},Ns(r.events,d)),t.add(d,0,[["exit",p,r]]),p=void 0),p}function qg(t,r,s,l,d){const p=[],f=Ns(r.events,s);d&&(d.end=Object.assign({},f),p.push(["exit",d,r])),l.end=Object.assign({},f),p.push(["exit",l,r]),t.add(s+1,0,p)}function Ns(t,r){const s=t[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const e2={name:"tasklistCheck",tokenize:n2};function t2(){return{text:{91:e2}}}function n2(t,r,s){const l=this;return d;function d(c){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?s(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),p)}function p(c){return ht(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):s(c)}function o(c){return Oe(c)?r(c):We(c)?t.check({tokenize:i2},r,s)(c):s(c)}}function i2(t,r,s){return Ze(t,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function r2(t){return R_([RE(),IE(),WE(t),QE(),t2()])}const s2={};function Sv(t){const r=this,s=t||s2,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),p=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(r2(s)),p.push(EE()),f.push(kE(s))}const bv=1e3,Hs=new Map;let Ja;function a2(t,r,s){const l=Symbol(t),d=Math.max(bv,s.intervalMs),p=Date.now();return Hs.set(t,{id:t,intervalMs:d,nextRunAt:s.runImmediately===!1?p+d:p,inFlight:!1,run:r,token:l}),l2(),Cv(),()=>{const f=Hs.get(t);(f==null?void 0:f.token)===l&&(Hs.delete(t),Hs.size===0&&Ja!==void 0&&(window.clearInterval(Ja),Ja=void 0))}}function l2(){Ja!==void 0||typeof window>"u"||(Ja=window.setInterval(()=>{Cv()},bv))}async function Cv(){const t=Date.now();for(const r of Hs.values())r.inFlight||r.nextRunAt>t||o2(r)}async function o2(t){t.inFlight=!0;try{await t.run()}catch{}finally{const r=Hs.get(t.id);(r==null?void 0:r.token)===t.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function rl(t,r,s){const l=te.useRef(r);te.useEffect(()=>{l.current=r},[r]),te.useEffect(()=>{if(!(!t||s.enabled===!1))return a2(t,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[t,s.enabled,s.intervalMs,s.runImmediately])}const Lo=`
|
|
91
|
-
|
|
92
|
-
--- Translation ---
|
|
93
|
-
`;function c2({active:t=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:p,panelState:f,onClearSession:o,onEntry:c,onFailures:h}){const[m,u]=te.useState(""),[y,w]=te.useState(""),[T,E]=te.useState(!1),[b,v]=te.useState(Date.now()),[_,S]=te.useState(!1),[,A]=Li(""),L=te.useRef(null),M=f.entries,D=f.failures,k=f.status;te.useEffect(()=>{if(!t)return;const N=L.current;if(!N)return;const $=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame($)},[t,M]);const R=_2(M);te.useEffect(()=>{if(!R)return;v(Date.now());const N=window.setInterval(()=>v(Date.now()),250);return()=>window.clearInterval(N)},[R]);async function B(N=!1){const $=m;S(!0),A(""),E(!1);try{const I=await ye.translateUserInput(l,d,{text:$,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});I.sent?(u(""),E(!1)):(u(xv($,I.englishPreview)),E(!0))}catch(I){A(ut("Translate composer input",I))}finally{S(!1)}}async function H(){const N=y.trim();if(N){S(!0),A("");try{const $=await ye.translateManualOutput(l,d,{text:N});c(p,d,$),w("")}catch($){A(ut("Translate pasted English output",$))}finally{S(!1)}}}async function U(){S(!0),A("");try{const N=await ye.translateLatestReply(l,d);c(p,d,N)}catch(N){A(ut("Translate final reply",N))}finally{S(!1)}}async function P(){const N=T?Gg(m):m;if(N.trim()){S(!0),A("");try{await ye.sendTranslatedInput(l,d,{englishText:N}),u(""),E(!1)}catch($){A(ut("Send translated English input to role",$))}finally{S(!1)}}}function V(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!_&&m.trim()&&(T?P():B(r)))}async function K(){o(p,d),await ye.clearTranslationSession(p).catch(N=>A(ut("Clear conversation translation panel",N)))}async function G(){S(!0),A("");try{const N=await ye.ignoreTranslationFailures(p);h(p,d,N.failures)}catch(N){A(ut("Ignore failed conversation translations",N))}finally{S(!1)}}async function Y(N){S(!0),A("");try{const $=await ye.retryTranslation(p,N.translationId);c(p,d,$)}catch($){A(ut("Retry latest failed conversation translation",$))}finally{S(!1)}}const ee=v2(M,k,b),z=D.length,j=h2(D);return x.jsxs("aside",{className:"translation-panel",children:[x.jsxs("header",{className:"translation-panel-header",children:[x.jsxs("div",{className:"translation-panel-titlebar",children:[x.jsx("h2",{children:"Translation"}),x.jsxs("div",{className:"translation-panel-actions",children:[z>0?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",disabled:_,onClick:()=>void G(),children:["Ignore ",z]}),j?x.jsx("button",{type:"button",disabled:_,onClick:()=>void Y(j),children:"Retry latest"}):null]}):null,x.jsx("button",{type:"button",disabled:_,onClick:()=>void U(),children:"Translate final reply"}),x.jsx("button",{type:"button",onClick:()=>void K(),children:"Clear"})]})]}),x.jsx("div",{className:"translation-status-row",children:x.jsxs("p",{children:["Claude Code · target ",u2(s)," · ",ee]})})]}),x.jsx("div",{className:"translation-manual-panel",children:x.jsxs("div",{className:"translation-composer-row translation-manual-row",children:[x.jsx("textarea",{value:y,onChange:N=>w(N.target.value),placeholder:"Paste English to translate on demand..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!y.trim(),onClick:()=>void H(),children:"Translate"})})]})}),x.jsxs("div",{className:"translation-entry-list",ref:L,children:[M.length===0?x.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,M.map(N=>x.jsx(m2,{entry:N},N.id))]}),x.jsx("div",{className:"translation-composer",children:x.jsxs("div",{className:"translation-composer-row",children:[x.jsx("textarea",{value:m,onChange:N=>{u(N.target.value),(!N.target.value.trim()||T&&!b2(N.target.value))&&E(!1)},onKeyDown:V,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!T||!Gg(m).trim(),onClick:()=>void P(),children:"Send English"})})]})})]})}function u2(t){var r;return((r=o_.find(s=>s.value===t))==null?void 0:r.label)??t}function h2(t){let r,s=Number.NEGATIVE_INFINITY;for(const l of t){const d=Date.parse(l.failedAt),p=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||p>=s)&&(r=l,s=p)}return r}function f2({open:t,taskSlug:r,targetLanguage:s,onClose:l}){const[d,p]=te.useState(!1),[,f]=Li(""),[o,c]=te.useState(null),[h,m]=te.useState(""),[u,y]=te.useState(""),[w,T]=te.useState(""),[E,b]=te.useState(!1),[v,_]=te.useState(null),[S,A]=te.useState(""),[L,M]=te.useState(""),[D,k]=te.useState(""),[R,B]=te.useState(!1);rl(t?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(G=!1){try{const Y=await ye.getTranslationState();c(Y);const ee=h?Y.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!ee)&&Y.fileIndex.jobs[0])U(Y.fileIndex.jobs[0].id);else if(!Y.fileIndex.jobs[0])m(""),y(""),T("");else if(G&&h){const z=await ye.readFileTranslation(h);y(z.output),T(z.report)}}catch(Y){f(ut("Load file translation list",Y))}}async function U(G){m(G),y(""),T("");try{const Y=await ye.readFileTranslation(G);y(Y.output),T(Y.report)}catch(Y){f(ut(`Read translated file ${G}`,Y))}}async function P(){b(!0),await V(S,L)}async function V(G="",Y=""){B(!0),f("");try{const ee=await ye.browseTranslationSourceFiles({path:G,query:Y,limit:250});_(ee),A(ee.currentPath),M(Y)}catch(ee){f(ut("Browse translation source files",ee))}finally{B(!1)}}async function K(G=D){const Y=G.trim();if(Y){p(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const ee=await ye.createFileTranslation({taskSlug:r,sourcePath:Y,targetLanguage:s});b(!1),await H(),await U(ee.id)}catch(ee){f(ut(`Create file translation for ${Y}`,ee))}finally{p(!1)}}}return t?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(p2,{busy:d,state:o,selectedJobId:h,output:u,report:w,onClose:()=>{b(!1),l()},onRefresh:()=>void H(),onSelectJob:G=>void U(G),onTranslate:()=>void P()})}),E?x.jsx(d2,{busy:d||R,state:v,currentPath:S,query:L,selectedPath:D,onBrowse:(G,Y)=>void V(G,Y),onClose:()=>b(!1),onQueryChange:M,onSelectPath:k,onTranslate:()=>void K()}):null]}):null}function d2({busy:t,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:p,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:h}){const m=(r==null?void 0:r.entries)??[],u=m.filter(w=>w.type==="directory"),y=m.filter(w=>w.type==="file");return x.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:x.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Select Source File"}),x.jsx("p",{children:s||"."})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsxs("div",{className:"translation-file-browser-controls",children:[x.jsxs("div",{className:"translation-file-browser-nav",children:[x.jsx("button",{type:"button",disabled:t||!s,onClick:()=>p((r==null?void 0:r.parentPath)??"",""),children:"Up"}),x.jsx("button",{type:"button",disabled:t||!s,onClick:()=>p("",""),children:"Root"})]}),x.jsxs("form",{className:"translation-file-browser-search",onSubmit:w=>{w.preventDefault(),p(s,l)},children:[x.jsx("input",{value:l,onChange:w=>o(w.target.value),placeholder:"Search files"}),x.jsx("button",{type:"submit",disabled:t,children:"Search"}),x.jsx("button",{type:"button",disabled:t||!l,onClick:()=>p(s,""),children:"Clear"})]})]}),x.jsxs("div",{className:"translation-file-browser-layout",children:[x.jsxs("div",{className:"translation-file-browser-list",children:[t&&!r?x.jsx("p",{className:"muted",children:"Loading files..."}):null,!t&&m.length===0?x.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Folders"}),u.map(w=>x.jsx($g,{entry:w,selected:d===w.path,onBrowse:p,onSelectPath:c},w.path))]}):null,y.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Files"}),y.map(w=>x.jsx($g,{entry:w,selected:d===w.path,onBrowse:p,onSelectPath:c},w.path))]}):null,r!=null&&r.truncated?x.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),x.jsxs("aside",{className:"translation-file-browser-selection",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Source path"}),x.jsx("input",{value:d,onChange:w=>c(w.target.value)})]}),x.jsx("button",{type:"button",disabled:t||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function $g({entry:t,selected:r,onBrowse:s,onSelectPath:l}){const d=t.type==="directory";return x.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(t.path,""):l(t.path),onDoubleClick:()=>d?s(t.path,""):void 0,children:[x.jsx("span",{children:d?"DIR":"FILE"}),x.jsx("strong",{children:t.name}),x.jsx("small",{children:t.path})]})}function p2({busy:t,state:r,selectedJobId:s,output:l,report:d,onClose:p,onRefresh:f,onSelectJob:o,onTranslate:c}){const h=(r==null?void 0:r.fileIndex.jobs)??[],m=h.find(u=>u.id===s);return x.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[x.jsxs("header",{className:"file-translation-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"File Translation"}),x.jsx("p",{children:"Claude Code · 中英互译"})]}),x.jsxs("div",{className:"file-translation-toolbar",children:[x.jsx("button",{type:"button",disabled:t,onClick:c,children:"Translate"}),x.jsx("button",{type:"button",disabled:t,onClick:f,children:"Refresh"}),x.jsx("button",{type:"button",onClick:p,children:"Close"})]})]}),r!=null&&r.memoryInitialized?null:x.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),x.jsxs("div",{className:"file-translation-layout",children:[x.jsxs("div",{className:"file-translation-list",children:[h.length===0?x.jsx("p",{className:"muted",children:"No translated files yet."}):null,h.map(u=>x.jsxs("button",{className:u.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>o(u.id),children:[x.jsx("strong",{children:u.sourcePath}),x.jsxs("span",{children:[u.status," · ",u.targetLanguage]})]},u.id))]}),x.jsx("div",{className:"file-translation-preview",children:m?x.jsxs(x.Fragment,{children:[x.jsxs("header",{children:[x.jsx("strong",{children:m.sourcePath}),x.jsx("span",{children:m.status})]}),x.jsx("div",{className:"translation-markdown",children:x.jsx(X_,{remarkPlugins:[Sv],children:l||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function m2({entry:t}){if(t.sourceKind==="conversation-boundary")return x.jsx(g2,{entry:t});const r=S2(t),s=t.sourceKind==="tool-output",l=t.direction==="user-input-to-english",d=["translation-entry",`is-${t.sourceKind}`,l?"is-user-input":""].filter(Boolean).join(" ");return x.jsxs("article",{className:d,children:[s?x.jsx("pre",{children:r}):x.jsx("div",{className:"translation-markdown",children:x.jsx(X_,{remarkPlugins:[Sv],children:r})}),t.warning?x.jsx("p",{className:"translation-entry-note",children:t.warning}):null,t.error?x.jsx("p",{className:"translation-entry-note is-error",children:t.error}):null]})}function g2({entry:t}){const r=t.boundaryKind==="end"?"结束":"开始",s=t.conversationTurn??0,l=w2(t.occurredAt??t.createdAt);return x.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${l}`,children:[x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),x.jsx("span",{children:r}),x.jsxs("span",{children:["第 ",s," 轮"]}),x.jsx("time",{children:l}),x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function _2(t){const r=t.find(wv);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function v2(t,r,s){const l=t.find(wv);if(l)return`translating ${C2(Math.max(0,s-y2(l)))}`;const d=t.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function wv(t){return t.status==="queued"||t.status==="translating"}function y2(t){const r=Date.parse(t.translationStartedAt??t.createdAt);return Number.isFinite(r)?r:Date.now()}function S2(t){return t.status==="queued"||t.status==="translating"?t.sourceText:t.status==="translated"?t.direction==="user-input-to-english"?xv(t.sourceText,t.translatedText):t.translatedText:t.translatedText||t.sourceText}function xv(t,r){return`${t.trimEnd()}${Lo}${r.trimStart()}`}function b2(t){return t.includes(Lo)}function Gg(t){const r=t.indexOf(Lo);return r===-1?t:t.slice(r+Lo.length)}function C2(t){if(t<1e3)return`${Math.max(.1,t/1e3).toFixed(1)}s`;const r=t/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),l=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${l}`}function w2(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleTimeString()}const x2=8;function E2(){const[t,r]=te.useState([]);return te.useEffect(()=>{const s=p=>{var c,h;const f=(h=(c=p.detail)==null?void 0:c.message)==null?void 0:h.trim();if(!f)return;const o=new Date().toISOString();r(m=>{const u=m.find(y=>y.message===f);return u?[{...u,count:u.count+1,updatedAt:o},...m.filter(y=>y.id!==u.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...m].slice(0,x2)})},l=p=>{var o;const f=((o=p.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(h=>!f.some(m=>h.message.startsWith(`${m} failed.`))))},d=p=>{var o,c;const f=(c=(o=p.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(h=>h.filter(m=>m.message!==f))};return window.addEventListener(mh,s),window.addEventListener(gh,l),window.addEventListener(_h,d),()=>{window.removeEventListener(mh,s),window.removeEventListener(gh,l),window.removeEventListener(_h,d)}},[]),t.length===0?null:x.jsxs("aside",{className:"ui-error-center",role:"alert","aria-live":"polite","aria-label":"Application errors",children:[x.jsxs("header",{className:"ui-error-center-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Errors"}),x.jsxs("p",{children:[t.length," active"]})]}),x.jsx("button",{type:"button",onClick:()=>r([]),children:"Clear"})]}),x.jsx("ol",{className:"ui-error-list",children:t.map(s=>x.jsxs("li",{children:[x.jsxs("div",{children:[x.jsx("p",{children:s.message}),x.jsxs("span",{children:[k2(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),x.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(l=>l.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function k2(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function A2(t,r){return t.find(s=>s.taskSlug===r)??t[0]??null}function T2(t){if(!(t.mode!=="auto"||t.status!=="running")&&!(!t.activeRole||t.activeRole===t.lastFollowedRole))return t.activeRole}function R2(t,r){var d;if(!((d=t.flowPause)!=null&&d.paused))return null;const s=t.flowPause.role??t.activeRole??"role",l=t.roleRecovery;return t.flowPause.reason==="role-recovery-failed"&&l?r(l,s):`No new turn started after ${s} stopped.`}function D2(t){const r=t.roundId??t.startedAt??t.taskSlug,s=t.stoppedAt??t.lastTurnEndedAt??"stopped";return`${r}:${s}`}function M2(t){return t?"strong":"none"}function L2(t,r){if(!r)return{observation:t,dismissPauseAlert:!1};const s=r.lastPmInputMessageId??null;return t.initialized?{observation:{initialized:!0,messageId:s},dismissPauseAlert:!!(r.enabled&&s&&s!==t.messageId)}:{observation:{initialized:!0,messageId:s},dismissPauseAlert:!1}}const O2=3,B2=3e4,ko=new Map;function Ev(t,r){const s=ut(t,r);if(!j2(r))return ko.set(t,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=ko.get(t),d=((l==null?void 0:l.consecutiveFailures)??0)+1,p=Date.now(),f=d>=O2&&(!l||l.lastMessage!==s||p-l.lastReportedAt>=B2);return ko.set(t,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?p:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Oo(t){ko.delete(t),u1([t])}function j2(t){const r=jo(t);return r.includes("could not reach the VCM backend")||r.includes("Failed to fetch")||r.includes("NetworkError")||r.includes("Load failed")||r.includes("ERR_CONNECTION")}const N2=["architecture-plan","validation-adequacy","code-diff"];function H2({events:t,maxEvents:r=8,showHeader:s=!0}){const l=r===null?t:t.slice(-r);return x.jsxs("section",{className:"event-log",children:[s?x.jsx("h2",{children:"Events"}):null,t.length===0?x.jsx("p",{className:"muted",children:"No terminal events yet."}):x.jsx("ol",{children:l.map((d,p)=>x.jsx("li",{children:d},`${d}-${p}`))})]})}function Fn({checked:t,className:r,disabled:s,label:l,stateLabel:d,title:p,onChange:f}){const o=["switch-control",t?"is-on":"is-off",r].filter(Boolean).join(" "),c=d??(t?"on":"off");return x.jsxs("button",{type:"button",role:"switch","aria-checked":t,"aria-label":`${l}: ${c}`,className:o,disabled:s,title:p,onClick:()=>f(!t),children:[x.jsx("span",{className:"switch-control-label",children:l}),x.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:x.jsx("span",{className:"switch-control-thumb"})})]})}function z2({status:t,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,autoMemoryEnabled:p,busy:f=!1,onRefresh:o,onApply:c,onOpenStudio:h,onOpenRepositoryDiff:m,onAutoTaskHarnessReviewChange:u,onAutoMemoryChange:y,onStartBootstrap:w,onRestartBootstrap:T,onStopBootstrap:E,onRunBootstrap:b}){const[v,_]=te.useState(!1),[S,A]=te.useState("bypassPermissions"),[L,M]=te.useState("default"),[D,k]=te.useState("default"),R=r==null?void 0:r.session,B=(r==null?void 0:r.status)==="running",H=(R==null?void 0:R.status)==="running",U=(r==null?void 0:r.status)!=="complete",P={permissionMode:S,model:L,effort:D};return l?t?x.jsxs("section",{className:"harness-panel",children:[x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Fixed install"}),x.jsx("p",{className:"muted",children:t.initialized?t.needsApply?`${t.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),x.jsx("div",{className:"harness-actions",children:t.initialized?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:f,onClick:()=>void o(),children:"Refresh"}),t.needsApply?x.jsx("button",{type:"button",disabled:f,onClick:()=>void c(),children:"Update"}):null]}):x.jsx("button",{type:"button",disabled:f,onClick:()=>void c(),children:"Initialize"})})]}),t.initialized&&t.needsApply?x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),x.jsx("ol",{className:"harness-file-list",children:t.plannedChanges.map(V=>x.jsxs("li",{children:[x.jsx("span",{children:V.path}),x.jsx(Yn,{status:V.action})]},`${V.path}:${V.action}`))})]}):null]}),x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsx("div",{children:x.jsx("strong",{children:"Harness Studio"})}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:f,onClick:h,children:"Open Studio"})})]}),x.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:f,onClick:m,children:"Review Diff"}),x.jsx(Fn,{checked:d,className:"sidebar-switch",disabled:f,label:"Auto task harness review",title:"Automatically ask Harness Engineer to review task harness after final acceptance completes",onChange:u}),x.jsx(Fn,{checked:p,className:"sidebar-switch",disabled:f,label:"Auto memory",title:"Collect role memory drafts after Final Acceptance and let Harness Engineer apply reviewed memory",onChange:y})]}),U?x.jsx("div",{className:"harness-stage",children:x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Bootstrap"}),x.jsx("p",{className:"muted",children:r?I2(r.status):"not loaded"})]}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:f||!(r!=null&&r.canStart),onClick:()=>{_(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?x.jsx("div",{className:"harness-result",children:x.jsx("p",{className:"muted",children:s.message})}):null,t.warnings.length>0?x.jsx("ul",{className:"warnings",children:t.warnings.map(V=>x.jsx("li",{children:V},V))}):null,r!=null&&r.warnings.length?x.jsx("ul",{className:"warnings",children:r.warnings.map(V=>x.jsx("li",{children:V},V))}):null,U&&v?x.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:x.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[x.jsxs("header",{className:"harness-bootstrap-modal-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Harness Engineer Bootstrap"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),x.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[R?x.jsx(Yn,{status:R.status}):null,x.jsx("button",{type:"button",onClick:()=>_(!1),children:"Close"})]})]}),x.jsxs("div",{className:"harness-bootstrap-controls",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:S,disabled:f||B||H,onChange:V=>A(V.target.value),children:h_.map(V=>x.jsx("option",{value:V.value,children:V.label},V.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:L,disabled:f||B||H,onChange:V=>M(V.target.value),children:f_.map(V=>x.jsx("option",{value:V.value,children:V.label},V.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:D,disabled:f||B||H,onChange:V=>k(V.target.value),children:d_.map(V=>x.jsx("option",{value:V.value,children:V.label},V.value))})]}),x.jsxs("div",{className:"harness-bootstrap-control-actions",children:[x.jsx("button",{type:"button",disabled:f||B||!(r!=null&&r.canStart),onClick:()=>void w(P),children:"Start"}),x.jsx("button",{type:"button",disabled:f||B||!(r!=null&&r.canStart),onClick:()=>void T(P),children:"Restart"}),x.jsx("button",{type:"button",disabled:f||!R,onClick:()=>void E(),children:"Stop"}),x.jsx("button",{type:"button",disabled:f||B||!H,onClick:()=>void b(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:H?x.jsx(No,{sessionId:R.id,active:v}):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"Harness Bootstrap"}),x.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:x.jsx("section",{className:"harness-panel",children:x.jsxs("div",{className:"harness-result",children:[x.jsx("strong",{children:"Task required"}),x.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function I2(t){return t.replaceAll("_"," ")}function ef(t){return{total:t.length,accepted:t.filter(r=>r.acceptedAt).length,delivered:t.filter(r=>r.deliveredAt).length}}function P2(t,r=6){const s=[...t].sort(q2).map((d,p)=>({message:d,sequence:p+1}));return[...r===null?s:s.slice(-r)].sort((d,p)=>p.sequence-d.sequence)}function U2({messages:t,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:p=!0,onModeChange:f,onMarkAllDone:o}){const[c,h]=te.useState(null),m=ef(t),u=(r==null?void 0:r.mode)??"auto",y=P2(t,l);async function w(T){await $2(T.body),h(T.id),window.setTimeout(()=>h(E=>E===T.id?null:E),1200)}return x.jsxs("section",{className:"message-panel",children:[p?x.jsxs("div",{className:"message-panel-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[m.total," total / ",m.accepted," accepted"]})]}),d&&f?x.jsx("div",{className:"message-controls",children:x.jsx(Fn,{checked:u==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:T=>f(T?"auto":"manual")})}):null,d&&o?x.jsx("button",{type:"button",disabled:s,onClick:o,children:"Mark All Done"}):null]}):null,t.length===0?x.jsx("p",{className:"muted",children:"No role messages yet."}):x.jsx("ol",{className:"message-list",children:y.map(({message:T,sequence:E})=>x.jsxs("li",{className:"message-item",children:[x.jsxs("div",{className:"message-item-main",children:[x.jsxs("div",{className:"message-meta",children:[x.jsxs("span",{className:"message-sequence",children:["#",E]}),x.jsx("time",{dateTime:Bo(T),children:F2(Bo(T))}),x.jsxs("strong",{children:[T.fromRole," ","->"," ",T.toRole]}),x.jsx("span",{children:T.type})]}),x.jsx("p",{children:T.body}),T.failureReason?x.jsx("span",{className:"message-reason",children:T.failureReason}):null,T.bodyPath?x.jsx("span",{className:"message-path",children:T.bodyPath}):null]}),x.jsx("div",{className:"message-actions",children:x.jsx("button",{type:"button",disabled:s,onClick:()=>void w(T),children:c===T.id?"Copied":"Copy"})})]},T.id))})]})}function F2(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Bo(t){return t.acceptedAt??t.deliveredAt??t.dispatchingAt??t.createdAt}function q2(t,r){const s=Bo(t).localeCompare(Bo(r));if(s!==0)return s;const l=t.createdAt.localeCompare(r.createdAt);return l!==0?l:t.id.localeCompare(r.id)}async function $2(t){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(t);return}const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function G2({defaultPath:t="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,p]=te.useState(t);te.useEffect(()=>{t&&p(t)},[t]);async function f(o){o.preventDefault(),await l(d)}return x.jsx("form",{className:"repo-connect",onSubmit:f,children:x.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[x.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:o=>p(o.target.value),placeholder:"/path/to/repo"}),r.length>0?x.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:o=>{o.target.value&&p(o.target.value)},children:[x.jsx("option",{value:"",children:"Recent"}),r.map(o=>x.jsx("option",{value:o,children:o},o))]}):null,x.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function V2({tasks:t,activeTaskSlug:r,onSelect:s}){return x.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:t.map(l=>x.jsxs("button",{className:l.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(l.taskSlug),children:[x.jsx("span",{children:l.title||l.taskSlug}),x.jsx(Yn,{status:l.status})]},l.taskSlug))})}function W2({project:t,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:p,events:f,roundState:o,gateReview:c,translationEnabled:h,translationAutoSendEnabled:m,translationTargetLanguage:u,translationOutputMode:y,translationMemoryInitialized:w,translatorSession:T,harnessStatus:E,harnessBootstrapStatus:b,harnessApplyResult:v,autoTaskHarnessReviewEnabled:_,autoMemoryEnabled:S,gatewayStatus:A,gatewayQrLogin:L,gatewayQrCheck:M,gatewayLarkRegistration:D,gatewayLarkRegistrationCheck:k,busy:R,onConnect:B,onRefreshConnectedRepository:H,onPullConnectedRepository:U,onRefreshHarness:P,onApplyHarness:V,onStartHarnessBootstrap:K,onRestartHarnessBootstrap:G,onStopHarnessBootstrap:Y,onRunHarnessBootstrap:ee,onOpenHarnessStudio:z,onOpenRepositoryDiff:j,onAutoTaskHarnessReviewChange:N,onAutoMemoryChange:$,onRefreshGateway:I,onGatewayEnabledChange:ie,onGatewaySettingsChange:me,onGatewayTranslationChange:ve,onGatewayConnectionChange:Q,onStartGatewayQrLogin:q,onStartGatewayLarkRegistration:ce,onResetGatewayBinding:ae,onGateReviewGateEnabledChange:be,onTranslationEnabledChange:Ee,onTranslationAutoSendChange:xe,onTranslationTargetLanguageChange:de,onTranslationOutputModeChange:Me,onOpenFileTranslation:$e,onOpenTranslatorSession:Ae,onCreateTranslationBootstrap:ge,onUpdateTranslationMemory:He,onCreateTask:Ke,onCloseTask:Dt,onSelectTask:Vt,themeMode:St,onAutoOrchestrationChange:dt,onThemeModeChange:Nt,pauseAlertSound:he,onPauseAlertSoundChange:Ce,roleRetryEnabled:Re,onRoleRetryEnabledChange:je,permissionRequestMode:Ne,onPermissionRequestModeChange:_t,launchTemplate:qe,canSaveLaunchTemplate:bt,canOneClickStart:Ct,onSaveLaunchTemplate:xt,onOneClickStart:nt,onMarkAllMessagesDone:mn,onDeleteMessageHistory:en}){const[br,ci]=te.useState(""),[ui,hi]=te.useState(!1),[gn,_n]=te.useState(!1),[wt,fi]=te.useState(()=>l?null:"repository"),Bi=ef(d),tn=br.trim(),qn=Q2(t,l,E),Qn=s.filter(Ie=>Ie.cleanupStatus!=="cleaned"),$n=Qn.find(Ie=>Ie.taskSlug===l)??null;te.useEffect(()=>{fi(Ie=>!l&&Ie===null?t?"task":"repository":Ie)},[l,t]);function Dn(Ie,di){fi(di?Ie:null)}async function nn(Ie){Ie.preventDefault(),await Ke({taskSlug:tn}),ci("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx($r,{title:"Repository",open:wt==="repository",onOpenChange:Ie=>{Dn("repository",Ie),Ie&&t&&H()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(G2,{defaultPath:(t==null?void 0:t.repoRoot)??"",recentPaths:r,busy:R,onConnect:B}),t?x.jsx(tk,{busy:R,project:t,onPull:U}):null]})}),x.jsx($r,{title:"Settings",open:wt==="settings",onOpenChange:Ie=>Dn("settings",Ie),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Wg(St)}`,className:"settings-toggle theme-mode-toggle",disabled:R,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>Nt(ak(St)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Wg(St)})]}),x.jsx(Fn,{checked:((p==null?void 0:p.mode)??"auto")==="auto",className:"sidebar-switch",disabled:R||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:dt}),x.jsx(Fn,{checked:he,className:"sidebar-switch",disabled:R,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:Ie=>Ce(Ie)}),x.jsx(Fn,{checked:Re,className:"sidebar-switch",disabled:R,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:Ie=>je(Ie)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Ne,disabled:R,onChange:Ie=>_t(Ie.target.value),children:[x.jsx("option",{value:"off",children:"off"}),x.jsx("option",{value:"allowAll",children:"allow all"})]})]}),x.jsxs("button",{className:"settings-toggle",disabled:R||!bt,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:xt,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:bt?"ready":"open task"})]}),Ct?x.jsxs("button",{className:"settings-toggle is-active",disabled:R,title:K2(qe),type:"button",onClick:nt,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:kv(qe)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>hi(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Bi.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>_n(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx($r,{title:"Translation",open:wt==="translation",onOpenChange:Ie=>Dn("translation",Ie),children:x.jsx(Y2,{busy:R,enabled:h,autoSendEnabled:m,targetLanguage:u,outputMode:y,memoryInitialized:w,baseUnavailableReason:qn,translatorSession:T,onAutoSendChange:xe,onCreateBootstrap:ge,onEnabledChange:Ee,onUpdateMemory:He,onTargetLanguageChange:de,onOutputModeChange:Me,onOpenFileTranslation:$e,onOpenTranslatorSession:Ae})}),t&&l?x.jsx($r,{title:"Gate Review Gates",open:wt==="gate-review-gates",onOpenChange:Ie=>Dn("gate-review-gates",Ie),children:x.jsx(J2,{busy:R,state:c,onGateEnabledChange:be})}):null,x.jsx($r,{title:"Gateway",open:wt==="gateway",onOpenChange:Ie=>{Dn("gateway",Ie),Ie&&I()},children:x.jsx(ek,{busy:R,qrCheck:M,qrLogin:L,larkRegistration:D,larkRegistrationCheck:k,status:A,onEnabledChange:ie,onSettingsChange:me,onResetBinding:ae,onStartLarkRegistration:ce,onStartQrLogin:q,onTranslationChange:ve,onConnectionChange:Q})}),t?x.jsx($r,{title:"VCM Harness",open:wt==="vcm-harness",onOpenChange:Ie=>Dn("vcm-harness",Ie),children:x.jsx(z2,{status:E,bootstrapStatus:b,applyResult:v,hasActiveTask:!!$n,autoTaskHarnessReviewEnabled:_,autoMemoryEnabled:S,busy:R,onRefresh:P,onApply:V,onOpenStudio:z,onOpenRepositoryDiff:j,onAutoTaskHarnessReviewChange:N,onAutoMemoryChange:$,onStartBootstrap:K,onRestartBootstrap:G,onStopBootstrap:Y,onRunBootstrap:ee})}):null,t?x.jsx($r,{title:"Task",open:wt==="task",onOpenChange:Ie=>Dn("task",Ie),children:Qn.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(V2,{tasks:Qn,activeTaskSlug:l,onSelect:Vt}),$n?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:R,type:"button",onClick:Dt,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:nn,children:[x.jsx("input",{value:br,onChange:Ie=>ci(Ie.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",tn?`feature/${tn}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",tn?`.claude/worktrees/${tn}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:R||!tn,children:"Create"})]})})}):null,t&&$n?x.jsx(rk,{task:$n,roundState:o}):null,ui?x.jsx(ok,{busy:R,messages:d,orchestration:p,onClose:()=>hi(!1),onMarkAllDone:()=>{l&&mn(l)},onDeleteMessageHistory:()=>{l&&en(l)}}):null,gn?x.jsx(lk,{events:f,onClose:()=>_n(!1)}):null]})}function kv(t){return[t.autoOrchestration?"auto":"manual"].join(" + ")}function K2(t){const r=Object.entries(t.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${kv(t)}; ${r}`}function Y2({autoSendEnabled:t,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:p,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:m,onUpdateMemory:u,onOutputModeChange:y,onTargetLanguageChange:w,onOpenFileTranslation:T,onOpenTranslatorSession:E}){const b=!!(s||r),v=(o==null?void 0:o.status)==="running",_=!!(l&&!r&&v),S=r??(v?null:"Start Translator session first."),A=!!(s||S),M=r??"Open Translator session",D=S??"Translation tools are ready";return x.jsxs("div",{className:"sidebar-settings",children:[x.jsx(Fn,{checked:_,className:"sidebar-switch",disabled:b||!v,label:"Conversation translation",title:D,onChange:m}),x.jsx(Fn,{checked:t,className:"sidebar-switch",disabled:b,label:"Auto-send",onChange:c}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Language"}),x.jsx("select",{value:f,disabled:b,onChange:k=>w(k.target.value),children:o_.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Reply scope"}),x.jsx("select",{value:p,disabled:b,onChange:k=>y(k.target.value),children:i1.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:D,type:"button",onClick:T,children:[x.jsx("span",{children:"File translation"}),x.jsx("span",{children:"open"})]}),d?null:x.jsxs("button",{className:"settings-toggle",disabled:A,title:D,type:"button",onClick:h,children:[x.jsx("span",{children:"Bootstrap"}),x.jsx("span",{children:"run"})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:D,type:"button",onClick:u,children:[x.jsx("span",{children:"Update memory"}),x.jsx("span",{children:"run"})]}),S?x.jsx("p",{className:"settings-help-text",children:S}):null,x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"Session status"}),x.jsx("strong",{children:X2(o)})]}),x.jsxs("button",{className:"settings-toggle",disabled:b,title:M,type:"button",onClick:E,children:[x.jsx("span",{children:"Open Session"}),x.jsx("span",{children:"open"})]})]})}function X2(t){return t?t.status==="running"?t.activityStatus??"idle":t.status:"not started"}function Q2(t,r,s){return t?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 J2({busy:t,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:N2.map(l=>{const d=s==null?void 0:s.gates[l],p=!!(d!=null&&d.required);return x.jsx(Fn,{checked:p,className:"sidebar-switch",disabled:t||!s,label:Z2(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function Z2(t){switch(t){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"code-diff":return"Code diff"}return t}function ek({busy:t,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:l,onResetBinding:d,onSettingsChange:p,onStartLarkRegistration:f,onStartQrLogin:o,onTranslationChange:c,onConnectionChange:h,qrCheck:m,qrLogin:u,status:y}){const w=(y==null?void 0:y.channel)==="lark",T=(y==null?void 0:y.channel)==="lark"?!!(y.binding.appIdConfigured&&y.binding.appSecretConfigured):!!(y!=null&&y.binding.tokenConfigured),E=(y==null?void 0:y.channel)==="lark"?!!(y.binding.appIdConfigured&&y.binding.appSecretConfigured):!!(y!=null&&y.binding.tokenConfigured);return x.jsxs("div",{className:"gateway-panel",children:[x.jsxs("label",{className:"compact-field",children:[x.jsx("span",{children:"Channel"}),x.jsxs("select",{disabled:t||!y,value:(y==null?void 0:y.channel)??"weixin-ilink",onChange:b=>{p({channel:b.currentTarget.value==="lark"?"lark":"weixin-ilink"})},children:[x.jsx("option",{value:"weixin-ilink",children:"Weixin iLink"}),x.jsx("option",{value:"lark",children:"Lark"})]})]}),x.jsxs("div",{className:"gateway-actions",children:[x.jsx(Fn,{checked:!!(y!=null&&y.connectionEnabled),className:"sidebar-switch",disabled:t||!y||!y.connectionEnabled&&!T,label:"Connection",stateLabel:y!=null&&y.connectionEnabled?"connected":"off",title:T?"Connect or disconnect the channel for this session. Off by default; the phone can drive the gateway only while Connection is on. Separate from the Gateway command switch.":"Configure the selected Gateway channel first",onChange:b=>h(b)}),x.jsx(Fn,{checked:!!(y!=null&&y.enabled),className:"sidebar-switch",disabled:t||!y||!y.enabled&&!T,label:"Gateway",title:T?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:b=>l(b)}),x.jsx(Fn,{checked:!!(y!=null&&y.translationEnabled),className:"sidebar-switch",disabled:t||!y,label:"Translation",onChange:b=>c(b)}),w?x.jsx("button",{type:"button",disabled:t,onClick:f,children:"Start QR Setup"}):E?x.jsx("button",{className:"danger-button",type:"button",disabled:t,onClick:d,children:"Reset Binding"}):x.jsx("button",{type:"button",disabled:t,onClick:o,children:"Start QR Login"})]}),w?x.jsxs("div",{className:"gateway-lark-settings",children:[x.jsx("p",{className:"muted",children:y!=null&&y.binding.appIdConfigured&&y.binding.appSecretConfigured?`Lark app configured${y.binding.larkBotName?` · ${y.binding.larkBotName}`:""}.`:"Use QR setup to create and configure the Lark bot automatically."}),r?x.jsxs("p",{className:"muted",children:["QR setup: ",(s==null?void 0:s.status)??r.status,s!=null&&s.message?` · ${s.message}`:""]}):null]}):u?x.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!w&&m?x.jsxs("p",{className:"muted",children:["QR status: ",m.status,m.message?` · ${m.message}`:""]}):null]})}function tk({busy:t,onPull:r,project:s}){const l=s.pullDisabledReason,d=!!s.canPull;return x.jsxs("div",{className:"project-summary",children:[x.jsxs("dl",{children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Base path"}),x.jsx("dd",{children:s.repoRoot})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Branch"}),x.jsx("dd",{children:nk(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Remote"}),x.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:ik(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Commit"}),x.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Working tree"}),x.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),x.jsxs("div",{className:"connected-repo-actions",children:[x.jsx("button",{type:"button",disabled:t||!d,title:l??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),x.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Mh(s.checkedAt)}`:"status not refreshed"})]}),l?x.jsx("p",{className:"muted",children:l}):null,s.warnings.length>0?x.jsx("ul",{className:"warnings",children:s.warnings.map(p=>x.jsx("li",{children:p},p))}):null]})}function nk(t){return t.branch||"unknown"}function ik(t){if(!t.upstreamBranch)return"no upstream";const r=t.ahead??0,s=t.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 rk({roundState:t,task:r}){var m;const[s,l]=te.useState(()=>Date.now()),d=!!(t!=null&&t.startedAt),p=Av(r.createdAt,s),f=Vg(t,(t==null?void 0:t.totalCcActiveMs)??0,s),o=d&&t?Vg(t,t.currentRoundCcActiveMs,s):0,c=d&&t?sk(t,s):0,h=((m=r.title)==null?void 0:m.trim())||r.taskSlug;return te.useEffect(()=>{const u=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(u)},[]),x.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[x.jsxs("div",{className:"task-status-dock-title",children:[x.jsx("strong",{title:h,children:h}),x.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Session start"}),x.jsx("dd",{children:Mh(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:xo(p)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Rounds"}),x.jsx("dd",{children:(t==null?void 0:t.totalRoundCount)??0})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:xo(f)})]})]}),d&&t?x.jsxs("div",{className:"current-round-status",children:[x.jsxs("div",{className:"current-round-title",children:[x.jsx("span",{children:t.status==="running"?"Current Round":"Last Round"}),x.jsx("span",{className:`status-badge status-${t.status}`,children:t.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Started"}),x.jsx("dd",{children:Mh(t.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:xo(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:xo(o)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:t.turnCount})]})]})]}):null]})}function Vg(t,r,s){if(!(t!=null&&t.activeTurnStartedAt)||t.status!=="running")return r;const l=Date.parse(t.updatedAt);return Number.isFinite(l)?r+Math.max(0,s-l):r}function sk(t,r){const s=t.status==="running"?r:Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return Av(t.startedAt??"",Number.isFinite(s)?s:r)}function Av(t,r){const s=Date.parse(t);return Number.isFinite(s)?Math.max(0,r-s):0}function Mh(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(r)}function xo(t){const r=Math.max(0,Math.floor(t/1e3)),s=Math.floor(r/3600),l=Math.floor(r%3600/60),d=r%60;return s>0?l>0?`${s}h ${l}m`:`${s}h`:l>0?d>0?`${l}m ${d}s`:`${l}m`:`${d}s`}function ak(t){return t==="system"?"light":t==="light"?"dark":"system"}function Wg(t){return t==="system"?"System":t==="light"?"Light":"Dark"}function lk({events:t,onClose:r}){return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Events"}),x.jsxs("p",{className:"muted",children:[t.length," total"]})]}),x.jsx("button",{type:"button",onClick:r,children:"Close"})]}),x.jsx(H2,{events:t,maxEvents:null,showHeader:!1})]})})}function ok({busy:t,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:p}){const f=ef(r);function o(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
|
|
94
|
-
`))&&d()}function c(){window.confirm([`Delete ${f.total} message histor${f.total===1?"y item":"y items"}?`,"","This removes message history from the Messages panel.","Pending route-file messages are not touched."].join(`
|
|
95
|
-
`))&&p()}return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),x.jsxs("div",{className:"modal-actions",children:[x.jsx("button",{type:"button",disabled:t,onClick:o,children:"Mark All Done"}),x.jsx("button",{type:"button",disabled:t||f.total===0,onClick:c,children:"Delete All"}),x.jsx("button",{type:"button",onClick:l,children:"Close"})]})]}),x.jsx(U2,{busy:t,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function $r({children:t,onOpenChange:r,open:s,title:l}){return x.jsxs("section",{className:"sidebar-section",children:[x.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[x.jsx("span",{children:l}),x.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?x.jsx("div",{className:"sidebar-section-content",children:t}):null]})}function Tv(t,r){return t.find(s=>s.role===r)}function ck({activeRole:t,roles:r=Bh,sessions:s,onSelect:l}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const p=Tv(s,d.name),f=(p==null?void 0:p.status)==="running"?p.activityStatus??"idle":(p==null?void 0:p.status)??"not_started";return x.jsxs("button",{className:d.name===t?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===t,onClick:()=>l(d.name),children:[x.jsx("span",{children:d.label}),x.jsx(Yn,{status:f})]},d.name)})})}function uk({role:t,session:r,permissionMode:s,model:l,effort:d,active:p=!0,busy:f,translationEnabled:o,translationAutoSendEnabled:c,translationTargetLanguage:h,translationPanelState:m,onClearTranslationSession:u,onTranslationEntry:y,onTranslationFailures:w,onPermissionModeChange:T,onModelChange:E,onEffortChange:b,onStart:v,onResume:_,onStop:S,onRestart:A,onNotifyHarnessUpdated:L,onTerminalEvent:M}){const D=e1(t)&&o&&(r==null?void 0:r.status)==="running";return x.jsx("section",{className:"session-console",children:x.jsxs("div",{className:D?"session-console-body has-translation":"session-console-body",children:[x.jsxs("div",{className:"terminal-pane",children:[x.jsx(jh,{role:t,session:r,permissionMode:s,model:l,effort:d,busy:f,onPermissionModeChange:T,onModelChange:E,onEffortChange:b,onStart:v,onResume:_,onStop:S,onRestart:A,onNotifyHarnessUpdated:L}),(r==null?void 0:r.status)==="running"?x.jsx(No,{sessionId:r.id,active:p,onEvent:M},r.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:t}),x.jsx("span",{children:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]}),D?x.jsx("div",{className:"translation-pane",children:x.jsx(c2,{active:p,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:t,sessionId:r.id,panelState:m??{role:t,status:"ready",entries:[],failures:[]},onClearSession:u??(()=>{}),onEntry:y??(()=>{}),onFailures:w??(()=>{})},`${t}:${r.id}`)}):null]})})}const ph=500;function Lh(t){return{taskSlug:t,cursor:1,sessions:{}}}function hk(t,r,s){return t.sessions[r]??Ps(s)}function fk(t,r){const l={...gk(t,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...Ps(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const p=l[d.sessionId]??Ps(d.role);if(d.event.type==="status")l[d.sessionId]={...p,role:d.role,status:d.event.status};else if(d.event.type==="failures")l[d.sessionId]={...p,role:d.role,failures:d.event.failures};else if(d.event.type==="entry"){const f=Dv(Rv(p.entries,d.event.entry));l[d.sessionId]={...p,role:d.role,entries:f.entries,failures:f.removedIds.size>0?p.failures.filter(o=>!f.removedIds.has(o.translationId)):p.failures}}}return{taskSlug:r.taskSlug,cursor:r.nextCursor,sessions:l}}function dk(t,r,s){return{...t,sessions:{...t.sessions,[r]:Ps(s)}}}function pk(t,r,s,l){const d=t.sessions[r]??Ps(s),p=Dv(Rv(d.entries,l));return{...t,sessions:{...t.sessions,[r]:{...d,role:s,entries:p.entries,failures:p.removedIds.size>0?d.failures.filter(f=>!p.removedIds.has(f.translationId)):d.failures}}}}function mk(t,r,s,l){const d=t.sessions[r]??Ps(s);return{...t,sessions:{...t.sessions,[r]:{...d,role:s,failures:l}}}}function gk(t,r){return t.taskSlug===r?t:Lh(r)}function Ps(t){return{role:t,status:"ready",entries:[],failures:[]}}function Rv(t,r){return t.findIndex(l=>l.id===r.id)===-1?[...t,r]:t.map(l=>l.id===r.id?r:l)}function Dv(t){if(t.length<=ph)return{entries:t,removedIds:new Set};const r=t.slice(0,t.length-ph);return{entries:t.slice(-ph),removedIds:new Set(r.map(s=>s.id))}}const _k={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",tester:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},vk={"project-manager":"default",architect:"default",coder:"default",tester:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},yk={"project-manager":"default",architect:"default",coder:"default",tester:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function Sk({task:t,activeRole:r,gateReviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:p,launchTemplate:f,refreshNonce:o=0,onTaskChanged:c,onActiveRoleChange:h,onMessagesChanged:m,onOrchestrationChanged:u,onRoundStateChanged:y,onEventsChanged:w,onLaunchStateChanged:T}){const[E,b]=te.useState(null),[v,_]=te.useState(()=>Yg(f)),[S,A]=te.useState(()=>Xg(f)),[L,M]=te.useState(()=>Qg(f)),[D,k]=te.useState(!1),[,R]=Li(""),[B,H]=te.useState([]),[U,P]=te.useState(null),[V,K]=te.useState(null),[G,Y]=te.useState(()=>Lh(t.taskSlug)),ee=te.useRef(""),z=te.useRef(1),j=te.useMemo(()=>JSON.stringify(f),[f]),N=!!(E!=null&&E.sessions.some(xe=>xe.role==="gate-reviewer")),$=s||N,I=[...el,...$?[s_]:[]],ie=te.useCallback((xe,de)=>{P(de),m==null||m(xe),u==null||u(de)},[m,u]),me=te.useCallback((xe,de,Me,$e,Ae)=>{b(xe),K(Ae),ie(de,Me),y==null||y($e)},[ie,y]),ve=te.useCallback(async()=>{const xe=await ye.getTaskWorkspaceState(t.taskSlug);me(xe.taskStatus,xe.messages,xe.orchestration,xe.roundState,xe.workflowState),Oo("Poll task workspace state"),R(de=>Ao(de,["Load task workspace state","Poll task workspace state"]))},[me,t.taskSlug]),Q=te.useCallback((xe,de)=>{const Me=Ev(xe,de);Me&&R(Me)},[]);rl(`task-workspace:${t.taskSlug}:${o}`,()=>ve().catch(xe=>{Q("Poll task workspace state",xe)}),{intervalMs:3e3,runImmediately:!0}),rl(l?`task-translation-feed:${t.taskSlug}`:null,async()=>{try{const xe=await ye.pollTranslationTaskFeed(t.taskSlug,z.current);z.current=xe.nextCursor,Y(de=>fk(de,xe)),Oo("Poll task translation feed"),R(de=>Ao(de,["Poll task translation feed"]))}catch(xe){Q("Poll task translation feed",xe)}},{intervalMs:1e3,runImmediately:!0}),te.useEffect(()=>{H([]),K(null),w==null||w([])},[w,t.taskSlug]),te.useEffect(()=>{z.current=1,Y(Lh(t.taskSlug))},[t.taskSlug]),te.useEffect(()=>{_(Yg(f)),A(Xg(f)),M(Qg(f))},[j,t.taskSlug]),te.useEffect(()=>{E&&!$&&r==="gate-reviewer"&&h("project-manager"),E&&r==="translator"&&h("project-manager")},[r,$,h,E]),te.useEffect(()=>{const xe=E==null?void 0:E.task;if(!xe||xe.taskSlug!==t.taskSlug)return;const de=Kg(xe);if(de===Kg(t)){ee.current="";return}ee.current!==de&&(ee.current=de,c().catch(Me=>{ee.current="",R(ut("Refresh task list after task status changed",Me))}))},[c,E==null?void 0:E.task,t]),te.useEffect(()=>{const xe=(E==null?void 0:E.sessions)??[],de=xe.filter(ge=>bk(ge.role)),Me=new Set(de.map(ge=>ge.role)),$e=xe.some(ge=>ge.role==="gate-reviewer"),Ae={};for(const ge of Us)Ae[ge.name]={permissionMode:v[ge.name],model:S[ge.name],effort:L[ge.name]};T==null||T({taskSlug:t.taskSlug,roles:Ae,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!E,sessionCount:de.length,hasAnySession:de.length>0,hasGateReviewerSession:$e,allRolesHaveSession:el.every(ge=>Me.has(ge.name))})},[S,L,T,U==null?void 0:U.mode,v,E,t.taskSlug]);async function q(xe,de="Run role session action"){k(!0),R("");try{await xe(),await ve(),await c()}catch(Me){R(ut(de,Me))}finally{k(!1)}}function ce(xe){H(de=>{const Me=[...de,`${new Date().toLocaleTimeString()} ${xe}`];return w==null||w(Me),Me})}function ae(xe,de){_(Me=>({...Me,[xe]:de}))}function be(xe,de){A(Me=>({...Me,[xe]:de}))}function Ee(xe,de){M(Me=>({...Me,[xe]:de}))}return x.jsxs("div",{className:"task-workspace",children:[x.jsxs("header",{className:"workspace-header",children:[x.jsxs("div",{className:"workspace-title-line",children:[x.jsx("h1",{children:t.title||t.taskSlug}),V!=null&&V.declared?x.jsxs("div",{className:"workspace-workflow-state",title:[V.declared.branch?`Branch: ${V.declared.branch}`:"",V.declared.resumePoint?`Resume: ${V.declared.resumePoint}`:"",V.declared.status?`Status: ${V.declared.status}`:""].filter(Boolean).join(" | "),children:[x.jsx("span",{children:V.declared.flow??"Workflow"}),V.declared.step?x.jsx("strong",{children:V.declared.step}):null]}):null]}),x.jsx(ck,{activeRole:r,roles:I,sessions:(E==null?void 0:E.sessions)??[],onSelect:h})]}),x.jsx("div",{className:"workspace-grid",children:x.jsx("div",{className:"workspace-main",children:x.jsx("div",{className:"role-console-stack",children:I.map(xe=>{const de=xe.name,Me=de===r,$e=(E==null?void 0:E.sessions)??[],Ae=Tv($e,de),ge=Ae?hk(G,Ae.id,de):void 0;return x.jsx("div",{className:Me?"role-console-panel is-active":"role-console-panel","aria-hidden":!Me,children:x.jsx(uk,{role:de,session:Ae,permissionMode:v[de],model:S[de],effort:L[de],active:Me,busy:D,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:p,translationPanelState:ge,onClearTranslationSession:(He,Ke)=>{Y(Dt=>dk(Dt,He,Ke))},onTranslationEntry:(He,Ke,Dt)=>{Y(Vt=>pk(Vt,He,Ke,Dt))},onTranslationFailures:(He,Ke,Dt)=>{Y(Vt=>mk(Vt,He,Ke,Dt))},onPermissionModeChange:He=>ae(de,He),onModelChange:He=>be(de,He),onEffortChange:He=>Ee(de,He),onStart:()=>void q(async()=>{await ye.startRoleSession(t.taskSlug,de,{cols:100,rows:28,permissionMode:v[de],model:S[de],effort:L[de]}),ce(`started ${de} with ${v[de]} / ${S[de]} / ${L[de]}`)},`Start ${de} session`),onResume:()=>void q(async()=>{await ye.resumeRoleSession(t.taskSlug,de,{cols:100,rows:28,permissionMode:v[de],model:S[de],effort:L[de]}),ce(`resumed ${de} with ${v[de]} / ${S[de]} / ${L[de]}`)},`Resume ${de} session`),onStop:()=>void q(async()=>{await ye.stopRoleSession(t.taskSlug,de),ce(`stopped ${de}`)},`Stop ${de} session`),onRestart:()=>void q(async()=>{await ye.restartRoleSession(t.taskSlug,de,{cols:100,rows:28,permissionMode:v[de],model:S[de],effort:L[de]}),ce(`restarted ${de} with ${v[de]} / ${S[de]} / ${L[de]}`)},`Restart ${de} session`),onNotifyHarnessUpdated:()=>void q(async()=>{await ye.notifyRoleHarnessUpdated(t.taskSlug,de),ce(`notified ${de} to reload latest harness`)},`Notify ${de} to reload harness`),onTerminalEvent:He=>ce(`${xe.label}: ${He}`)})},de)})})})})]})}function bk(t){return el.some(r=>r.name===t)}function Kg(t){return[t.status,t.updatedAt,t.cleanupStatus??"",t.cleanedAt??""].join(":")}function Yg(t){var s;const r={..._k};for(const l of Us)r[l.name]=((s=t.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function Xg(t){var s;const r={...vk};for(const l of Us)r[l.name]=((s=t.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function Qg(t){var s;const r={...yk};for(const l of Us)r[l.name]=((s=t.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const Ck=1400;function wk(t){return!!(t!=null&&t.initialized)}function xk(){const[t,r]=te.useState(null),[s,l]=te.useState([]),[d,p]=te.useState(null),[f,o]=te.useState(null),[c,h]=te.useState(null),[m,u]=te.useState(null),[y,w]=te.useState(null),[T,E]=te.useState(null),[b,v]=te.useState(null),[_,S]=te.useState(null),[A,L]=te.useState(null),[M,D]=te.useState(null),[k,R]=te.useState(null),[B,H]=te.useState(!1),[U,P]=te.useState(null),[V,K]=te.useState(null),[G,Y]=te.useState(!1),[ee,z]=te.useState([]),[j,N]=te.useState(null),[$,I]=te.useState(null),[ie,me]=te.useState(null),[ve,Q]=te.useState(null),[q,ce]=te.useState(null),[ae,be]=te.useState(null),[Ee,xe]=te.useState("project-manager"),[de,Me]=te.useState("system"),[$e,Ae]=te.useState(!0),[ge,He]=te.useState(!0),[Ke,Dt]=te.useState("off"),[Vt,St]=te.useState(!1),[dt,Nt]=te.useState(!1),[he,Ce]=te.useState(!1),[Re,je]=te.useState(!1),[Ne,_t]=te.useState(t1),[qe,bt]=te.useState(n1),[Ct,xt]=te.useState(!1),[nt,mn]=te.useState(!1),[en,br]=te.useState(!1),[ci,ui]=te.useState(!1),[hi,gn]=te.useState(!1),[_n,wt]=te.useState(null),[fi,Bi]=te.useState("bypassPermissions"),[tn,qn]=te.useState("default"),[Qn,$n]=te.useState("medium"),[Dn,nn]=te.useState(null),[Ie,di]=te.useState("bypassPermissions"),[Cr,Yr]=te.useState("default"),[vn,At]=te.useState("medium"),[It,ji]=te.useState(()=>r1()),[Mn,Fo]=te.useState(null),[qo,$s]=te.useState(0),[Ln,Xr]=te.useState(null),[Ni,Hi]=te.useState(null),[zi,Ii]=te.useState(!1),[vt,Gs]=te.useState(!1),[,Jn]=Li(""),Zn=te.useRef({}),ei=te.useRef({}),ol=te.useRef({}),Vs=te.useRef({}),Ws=te.useRef({}),Qr=te.useRef(null),wr=te.useRef({initialized:!1,messageId:null}),Pi=te.useRef(""),Z=te.useMemo(()=>A2(ee,j),[ee,j]),pt=(Mn==null?void 0:Mn.taskSlug)===(Z==null?void 0:Z.taskSlug)?Mn:null,Jr=c===(Z==null?void 0:Z.taskSlug)?d:null,cl=m===(Z==null?void 0:Z.taskSlug)?f:null,Ks=_===(Z==null?void 0:Z.taskSlug)?b:null,ul=!!(t&&Z&&wk(Jr)),Zr=(_n==null?void 0:_n.status)==="running",hl=!!(he&&ul&&Zr),an=!!(pt!=null&&pt.statusLoaded),Ys=!!(Z&&(pt!=null&&pt.statusLoaded)&&!pt.hasAnySession),Pt=te.useCallback(W=>{Me(W.themeMode),Ae(W.flowPauseAlerts),He(W.roleRetryEnabled),Dt(W.permissionRequestMode),St(W.autoTaskHarnessReviewEnabled),Nt(W.autoMemoryEnabled),Ce(W.translationEnabled),je(W.translationAutoSendEnabled),_t(W.translationTargetLanguage),bt(W.translationOutputMode),ji(W.launchTemplate)},[]);te.useEffect(()=>{if(!$e)return;let W=!1;const ue=()=>{W||(W=!0,Jg(),window.removeEventListener("pointerdown",ue),window.removeEventListener("keydown",ue))};return window.addEventListener("pointerdown",ue),window.addEventListener("keydown",ue),()=>{window.removeEventListener("pointerdown",ue),window.removeEventListener("keydown",ue)}},[$e]);const yn=te.useCallback(()=>{Qr.current!==null&&(window.clearInterval(Qr.current),Qr.current=null)},[]),pi=te.useCallback(()=>{yn(),Zg(),Qr.current=window.setInterval(()=>{Zg()},Ck)},[yn]),Xs=te.useCallback((W,ue=`manual-${Date.now()}`)=>{Xr({id:ue,text:W})},[]),es=te.useCallback(()=>{yn(),Xr(null)},[yn]);te.useEffect(()=>{Z!=null&&Z.taskSlug&&(Ws.current[Z.taskSlug]=Date.now())},[Z==null?void 0:Z.taskSlug]);const Ui=te.useCallback(W=>{Z!=null&&Z.taskSlug&&I({taskSlug:Z.taskSlug,messages:W})},[Z==null?void 0:Z.taskSlug]),$o=te.useCallback(W=>{ol.current[W.taskSlug]=W.mode,Z!=null&&Z.taskSlug&&me({taskSlug:Z.taskSlug,orchestration:W})},[Z==null?void 0:Z.taskSlug]),fl=te.useCallback(W=>{Z!=null&&Z.taskSlug&&Q({taskSlug:Z.taskSlug,events:W})},[Z==null?void 0:Z.taskSlug]),dl=te.useCallback(W=>{if(!(Z!=null&&Z.taskSlug)||W.taskSlug!==Z.taskSlug)return;ce({taskSlug:W.taskSlug,roundState:W});const ue=T2({mode:ol.current[W.taskSlug],status:W.status,activeRole:W.activeRole,lastFollowedRole:Vs.current[W.taskSlug]});ue&&(Vs.current[W.taskSlug]=ue,xe(ue));const Je=R2(W,Dk);if(Je===null){ei.current[W.taskSlug]={status:W.status};return}const Ut=D2(W),Ar=Zn.current[W.taskSlug],Vo=ei.current[W.taskSlug];ei.current[W.taskSlug]={status:W.status},Ar!==Ut&&(Zn.current[W.taskSlug]=Ut,Ak(W,Vo,Ws.current[W.taskSlug])&&Xs(Je,Ut))},[Z==null?void 0:Z.taskSlug,Xs]),Qs=te.useCallback(W=>{Fo(ue=>(ue==null?void 0:ue.taskSlug)===W.taskSlug&&ue.statusLoaded===W.statusLoaded&&ue.sessionCount===W.sessionCount&&ue.hasAnySession===W.hasAnySession&&ue.hasGateReviewerSession===W.hasGateReviewerSession&&ue.allRolesHaveSession===W.allRolesHaveSession&&ue.autoOrchestration===W.autoOrchestration&&JSON.stringify(ue.roles)===JSON.stringify(W.roles)?ue:W)},[]);async function Fi(){const W=await ye.listTasks();return z(W),N(ue=>{var Je;return ue&&W.some(Ut=>Ut.taskSlug===ue)?ue:((Je=W[0])==null?void 0:Je.taskSlug)??null}),W}async function Js(W=Z==null?void 0:Z.taskSlug){if(!W)return p(null),h(null),null;const ue=await ye.getHarnessStatus(W);return p(ue),h(W),ue}async function qi(W=Z==null?void 0:Z.taskSlug){if(!W)return o(null),u(null),null;const ue=await ye.getHarnessBootstrapStatus(W);return o(ue),u(W),ue}async function Wt(){const W=await ye.getGatewayStatus();return L(W),W}async function Zs(){const W=await ye.getRecentRepositoryPaths();return l(W),W}async function ts(){if(!t)return xt(!1),!1;const W=await ye.getTranslationState();return xt(W.memoryInitialized),W.memoryInitialized}async function ti(W){const[ue,Je]=await Promise.all([ye.listMessages(W),ye.getOrchestrationState(W)]);I({taskSlug:W,messages:ue}),me({taskSlug:W,orchestration:Je})}async function mi(W){const ue=await ye.getGateReviewState(W);return be({taskSlug:W,state:ue}),Oo("Poll Gate Review state"),Jn(Je=>Ao(Je,["Refresh Gate Review state","Poll Gate Review state"])),ue}function ea(W,ue){const Je=Ev(W,ue);Je&&Jn(Je)}function ni(W){W&&(Bi(W.permissionMode),W.model&&qn(W.model),W.effort&&$n(W.effort))}async function ta(W={}){const ue=await ye.getTranslatorSession((Z==null?void 0:Z.taskSlug)??null);return wt(ue),W.syncLaunchOptions&&ni(ue),ue}function Sn(W){W&&(di(W.permissionMode),W.model&&Yr(W.model),W.effort&&At(W.effort))}async function Kt(W={}){const ue=await ye.getHarnessEngineerSession((Z==null?void 0:Z.taskSlug)??null);return nn(ue),W.syncLaunchOptions&&Sn(ue),ue}async function na(W=Z==null?void 0:Z.taskSlug){if(!t)return E(null),null;const ue=await ye.getHarnessFeedbackState(W);return E(ue),ue}function xr(W,ue,Je={}){var Ut;wt(W.translatorSession),xt(!!((Ut=W.translationState)!=null&&Ut.memoryInitialized)),nn(W.harnessEngineerSession),E(W.harnessFeedbackState),v(W.autoMemoryState),S(ue&&W.autoMemoryState?ue:null),L(W.gatewayStatus),ue&&W.harnessStatus?(p(W.harnessStatus),h(ue)):(p(null),h(null)),ue&&W.harnessBootstrapStatus?(o(W.harnessBootstrapStatus),u(ue)):(o(null),u(null)),Je.syncLaunchOptions&&(ni(W.translatorSession),Sn(W.harnessEngineerSession))}async function Gn(W={}){if(!t)return wt(null),xt(!1),nn(null),p(null),o(null),h(null),u(null),E(null),v(null),S(null),null;const ue=(Z==null?void 0:Z.taskSlug)??null,Je=await ye.getProjectRuntimeState(ue);return xr(Je,ue,W),Je}function ia(){const W=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const ue of W)Oo(ue);Jn(ue=>Ao(ue,W))}te.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus()]).then(async([W,ue,Je,Ut])=>{r(W),l(ue),L(Ut),Pt(Je),W&&await Fi()}).catch(W=>Jn(ut("Load initial app data",W)))},[Pt]),te.useEffect(()=>{const W=window.matchMedia("(prefers-color-scheme: dark)"),ue=()=>Ii(W.matches);return ue(),W.addEventListener("change",ue),()=>W.removeEventListener("change",ue)},[]),te.useEffect(()=>()=>yn(),[yn]),te.useEffect(()=>{(A==null?void 0:A.pauseAlertSoundEnabled)!==void 0&&Ae(A.pauseAlertSoundEnabled);const W=L2(wr.current,A);wr.current=W.observation,W.dismissPauseAlert&&es()},[es,A]),te.useEffect(()=>{if(Ln&&M2($e)==="strong")return pi(),yn;yn()},[Ln==null?void 0:Ln.id,$e,pi,yn]),te.useEffect(()=>{const W=de==="system"?zi?"dark":"light":de;document.documentElement.dataset.theme=W,document.documentElement.dataset.themeMode=de},[zi,de]),te.useEffect(()=>{if(!(Z!=null&&Z.taskSlug)){be(null);return}mi(Z.taskSlug).catch(W=>Jn(ut("Refresh Gate Review state",W)))},[Z==null?void 0:Z.taskSlug]),te.useEffect(()=>{Pi.current="",wt(null),Bi("bypassPermissions"),qn("default"),$n("medium"),xt(!1),nn(null),di("bypassPermissions"),Yr("default"),At("medium"),p(null),o(null),h(null),u(null),E(null)},[t==null?void 0:t.repoRoot]),rl(t?`project-runtime:${t.repoRoot}:${(Z==null?void 0:Z.taskSlug)??"no-task"}`:null,async()=>{try{const W=(t==null?void 0:t.repoRoot)??"",ue=!!(t&&Pi.current!==W);await Gn({syncLaunchOptions:ue}),ue&&(Pi.current=W),ia()}catch(W){ea("Poll project runtime state",W)}},{intervalMs:3e3,runImmediately:!0});const Yt=(Z==null?void 0:Z.taskSlug)??null,ns=Yt&&(ae==null?void 0:ae.taskSlug)===Yt?ae.state:null,$i=Yt&&(q==null?void 0:q.taskSlug)===Yt?q.roundState:null,Gi=Yt&&(Mn==null?void 0:Mn.taskSlug)===Yt?Mn:null,pl=!!(Yt&&(ns!=null&&ns.activeGate||($i==null?void 0:$i.activeRole)==="gate-reviewer"||Gi!=null&&Gi.hasGateReviewerSession));rl(pl&&Yt?`gate-review:${Yt}`:null,async()=>{if(Yt)try{await mi(Yt)}catch(W){ea("Poll Gate Review state",W)}},{intervalMs:3e3,runImmediately:!1});async function ke(W,ue="Run UI action"){Gs(!0),Jn("");try{await W()}catch(Je){Jn(ut(ue,Je))}finally{Gs(!1)}}async function gi(){var Ut;if(!Z)throw new Error("Create or select a task before closing it.");const W=[`Close task "${Z.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- stops Translator and Harness Engineer sessions for this task",`- deletes the task worktree: ${Z.worktreePath}`,`- deletes the Git branch: ${Z.branch}`,"- deletes VCM task/session/message/orchestration state","","The task will close even if a cleanup step fails; cleanup issues are reported as warnings."].join(`
|
|
96
|
-
`);if(!window.confirm(W))return;const Je=await ye.cleanupTask(Z.taskSlug);N(null),I(null),me(null),Q(null),ce(null),be(null),$s(Ar=>Ar+1),await Fi(),(Ut=Je.warnings)!=null&&Ut.length&&window.alert([`Task "${Je.taskSlug}" closed with cleanup warnings:`,"",...Je.warnings.map(Ar=>`- ${Ar}`)].join(`
|
|
97
|
-
`))}const is=$&&$.taskSlug===(Z==null?void 0:Z.taskSlug)?$.messages:[],Er=ie&&ie.taskSlug===(Z==null?void 0:Z.taskSlug)?ie.orchestration:null,Go=ve&&ve.taskSlug===(Z==null?void 0:Z.taskSlug)?ve.events:[],ln=q&&q.taskSlug===(Z==null?void 0:Z.taskSlug)?q.roundState:null,kr=Z!=null&&Z.taskSlug&&(ln!=null&&ln.roleRecovery)?Tk(Z.taskSlug,ln.roleRecovery):null,Vi=ln!=null&&ln.roleRecovery&&ln.roleRecovery.status!=="failed"&&kr!==Ni?Rk(ln.roleRecovery):null,Wi=ae&&ae.taskSlug===(Z==null?void 0:Z.taskSlug)?ae.state:null,ml=!!(Wi&&Object.values(Wi.gates).some(W=>W.required));return x.jsxs(s1,{sidebar:x.jsx(W2,{project:t,recentRepositoryPaths:s,tasks:ee,activeTaskSlug:(Z==null?void 0:Z.taskSlug)??null,messages:is,orchestration:Er,events:Go,roundState:ln,gateReview:Wi,translationEnabled:hl,translationAutoSendEnabled:Re,translationTargetLanguage:Ne,translationOutputMode:qe,translationMemoryInitialized:Ct,translatorSession:_n,harnessStatus:Jr,harnessBootstrapStatus:cl,harnessApplyResult:y,autoTaskHarnessReviewEnabled:Vt,autoMemoryEnabled:dt,gatewayStatus:A,gatewayQrLogin:M,gatewayQrCheck:k,gatewayLarkRegistration:U,gatewayLarkRegistrationCheck:V,busy:vt,onConnect:W=>ke(async()=>{const ue=await ye.connectProject({repoPath:W});r(ue),w(null),await Promise.all([Fi(),Zs()])},"Connect repository"),onRefreshConnectedRepository:()=>ke(async()=>{const W=await ye.getCurrentProject();r(W)},"Refresh connected repository"),onPullConnectedRepository:()=>ke(async()=>{const W=await ye.pullCurrentProject();r(W)},"Pull connected repository"),onRefreshHarness:()=>ke(async()=>{if(!Z)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([Js(Z.taskSlug),qi(Z.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>ke(async()=>{if(!Z)throw new Error("Create or select a task before applying VCM Harness.");const W=await ye.applyHarness({taskSlug:Z.taskSlug});w(W),await Promise.all([Js(Z.taskSlug),qi(Z.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:W=>ke(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Bootstrap.");const ue=await ye.startHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...W});o(ue.status),u(Z.taskSlug),await Kt({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:W=>ke(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Bootstrap.");const ue=await ye.restartHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...W});o(ue.status),u(Z.taskSlug),await Kt({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>ke(async()=>{if(!Z)throw new Error("Create or select a task before stopping Harness Bootstrap.");const W=await ye.stopHarnessBootstrap({taskSlug:Z.taskSlug});o(W),u((Z==null?void 0:Z.taskSlug)??null),await Kt()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>ke(async()=>{if(!Z)throw new Error("Create or select a task before running Harness Bootstrap.");const W=await ye.runHarnessBootstrap({taskSlug:Z.taskSlug});o(W.status),u(Z.taskSlug),await Kt()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>ui(!0),onOpenRepositoryDiff:()=>gn(!0),onAutoTaskHarnessReviewChange:W=>{St(W),ke(async()=>{const ue=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:W});Pt(ue)},"Update auto task harness review setting")},onAutoMemoryChange:W=>{Nt(W),ke(async()=>{const ue=await ye.updateAppPreferences({autoMemoryEnabled:W});Pt(ue),await Gn()},"Update auto memory setting")},onRefreshGateway:()=>ke(async()=>{await Wt()},"Refresh Gateway status"),onGatewayEnabledChange:W=>{ke(async()=>{const ue=await ye.updateGatewaySettings({enabled:W,...W&&t?{currentProjectId:t.repoRoot,currentTaskSlug:(Z==null?void 0:Z.taskSlug)??null}:{}});L(ue),W&&Pt(await ye.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:W=>ke(async()=>{const ue=await ye.updateGatewaySettings(W);L(ue)},"Update Gateway settings"),onGatewayTranslationChange:W=>{ke(async()=>{const ue=await ye.updateGatewaySettings({translationEnabled:W});L(ue)},"Update Gateway translation setting")},onGatewayConnectionChange:W=>{ke(async()=>{const ue=await ye.setGatewayConnection(W);L(ue)},"Update Gateway connection setting")},onStartGatewayQrLogin:()=>{ke(async()=>{const W=await ye.startGatewayQrLogin();D(W),R(null),H(!0),await Wt()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{ke(async()=>{const W=await ye.startGatewayLarkRegistration();P(W),K(null),Y(!0),await Wt()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{ke(async()=>{const W=await ye.resetGatewayBinding();L(W),D(null),R(null),H(!1),P(null),K(null),Y(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(W,ue)=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before changing Gate Review Gates.");const Je=await ye.updateGateReviewSettings(Z.taskSlug,{gates:{[W]:ue}});be({taskSlug:Z.taskSlug,state:Je})},`Update ${W} Gate Review setting`)},onTranslationEnabledChange:W=>{Ce(W),ke(async()=>{const ue=await ye.updateAppPreferences({translationEnabled:W});Pt(ue)},"Update conversation translation setting")},onTranslationAutoSendChange:W=>{je(W),ke(async()=>{const ue=await ye.updateAppPreferences({translationAutoSendEnabled:W});Pt(ue)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:W=>{_t(W),ke(async()=>{const ue=await ye.updateAppPreferences({translationTargetLanguage:W});Pt(ue)},"Update translation target language")},onTranslationOutputModeChange:W=>{bt(W),ke(async()=>{const ue=await ye.updateAppPreferences({translationOutputMode:W});Pt(ue)},"Update translation output mode")},onOpenFileTranslation:()=>mn(!0),onOpenTranslatorSession:()=>br(!0),onCreateTranslationBootstrap:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:Z.taskSlug,targetLanguage:Ne}),await ts(),await ta()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:Z.taskSlug,targetLanguage:Ne}),await ts(),await ta()},"Create translation memory update task")},onCreateTask:W=>ke(async()=>{const ue=await ye.createTask(W);await Fi(),N(ue.taskSlug)},"Create task"),onCloseTask:()=>{ke(gi,"Close task")},onSelectTask:N,themeMode:de,onAutoOrchestrationChange:W=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before changing auto orchestration.");const ue=await ye.updateOrchestrationState(Z.taskSlug,{mode:W?"auto":"manual"});me({taskSlug:Z.taskSlug,orchestration:ue})},"Update auto orchestration mode")},onThemeModeChange:W=>{Me(W),ke(async()=>{const ue=await ye.updateAppPreferences({themeMode:W});Pt(ue)},"Update theme setting")},pauseAlertSound:$e,onPauseAlertSoundChange:W=>{Ae(W),W&&Jg(),ke(async()=>{const ue=await ye.updateAppPreferences({flowPauseAlerts:W});Pt(ue)},"Update pause alert sound setting")},roleRetryEnabled:ge,onRoleRetryEnabledChange:W=>{He(W),ke(async()=>{const ue=await ye.updateAppPreferences({roleRetryEnabled:W});Pt(ue)},"Update CC retry setting")},permissionRequestMode:Ke,onPermissionRequestModeChange:W=>{Dt(W),ke(async()=>{const ue=await ye.updateAppPreferences({permissionRequestMode:W});Pt(ue)},"Update permission request setting")},launchTemplate:It,canSaveLaunchTemplate:an,canOneClickStart:Ys,onSaveLaunchTemplate:()=>{ke(async()=>{if(!(pt!=null&&pt.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const W=await ye.updateAppPreferences({launchTemplate:{version:1,roles:pt.roles,autoOrchestration:pt.autoOrchestration}});Pt(W)},"Save launch template")},onOneClickStart:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before one-click start.");const W=await ye.oneClickStart(Z.taskSlug);me({taskSlug:Z.taskSlug,orchestration:W.orchestration}),xe("project-manager"),await ti(Z.taskSlug),await Fi(),$s(ue=>ue+1)},"One-click start role sessions")},onMarkAllMessagesDone:W=>{ke(async()=>{const ue=await ye.markAllMessagesDone(W);I({taskSlug:W,messages:ue.messages}),await ti(W)},"Mark all role messages done")},onDeleteMessageHistory:W=>{ke(async()=>{const ue=await ye.deleteMessageHistory(W);I({taskSlug:W,messages:ue.messages}),await ti(W)},"Delete role message history")}}),children:[x.jsx(E2,{}),Ln?x.jsx("div",{className:"flow-pause-alert-backdrop",children:x.jsxs("section",{"aria-describedby":"flow-pause-alert-body flow-pause-alert-hint","aria-labelledby":"flow-pause-alert-title","aria-modal":"true",className:"flow-pause-alert",role:"alertdialog",children:[x.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),x.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),x.jsx("p",{id:"flow-pause-alert-body",children:Ln.text}),x.jsx("p",{id:"flow-pause-alert-hint",className:"flow-pause-alert-hint",children:"The task may be complete, waiting for your decision, or blocked by a workflow issue."}),x.jsx("button",{type:"button",autoFocus:!0,onClick:es,children:"Confirm"})]})}):null,Vi&&kr?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Vi}),x.jsx("button",{type:"button",onClick:()=>Hi(kr),children:"Close"})]}):null,B&&M?x.jsx(Ek,{busy:vt,qrCheck:k,qrLogin:M,onCheck:()=>{ke(async()=>{const W=await ye.checkGatewayQrLogin();R(W),(W.status==="confirmed"||W.status==="binded_redirect")&&H(!1),await Wt()})},onClose:()=>H(!1)}):null,G&&U?x.jsx(kk,{busy:vt,registration:U,registrationCheck:V,onCheck:()=>{ke(async()=>{const W=await ye.checkGatewayLarkRegistration();K(W),W.gatewayStatus&&L(W.gatewayStatus),W.status==="confirmed"&&(Y(!1),await Wt())},"Check Lark Gateway QR setup")},onManualBind:(W,ue)=>{ke(async()=>{const Je=await ye.bindGatewayLarkApp({appId:W,appSecret:ue,larkDomain:"lark"});K(Je),Je.gatewayStatus&&L(Je.gatewayStatus),Je.status==="confirmed"&&(Y(!1),await Wt())},"Bind Lark Gateway app")},onClose:()=>Y(!1)}):null,t&&Z?x.jsx(Sk,{task:Z,activeRole:Ee,gateReviewerEnabled:ml,translationEnabled:hl,translationAutoSendEnabled:Re,translationTargetLanguage:Ne,launchTemplate:It,refreshNonce:qo,onTaskChanged:async()=>{await Fi()},onActiveRoleChange:xe,onMessagesChanged:Ui,onOrchestrationChanged:$o,onRoundStateChanged:dl,onEventsChanged:fl,onLaunchStateChanged:Qs}):x.jsxs("section",{className:"empty-workspace",children:[x.jsx("h1",{children:t?"Create a task to open the workspace":"Connect a repository to begin"}),x.jsx("p",{children:t?"Tasks create local role commands and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, and handoff artifacts."})]}),x.jsx(f2,{open:nt,taskSlug:(Z==null?void 0:Z.taskSlug)??null,targetLanguage:Ne,onClose:()=>mn(!1)}),x.jsx(x1,{open:ci,busy:vt,status:Jr,feedbackState:T,memoryState:Ks,bootstrapStatus:cl,engineerSession:Dn,permissionMode:Ie,model:Cr,effort:vn,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>ui(!1),onRefresh:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Js(Z.taskSlug),qi(Z.taskSlug),Kt(),na(Z.taskSlug),ye.getAutoMemoryState(Z.taskSlug).then(W=>{v(W),S(Z.taskSlug)})])},"Refresh Harness Studio")},onPermissionModeChange:di,onModelChange:Yr,onEffortChange:At,onEngineerStart:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Engineer.");const W=await ye.startHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:Ie,model:Cr,effort:vn});nn(W),Sn(W)},"Start Harness Engineer")},onEngineerResume:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before resuming Harness Engineer.");const W=await ye.resumeHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:Ie,model:Cr,effort:vn});nn(W),Sn(W)},"Resume Harness Engineer")},onEngineerRestart:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Engineer.");const W=await ye.restartHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:Ie,model:Cr,effort:vn});nn(W),Sn(W)},"Restart Harness Engineer")},onEngineerStop:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before stopping Harness Engineer.");const W=await ye.stopHarnessEngineerSession({taskSlug:Z.taskSlug});nn(W)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before notifying Harness Engineer.");const W=await ye.notifyHarnessEngineerHarnessUpdated({taskSlug:Z.taskSlug});nn(W),Sn(W)},"Notify Harness Engineer to reload harness")},onSendFeedback:W=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before sending Harness Feedback.");const ue=await ye.sendHarnessFeedback({taskSlug:Z.taskSlug,feedbackPath:W});nn(ue),Sn(ue)},"Send Harness Feedback to Harness Engineer")},onOpenRepositoryDiff:()=>gn(!0),onReviewTaskHarness:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before reviewing task harness.");const W=await ye.startTaskHarnessRetrospective({taskSlug:Z.taskSlug,trigger:"manual"});E(W),await Kt({syncLaunchOptions:!0})},"Review task harness")},onMemoryStateChange:W=>{v(W),S((Z==null?void 0:Z.taskSlug)??null)}}),x.jsx(D1,{open:hi,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>gn(!1)}),x.jsx(j1,{open:en,busy:vt,session:_n,permissionMode:fi,model:tn,effort:Qn,onClose:()=>br(!1),onPermissionModeChange:Bi,onModelChange:qn,onEffortChange:$n,onStart:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before starting Translator.");const W=await ye.startTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:fi,model:tn,effort:Qn});wt(W),ni(W)},"Start Translator session")},onResume:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before resuming Translator.");const W=await ye.resumeTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:fi,model:tn,effort:Qn});wt(W),ni(W)},"Resume Translator session")},onRestart:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before restarting Translator.");const W=await ye.restartTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:fi,model:tn,effort:Qn});wt(W),ni(W)},"Restart Translator session")},onStop:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before stopping Translator.");const W=await ye.stopTranslatorSession({taskSlug:Z.taskSlug});wt(W)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{ke(async()=>{if(!Z)throw new Error("Create or select a task before notifying Translator.");const W=await ye.notifyTranslatorHarnessUpdated({taskSlug:Z.taskSlug});wt(W),ni(W)},"Notify Translator to reload harness")}})]})}function Ek({busy:t,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[p,f]=te.useState(""),[o,c]=Li("");return te.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const m=Wr(0,"M");m.addData(d.qrcodeUrl),m.make(),h||f(m.createDataURL(8,2))}catch(m){h||c(ut("Render Gateway QR login code",m))}return()=>{h=!0}},[d.qrcodeUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),x.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:p?x.jsx("img",{alt:"Weixin Gateway QR login",src:p}):x.jsx("div",{className:"gateway-qr-placeholder",children:o?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(l==null?void 0:l.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:Mv(d.expiresAt)})]}),l!=null&&l.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:l.message})]}):null]})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:t,onClick:r,children:"Confirm"})})]})})}function kk({busy:t,onCheck:r,onClose:s,onManualBind:l,registration:d,registrationCheck:p}){const[f,o]=te.useState(""),[c,h]=Li(""),[m,u]=te.useState(""),[y,w]=te.useState(""),[T,E]=Li("");return te.useEffect(()=>{let b=!1;h(""),o("");try{const v=Wr(0,"M");v.addData(d.qrUrl),v.make(),b||o(v.createDataURL(8,2))}catch(v){b||h(ut("Render Lark Gateway setup QR code",v))}return()=>{b=!0}},[d.qrUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-lark-registration-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-lark-registration-title",children:"Lark Gateway Setup"}),x.jsx("p",{className:"muted",children:"Scan with Lark, approve bot creation, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:f?x.jsx("img",{alt:"Lark Gateway setup QR code",src:f}):x.jsx("div",{className:"gateway-qr-placeholder",children:c?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsx("div",{className:"gateway-qr-actions",children:x.jsx("button",{type:"button",disabled:t,onClick:r,children:"Confirm"})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(p==null?void 0:p.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:Mv(d.expiresAt)})]}),d.userCode?x.jsxs("div",{children:[x.jsx("dt",{children:"User Code"}),x.jsx("dd",{children:d.userCode})]}):null,p!=null&&p.larkBotName?x.jsxs("div",{children:[x.jsx("dt",{children:"Bot"}),x.jsx("dd",{children:p.larkBotName})]}):null,p!=null&&p.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:p.message})]}):null]}),x.jsxs("form",{className:"gateway-manual-bind",onSubmit:b=>{b.preventDefault();const v=m.trim(),_=y.trim();if(!v||!_){E("Enter both App ID and App Secret.");return}E(""),w(""),l(v,_)},children:[x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-id",children:"App ID"}),x.jsx("input",{id:"gateway-lark-app-id",autoComplete:"off",disabled:t,value:m,onChange:b=>u(b.currentTarget.value),placeholder:"cli_xxx"})]}),x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-secret",children:"App Secret"}),x.jsx("input",{id:"gateway-lark-app-secret",autoComplete:"off",disabled:t,type:"password",value:y,onChange:b=>w(b.currentTarget.value),placeholder:"Enter App Secret"})]}),T?x.jsx("p",{className:"form-error",children:T}):null,x.jsx("button",{type:"submit",disabled:t,children:"Bind manually"})]})]})]})})}function Mv(t){const r=new Date(t);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r)}let Gr=null;function Ak(t,r,s){if((r==null?void 0:r.status)==="running")return!0;const l=Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return!!(s&&Number.isFinite(l)&&l>s)}function Tk(t,r){return`${t}:${r.role}:${r.lastFailureAt}`}function Rk(t){const r=Lk(t.role),s=Lv(t);return t.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次 · ${Ok(t.nextRetryAt)}`}function Dk(t,r){const s=Lv(t);return t.retryable===!1?`CC stopped for ${r}: ${Mk(t)} cannot be fixed by retrying.`:`CC retry failed after ${t.maxAttempts} attempts for ${r}${s}.`}function Lv(t){return!t.error||t.error==="unknown"?"":` · ${t.error}`}function Mk(t){return t.error&&t.error!=="unknown"?t.error:"this error"}function Lk(t){return t.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function Ok(t){if(!t)return"即将重试";const r=Date.parse(t)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function Jg(){const t=Ov();return t?Bv(t):!1}async function Zg(){const t=Ov();if(!t||!await Bv(t))return!1;try{const s=t.createGain(),l=t.currentTime+.025;return s.gain.setValueAtTime(.85,t.currentTime),s.connect(t.destination),n_(t,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),n_(t,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Ov(){const t=window.AudioContext??window.webkitAudioContext;if(!t)return null;try{return(!Gr||Gr.state==="closed")&&(Gr=new t),Gr}catch{return null}}function e_(t){Gr=null,t&&t.state!=="closed"&&t.close().catch(()=>{})}async function Bv(t){if(t_(t))return!0;try{await t.resume();const r=t_(t);return!r&&t===Gr&&e_(t),r}catch{return t===Gr&&e_(t),!1}}function t_(t){return t.state==="running"}function n_(t,r,s){const l=t.createGain(),d=t.createOscillator(),p=t.createOscillator(),f=s.startAt+s.duration;l.gain.setValueAtTime(1e-4,s.startAt),l.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),l.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),p.type="triangle",p.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(l),p.connect(l),l.connect(r),d.start(s.startAt),p.start(s.startAt),d.stop(f+.02),p.stop(f+.02)}const jv=document.getElementById("root");if(!jv)throw new Error("Missing #root element.");q0.createRoot(jv).render(x.jsx(te.StrictMode,{children:x.jsx(xk,{})}));
|