vibe-coding-master 0.7.2 → 0.7.3

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.
@@ -1,4 +1,4 @@
1
- var O0=Object.defineProperty;var B0=(t,r,s)=>r in t?O0(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;var Mm=(t,r,s)=>B0(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 s_(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $u={exports:{}},Ua={};/**
1
+ var O0=Object.defineProperty;var B0=(t,r,s)=>r in t?O0(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;var Lm=(t,r,s)=>B0(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 a_(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gu={exports:{}},Fa={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@ var O0=Object.defineProperty;var B0=(t,r,s)=>r in t?O0(t,r,{enumerable:!0,config
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Lm;function j0(){if(Lm)return Ua;Lm=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 Om;function N0(){return Om||(Om=1,$u.exports=j0()),$u.exports}var x=N0(),Gu={exports:{}},He={};/**
9
+ */var Om;function j0(){if(Om)return Fa;Om=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 Fa.Fragment=r,Fa.jsx=s,Fa.jsxs=s,Fa}var Bm;function N0(){return Bm||(Bm=1,Gu.exports=j0()),Gu.exports}var x=N0(),Vu={exports:{}},He={};/**
10
10
  * @license React
11
11
  * react.production.js
12
12
  *
@@ -14,7 +14,7 @@ var O0=Object.defineProperty;var B0=(t,r,s)=>r in t?O0(t,r,{enumerable:!0,config
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Bm;function H0(){if(Bm)return He;Bm=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 W(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,ve){var _e=typeof N;(_e==="undefined"||_e==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(_e){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,ve)}}if(Q)return ve=ve(N),Q=ie===""?"."+W(N,0):ie,L(ve)?(I="",Q!=null&&(I=Q.replace(P,"$&/")+"/"),G(ve,$,I,"",function(ae){return ae})):ve!=null&&(H(ve)&&(ve=B(ve,I+(ve.key==null||N&&N.key===ve.key?"":(""+ve.key).replace(P,"$&/")+"/")+Q)),$.push(ve)),1;Q=0;var q=ie===""?".":ie+":";if(L(N))for(var ue=0;ue<N.length;ue++)ie=N[ue],_e=q+W(ie,ue),Q+=G(ie,$,I,_e,ve);else if(ue=w(N),typeof ue=="function")for(N=ue.call(N),ue=0;!(ie=N.next()).done;)ie=ie.value,_e=q+W(ie,ue++),Q+=G(ie,$,I,_e,ve);else if(_e==="object"){if(typeof N.then=="function")return G(K(N),$,I,ie,ve);throw $=String(N),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Q}function Y(N,$,I){if(N==null)return N;var ie=[],ve=0;return G(N,ie,"","",function(_e){return $.call(I,_e,ve++)}),ie}function Z(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(I){(N._status===0||N._status===-1)&&(N._status=1,N._result=I)},function(I){(N._status===0||N._status===-1)&&(N._status=2,N._result=I)}),N._status===-1&&(N._status=0,N._result=$)}if(N._status===1)return N._result.default;throw N._result}var z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},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 He.Activity=u,He.Children=j,He.Component=v,He.Fragment=s,He.Profiler=d,He.PureComponent=S,He.StrictMode=l,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,He.__COMPILER_RUNTIME={__proto__:null,c:function(N){return D.H.useMemoCache(N)}},He.cache=function(N){return function(){return N.apply(null,arguments)}},He.cacheSignal=function(){return null},He.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),ve=N.key;if($!=null)for(_e in $.key!==void 0&&(ve=""+$.key),$)!k.call($,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&$.ref===void 0||(ie[_e]=$[_e]);var _e=arguments.length-2;if(_e===1)ie.children=I;else if(1<_e){for(var Q=Array(_e),q=0;q<_e;q++)Q[q]=arguments[q+2];ie.children=Q}return R(N.type,ve,ie)},He.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},He.createElement=function(N,$,I){var ie,ve={},_e=null;if($!=null)for(ie in $.key!==void 0&&(_e=""+$.key),$)k.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(ve[ie]=$[ie]);var Q=arguments.length-2;if(Q===1)ve.children=I;else if(1<Q){for(var q=Array(Q),ue=0;ue<Q;ue++)q[ue]=arguments[ue+2];ve.children=q}if(N&&N.defaultProps)for(ie in Q=N.defaultProps,Q)ve[ie]===void 0&&(ve[ie]=Q[ie]);return R(N,_e,ve)},He.createRef=function(){return{current:null}},He.forwardRef=function(N){return{$$typeof:o,render:N}},He.isValidElement=H,He.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:Z}},He.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},He.startTransition=function(N){var $=D.T,I={};D.T=I;try{var ie=N(),ve=D.S;ve!==null&&ve(I,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(M,z)}catch(_e){z(_e)}finally{$!==null&&I.types!==null&&($.types=I.types),D.T=$}},He.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},He.use=function(N){return D.H.use(N)},He.useActionState=function(N,$,I){return D.H.useActionState(N,$,I)},He.useCallback=function(N,$){return D.H.useCallback(N,$)},He.useContext=function(N){return D.H.useContext(N)},He.useDebugValue=function(){},He.useDeferredValue=function(N,$){return D.H.useDeferredValue(N,$)},He.useEffect=function(N,$){return D.H.useEffect(N,$)},He.useEffectEvent=function(N){return D.H.useEffectEvent(N)},He.useId=function(){return D.H.useId()},He.useImperativeHandle=function(N,$,I){return D.H.useImperativeHandle(N,$,I)},He.useInsertionEffect=function(N,$){return D.H.useInsertionEffect(N,$)},He.useLayoutEffect=function(N,$){return D.H.useLayoutEffect(N,$)},He.useMemo=function(N,$){return D.H.useMemo(N,$)},He.useOptimistic=function(N,$){return D.H.useOptimistic(N,$)},He.useReducer=function(N,$,I){return D.H.useReducer(N,$,I)},He.useRef=function(N){return D.H.useRef(N)},He.useState=function(N){return D.H.useState(N)},He.useSyncExternalStore=function(N,$,I){return D.H.useSyncExternalStore(N,$,I)},He.useTransition=function(){return D.H.useTransition()},He.version="19.2.6",He}var jm;function jh(){return jm||(jm=1,Gu.exports=H0()),Gu.exports}var ee=jh(),Vu={exports:{}},Pa={},Wu={exports:{}},Ku={};/**
17
+ */var jm;function H0(){if(jm)return He;jm=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 O(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 W(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,_e){var ge=typeof N;(ge==="undefined"||ge==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(ge){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(N.$$typeof){case t:case r:Q=!0;break;case m:return Q=N._init,G(Q(N._payload),$,I,ie,_e)}}if(Q)return _e=_e(N),Q=ie===""?"."+W(N,0):ie,L(_e)?(I="",Q!=null&&(I=Q.replace(P,"$&/")+"/"),G(_e,$,I,"",function(le){return le})):_e!=null&&(H(_e)&&(_e=O(_e,I+(_e.key==null||N&&N.key===_e.key?"":(""+_e.key).replace(P,"$&/")+"/")+Q)),$.push(_e)),1;Q=0;var q=ie===""?".":ie+":";if(L(N))for(var ue=0;ue<N.length;ue++)ie=N[ue],ge=q+W(ie,ue),Q+=G(ie,$,I,ge,_e);else if(ue=w(N),typeof ue=="function")for(N=ue.call(N),ue=0;!(ie=N.next()).done;)ie=ie.value,ge=q+W(ie,ue++),Q+=G(ie,$,I,ge,_e);else if(ge==="object"){if(typeof N.then=="function")return G(K(N),$,I,ie,_e);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=[],_e=0;return G(N,ie,"","",function(ge){return $.call(I,ge,_e++)}),ie}function Z(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(I){(N._status===0||N._status===-1)&&(N._status=1,N._result=I)},function(I){(N._status===0||N._status===-1)&&(N._status=2,N._result=I)}),N._status===-1&&(N._status=0,N._result=$)}if(N._status===1)return N._result.default;throw N._result}var z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},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 He.Activity=u,He.Children=j,He.Component=v,He.Fragment=s,He.Profiler=d,He.PureComponent=S,He.StrictMode=l,He.Suspense=c,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,He.__COMPILER_RUNTIME={__proto__:null,c:function(N){return D.H.useMemoCache(N)}},He.cache=function(N){return function(){return N.apply(null,arguments)}},He.cacheSignal=function(){return null},He.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),_e=N.key;if($!=null)for(ge in $.key!==void 0&&(_e=""+$.key),$)!k.call($,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&$.ref===void 0||(ie[ge]=$[ge]);var ge=arguments.length-2;if(ge===1)ie.children=I;else if(1<ge){for(var Q=Array(ge),q=0;q<ge;q++)Q[q]=arguments[q+2];ie.children=Q}return R(N.type,_e,ie)},He.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},He.createElement=function(N,$,I){var ie,_e={},ge=null;if($!=null)for(ie in $.key!==void 0&&(ge=""+$.key),$)k.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(_e[ie]=$[ie]);var Q=arguments.length-2;if(Q===1)_e.children=I;else if(1<Q){for(var q=Array(Q),ue=0;ue<Q;ue++)q[ue]=arguments[ue+2];_e.children=q}if(N&&N.defaultProps)for(ie in Q=N.defaultProps,Q)_e[ie]===void 0&&(_e[ie]=Q[ie]);return R(N,ge,_e)},He.createRef=function(){return{current:null}},He.forwardRef=function(N){return{$$typeof:o,render:N}},He.isValidElement=H,He.lazy=function(N){return{$$typeof:m,_payload:{_status:-1,_result:N},_init:Z}},He.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},He.startTransition=function(N){var $=D.T,I={};D.T=I;try{var ie=N(),_e=D.S;_e!==null&&_e(I,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(M,z)}catch(ge){z(ge)}finally{$!==null&&I.types!==null&&($.types=I.types),D.T=$}},He.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},He.use=function(N){return D.H.use(N)},He.useActionState=function(N,$,I){return D.H.useActionState(N,$,I)},He.useCallback=function(N,$){return D.H.useCallback(N,$)},He.useContext=function(N){return D.H.useContext(N)},He.useDebugValue=function(){},He.useDeferredValue=function(N,$){return D.H.useDeferredValue(N,$)},He.useEffect=function(N,$){return D.H.useEffect(N,$)},He.useEffectEvent=function(N){return D.H.useEffectEvent(N)},He.useId=function(){return D.H.useId()},He.useImperativeHandle=function(N,$,I){return D.H.useImperativeHandle(N,$,I)},He.useInsertionEffect=function(N,$){return D.H.useInsertionEffect(N,$)},He.useLayoutEffect=function(N,$){return D.H.useLayoutEffect(N,$)},He.useMemo=function(N,$){return D.H.useMemo(N,$)},He.useOptimistic=function(N,$){return D.H.useOptimistic(N,$)},He.useReducer=function(N,$,I){return D.H.useReducer(N,$,I)},He.useRef=function(N){return D.H.useRef(N)},He.useState=function(N){return D.H.useState(N)},He.useSyncExternalStore=function(N,$,I){return D.H.useSyncExternalStore(N,$,I)},He.useTransition=function(){return D.H.useTransition()},He.version="19.2.6",He}var Nm;function Nh(){return Nm||(Nm=1,Vu.exports=H0()),Vu.exports}var ee=Nh(),Wu={exports:{}},qa={},Ku={exports:{}},Yu={};/**
18
18
  * @license React
19
19
  * scheduler.production.js
20
20
  *
@@ -22,7 +22,7 @@ var O0=Object.defineProperty;var B0=(t,r,s)=>r in t?O0(t,r,{enumerable:!0,config
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var Nm;function z0(){return Nm||(Nm=1,(function(t){function r(G,Y){var Z=G.length;G.push(Y);e:for(;0<Z;){var z=Z-1>>>1,j=G[z];if(0<d(j,Y))G[z]=Y,G[Z]=j,Z=z;else break e}}function s(G){return G.length===0?null:G[0]}function l(G){if(G.length===0)return null;var Y=G[0],Z=G.pop();if(Z!==Y){G[0]=Z;e:for(var z=0,j=G.length,N=j>>>1;z<N;){var $=2*(z+1)-1,I=G[$],ie=$+1,ve=G[ie];if(0>d(I,Z))ie<j&&0>d(ve,I)?(G[z]=ve,G[ie]=Z,z=ie):(G[z]=I,G[$]=Z,z=$);else if(ie<j&&0>d(ve,Z))G[z]=ve,G[ie]=Z,z=ie;else break e}}return Y}function d(G,Y){var Z=G.sortIndex-Y.sortIndex;return Z!==0?Z: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 Z=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=Z,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,W=P.port2;P.port1.onmessage=H,U=function(){W.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 Z=y;y=Y;try{return G()}finally{y=Z}},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 Z=y;y=G;try{return Y()}finally{y=Z}},t.unstable_scheduleCallback=function(G,Y,Z){var z=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,G){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,G={id:m++,callback:Y,priorityLevel:G,startTime:Z,expirationTime:j,sortIndex:-1},Z>z?(G.sortIndex=Z,r(h,G),s(c)===null&&G===s(h)&&(E?(_(D),D=-1):E=!0,K(L,Z-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 Z=y;y=Y;try{return G.apply(this,arguments)}finally{y=Z}}}})(Ku)),Ku}var Hm;function I0(){return Hm||(Hm=1,Wu.exports=z0()),Wu.exports}var Yu={exports:{}},Yt={};/**
25
+ */var Hm;function z0(){return Hm||(Hm=1,(function(t){function r(G,Y){var Z=G.length;G.push(Y);e:for(;0<Z;){var z=Z-1>>>1,j=G[z];if(0<d(j,Y))G[z]=Y,G[Z]=j,Z=z;else break e}}function s(G){return G.length===0?null:G[0]}function l(G){if(G.length===0)return null;var Y=G[0],Z=G.pop();if(Z!==Y){G[0]=Z;e:for(var z=0,j=G.length,N=j>>>1;z<N;){var $=2*(z+1)-1,I=G[$],ie=$+1,_e=G[ie];if(0>d(I,Z))ie<j&&0>d(_e,I)?(G[z]=_e,G[ie]=Z,z=ie):(G[z]=I,G[$]=Z,z=$);else if(ie<j&&0>d(_e,Z))G[z]=_e,G[ie]=Z,z=ie;else break e}}return Y}function d(G,Y){var Z=G.sortIndex-Y.sortIndex;return Z!==0?Z: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 O(){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 Z=y;try{t:{for(A(G),u=s(c);u!==null&&!(u.expirationTime>G&&O());){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=Z,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,W=P.port2;P.port1.onmessage=H,U=function(){W.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 Z=y;y=Y;try{return G()}finally{y=Z}},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 Z=y;y=G;try{return Y()}finally{y=Z}},t.unstable_scheduleCallback=function(G,Y,Z){var z=t.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,G){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=Z+j,G={id:m++,callback:Y,priorityLevel:G,startTime:Z,expirationTime:j,sortIndex:-1},Z>z?(G.sortIndex=Z,r(h,G),s(c)===null&&G===s(h)&&(E?(_(D),D=-1):E=!0,K(L,Z-z))):(G.sortIndex=j,r(c,G),T||w||(T=!0,M||(M=!0,U()))),G},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(G){var Y=y;return function(){var Z=y;y=Y;try{return G.apply(this,arguments)}finally{y=Z}}}})(Yu)),Yu}var zm;function I0(){return zm||(zm=1,Ku.exports=z0()),Ku.exports}var Xu={exports:{}},Kt={};/**
26
26
  * @license React
27
27
  * react-dom.production.js
28
28
  *
@@ -30,7 +30,7 @@ var O0=Object.defineProperty;var B0=(t,r,s)=>r in t?O0(t,r,{enumerable:!0,config
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var zm;function U0(){if(zm)return Yt;zm=1;var t=jh();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 Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Yt.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)},Yt.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()}},Yt.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))},Yt.prefetchDNS=function(c){typeof c=="string"&&l.d.D(c)},Yt.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})}},Yt.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)},Yt.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})}},Yt.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)},Yt.requestFormReset=function(c){l.d.r(c)},Yt.unstable_batchedUpdates=function(c,h){return c(h)},Yt.useFormState=function(c,h,m){return f.H.useFormState(c,h,m)},Yt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Yt.version="19.2.6",Yt}var Im;function P0(){if(Im)return Yu.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(),Yu.exports=U0(),Yu.exports}/**
33
+ */var Im;function U0(){if(Im)return Kt;Im=1;var t=Nh();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 Kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Kt.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)},Kt.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()}},Kt.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))},Kt.prefetchDNS=function(c){typeof c=="string"&&l.d.D(c)},Kt.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})}},Kt.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)},Kt.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})}},Kt.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)},Kt.requestFormReset=function(c){l.d.r(c)},Kt.unstable_batchedUpdates=function(c,h){return c(h)},Kt.useFormState=function(c,h,m){return f.H.useFormState(c,h,m)},Kt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Kt.version="19.2.6",Kt}var Um;function P0(){if(Um)return Xu.exports;Um=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(),Xu.exports=U0(),Xu.exports}/**
34
34
  * @license React
35
35
  * react-dom-client.production.js
36
36
  *
@@ -38,60 +38,60 @@ var O0=Object.defineProperty;var B0=(t,r,s)=>r in t?O0(t,r,{enumerable:!0,config
38
38
  *
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
- */var Um;function F0(){if(Um)return Pa;Um=1;var t=I0(),r=jh(),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 W(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:W(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return W(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,Z={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),ve=N(null),_e=N(null),Q=N(null);function q(e,n){switch(I(_e,n),I(ve,e),I(ie,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?em(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=em(n),e=tm(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ie),I(ie,e)}function ue(){$(ie),$(ve),$(_e)}function ae(e){e.memoizedState!==null&&I(Q,e);var n=ie.current,i=tm(n,e.type);n!==i&&(I(ve,e),I(ie,i))}function de(e){ve.current===e&&($(ie),$(ve)),Q.current===e&&($(Q),Na._currentValue=Z)}var re,xe;function me(e){if(re===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);re=n&&n[1]||"",xe=-1<i.stack.indexOf(`
41
+ */var Pm;function F0(){if(Pm)return qa;Pm=1;var t=I0(),r=Nh(),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 B=!1,F=g.child;F;){if(F===i){B=!0,i=g,a=C;break}if(F===a){B=!0,a=g,i=C;break}F=F.sibling}if(!B){for(F=C.child;F;){if(F===i){B=!0,i=C,a=g;break}if(F===a){B=!0,a=C,i=g;break}F=F.sibling}if(!B)throw Error(l(189))}}if(i.alternate!==a)throw Error(l(190))}if(i.tag!==3)throw Error(l(188));return i.stateNode.current===i?e: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"),O=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 W(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:W(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return W(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,Z={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),_e=N(null),ge=N(null),Q=N(null);function q(e,n){switch(I(ge,n),I(_e,e),I(ie,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?tm(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=tm(n),e=nm(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ie),I(ie,e)}function ue(){$(ie),$(_e),$(ge)}function le(e){e.memoizedState!==null&&I(Q,e);var n=ie.current,i=nm(n,e.type);n!==i&&(I(_e,e),I(ie,i))}function he(e){_e.current===e&&($(ie),$(_e)),Q.current===e&&($(Q),za._currentValue=Z)}var re,Ee;function Be(e){if(re===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);re=n&&n[1]||"",Ee=-1<i.stack.indexOf(`
42
42
  at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+re+e+xe}var Me=!1;function De(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 ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(ce){var oe=ce}Reflect.construct(e,[],ye)}else{try{ye.call()}catch(ce){oe=ce}e.call(ye.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(ye=e())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=a.DetermineComponentFrameRoot(),O=C[0],F=C[1];if(O&&F){var X=O.split(`
44
- `),le=F.split(`
45
- `);for(g=a=0;a<X.length&&!X[a].includes("DetermineComponentFrameRoot");)a++;for(;g<le.length&&!le[g].includes("DetermineComponentFrameRoot");)g++;if(a===X.length||g===le.length)for(a=X.length-1,g=le.length-1;1<=a&&0<=g&&X[a]!==le[g];)g--;for(;1<=a&&0<=g;a--,g--)if(X[a]!==le[g]){if(a!==1||g!==1)do if(a--,g--,0>g||X[a]!==le[g]){var pe=`
46
- `+X[a].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),pe}while(1<=a&&0<=g);break}}}finally{Me=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?me(i):""}function ke(e,n){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me("Lazy");case 13:return e.child!==n&&n!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return De(e.type,!1);case 11:return De(e.type.render,!1);case 1:return De(e.type,!0);case 31:return me("Activity");default:return""}}function Tt(e){try{var n="",i=null;do n+=ke(e,i),i=e,e=e.return;while(e);return n}catch(a){return`
43
+ `+re+e+Ee}var ve=!1;function Te(e,n){if(!e||ve)return"";ve=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(n){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(ce){var oe=ce}Reflect.construct(e,[],ye)}else{try{ye.call()}catch(ce){oe=ce}e.call(ye.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(ye=e())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=a.DetermineComponentFrameRoot(),B=C[0],F=C[1];if(B&&F){var X=B.split(`
44
+ `),ae=F.split(`
45
+ `);for(g=a=0;a<X.length&&!X[a].includes("DetermineComponentFrameRoot");)a++;for(;g<ae.length&&!ae[g].includes("DetermineComponentFrameRoot");)g++;if(a===X.length||g===ae.length)for(a=X.length-1,g=ae.length-1;1<=a&&0<=g&&X[a]!==ae[g];)g--;for(;1<=a&&0<=g;a--,g--)if(X[a]!==ae[g]){if(a!==1||g!==1)do if(a--,g--,0>g||X[a]!==ae[g]){var pe=`
46
+ `+X[a].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),pe}while(1<=a&&0<=g);break}}}finally{ve=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Be(i):""}function xe(e,n){switch(e.tag){case 26:case 27:case 5:return Be(e.type);case 16:return Be("Lazy");case 13:return e.child!==n&&n!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return Be("Activity");default:return""}}function Tt(e){try{var n="",i=null;do n+=xe(e,i),i=e,e=e.return;while(e);return n}catch(a){return`
47
47
  Error generating stack: `+a.message+`
48
- `+a.stack}}var xt=Object.prototype.hasOwnProperty,Nt=t.unstable_scheduleCallback,rn=t.unstable_cancelCallback,Rn=t.unstable_shouldYield,gt=t.unstable_requestPaint,ut=t.unstable_now,Bt=t.unstable_getCurrentPriorityLevel,fe=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,je=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,pt=t.log,Fe=t.unstable_setDisableYieldValue,_t=null,vt=null;function St(e){if(typeof pt=="function"&&Fe(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(_t,e)}catch{}}var Ze=Math.clz32?Math.clz32:Ar,mn=Math.log,Zt=Math.LN2;function Ar(e){return e>>>=0,e===0?32:31-(mn(e)/Zt|0)|0}var ui=256,hi=262144,fi=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 yt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function di(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 Hi(){var e=fi;return fi<<=1,(fi&62914560)===0&&(fi=4194304),e}function en(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,le=e.hiddenUpdates;for(i=O&~i;0<i;){var pe=31-Ze(i),ye=1<<pe;F[pe]=0,X[pe]=-1;var oe=le[pe];if(oe!==null)for(le[pe]=null,pe=0;pe<oe.length;pe++){var ce=oe[pe];ce!==null&&(ce.lane&=-536870913)}i&=~ye}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-Ze(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-Ze(i),g=1<<a;g&n|e[a]&n&&(e[a]|=n),i&=~g}}function sn(e,n){var i=n&-n;return i=(i&42)!==0?1:ze(i),(i&(e.suspendedLanes|n))!==0?0:i}function ze(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 pi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Tr(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:xm(e.type))}function es(e,n){var i=Y.p;try{return Y.p=e,n()}finally{Y.p=i}}var vn=Math.random().toString(36).slice(2),Et="__reactFiber$"+vn,It="__reactProps$"+vn,zi="__reactContainer$"+vn,Mn="__reactEvents$"+vn,Po="__reactListeners$"+vn,Fo="__reactHandles$"+vn,$s="__reactResources$"+vn,Ii="__reactMarker$"+vn;function Ui(e){delete e[Et],delete e[It],delete e[Mn],delete e[Po],delete e[Fo]}function Pi(e){var n=e[Et];if(n)return n;for(var i=e.parentNode;i;){if(n=i[zi]||i[Et]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=om(e);e!==null;){if(i=e[Et])return i;e=om(e)}return n}e=i,i=e.parentNode}return null}function Fi(e){if(e=e[Et]||e[zi]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function qi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function $i(e){var n=e[$s];return n||(n=e[$s]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function ht(e){e[Ii]=!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 al=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 ti(e){return xt.call(Ws,e)?!0:xt.call(Vs,e)?!1:al.test(e)?Ws[e]=!0:(Vs[e]=!0,!1)}function Gi(e,n,i){if(ti(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 te(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 bt(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 Vt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ks(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function qo(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 Ys(e){if(!e._valueTracker){var n=Ks(e)?"checked":"value";e._valueTracker=qo(e,n,""+e[n])}}function ll(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),a="";return e&&(a=Ks(e)?e.checked?"true":"false":e.value),e=a,e!==i?(n.setValue(e),!0):!1}function mi(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 ol=/[\n"\\]/g;function an(e){return e.replace(ol,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Xs(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=""+Vt(n)):e.value!==""+Vt(n)&&(e.value=""+Vt(n)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),n!=null?Ht(e,O,Vt(n)):i!=null?Ht(e,O,Vt(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=""+Vt(F):e.removeAttribute("name")}function Ut(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)){Ys(e);return}i=i!=null?""+Vt(i):"",n=n!=null?""+Vt(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),Ys(e)}function Ht(e,n,i){n==="number"&&mi(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function gi(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=""+Vt(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 Qs(e,n,i){if(n!=null&&(n=""+Vt(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+Vt(i):""}function Js(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=Vt(n),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Ys(e)}function Vi(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 cl(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 ul(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&&cl(e,g,a)}else for(var C in n)n.hasOwnProperty(C)&&cl(e,C,n[C])}function Zs(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 Go=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"]]),Wi=/^[\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 Ki(e){return Wi.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function yn(){}var ni=null;function ea(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _i=null,ii=null;function ta(e){var n=Fi(e);if(n&&(e=n.stateNode)){var i=e[It]||null;e:switch(e=n.stateNode,n.type){case"input":if(Xs(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));Xs(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&&ll(a)}break e;case"textarea":Qs(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&gi(e,!!i.multiple,n,!1)}}}var ts=!1;function vi(e,n,i){if(ts)return e(n,i);ts=!0;try{var a=e(n);return a}finally{if(ts=!1,(_i!==null||ii!==null)&&(Kl(),_i&&(n=_i,e=ii,ii=_i=null,ta(n),e)))for(n=0;n<e.length;n++)ta(e[n])}}function Yi(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 Wt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ln=!1;if(Wt)try{var Rr={};Object.defineProperty(Rr,"passive",{get:function(){Ln=!0}}),window.addEventListener("test",Rr,Rr),window.removeEventListener("test",Rr,Rr)}catch{Ln=!1}var Gn=null,na=null,Kt=null;function ns(){if(Kt)return Kt;var e,n=na,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 Kt=g.slice(e,1<a?1-a:void 0)}function Xi(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 Qi(){return!0}function hl(){return!1}function Ee(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)?Qi:hl,this.isPropagationStopped=hl,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=Qi)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Qi)},persist:function(){},isPersistent:Qi}),n}var yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},is=Ee(yi),Dr=u({},yi,{view:0,detail:0}),Vo=Ee(Dr),ln,Mr,Ji,Zi=u({},Dr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yo,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!==Ji&&(Ji&&e.type==="mousemove"?(ln=e.screenX-Ji.screenX,Mr=e.screenY-Ji.screenY):Mr=ln=0,Ji=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:Mr}}),fl=Ee(Zi),V=u({},Zi,{dataTransfer:0}),he=Ee(V),qe=u({},Dr,{relatedTarget:0}),Pt=Ee(qe),Lr=u({},yi,{animationName:0,elapsedTime:0,pseudoElement:0}),Wo=Ee(Lr),Ko=u({},yi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zv=Ee(Ko),Iv=u({},yi,{data:0}),rf=Ee(Iv),Uv={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"},Fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qv(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Fv[e])?!!n[e]:!1}function Yo(){return qv}var $v=u({},Dr,{key:function(e){if(e.key){var n=Uv[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Xi(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:Yo,charCode:function(e){return e.type==="keypress"?Xi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Gv=Ee($v),Vv=u({},Zi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sf=Ee(Vv),Wv=u({},Dr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yo}),Kv=Ee(Wv),Yv=u({},yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xv=Ee(Yv),Qv=u({},Zi,{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}),Jv=Ee(Qv),Zv=u({},yi,{newState:0,oldState:0}),ey=Ee(Zv),ty=[9,13,27,32],Xo=Wt&&"CompositionEvent"in window,ia=null;Wt&&"documentMode"in document&&(ia=document.documentMode);var ny=Wt&&"TextEvent"in window&&!ia,af=Wt&&(!Xo||ia&&8<ia&&11>=ia),lf=" ",of=!1;function cf(e,n){switch(e){case"keyup":return ty.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rs=!1;function iy(e,n){switch(e){case"compositionend":return uf(n);case"keypress":return n.which!==32?null:(of=!0,lf);case"textInput":return e=n.data,e===lf&&of?null:e;default:return null}}function ry(e,n){if(rs)return e==="compositionend"||!Xo&&cf(e,n)?(e=ns(),Kt=na=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 af&&n.locale!=="ko"?null:n.data;default:return null}}var sy={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 hf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!sy[e.type]:n==="textarea"}function ff(e,n,i,a){_i?ii?ii.push(a):ii=[a]:_i=a,n=to(n,"onChange"),0<n.length&&(i=new is("onChange","change",null,i,a),e.push({event:i,listeners:n}))}var ra=null,sa=null;function ay(e){Kp(e,0)}function dl(e){var n=qi(e);if(ll(n))return e}function df(e,n){if(e==="change")return n}var pf=!1;if(Wt){var Qo;if(Wt){var Jo="oninput"in document;if(!Jo){var mf=document.createElement("div");mf.setAttribute("oninput","return;"),Jo=typeof mf.oninput=="function"}Qo=Jo}else Qo=!1;pf=Qo&&(!document.documentMode||9<document.documentMode)}function gf(){ra&&(ra.detachEvent("onpropertychange",_f),sa=ra=null)}function _f(e){if(e.propertyName==="value"&&dl(sa)){var n=[];ff(n,sa,e,ea(e)),vi(ay,n)}}function ly(e,n,i){e==="focusin"?(gf(),ra=n,sa=i,ra.attachEvent("onpropertychange",_f)):e==="focusout"&&gf()}function oy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return dl(sa)}function cy(e,n){if(e==="click")return dl(n)}function uy(e,n){if(e==="input"||e==="change")return dl(n)}function hy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Sn=typeof Object.is=="function"?Object.is:hy;function aa(e,n){if(Sn(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(!xt.call(n,g)||!Sn(e[g],n[g]))return!1}return!0}function vf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yf(e,n){var i=vf(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=vf(i)}}function Sf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Sf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function bf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=mi(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=mi(e.document)}return n}function Zo(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 fy=Wt&&"documentMode"in document&&11>=document.documentMode,ss=null,ec=null,la=null,tc=!1;function Cf(e,n,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;tc||ss==null||ss!==mi(a)||(a=ss,"selectionStart"in a&&Zo(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}),la&&aa(la,a)||(la=a,a=to(ec,"onSelect"),0<a.length&&(n=new is("onSelect","select",null,n,i),e.push({event:n,listeners:a}),n.target=ss)))}function Or(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var as={animationend:Or("Animation","AnimationEnd"),animationiteration:Or("Animation","AnimationIteration"),animationstart:Or("Animation","AnimationStart"),transitionrun:Or("Transition","TransitionRun"),transitionstart:Or("Transition","TransitionStart"),transitioncancel:Or("Transition","TransitionCancel"),transitionend:Or("Transition","TransitionEnd")},nc={},wf={};Wt&&(wf=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 Br(e){if(nc[e])return nc[e];if(!as[e])return e;var n=as[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in wf)return nc[e]=n[i];return e}var xf=Br("animationend"),Ef=Br("animationiteration"),kf=Br("animationstart"),dy=Br("transitionrun"),py=Br("transitionstart"),my=Br("transitioncancel"),Af=Br("transitionend"),Tf=new Map,ic="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(" ");ic.push("scrollEnd");function Vn(e,n){Tf.set(e,n),Zn(n,[e])}var pl=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,rc=0;function ml(){for(var e=ls,n=rc=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&&Rf(i,g,C)}}function gl(e,n,i,a){On[ls++]=e,On[ls++]=n,On[ls++]=i,On[ls++]=a,rc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function sc(e,n,i,a){return gl(e,n,i,a),_l(e)}function jr(e,n){return gl(e,null,null,n),_l(e)}function Rf(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-Ze(i),e=C.hiddenUpdates,a=e[g],a===null?e[g]=[n]:a.push(n),n.lane=i|536870912),C):null}function _l(e){if(50<Ra)throw Ra=0,pu=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 gy(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 bn(e,n,i,a){return new gy(e,n,i,a)}function ac(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Si(e,n){var i=e.alternate;return i===null?(i=bn(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 Df(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 vl(e,n,i,a,g,C){var O=0;if(a=e,typeof e=="function")ac(e)&&(O=1);else if(typeof e=="string")O=b0(e,i,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=bn(31,i,n,g),e.elementType=R,e.lanes=C,e;case E:return Nr(i.children,g,C,n);case b:O=8,g|=24;break;case v:return e=bn(12,i,n,g|2),e.elementType=v,e.lanes=C,e;case L:return e=bn(13,i,n,g),e.elementType=L,e.lanes=C,e;case M:return e=bn(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=bn(O,i,n,g),n.elementType=e,n.type=a,n.lanes=C,n}function Nr(e,n,i,a){return e=bn(7,e,a,n),e.lanes=i,e}function lc(e,n,i){return e=bn(6,e,null,n),e.lanes=i,e}function Mf(e){var n=bn(18,null,null,0);return n.stateNode=e,n}function oc(e,n,i){return n=bn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Lf=new WeakMap;function Bn(e,n){if(typeof e=="object"&&e!==null){var i=Lf.get(e);return i!==void 0?i:(n={value:e,source:n,stack:Tt(n)},Lf.set(e,n),n)}return{value:e,source:n,stack:Tt(n)}}var cs=[],us=0,yl=null,oa=0,jn=[],Nn=0,er=null,ri=1,si="";function bi(e,n){cs[us++]=oa,cs[us++]=yl,yl=e,oa=n}function Of(e,n,i){jn[Nn++]=ri,jn[Nn++]=si,jn[Nn++]=er,er=e;var a=ri;e=si;var g=32-Ze(a)-1;a&=~(1<<g),i+=1;var C=32-Ze(n)+g;if(30<C){var O=g-g%5;C=(a&(1<<O)-1).toString(32),a>>=O,g-=O,ri=1<<32-Ze(n)+g|i<<g|a,si=C+e}else ri=1<<C|i<<g|a,si=e}function cc(e){e.return!==null&&(bi(e,1),Of(e,1,0))}function uc(e){for(;e===yl;)yl=cs[--us],cs[us]=null,oa=cs[--us],cs[us]=null;for(;e===er;)er=jn[--Nn],jn[Nn]=null,si=jn[--Nn],jn[Nn]=null,ri=jn[--Nn],jn[Nn]=null}function Bf(e,n){jn[Nn++]=ri,jn[Nn++]=si,jn[Nn++]=er,ri=n.id,si=n.overflow,er=e}var Ft=null,ft=null,Ye=!1,tr=null,Hn=!1,hc=Error(l(519));function nr(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ca(Bn(n,e)),hc}function jf(e){var n=e.stateNode,i=e.type,a=e.memoizedProps;switch(n[Et]=e,n[It]=a,i){case"dialog":Ge("cancel",n),Ge("close",n);break;case"iframe":case"object":case"embed":Ge("load",n);break;case"video":case"audio":for(i=0;i<Ma.length;i++)Ge(Ma[i],n);break;case"source":Ge("error",n);break;case"img":case"image":case"link":Ge("error",n),Ge("load",n);break;case"details":Ge("toggle",n);break;case"input":Ge("invalid",n),Ut(n,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ge("invalid",n);break;case"textarea":Ge("invalid",n),Js(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||Jp(n.textContent,i)?(a.popover!=null&&(Ge("beforetoggle",n),Ge("toggle",n)),a.onScroll!=null&&Ge("scroll",n),a.onScrollEnd!=null&&Ge("scrollend",n),a.onClick!=null&&(n.onclick=yn),n=!0):n=!1,n||nr(e,!0)}function Nf(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(!Ye)return Nf(e),Ye=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Ru(e.type,e.memoizedProps)),i=!i),i&&ft&&nr(e),Nf(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ft=lm(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ft=lm(e)}else n===27?(n=ft,gr(e.type)?(e=Bu,Bu=null,ft=e):ft=n):ft=Ft?In(e.stateNode.nextSibling):null;return!0}function Hr(){ft=Ft=null,Ye=!1}function fc(){var e=tr;return e!==null&&(hn===null?hn=e:hn.push.apply(hn,e),tr=null),e}function ca(e){tr===null?tr=[e]:tr.push(e)}var dc=N(null),zr=null,Ci=null;function ir(e,n,i){I(dc,n._currentValue),n._currentValue=i}function wi(e){e._currentValue=dc.current,$(dc)}function pc(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 mc(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),pc(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),pc(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;Sn(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(Na):e=[Na])}g=g.return}e!==null&&mc(n,e,i,a),n.flags|=262144}function Sl(e){for(e=e.firstContext;e!==null;){if(!Sn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ir(e){zr=e,Ci=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qt(e){return Hf(zr,e)}function bl(e,n){return zr===null&&Ir(e),Hf(e,n)}function Hf(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},Ci===null){if(e===null)throw Error(l(308));Ci=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Ci=Ci.next=n;return i}var _y=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()})}},vy=t.unstable_scheduleCallback,yy=t.unstable_NormalPriority,Rt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gc(){return{controller:new _y,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&vy(yy,function(){e.controller.abort()})}var ha=null,_c=0,ds=0,ps=null;function Sy(e,n){if(ha===null){var i=ha=[];_c=0,ds=Su(),ps={status:"pending",value:void 0,then:function(a){i.push(a)}}}return _c++,n.then(zf,zf),n}function zf(){if(--_c===0&&ha!==null){ps!==null&&(ps.status="fulfilled");var e=ha;ha=null,ds=0,ps=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function by(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 If=G.S;G.S=function(e,n){Cp=ut(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Sy(e,n),If!==null&&If(e,n)};var Ur=N(null);function vc(){var e=Ur.current;return e!==null?e:at.pooledCache}function Cl(e,n){n===null?I(Ur,Ur.current):I(Ur,n.pool)}function Uf(){var e=vc();return e===null?null:{parent:Rt._currentValue,pool:e}}var ms=Error(l(460)),yc=Error(l(474)),wl=Error(l(542)),xl={then:function(){}};function Pf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ff(e,n,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(yn,yn),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,$f(e),e;default:if(typeof n.status=="string")n.then(yn,yn);else{if(e=at,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,$f(e),e}throw Fr=n,ms}}function Pr(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Fr=i,ms):i}}var Fr=null;function qf(){if(Fr===null)throw Error(l(459));var e=Fr;return Fr=null,e}function $f(e){if(e===ms||e===wl)throw Error(l(483))}var gs=null,fa=0;function El(e){var n=fa;return fa+=1,gs===null&&(gs=[]),Ff(gs,e,n)}function da(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function kl(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 Gf(e){function n(ne,J){if(e){var se=ne.deletions;se===null?(ne.deletions=[J],ne.flags|=16):se.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=Si(ne,J),ne.index=0,ne.sibling=null,ne}function C(ne,J,se){return ne.index=se,e?(se=ne.alternate,se!==null?(se=se.index,se<J?(ne.flags|=67108866,J):se):(ne.flags|=67108866,J)):(ne.flags|=1048576,J)}function O(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function F(ne,J,se,ge){return J===null||J.tag!==6?(J=lc(se,ne.mode,ge),J.return=ne,J):(J=g(J,se),J.return=ne,J)}function X(ne,J,se,ge){var Le=se.type;return Le===E?pe(ne,J,se.props.children,ge,se.key):J!==null&&(J.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===k&&Pr(Le)===J.type)?(J=g(J,se.props),da(J,se),J.return=ne,J):(J=vl(se.type,se.key,se.props,null,ne.mode,ge),da(J,se),J.return=ne,J)}function le(ne,J,se,ge){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=oc(se,ne.mode,ge),J.return=ne,J):(J=g(J,se.children||[]),J.return=ne,J)}function pe(ne,J,se,ge,Le){return J===null||J.tag!==7?(J=Nr(se,ne.mode,ge,Le),J.return=ne,J):(J=g(J,se),J.return=ne,J)}function ye(ne,J,se){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=lc(""+J,ne.mode,se),J.return=ne,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case w:return se=vl(J.type,J.key,J.props,null,ne.mode,se),da(se,J),se.return=ne,se;case T:return J=oc(J,ne.mode,se),J.return=ne,J;case k:return J=Pr(J),ye(ne,J,se)}if(K(J)||U(J))return J=Nr(J,ne.mode,se,null),J.return=ne,J;if(typeof J.then=="function")return ye(ne,El(J),se);if(J.$$typeof===S)return ye(ne,bl(ne,J),se);kl(ne,J)}return null}function oe(ne,J,se,ge){var Le=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Le!==null?null:F(ne,J,""+se,ge);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case w:return se.key===Le?X(ne,J,se,ge):null;case T:return se.key===Le?le(ne,J,se,ge):null;case k:return se=Pr(se),oe(ne,J,se,ge)}if(K(se)||U(se))return Le!==null?null:pe(ne,J,se,ge,null);if(typeof se.then=="function")return oe(ne,J,El(se),ge);if(se.$$typeof===S)return oe(ne,J,bl(ne,se),ge);kl(ne,se)}return null}function ce(ne,J,se,ge,Le){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ne=ne.get(se)||null,F(J,ne,""+ge,Le);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case w:return ne=ne.get(ge.key===null?se:ge.key)||null,X(J,ne,ge,Le);case T:return ne=ne.get(ge.key===null?se:ge.key)||null,le(J,ne,ge,Le);case k:return ge=Pr(ge),ce(ne,J,se,ge,Le)}if(K(ge)||U(ge))return ne=ne.get(se)||null,pe(J,ne,ge,Le,null);if(typeof ge.then=="function")return ce(ne,J,se,El(ge),Le);if(ge.$$typeof===S)return ce(ne,J,se,bl(J,ge),Le);kl(J,ge)}return null}function Ae(ne,J,se,ge){for(var Le=null,Qe=null,Re=J,Ue=J=0,Ke=null;Re!==null&&Ue<se.length;Ue++){Re.index>Ue?(Ke=Re,Re=null):Ke=Re.sibling;var Je=oe(ne,Re,se[Ue],ge);if(Je===null){Re===null&&(Re=Ke);break}e&&Re&&Je.alternate===null&&n(ne,Re),J=C(Je,J,Ue),Qe===null?Le=Je:Qe.sibling=Je,Qe=Je,Re=Ke}if(Ue===se.length)return i(ne,Re),Ye&&bi(ne,Ue),Le;if(Re===null){for(;Ue<se.length;Ue++)Re=ye(ne,se[Ue],ge),Re!==null&&(J=C(Re,J,Ue),Qe===null?Le=Re:Qe.sibling=Re,Qe=Re);return Ye&&bi(ne,Ue),Le}for(Re=a(Re);Ue<se.length;Ue++)Ke=ce(Re,ne,Ue,se[Ue],ge),Ke!==null&&(e&&Ke.alternate!==null&&Re.delete(Ke.key===null?Ue:Ke.key),J=C(Ke,J,Ue),Qe===null?Le=Ke:Qe.sibling=Ke,Qe=Ke);return e&&Re.forEach(function(br){return n(ne,br)}),Ye&&bi(ne,Ue),Le}function Be(ne,J,se,ge){if(se==null)throw Error(l(151));for(var Le=null,Qe=null,Re=J,Ue=J=0,Ke=null,Je=se.next();Re!==null&&!Je.done;Ue++,Je=se.next()){Re.index>Ue?(Ke=Re,Re=null):Ke=Re.sibling;var br=oe(ne,Re,Je.value,ge);if(br===null){Re===null&&(Re=Ke);break}e&&Re&&br.alternate===null&&n(ne,Re),J=C(br,J,Ue),Qe===null?Le=br:Qe.sibling=br,Qe=br,Re=Ke}if(Je.done)return i(ne,Re),Ye&&bi(ne,Ue),Le;if(Re===null){for(;!Je.done;Ue++,Je=se.next())Je=ye(ne,Je.value,ge),Je!==null&&(J=C(Je,J,Ue),Qe===null?Le=Je:Qe.sibling=Je,Qe=Je);return Ye&&bi(ne,Ue),Le}for(Re=a(Re);!Je.done;Ue++,Je=se.next())Je=ce(Re,ne,Ue,Je.value,ge),Je!==null&&(e&&Je.alternate!==null&&Re.delete(Je.key===null?Ue:Je.key),J=C(Je,J,Ue),Qe===null?Le=Je:Qe.sibling=Je,Qe=Je);return e&&Re.forEach(function(L0){return n(ne,L0)}),Ye&&bi(ne,Ue),Le}function st(ne,J,se,ge){if(typeof se=="object"&&se!==null&&se.type===E&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case w:e:{for(var Le=se.key;J!==null;){if(J.key===Le){if(Le=se.type,Le===E){if(J.tag===7){i(ne,J.sibling),ge=g(J,se.props.children),ge.return=ne,ne=ge;break e}}else if(J.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===k&&Pr(Le)===J.type){i(ne,J.sibling),ge=g(J,se.props),da(ge,se),ge.return=ne,ne=ge;break e}i(ne,J);break}else n(ne,J);J=J.sibling}se.type===E?(ge=Nr(se.props.children,ne.mode,ge,se.key),ge.return=ne,ne=ge):(ge=vl(se.type,se.key,se.props,null,ne.mode,ge),da(ge,se),ge.return=ne,ne=ge)}return O(ne);case T:e:{for(Le=se.key;J!==null;){if(J.key===Le)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){i(ne,J.sibling),ge=g(J,se.children||[]),ge.return=ne,ne=ge;break e}else{i(ne,J);break}else n(ne,J);J=J.sibling}ge=oc(se,ne.mode,ge),ge.return=ne,ne=ge}return O(ne);case k:return se=Pr(se),st(ne,J,se,ge)}if(K(se))return Ae(ne,J,se,ge);if(U(se)){if(Le=U(se),typeof Le!="function")throw Error(l(150));return se=Le.call(se),Be(ne,J,se,ge)}if(typeof se.then=="function")return st(ne,J,El(se),ge);if(se.$$typeof===S)return st(ne,J,bl(ne,se),ge);kl(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,J!==null&&J.tag===6?(i(ne,J.sibling),ge=g(J,se),ge.return=ne,ne=ge):(i(ne,J),ge=lc(se,ne.mode,ge),ge.return=ne,ne=ge),O(ne)):i(ne,J)}return function(ne,J,se,ge){try{fa=0;var Le=st(ne,J,se,ge);return gs=null,Le}catch(Re){if(Re===ms||Re===wl)throw Re;var Qe=bn(29,Re,null,ne.mode);return Qe.lanes=ge,Qe.return=ne,Qe}finally{}}}var qr=Gf(!0),Vf=Gf(!1),rr=!1;function Sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bc(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 sr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ar(e,n,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(et&2)!==0){var g=a.pending;return g===null?n.next=n:(n.next=g.next,g.next=n),a.pending=n,n=_l(e),Rf(e,null,i),n}return gl(e,a,n,i),_l(e)}function pa(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 Cc(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 wc=!1;function ma(){if(wc){var e=ps;if(e!==null)throw e}}function ga(e,n,i,a){wc=!1;var g=e.updateQueue;rr=!1;var C=g.firstBaseUpdate,O=g.lastBaseUpdate,F=g.shared.pending;if(F!==null){g.shared.pending=null;var X=F,le=X.next;X.next=null,O===null?C=le:O.next=le,O=X;var pe=e.alternate;pe!==null&&(pe=pe.updateQueue,F=pe.lastBaseUpdate,F!==O&&(F===null?pe.firstBaseUpdate=le:F.next=le,pe.lastBaseUpdate=X))}if(C!==null){var ye=g.baseState;O=0,pe=le=X=null,F=C;do{var oe=F.lane&-536870913,ce=oe!==F.lane;if(ce?(We&oe)===oe:(a&oe)===oe){oe!==0&&oe===ds&&(wc=!0),pe!==null&&(pe=pe.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var Ae=e,Be=F;oe=n;var st=i;switch(Be.tag){case 1:if(Ae=Be.payload,typeof Ae=="function"){ye=Ae.call(st,ye,oe);break e}ye=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Be.payload,oe=typeof Ae=="function"?Ae.call(st,ye,oe):Ae,oe==null)break e;ye=u({},ye,oe);break e;case 2:rr=!0}}oe=F.callback,oe!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=g.callbacks,ce===null?g.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:F.tag,payload:F.payload,callback:F.callback,next:null},pe===null?(le=pe=ce,X=ye):pe=pe.next=ce,O|=oe;if(F=F.next,F===null){if(F=g.shared.pending,F===null)break;ce=F,F=ce.next,ce.next=null,g.lastBaseUpdate=ce,g.shared.pending=null}}while(!0);pe===null&&(X=ye),g.baseState=X,g.firstBaseUpdate=le,g.lastBaseUpdate=pe,C===null&&(g.shared.lanes=0),hr|=O,e.lanes=O,e.memoizedState=ye}}function Wf(e,n){if(typeof e!="function")throw Error(l(191,e));e.call(n)}function Kf(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Wf(i[e],n)}var _s=N(null),Al=N(0);function Yf(e,n){e=Li,I(Al,e),I(_s,n),Li=e|n.baseLanes}function xc(){I(Al,Li),I(_s,_s.current)}function Ec(){Li=Al.current,$(_s),$(Al)}var Cn=N(null),zn=null;function lr(e){var n=e.alternate;I(kt,kt.current&1),I(Cn,e),zn===null&&(n===null||_s.current!==null||n.memoizedState!==null)&&(zn=e)}function kc(e){I(kt,kt.current),I(Cn,e),zn===null&&(zn=e)}function Xf(e){e.tag===22?(I(kt,kt.current),I(Cn,e),zn===null&&(zn=e)):or()}function or(){I(kt,kt.current),I(Cn,Cn.current)}function wn(e){$(Cn),zn===e&&(zn=null),$(kt)}var kt=N(0);function Tl(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Lu(i)||Ou(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 xi=0,Ie=null,it=null,Dt=null,Rl=!1,vs=!1,$r=!1,Dl=0,_a=0,ys=null,Cy=0;function Ct(){throw Error(l(321))}function Ac(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!Sn(e[i],n[i]))return!1;return!0}function Tc(e,n,i,a,g,C){return xi=C,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=e===null||e.memoizedState===null?Od:qc,$r=!1,C=i(a,g),$r=!1,vs&&(C=Jf(n,i,a,g)),Qf(e),C}function Qf(e){G.H=Sa;var n=it!==null&&it.next!==null;if(xi=0,Dt=it=Ie=null,Rl=!1,_a=0,ys=null,n)throw Error(l(300));e===null||Mt||(e=e.dependencies,e!==null&&Sl(e)&&(Mt=!0))}function Jf(e,n,i,a){Ie=e;var g=0;do{if(vs&&(ys=null),_a=0,vs=!1,25<=g)throw Error(l(301));if(g+=1,Dt=it=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=Bd,C=n(i,a)}while(vs);return C}function wy(){var e=G.H,n=e.useState()[0];return n=typeof n.then=="function"?va(n):n,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(Ie.flags|=1024),n}function Rc(){var e=Dl!==0;return Dl=0,e}function Dc(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function Mc(e){if(Rl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Rl=!1}xi=0,Dt=it=Ie=null,vs=!1,_a=Dl=0,ys=null}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?Ie.memoizedState=Dt=e:Dt=Dt.next=e,Dt}function At(){if(it===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var n=Dt===null?Ie.memoizedState:Dt.next;if(n!==null)Dt=n,it=e;else{if(e===null)throw Ie.alternate===null?Error(l(467)):Error(l(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Dt===null?Ie.memoizedState=Dt=e:Dt=Dt.next=e}return Dt}function Ml(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function va(e){var n=_a;return _a+=1,ys===null&&(ys=[]),e=Ff(ys,e,n),n=Ie,(Dt===null?n.memoizedState:Dt.next)===null&&(n=n.alternate,G.H=n===null||n.memoizedState===null?Od:qc),e}function Ll(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return va(e);if(e.$$typeof===S)return qt(e)}throw Error(l(438,String(e)))}function Lc(e){var n=null,i=Ie.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var a=Ie.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=Ml(),Ie.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 Ei(e,n){return typeof n=="function"?n(e):n}function Ol(e){var n=At();return Oc(n,it,e)}function Oc(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,le=n,pe=!1;do{var ye=le.lane&-536870913;if(ye!==le.lane?(We&ye)===ye:(xi&ye)===ye){var oe=le.revertLane;if(oe===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),ye===ds&&(pe=!0);else if((xi&oe)===oe){le=le.next,oe===ds&&(pe=!0);continue}else ye={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},X===null?(F=X=ye,O=C):X=X.next=ye,Ie.lanes|=oe,hr|=oe;ye=le.action,$r&&i(C,ye),C=le.hasEagerState?le.eagerState:i(C,ye)}else oe={lane:ye,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},X===null?(F=X=oe,O=C):X=X.next=oe,Ie.lanes|=ye,hr|=ye;le=le.next}while(le!==null&&le!==n);if(X===null?O=C:X.next=F,!Sn(C,e.memoizedState)&&(Mt=!0,pe&&(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 Bc(e){var n=At(),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);Sn(C,n.memoizedState)||(Mt=!0),n.memoizedState=C,n.baseQueue===null&&(n.baseState=C),i.lastRenderedState=C}return[C,a]}function Zf(e,n,i){var a=Ie,g=At(),C=Ye;if(C){if(i===void 0)throw Error(l(407));i=i()}else i=n();var O=!Sn((it||g).memoizedState,i);if(O&&(g.memoizedState=i,Mt=!0),g=g.queue,Hc(nd.bind(null,a,g,e),[e]),g.getSnapshot!==n||O||Dt!==null&&Dt.memoizedState.tag&1){if(a.flags|=2048,Ss(9,{destroy:void 0},td.bind(null,a,g,i,n),null),at===null)throw Error(l(349));C||(xi&127)!==0||ed(a,n,i)}return i}function ed(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Ie.updateQueue,n===null?(n=Ml(),Ie.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function td(e,n,i,a){n.value=i,n.getSnapshot=a,id(n)&&rd(e)}function nd(e,n,i){return i(function(){id(n)&&rd(e)})}function id(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!Sn(e,i)}catch{return!0}}function rd(e){var n=jr(e,2);n!==null&&fn(n,e,2)}function jc(e){var n=tn();if(typeof e=="function"){var i=e;if(e=i(),$r){St(!0);try{i()}finally{St(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:e},n}function sd(e,n,i,a){return e.baseState=i,Oc(e,it,typeof a=="function"?a:Ei)}function xy(e,n,i,a,g){if(Nl(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,ad(n,C)):(C.next=i.next,n.pending=i.next=C)}}function ad(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),ld(e,n,F)}catch(le){Nc(e,n,le)}finally{C!==null&&O.types!==null&&(C.types=O.types),G.T=C}}else try{C=i(g,a),ld(e,n,C)}catch(le){Nc(e,n,le)}}function ld(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){od(e,n,a)},function(a){return Nc(e,n,a)}):od(e,n,i)}function od(e,n,i){n.status="fulfilled",n.value=i,cd(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,ad(e,i)))}function Nc(e,n,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do n.status="rejected",n.reason=i,cd(n),n=n.next;while(n!==a)}e.action=null}function cd(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function ud(e,n){return n}function hd(e,n){if(Ye){var i=at.formState;if(i!==null){e:{var a=Ie;if(Ye){if(ft){t:{for(var g=ft,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){ft=In(g.nextSibling),a=g.data==="F!";break e}}nr(a)}a=!1}a&&(n=i[0])}}return i=tn(),i.memoizedState=i.baseState=n,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ud,lastRenderedState:n},i.queue=a,i=Dd.bind(null,Ie,a),a.dispatch=i,a=jc(!1),C=Fc.bind(null,Ie,!1,a.queue),a=tn(),g={state:n,dispatch:null,action:e,pending:null},a.queue=g,i=xy.bind(null,Ie,g,C,i),g.dispatch=i,a.memoizedState=e,[n,i,!1]}function fd(e){var n=At();return dd(n,it,e)}function dd(e,n,i){if(n=Oc(e,n,ud)[0],e=Ol(Ei)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var a=va(n)}catch(O){throw O===ms?wl:O}else a=n;n=At();var g=n.queue,C=g.dispatch;return i!==n.memoizedState&&(Ie.flags|=2048,Ss(9,{destroy:void 0},Ey.bind(null,g,i),null)),[a,C,e]}function Ey(e,n){e.action=n}function pd(e){var n=At(),i=it;if(i!==null)return dd(n,i,e);At(),n=n.memoizedState,i=At();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=Ie.updateQueue,n===null&&(n=Ml(),Ie.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 md(){return At().memoizedState}function Bl(e,n,i,a){var g=tn();Ie.flags|=e,g.memoizedState=Ss(1|n,{destroy:void 0},i,a===void 0?null:a)}function jl(e,n,i,a){var g=At();a=a===void 0?null:a;var C=g.memoizedState.inst;it!==null&&a!==null&&Ac(a,it.memoizedState.deps)?g.memoizedState=Ss(n,C,i,a):(Ie.flags|=e,g.memoizedState=Ss(1|n,C,i,a))}function gd(e,n){Bl(8390656,8,e,n)}function Hc(e,n){jl(2048,8,e,n)}function ky(e){Ie.flags|=4;var n=Ie.updateQueue;if(n===null)n=Ml(),Ie.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function _d(e){var n=At().memoizedState;return ky({ref:n,nextImpl:e}),function(){if((et&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function vd(e,n){return jl(4,2,e,n)}function yd(e,n){return jl(4,4,e,n)}function Sd(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 bd(e,n,i){i=i!=null?i.concat([e]):null,jl(4,4,Sd.bind(null,n,e),i)}function zc(){}function Cd(e,n){var i=At();n=n===void 0?null:n;var a=i.memoizedState;return n!==null&&Ac(n,a[1])?a[0]:(i.memoizedState=[e,n],e)}function wd(e,n){var i=At();n=n===void 0?null:n;var a=i.memoizedState;if(n!==null&&Ac(n,a[1]))return a[0];if(a=e(),$r){St(!0);try{e()}finally{St(!1)}}return i.memoizedState=[a,n],a}function Ic(e,n,i){return i===void 0||(xi&1073741824)!==0&&(We&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=xp(),Ie.lanes|=e,hr|=e,i)}function xd(e,n,i,a){return Sn(i,n)?i:_s.current!==null?(e=Ic(e,i,a),Sn(e,n)||(Mt=!0),e):(xi&42)===0||(xi&1073741824)!==0&&(We&261930)===0?(Mt=!0,e.memoizedState=i):(e=xp(),Ie.lanes|=e,hr|=e,n)}function Ed(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,Fc(e,!1,n,i);try{var X=g(),le=G.S;if(le!==null&&le(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var pe=by(X,a);ya(e,n,pe,kn(e))}else ya(e,n,a,kn(e))}catch(ye){ya(e,n,{then:function(){},status:"rejected",reason:ye},kn())}finally{Y.p=C,O!==null&&F.types!==null&&(O.types=F.types),G.T=O}}function Ay(){}function Uc(e,n,i,a){if(e.tag!==5)throw Error(l(476));var g=kd(e).queue;Ed(e,g,n,Z,i===null?Ay:function(){return Ad(e),i(a)})}function kd(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:Z},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:i},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Ad(e){var n=kd(e);n.next===null&&(n=e.alternate.memoizedState),ya(e,n.next.queue,{},kn())}function Pc(){return qt(Na)}function Td(){return At().memoizedState}function Rd(){return At().memoizedState}function Ty(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=kn();e=sr(i);var a=ar(n,e,i);a!==null&&(fn(a,n,i),pa(a,n,i)),n={cache:gc()},e.payload=n;return}n=n.return}}function Ry(e,n,i){var a=kn();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Nl(e)?Md(n,i):(i=sc(e,n,i,a),i!==null&&(fn(i,e,a),Ld(i,n,a)))}function Dd(e,n,i){var a=kn();ya(e,n,i,a)}function ya(e,n,i,a){var g={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Nl(e))Md(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,Sn(F,O))return gl(e,n,g,0),at===null&&ml(),!1}catch{}finally{}if(i=sc(e,n,g,a),i!==null)return fn(i,e,a),Ld(i,n,a),!0}return!1}function Fc(e,n,i,a){if(a={lane:2,revertLane:Su(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Nl(e)){if(n)throw Error(l(479))}else n=sc(e,i,a,2),n!==null&&fn(n,e,2)}function Nl(e){var n=e.alternate;return e===Ie||n!==null&&n===Ie}function Md(e,n){vs=Rl=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Ld(e,n,i){if((i&4194048)!==0){var a=n.lanes;a&=e.pendingLanes,i|=a,n.lanes=i,Dn(e,i)}}var Sa={readContext:qt,use:Ll,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Sa.useEffectEvent=Ct;var Od={readContext:qt,use:Ll,useCallback:function(e,n){return tn().memoizedState=[e,n===void 0?null:n],e},useContext:qt,useEffect:gd,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,Bl(4194308,4,Sd.bind(null,n,e),i)},useLayoutEffect:function(e,n){return Bl(4194308,4,e,n)},useInsertionEffect:function(e,n){Bl(4,2,e,n)},useMemo:function(e,n){var i=tn();n=n===void 0?null:n;var a=e();if($r){St(!0);try{e()}finally{St(!1)}}return i.memoizedState=[a,n],a},useReducer:function(e,n,i){var a=tn();if(i!==void 0){var g=i(n);if($r){St(!0);try{i(n)}finally{St(!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=Ry.bind(null,Ie,e),[a.memoizedState,e]},useRef:function(e){var n=tn();return e={current:e},n.memoizedState=e},useState:function(e){e=jc(e);var n=e.queue,i=Dd.bind(null,Ie,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:zc,useDeferredValue:function(e,n){var i=tn();return Ic(i,e,n)},useTransition:function(){var e=jc(!1);return e=Ed.bind(null,Ie,e.queue,!0,!1),tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var a=Ie,g=tn();if(Ye){if(i===void 0)throw Error(l(407));i=i()}else{if(i=n(),at===null)throw Error(l(349));(We&127)!==0||ed(a,n,i)}g.memoizedState=i;var C={value:i,getSnapshot:n};return g.queue=C,gd(nd.bind(null,a,C,e),[e]),a.flags|=2048,Ss(9,{destroy:void 0},td.bind(null,a,C,i,n),null),i},useId:function(){var e=tn(),n=at.identifierPrefix;if(Ye){var i=si,a=ri;i=(a&~(1<<32-Ze(a)-1)).toString(32)+i,n="_"+n+"R_"+i,i=Dl++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=Cy++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Pc,useFormState:hd,useActionState:hd,useOptimistic:function(e){var n=tn();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Fc.bind(null,Ie,!0,i),i.dispatch=n,[e,n]},useMemoCache:Lc,useCacheRefresh:function(){return tn().memoizedState=Ty.bind(null,Ie)},useEffectEvent:function(e){var n=tn(),i={impl:e};return n.memoizedState=i,function(){if((et&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},qc={readContext:qt,use:Ll,useCallback:Cd,useContext:qt,useEffect:Hc,useImperativeHandle:bd,useInsertionEffect:vd,useLayoutEffect:yd,useMemo:wd,useReducer:Ol,useRef:md,useState:function(){return Ol(Ei)},useDebugValue:zc,useDeferredValue:function(e,n){var i=At();return xd(i,it.memoizedState,e,n)},useTransition:function(){var e=Ol(Ei)[0],n=At().memoizedState;return[typeof e=="boolean"?e:va(e),n]},useSyncExternalStore:Zf,useId:Td,useHostTransitionStatus:Pc,useFormState:fd,useActionState:fd,useOptimistic:function(e,n){var i=At();return sd(i,it,e,n)},useMemoCache:Lc,useCacheRefresh:Rd};qc.useEffectEvent=_d;var Bd={readContext:qt,use:Ll,useCallback:Cd,useContext:qt,useEffect:Hc,useImperativeHandle:bd,useInsertionEffect:vd,useLayoutEffect:yd,useMemo:wd,useReducer:Bc,useRef:md,useState:function(){return Bc(Ei)},useDebugValue:zc,useDeferredValue:function(e,n){var i=At();return it===null?Ic(i,e,n):xd(i,it.memoizedState,e,n)},useTransition:function(){var e=Bc(Ei)[0],n=At().memoizedState;return[typeof e=="boolean"?e:va(e),n]},useSyncExternalStore:Zf,useId:Td,useHostTransitionStatus:Pc,useFormState:pd,useActionState:pd,useOptimistic:function(e,n){var i=At();return it!==null?sd(i,it,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Lc,useCacheRefresh:Rd};Bd.useEffectEvent=_d;function $c(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 Gc={enqueueSetState:function(e,n,i){e=e._reactInternals;var a=kn(),g=sr(a);g.payload=n,i!=null&&(g.callback=i),n=ar(e,g,a),n!==null&&(fn(n,e,a),pa(n,e,a))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var a=kn(),g=sr(a);g.tag=1,g.payload=n,i!=null&&(g.callback=i),n=ar(e,g,a),n!==null&&(fn(n,e,a),pa(n,e,a))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=kn(),a=sr(i);a.tag=2,n!=null&&(a.callback=n),n=ar(e,a,i),n!==null&&(fn(n,e,i),pa(n,e,i))}};function jd(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?!aa(i,a)||!aa(g,C):!0}function Nd(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&&Gc.enqueueReplaceState(n,n.state,null)}function Gr(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 Hd(e){pl(e)}function zd(e){console.error(e)}function Id(e){pl(e)}function Hl(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(a){setTimeout(function(){throw a})}}function Ud(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 Vc(e,n,i){return i=sr(i),i.tag=3,i.payload={element:null},i.callback=function(){Hl(e,n)},i}function Pd(e){return e=sr(e),e.tag=3,e}function Fd(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(){Ud(n,i,a)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){Ud(n,i,a),typeof g!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function Dy(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=Cn.current,i!==null){switch(i.tag){case 31:case 13:return zn===null?Yl():i.alternate===null&&wt===0&&(wt=3),i.flags&=-257,i.flags|=65536,i.lanes=g,a===xl?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([a]):n.add(a),_u(e,a,g)),!1;case 22:return i.flags|=65536,a===xl?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)),_u(e,a,g)),!1}throw Error(l(435,i.tag))}return _u(e,a,g),Yl(),!1}if(Ye)return n=Cn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=g,a!==hc&&(e=Error(l(422),{cause:a}),ca(Bn(e,i)))):(a!==hc&&(n=Error(l(423),{cause:a}),ca(Bn(n,i))),e=e.current.alternate,e.flags|=65536,g&=-g,e.lanes|=g,a=Bn(a,i),g=Vc(e.stateNode,a,g),Cc(e,g),wt!==4&&(wt=2)),!1;var C=Error(l(520),{cause:a});if(C=Bn(C,i),Ta===null?Ta=[C]:Ta.push(C),wt!==4&&(wt=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=Vc(i.stateNode,a,e),Cc(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"&&(fr===null||!fr.has(C))))return i.flags|=65536,g&=-g,i.lanes|=g,g=Pd(g),Fd(g,e,i,a),Cc(i,g),!1}i=i.return}while(i!==null);return!1}var Wc=Error(l(461)),Mt=!1;function $t(e,n,i,a){n.child=e===null?Vf(n,null,i,a):qr(n,e.child,i,a)}function qd(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 Ir(n),a=Tc(e,n,i,O,C,g),F=Rc(),e!==null&&!Mt?(Dc(e,n,g),ki(e,n,g)):(Ye&&F&&cc(n),n.flags|=1,$t(e,n,a,g),n.child)}function $d(e,n,i,a,g){if(e===null){var C=i.type;return typeof C=="function"&&!ac(C)&&C.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=C,Gd(e,n,C,a,g)):(e=vl(i.type,null,a,n,n.mode,g),e.ref=n.ref,e.return=n,n.child=e)}if(C=e.child,!tu(e,g)){var O=C.memoizedProps;if(i=i.compare,i=i!==null?i:aa,i(O,a)&&e.ref===n.ref)return ki(e,n,g)}return n.flags|=1,e=Si(C,a),e.ref=n.ref,e.return=n,n.child=e}function Gd(e,n,i,a,g){if(e!==null){var C=e.memoizedProps;if(aa(C,a)&&e.ref===n.ref)if(Mt=!1,n.pendingProps=a=C,tu(e,g))(e.flags&131072)!==0&&(Mt=!0);else return n.lanes=e.lanes,ki(e,n,g)}return Kc(e,n,i,a,g)}function Vd(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 Wd(e,n,C,i,a)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Cl(n,C!==null?C.cachePool:null),C!==null?Yf(n,C):xc(),Xf(n);else return a=n.lanes=536870912,Wd(e,n,C!==null?C.baseLanes|i:i,i,a)}else C!==null?(Cl(n,C.cachePool),Yf(n,C),or(),n.memoizedState=null):(e!==null&&Cl(n,null),xc(),or());return $t(e,n,g,i),n.child}function ba(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Wd(e,n,i,a,g){var C=vc();return C=C===null?null:{parent:Rt._currentValue,pool:C},n.memoizedState={baseLanes:i,cachePool:C},e!==null&&Cl(n,null),xc(),Xf(n),e!==null&&fs(e,n,a,!0),n.childLanes=g,null}function zl(e,n){return n=Ul({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Kd(e,n,i){return qr(n,e.child,null,i),e=zl(n,n.pendingProps),e.flags|=2,wn(n),n.memoizedState=null,e}function My(e,n,i){var a=n.pendingProps,g=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ye){if(a.mode==="hidden")return e=zl(n,a),n.lanes=536870912,ba(null,e);if(kc(n),(e=ft)?(e=am(e,Hn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},i=Mf(e),i.return=n,n.child=i,Ft=n,ft=null)):e=null,e===null)throw nr(n);return n.lanes=536870912,null}return zl(n,a)}var C=e.memoizedState;if(C!==null){var O=C.dehydrated;if(kc(n),g)if(n.flags&256)n.flags&=-257,n=Kd(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(l(558));else if(Mt||fs(e,n,i,!1),g=(i&e.childLanes)!==0,Mt||g){if(a=at,a!==null&&(O=sn(a,i),O!==0&&O!==C.retryLane))throw C.retryLane=O,jr(e,O),fn(a,e,O),Wc;Yl(),n=Kd(e,n,i)}else e=C.treeContext,ft=In(O.nextSibling),Ft=n,Ye=!0,tr=null,Hn=!1,e!==null&&Bf(n,e),n=zl(n,a),n.flags|=4096;return n}return e=Si(e.child,{mode:a.mode,children:a.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Il(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 Kc(e,n,i,a,g){return Ir(n),i=Tc(e,n,i,a,void 0,g),a=Rc(),e!==null&&!Mt?(Dc(e,n,g),ki(e,n,g)):(Ye&&a&&cc(n),n.flags|=1,$t(e,n,i,g),n.child)}function Yd(e,n,i,a,g,C){return Ir(n),n.updateQueue=null,i=Jf(n,a,i,g),Qf(e),a=Rc(),e!==null&&!Mt?(Dc(e,n,C),ki(e,n,C)):(Ye&&a&&cc(n),n.flags|=1,$t(e,n,i,C),n.child)}function Xd(e,n,i,a,g){if(Ir(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=Gc,n.stateNode=C,C._reactInternals=n,C=n.stateNode,C.props=a,C.state=n.memoizedState,C.refs={},Sc(n),O=i.contextType,C.context=typeof O=="object"&&O!==null?qt(O):os,C.state=n.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&($c(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&&Gc.enqueueReplaceState(C,C.state,null),ga(n,a,C,g),ma(),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=Gr(i,F);C.props=X;var le=C.context,pe=i.contextType;O=os,typeof pe=="object"&&pe!==null&&(O=qt(pe));var ye=i.getDerivedStateFromProps;pe=typeof ye=="function"||typeof C.getSnapshotBeforeUpdate=="function",F=n.pendingProps!==F,pe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F||le!==O)&&Nd(n,C,a,O),rr=!1;var oe=n.memoizedState;C.state=oe,ga(n,a,C,g),ma(),le=n.memoizedState,F||oe!==le||rr?(typeof ye=="function"&&($c(n,i,ye,a),le=n.memoizedState),(X=rr||jd(n,i,X,a,oe,le,O))?(pe||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=le),C.props=a,C.state=le,C.context=O,a=X):(typeof C.componentDidMount=="function"&&(n.flags|=4194308),a=!1)}else{C=n.stateNode,bc(e,n),O=n.memoizedProps,pe=Gr(i,O),C.props=pe,ye=n.pendingProps,oe=C.context,le=i.contextType,X=os,typeof le=="object"&&le!==null&&(X=qt(le)),F=i.getDerivedStateFromProps,(le=typeof F=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==ye||oe!==X)&&Nd(n,C,a,X),rr=!1,oe=n.memoizedState,C.state=oe,ga(n,a,C,g),ma();var ce=n.memoizedState;O!==ye||oe!==ce||rr||e!==null&&e.dependencies!==null&&Sl(e.dependencies)?(typeof F=="function"&&($c(n,i,F,a),ce=n.memoizedState),(pe=rr||jd(n,i,pe,a,oe,ce,X)||e!==null&&e.dependencies!==null&&Sl(e.dependencies))?(le||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(a,ce,X),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(a,ce,X)),typeof C.componentDidUpdate=="function"&&(n.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&oe===e.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&oe===e.memoizedState||(n.flags|=1024),n.memoizedProps=a,n.memoizedState=ce),C.props=a,C.state=ce,C.context=X,a=pe):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&oe===e.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&oe===e.memoizedState||(n.flags|=1024),a=!1)}return C=a,Il(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=qr(n,e.child,null,g),n.child=qr(n,null,i,g)):$t(e,n,i,g),n.memoizedState=C.state,e=n.child):e=ki(e,n,g),e}function Qd(e,n,i,a){return Hr(),n.flags|=256,$t(e,n,i,a),n.child}var Yc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xc(e){return{baseLanes:e,cachePool:Uf()}}function Qc(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=En),e}function Jd(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:(kt.current&2)!==0),O&&(g=!0,n.flags&=-129),O=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ye){if(g?lr(n):or(),(e=ft)?(e=am(e,Hn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:er!==null?{id:ri,overflow:si}:null,retryLane:536870912,hydrationErrors:null},i=Mf(e),i.return=n,n.child=i,Ft=n,ft=null)):e=null,e===null)throw nr(n);return Ou(e)?n.lanes=32:n.lanes=536870912,null}var F=a.children;return a=a.fallback,g?(or(),g=n.mode,F=Ul({mode:"hidden",children:F},g),a=Nr(a,g,i,null),F.return=n,a.return=n,F.sibling=a,n.child=F,a=n.child,a.memoizedState=Xc(i),a.childLanes=Qc(e,O,i),n.memoizedState=Yc,ba(null,a)):(lr(n),Jc(n,F))}var X=e.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(C)n.flags&256?(lr(n),n.flags&=-257,n=Zc(e,n,i)):n.memoizedState!==null?(or(),n.child=e.child,n.flags|=128,n=null):(or(),F=a.fallback,g=n.mode,a=Ul({mode:"visible",children:a.children},g),F=Nr(F,g,i,null),F.flags|=2,a.return=n,F.return=n,a.sibling=F,n.child=a,qr(n,e.child,null,i),a=n.child,a.memoizedState=Xc(i),a.childLanes=Qc(e,O,i),n.memoizedState=Yc,n=ba(null,a));else if(lr(n),Ou(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var le=O.dgst;O=le,a=Error(l(419)),a.stack="",a.digest=O,ca({value:a,source:null,stack:null}),n=Zc(e,n,i)}else if(Mt||fs(e,n,i,!1),O=(i&e.childLanes)!==0,Mt||O){if(O=at,O!==null&&(a=sn(O,i),a!==0&&a!==X.retryLane))throw X.retryLane=a,jr(e,a),fn(O,e,a),Wc;Lu(F)||Yl(),n=Zc(e,n,i)}else Lu(F)?(n.flags|=192,n.child=e.child,n=null):(e=X.treeContext,ft=In(F.nextSibling),Ft=n,Ye=!0,tr=null,Hn=!1,e!==null&&Bf(n,e),n=Jc(n,a.children),n.flags|=4096);return n}return g?(or(),F=a.fallback,g=n.mode,X=e.child,le=X.sibling,a=Si(X,{mode:"hidden",children:a.children}),a.subtreeFlags=X.subtreeFlags&65011712,le!==null?F=Si(le,F):(F=Nr(F,g,i,null),F.flags|=2),F.return=n,a.return=n,a.sibling=F,n.child=a,ba(null,a),a=n.child,F=e.child.memoizedState,F===null?F=Xc(i):(g=F.cachePool,g!==null?(X=Rt._currentValue,g=g.parent!==X?{parent:X,pool:X}:g):g=Uf(),F={baseLanes:F.baseLanes|i,cachePool:g}),a.memoizedState=F,a.childLanes=Qc(e,O,i),n.memoizedState=Yc,ba(e.child,a)):(lr(n),i=e.child,e=i.sibling,i=Si(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 Jc(e,n){return n=Ul({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Ul(e,n){return e=bn(22,e,null,n),e.lanes=0,e}function Zc(e,n,i){return qr(n,e.child,null,i),e=Jc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Zd(e,n,i){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n),pc(e.return,n,i)}function eu(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 ep(e,n,i){var a=n.pendingProps,g=a.revealOrder,C=a.tail;a=a.children;var O=kt.current,F=(O&2)!==0;if(F?(O=O&1|2,n.flags|=128):O&=1,I(kt,O),$t(e,n,a,i),a=Ye?oa:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zd(e,i,n);else if(e.tag===19)Zd(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&&Tl(e)===null&&(g=i),i=i.sibling;i=g,i===null?(g=n.child,n.child=null):(g=i.sibling,i.sibling=null),eu(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&&Tl(e)===null){n.child=g;break}e=g.sibling,g.sibling=i,i=g,g=e}eu(n,!0,i,null,C,a);break;case"together":eu(n,!1,null,null,void 0,a);break;default:n.memoizedState=null}return n.child}function ki(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),hr|=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=Si(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=Si(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function tu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Sl(e)))}function Ly(e,n,i){switch(n.tag){case 3:q(n,n.stateNode.containerInfo),ir(n,Rt,e.memoizedState.cache),Hr();break;case 27:case 5:ae(n);break;case 4:q(n,n.stateNode.containerInfo);break;case 10:ir(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,kc(n),null;break;case 13:var a=n.memoizedState;if(a!==null)return a.dehydrated!==null?(lr(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Jd(e,n,i):(lr(n),e=ki(e,n,i),e!==null?e.sibling:null);lr(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 ep(e,n,i);n.flags|=128}if(g=n.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),I(kt,kt.current),a)break;return null;case 22:return n.lanes=0,Vd(e,n,i,n.pendingProps);case 24:ir(n,Rt,e.memoizedState.cache)}return ki(e,n,i)}function tp(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)Mt=!0;else{if(!tu(e,i)&&(n.flags&128)===0)return Mt=!1,Ly(e,n,i);Mt=(e.flags&131072)!==0}else Mt=!1,Ye&&(n.flags&1048576)!==0&&Of(n,oa,n.index);switch(n.lanes=0,n.tag){case 16:e:{var a=n.pendingProps;if(e=Pr(n.elementType),n.type=e,typeof e=="function")ac(e)?(a=Gr(e,a),n.tag=1,n=Xd(null,n,e,a,i)):(n.tag=0,n=Kc(null,n,e,a,i));else{if(e!=null){var g=e.$$typeof;if(g===A){n.tag=11,n=qd(null,n,e,a,i);break e}else if(g===D){n.tag=14,n=$d(null,n,e,a,i);break e}}throw n=W(e)||e,Error(l(306,n,""))}}return n;case 0:return Kc(e,n,n.type,n.pendingProps,i);case 1:return a=n.type,g=Gr(a,n.pendingProps),Xd(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,bc(e,n),ga(n,a,null,i);var O=n.memoizedState;if(a=O.cache,ir(n,Rt,a),a!==C.cache&&mc(n,[Rt],i,!0),ma(),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=Qd(e,n,a,i);break e}else if(a!==g){g=Bn(Error(l(424)),n),ca(g),n=Qd(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(ft=In(e.firstChild),Ft=n,Ye=!0,tr=null,Hn=!0,i=Vf(n,null,a,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Hr(),a===g){n=ki(e,n,i);break e}$t(e,n,a,i)}n=n.child}return n;case 26:return Il(e,n),e===null?(i=fm(n.type,null,n.pendingProps,null))?n.memoizedState=i:Ye||(i=n.type,e=n.pendingProps,a=no(_e.current).createElement(i),a[Et]=n,a[It]=e,Gt(a,i,e),ht(a),n.stateNode=a):n.memoizedState=fm(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ae(n),e===null&&Ye&&(a=n.stateNode=cm(n.type,n.pendingProps,_e.current),Ft=n,Hn=!0,g=ft,gr(n.type)?(Bu=g,ft=In(a.firstChild)):ft=g),$t(e,n,n.pendingProps.children,i),Il(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ye&&((g=a=ft)&&(a=o0(a,n.type,n.pendingProps,Hn),a!==null?(n.stateNode=a,Ft=n,ft=In(a.firstChild),Hn=!1,g=!0):g=!1),g||nr(n)),ae(n),g=n.type,C=n.pendingProps,O=e!==null?e.memoizedProps:null,a=C.children,Ru(g,C)?a=null:O!==null&&Ru(g,O)&&(n.flags|=32),n.memoizedState!==null&&(g=Tc(e,n,wy,null,null,i),Na._currentValue=g),Il(e,n),$t(e,n,a,i),n.child;case 6:return e===null&&Ye&&((e=i=ft)&&(i=c0(i,n.pendingProps,Hn),i!==null?(n.stateNode=i,Ft=n,ft=null,e=!0):e=!1),e||nr(n)),null;case 13:return Jd(e,n,i);case 4:return q(n,n.stateNode.containerInfo),a=n.pendingProps,e===null?n.child=qr(n,null,a,i):$t(e,n,a,i),n.child;case 11:return qd(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,ir(n,n.type,a.value),$t(e,n,a.children,i),n.child;case 9:return g=n.type._context,a=n.pendingProps.children,Ir(n),g=qt(g),a=a(g),n.flags|=1,$t(e,n,a,i),n.child;case 14:return $d(e,n,n.type,n.pendingProps,i);case 15:return Gd(e,n,n.type,n.pendingProps,i);case 19:return ep(e,n,i);case 31:return My(e,n,i);case 22:return Vd(e,n,i,n.pendingProps);case 24:return Ir(n),a=qt(Rt),e===null?(g=vc(),g===null&&(g=at,C=gc(),g.pooledCache=C,C.refCount++,C!==null&&(g.pooledCacheLanes|=i),g=C),n.memoizedState={parent:a,cache:g},Sc(n),ir(n,Rt,g)):((e.lanes&i)!==0&&(bc(e,n),ga(n,null,null,i),ma()),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),ir(n,Rt,a)):(a=C.cache,ir(n,Rt,a),a!==g.cache&&mc(n,[Rt],i,!0))),$t(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function Ai(e){e.flags|=4}function nu(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(Tp())e.flags|=8192;else throw Fr=xl,yc}else e.flags&=-16777217}function np(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!_m(n))if(Tp())e.flags|=8192;else throw Fr=xl,yc}function Pl(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Hi():536870912,e.lanes|=n,xs|=n)}function Ca(e,n){if(!Ye)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 dt(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 Oy(e,n,i){var a=n.pendingProps;switch(uc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(n),null;case 1:return dt(n),null;case 3:return i=n.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),wi(Rt),ue(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(hs(n)?Ai(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,fc())),dt(n),null;case 26:var g=n.type,C=n.memoizedState;return e===null?(Ai(n),C!==null?(dt(n),np(n,C)):(dt(n),nu(n,g,null,a,i))):C?C!==e.memoizedState?(Ai(n),dt(n),np(n,C)):(dt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==a&&Ai(n),dt(n),nu(n,g,e,a,i)),null;case 27:if(de(n),i=_e.current,g=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&Ai(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return dt(n),null}e=ie.current,hs(n)?jf(n):(e=cm(g,a,i),n.stateNode=e,Ai(n))}return dt(n),null;case 5:if(de(n),g=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&Ai(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return dt(n),null}if(C=ie.current,hs(n))jf(n);else{var O=no(_e.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[Et]=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&&Ai(n)}}return dt(n),nu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,i),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==a&&Ai(n);else{if(typeof a!="string"&&n.stateNode===null)throw Error(l(166));if(e=_e.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[Et]=n,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Jp(e.nodeValue,i)),e||nr(n,!0)}else e=no(e).createTextNode(a),e[Et]=n,n.stateNode=e}return dt(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[Et]=n}else Hr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dt(n),e=!1}else i=fc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return n.flags&256?(wn(n),n):(wn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return dt(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[Et]=n}else Hr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;dt(n),g=!1}else g=fc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=g),g=!0;if(!g)return n.flags&256?(wn(n),n):(wn(n),null)}return wn(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),Pl(n,n.updateQueue),dt(n),null);case 4:return ue(),e===null&&xu(n.stateNode.containerInfo),dt(n),null;case 10:return wi(n.type),dt(n),null;case 19:if($(kt),a=n.memoizedState,a===null)return dt(n),null;if(g=(n.flags&128)!==0,C=a.rendering,C===null)if(g)Ca(a,!1);else{if(wt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(C=Tl(e),C!==null){for(n.flags|=128,Ca(a,!1),e=C.updateQueue,n.updateQueue=e,Pl(n,e),n.subtreeFlags=0,e=i,i=n.child;i!==null;)Df(i,e),i=i.sibling;return I(kt,kt.current&1|2),Ye&&bi(n,a.treeForkCount),n.child}e=e.sibling}a.tail!==null&&ut()>Vl&&(n.flags|=128,g=!0,Ca(a,!1),n.lanes=4194304)}else{if(!g)if(e=Tl(C),e!==null){if(n.flags|=128,g=!0,e=e.updateQueue,n.updateQueue=e,Pl(n,e),Ca(a,!0),a.tail===null&&a.tailMode==="hidden"&&!C.alternate&&!Ye)return dt(n),null}else 2*ut()-a.renderingStartTime>Vl&&i!==536870912&&(n.flags|=128,g=!0,Ca(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=ut(),e.sibling=null,i=kt.current,I(kt,g?i&1|2:i&1),Ye&&bi(n,a.treeForkCount),e):(dt(n),null);case 22:case 23:return wn(n),Ec(),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&&(dt(n),n.subtreeFlags&6&&(n.flags|=8192)):dt(n),i=n.updateQueue,i!==null&&Pl(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&&$(Ur),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),wi(Rt),dt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function By(e,n){switch(uc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return wi(Rt),ue(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return de(n),null;case 31:if(n.memoizedState!==null){if(wn(n),n.alternate===null)throw Error(l(340));Hr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(wn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Hr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $(kt),null;case 4:return ue(),null;case 10:return wi(n.type),null;case 22:case 23:return wn(n),Ec(),e!==null&&$(Ur),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return wi(Rt),null;case 25:return null;default:return null}}function ip(e,n){switch(uc(n),n.tag){case 3:wi(Rt),ue();break;case 26:case 27:case 5:de(n);break;case 4:ue();break;case 31:n.memoizedState!==null&&wn(n);break;case 13:wn(n);break;case 19:$(kt);break;case 10:wi(n.type);break;case 22:case 23:wn(n),Ec(),e!==null&&$(Ur);break;case 24:wi(Rt)}}function wa(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){nt(n,n.return,F)}}function cr(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,le=F;try{le()}catch(pe){nt(g,X,pe)}}}a=a.next}while(a!==C)}}catch(pe){nt(n,n.return,pe)}}function rp(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{Kf(n,i)}catch(a){nt(e,e.return,a)}}}function sp(e,n,i){i.props=Gr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){nt(e,n,a)}}function xa(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){nt(e,n,g)}}function ai(e,n){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(g){nt(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){nt(e,n,g)}else i.current=null}function ap(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){nt(e,e.return,g)}}function iu(e,n,i){try{var a=e.stateNode;n0(a,e.type,i,n),a[It]=n}catch(g){nt(e,e.return,g)}}function lp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&gr(e.type)||e.tag===4}function ru(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lp(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&&gr(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 su(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=yn));else if(a!==4&&(a===27&&gr(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(su(e,n,i),e=e.sibling;e!==null;)su(e,n,i),e=e.sibling}function Fl(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&&gr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Fl(e,n,i),e=e.sibling;e!==null;)Fl(e,n,i),e=e.sibling}function op(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[Et]=e,n[It]=i}catch(C){nt(e,e.return,C)}}var Ti=!1,Lt=!1,au=!1,cp=typeof WeakSet=="function"?WeakSet:Set,zt=null;function jy(e,n){if(e=e.containerInfo,Au=co,e=bf(e),Zo(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,le=0,pe=0,ye=e,oe=null;t:for(;;){for(var ce;ye!==i||g!==0&&ye.nodeType!==3||(F=O+g),ye!==C||a!==0&&ye.nodeType!==3||(X=O+a),ye.nodeType===3&&(O+=ye.nodeValue.length),(ce=ye.firstChild)!==null;)oe=ye,ye=ce;for(;;){if(ye===e)break t;if(oe===i&&++le===g&&(F=O),oe===C&&++pe===a&&(X=O),(ce=ye.nextSibling)!==null)break;ye=oe,oe=ye.parentNode}ye=ce}i=F===-1||X===-1?null:{start:F,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(Tu={focusedElem:e,selectionRange:i},co=!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 Ae=Gr(i.type,g);e=a.getSnapshotBeforeUpdate(Ae,C),a.__reactInternalSnapshotBeforeUpdate=e}catch(Be){nt(i,i.return,Be)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)Mu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Mu(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 up(e,n,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Di(e,i),a&4&&wa(5,i);break;case 1:if(Di(e,i),a&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(O){nt(i,i.return,O)}else{var g=Gr(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(g,n,e.__reactInternalSnapshotBeforeUpdate)}catch(O){nt(i,i.return,O)}}a&64&&rp(i),a&512&&xa(i,i.return);break;case 3:if(Di(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{Kf(e,n)}catch(O){nt(i,i.return,O)}}break;case 27:n===null&&a&4&&op(i);case 26:case 5:Di(e,i),n===null&&a&4&&ap(i),a&512&&xa(i,i.return);break;case 12:Di(e,i);break;case 31:Di(e,i),a&4&&dp(e,i);break;case 13:Di(e,i),a&4&&pp(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=$y.bind(null,i),u0(e,i))));break;case 22:if(a=i.memoizedState!==null||Ti,!a){n=n!==null&&n.memoizedState!==null||Lt,g=Ti;var C=Lt;Ti=a,(Lt=n)&&!C?Mi(e,i,(i.subtreeFlags&8772)!==0):Di(e,i),Ti=g,Lt=C}break;case 30:break;default:Di(e,i)}}function hp(e){var n=e.alternate;n!==null&&(e.alternate=null,hp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Ui(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 mt=null,on=!1;function Ri(e,n,i){for(i=i.child;i!==null;)fp(e,n,i),i=i.sibling}function fp(e,n,i){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(_t,i)}catch{}switch(i.tag){case 26:Lt||ai(i,n),Ri(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Lt||ai(i,n);var a=mt,g=on;gr(i.type)&&(mt=i.stateNode,on=!1),Ri(e,n,i),Oa(i.stateNode),mt=a,on=g;break;case 5:Lt||ai(i,n);case 6:if(a=mt,g=on,mt=null,Ri(e,n,i),mt=a,on=g,mt!==null)if(on)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(i.stateNode)}catch(C){nt(i,n,C)}else try{mt.removeChild(i.stateNode)}catch(C){nt(i,n,C)}break;case 18:mt!==null&&(on?(e=mt,rm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ls(e)):rm(mt,i.stateNode));break;case 4:a=mt,g=on,mt=i.stateNode.containerInfo,on=!0,Ri(e,n,i),mt=a,on=g;break;case 0:case 11:case 14:case 15:cr(2,i,n),Lt||cr(4,i,n),Ri(e,n,i);break;case 1:Lt||(ai(i,n),a=i.stateNode,typeof a.componentWillUnmount=="function"&&sp(i,n,a)),Ri(e,n,i);break;case 21:Ri(e,n,i);break;case 22:Lt=(a=Lt)||i.memoizedState!==null,Ri(e,n,i),Lt=a;break;default:Ri(e,n,i)}}function dp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ls(e)}catch(i){nt(n,n.return,i)}}}function pp(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){nt(n,n.return,i)}}function Ny(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new cp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new cp),n;default:throw Error(l(435,e.tag))}}function ql(e,n){var i=Ny(e);n.forEach(function(a){if(!i.has(a)){i.add(a);var g=Gy.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(gr(F.type)){mt=F.stateNode,on=!1;break e}break;case 5:mt=F.stateNode,on=!1;break e;case 3:case 4:mt=F.stateNode.containerInfo,on=!0;break e}F=F.return}if(mt===null)throw Error(l(160));fp(C,O,g),mt=null,on=!1,C=g.alternate,C!==null&&(C.return=null),g.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)mp(n,e),n=n.sibling}var Wn=null;function mp(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&&(cr(3,e,e.return),wa(3,e),cr(5,e,e.return));break;case 1:cn(n,e),un(e),a&512&&(Lt||i===null||ai(i,i.return)),a&64&&Ti&&(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&&(Lt||i===null||ai(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[Ii]||C[Et]||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[Et]=e,ht(C),a=C;break e;case"link":var O=mm("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=mm("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[Et]=e,ht(C),a=C}e.stateNode=a}else gm(g,e.type,e.stateNode);else e.stateNode=pm(g,a,e.memoizedProps);else C!==a?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,a===null?gm(g,e.type,e.stateNode):pm(g,a,e.memoizedProps)):a===null&&e.stateNode!==null&&iu(e,e.memoizedProps,i.memoizedProps)}break;case 27:cn(n,e),un(e),a&512&&(Lt||i===null||ai(i,i.return)),i!==null&&a&4&&iu(e,e.memoizedProps,i.memoizedProps);break;case 5:if(cn(n,e),un(e),a&512&&(Lt||i===null||ai(i,i.return)),e.flags&32){g=e.stateNode;try{Vi(g,"")}catch(Ae){nt(e,e.return,Ae)}}a&4&&e.stateNode!=null&&(g=e.memoizedProps,iu(e,g,i!==null?i.memoizedProps:g)),a&1024&&(au=!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(Ae){nt(e,e.return,Ae)}}break;case 3:if(so=null,g=Wn,Wn=io(n.containerInfo),cn(n,e),Wn=g,un(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Ls(n.containerInfo)}catch(Ae){nt(e,e.return,Ae)}au&&(au=!1,gp(e));break;case 4:a=Wn,Wn=io(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,ql(e,a)));break;case 13:cn(n,e),un(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Gl=ut()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ql(e,a)));break;case 22:g=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,le=Ti,pe=Lt;if(Ti=le||g,Lt=pe||X,cn(n,e),Lt=pe,Ti=le,un(e),a&8192)e:for(n=e.stateNode,n._visibility=g?n._visibility&-2:n._visibility|1,g&&(i===null||X||Ti||Lt||Vr(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 ye=X.memoizedProps.style,oe=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;F.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ae){nt(X,X.return,Ae)}}}else if(n.tag===6){if(i===null){X=n;try{X.stateNode.nodeValue=g?"":X.memoizedProps}catch(Ae){nt(X,X.return,Ae)}}}else if(n.tag===18){if(i===null){X=n;try{var ce=X.stateNode;g?sm(ce,!0):sm(X.stateNode,!1)}catch(Ae){nt(X,X.return,Ae)}}}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,ql(e,i))));break;case 19:cn(n,e),un(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ql(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(lp(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var g=i.stateNode,C=ru(e);Fl(e,C,g);break;case 5:var O=i.stateNode;i.flags&32&&(Vi(O,""),i.flags&=-33);var F=ru(e);Fl(e,F,O);break;case 3:case 4:var X=i.stateNode.containerInfo,le=ru(e);su(e,le,X);break;default:throw Error(l(161))}}catch(pe){nt(e,e.return,pe)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function gp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;gp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Di(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)up(e,n.alternate,n),n=n.sibling}function Vr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:cr(4,n,n.return),Vr(n);break;case 1:ai(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&sp(n,n.return,i),Vr(n);break;case 27:Oa(n.stateNode);case 26:case 5:ai(n,n.return),Vr(n);break;case 22:n.memoizedState===null&&Vr(n);break;case 30:Vr(n);break;default:Vr(n)}e=e.sibling}}function Mi(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:Mi(g,C,i),wa(4,C);break;case 1:if(Mi(g,C,i),a=C,g=a.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(le){nt(a,a.return,le)}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++)Wf(X[g],F)}catch(le){nt(a,a.return,le)}}i&&O&64&&rp(C),xa(C,C.return);break;case 27:op(C);case 26:case 5:Mi(g,C,i),i&&a===null&&O&4&&ap(C),xa(C,C.return);break;case 12:Mi(g,C,i);break;case 31:Mi(g,C,i),i&&O&4&&dp(g,C);break;case 13:Mi(g,C,i),i&&O&4&&pp(g,C);break;case 22:C.memoizedState===null&&Mi(g,C,i),xa(C,C.return);break;case 30:break;default:Mi(g,C,i)}n=n.sibling}}function lu(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&&ua(i))}function ou(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ua(e))}function Kn(e,n,i,a){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)_p(e,n,i,a),n=n.sibling}function _p(e,n,i,a){var g=n.flags;switch(n.tag){case 0:case 11:case 15:Kn(e,n,i,a),g&2048&&wa(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&&ua(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){nt(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):Ea(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&&lu(O,n);break;case 24:Kn(e,n,i,a),g&2048&&ou(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,le=O.flags;switch(O.tag){case 0:case 11:case 15:bs(C,O,F,X,g),wa(8,O);break;case 23:break;case 22:var pe=O.stateNode;O.memoizedState!==null?pe._visibility&2?bs(C,O,F,X,g):Ea(C,O):(pe._visibility|=2,bs(C,O,F,X,g)),g&&le&2048&&lu(O.alternate,O);break;case 24:bs(C,O,F,X,g),g&&le&2048&&ou(O.alternate,O);break;default:bs(C,O,F,X,g)}n=n.sibling}}function Ea(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:Ea(i,a),g&2048&&lu(a.alternate,a);break;case 24:Ea(i,a),g&2048&&ou(a.alternate,a);break;default:Ea(i,a)}n=n.sibling}}var ka=8192;function Cs(e,n,i){if(e.subtreeFlags&ka)for(e=e.child;e!==null;)vp(e,n,i),e=e.sibling}function vp(e,n,i){switch(e.tag){case 26:Cs(e,n,i),e.flags&ka&&e.memoizedState!==null&&C0(i,Wn,e.memoizedState,e.memoizedProps);break;case 5:Cs(e,n,i);break;case 3:case 4:var a=Wn;Wn=io(e.stateNode.containerInfo),Cs(e,n,i),Wn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ka,ka=16777216,Cs(e,n,i),ka=a):Cs(e,n,i));break;default:Cs(e,n,i)}}function yp(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 Aa(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,bp(a,e)}yp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sp(e),e=e.sibling}function Sp(e){switch(e.tag){case 0:case 11:case 15:Aa(e),e.flags&2048&&cr(9,e,e.return);break;case 3:Aa(e);break;case 12:Aa(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,$l(e)):Aa(e);break;default:Aa(e)}}function $l(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,bp(a,e)}yp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:cr(8,n,n.return),$l(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,$l(n));break;default:$l(n)}e=e.sibling}}function bp(e,n){for(;zt!==null;){var i=zt;switch(i.tag){case 0:case 11:case 15:cr(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:ua(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(hp(a),a===i){zt=null;break e}if(g!==null){g.return=C,zt=g;break e}zt=C}}}var Hy={getCacheForType:function(e){var n=qt(Rt),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return qt(Rt).controller.signal}},zy=typeof WeakMap=="function"?WeakMap:Map,et=0,at=null,$e=null,We=0,tt=0,xn=null,ur=!1,ws=!1,cu=!1,Li=0,wt=0,hr=0,Wr=0,uu=0,En=0,xs=0,Ta=null,hn=null,hu=!1,Gl=0,Cp=0,Vl=1/0,Wl=null,fr=null,jt=0,dr=null,Es=null,Oi=0,fu=0,du=null,wp=null,Ra=0,pu=null;function kn(){return(et&2)!==0&&We!==0?We&-We:G.T!==null?Su():Tr()}function xp(){if(En===0)if((We&536870912)===0||Ye){var e=hi;hi<<=1,(hi&3932160)===0&&(hi=262144),En=e}else En=536870912;return e=Cn.current,e!==null&&(e.flags|=32),En}function fn(e,n,i){(e===at&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(ks(e,0),pr(e,We,En,!1)),qn(e,i),((et&2)===0||e!==at)&&(e===at&&((et&2)===0&&(Wr|=i),wt===4&&pr(e,We,En,!1)),li(e))}function Ep(e,n,i){if((et&6)!==0)throw Error(l(327));var a=!i&&(n&127)===0&&(n&e.expiredLanes)===0||yt(e,n),g=a?Py(e,n):gu(e,n,!0),C=a;do{if(g===0){ws&&!a&&pr(e,n,0,!1);break}else{if(i=e.current.alternate,C&&!Iy(i)){g=gu(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=Ta;var X=F.current.memoizedState.isDehydrated;if(X&&(ks(F,O).flags|=256),O=gu(F,O,!1),O!==2){if(cu&&!X){F.errorRecoveryDisabledLanes|=C,Wr|=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),pr(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:pr(a,n,En,!ur);break e;case 2:hn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(g=Gl+300-ut(),10<g)){if(pr(a,n,En,!ur),_n(a,0,!0)!==0)break e;Oi=n,a.timeoutHandle=nm(kp.bind(null,a,i,hn,Wl,hu,n,En,Wr,xs,ur,C,"Throttled",-0,0),g);break e}kp(a,i,hn,Wl,hu,n,En,Wr,xs,ur,C,null,-0,0)}}break}while(!0);li(e)}function kp(e,n,i,a,g,C,O,F,X,le,pe,ye,oe,ce){if(e.timeoutHandle=-1,ye=n.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},vp(n,C,ye);var Ae=(C&62914560)===C?Gl-ut():(C&4194048)===C?Cp-ut():0;if(Ae=w0(ye,Ae),Ae!==null){Oi=C,e.cancelPendingCommit=Ae(Bp.bind(null,e,n,C,i,a,g,O,F,X,pe,ye,null,oe,ce)),pr(e,C,O,!le);return}}Bp(e,n,C,i,a,g,O,F,X)}function Iy(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(!Sn(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 pr(e,n,i,a){n&=~uu,n&=~Wr,e.suspendedLanes|=n,e.pingedLanes&=~n,a&&(e.warmLanes|=n),a=e.expirationTimes;for(var g=n;0<g;){var C=31-Ze(g),O=1<<C;a[C]=-1,g&=~O}i!==0&&$n(e,i,n)}function Kl(){return(et&6)===0?(Da(0),!1):!0}function mu(){if($e!==null){if(tt===0)var e=$e.return;else e=$e,Ci=zr=null,Mc(e),gs=null,fa=0,e=$e;for(;e!==null;)ip(e.alternate,e),e=e.return;$e=null}}function ks(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,s0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Oi=0,mu(),at=e,$e=i=Si(e.current,null),We=n,tt=0,xn=null,ur=!1,ws=yt(e,n),cu=!1,xs=En=uu=Wr=hr=wt=0,hn=Ta=null,hu=!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-Ze(a),C=1<<g;n|=e[g],a&=~C}return Li=n,ml(),i}function Ap(e,n){Ie=null,G.H=Sa,n===ms||n===wl?(n=qf(),tt=3):n===yc?(n=qf(),tt=4):tt=n===Wc?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,xn=n,$e===null&&(wt=1,Hl(e,Bn(n,e.current)))}function Tp(){var e=Cn.current;return e===null?!0:(We&4194048)===We?zn===null:(We&62914560)===We||(We&536870912)!==0?e===zn:!1}function Rp(){var e=G.H;return G.H=Sa,e===null?Sa:e}function Dp(){var e=G.A;return G.A=Hy,e}function Yl(){wt=4,ur||(We&4194048)!==We&&Cn.current!==null||(ws=!0),(hr&134217727)===0&&(Wr&134217727)===0||at===null||pr(at,We,En,!1)}function gu(e,n,i){var a=et;et|=2;var g=Rp(),C=Dp();(at!==e||We!==n)&&(Wl=null,ks(e,n)),n=!1;var O=wt;e:do try{if(tt!==0&&$e!==null){var F=$e,X=xn;switch(tt){case 8:mu(),O=6;break e;case 3:case 2:case 9:case 6:Cn.current===null&&(n=!0);var le=tt;if(tt=0,xn=null,As(e,F,X,le),i&&ws){O=0;break e}break;default:le=tt,tt=0,xn=null,As(e,F,X,le)}}Uy(),O=wt;break}catch(pe){Ap(e,pe)}while(!0);return n&&e.shellSuspendCounter++,Ci=zr=null,et=a,G.H=g,G.A=C,$e===null&&(at=null,We=0,ml()),O}function Uy(){for(;$e!==null;)Mp($e)}function Py(e,n){var i=et;et|=2;var a=Rp(),g=Dp();at!==e||We!==n?(Wl=null,Vl=ut()+500,ks(e,n)):ws=yt(e,n);e:do try{if(tt!==0&&$e!==null){n=$e;var C=xn;t:switch(tt){case 1:tt=0,xn=null,As(e,n,C,1);break;case 2:case 9:if(Pf(C)){tt=0,xn=null,Lp(n);break}n=function(){tt!==2&&tt!==9||at!==e||(tt=7),li(e)},C.then(n,n);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:Pf(C)?(tt=0,xn=null,Lp(n)):(tt=0,xn=null,As(e,n,C,7));break;case 5:var O=null;switch($e.tag){case 26:O=$e.memoizedState;case 5:case 27:var F=$e;if(O?_m(O):F.stateNode.complete){tt=0,xn=null;var X=F.sibling;if(X!==null)$e=X;else{var le=F.return;le!==null?($e=le,Xl(le)):$e=null}break t}}tt=0,xn=null,As(e,n,C,5);break;case 6:tt=0,xn=null,As(e,n,C,6);break;case 8:mu(),wt=6;break e;default:throw Error(l(462))}}Fy();break}catch(pe){Ap(e,pe)}while(!0);return Ci=zr=null,G.H=a,G.A=g,et=i,$e!==null?0:(at=null,We=0,ml(),wt)}function Fy(){for(;$e!==null&&!Rn();)Mp($e)}function Mp(e){var n=tp(e.alternate,e,Li);e.memoizedProps=e.pendingProps,n===null?Xl(e):$e=n}function Lp(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=Yd(i,n,n.pendingProps,n.type,void 0,We);break;case 11:n=Yd(i,n,n.pendingProps,n.type.render,n.ref,We);break;case 5:Mc(n);default:ip(i,n),n=$e=Df(n,Li),n=tp(i,n,Li)}e.memoizedProps=e.pendingProps,n===null?Xl(e):$e=n}function As(e,n,i,a){Ci=zr=null,Mc(n),gs=null,fa=0;var g=n.return;try{if(Dy(e,g,n,i,We)){wt=1,Hl(e,Bn(i,e.current)),$e=null;return}}catch(C){if(g!==null)throw $e=g,C;wt=1,Hl(e,Bn(i,e.current)),$e=null;return}n.flags&32768?(Ye||a===1?e=!0:ws||(We&536870912)!==0?e=!1:(ur=e=!0,(a===2||a===9||a===3||a===6)&&(a=Cn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Op(n,e)):Xl(n)}function Xl(e){var n=e;do{if((n.flags&32768)!==0){Op(n,ur);return}e=n.return;var i=Oy(n.alternate,n,Li);if(i!==null){$e=i;return}if(n=n.sibling,n!==null){$e=n;return}$e=n=e}while(n!==null);wt===0&&(wt=5)}function Op(e,n){do{var i=By(e.alternate,e);if(i!==null){i.flags&=32767,$e=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){$e=e;return}$e=e=i}while(e!==null);wt=6,$e=null}function Bp(e,n,i,a,g,C,O,F,X){e.cancelPendingCommit=null;do Ql();while(jt!==0);if((et&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(C=n.lanes|n.childLanes,C|=rc,Qn(e,i,C,O,F,X),e===at&&($e=at=null,We=0),Es=n,dr=e,Oi=i,fu=C,du=g,wp=a,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Vy(Te,function(){return Ip(),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=et,et|=4;try{jy(e,n,i)}finally{et=O,Y.p=g,G.T=a}}jt=1,jp(),Np(),Hp()}}function jp(){if(jt===1){jt=0;var e=dr,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=et;et|=4;try{mp(n,e);var C=Tu,O=bf(e.containerInfo),F=C.focusedElem,X=C.selectionRange;if(O!==F&&F&&F.ownerDocument&&Sf(F.ownerDocument.documentElement,F)){if(X!==null&&Zo(F)){var le=X.start,pe=X.end;if(pe===void 0&&(pe=le),"selectionStart"in F)F.selectionStart=le,F.selectionEnd=Math.min(pe,F.value.length);else{var ye=F.ownerDocument||document,oe=ye&&ye.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Ae=F.textContent.length,Be=Math.min(X.start,Ae),st=X.end===void 0?Be:Math.min(X.end,Ae);!ce.extend&&Be>st&&(O=st,st=Be,Be=O);var ne=yf(F,Be),J=yf(F,st);if(ne&&J&&(ce.rangeCount!==1||ce.anchorNode!==ne.node||ce.anchorOffset!==ne.offset||ce.focusNode!==J.node||ce.focusOffset!==J.offset)){var se=ye.createRange();se.setStart(ne.node,ne.offset),ce.removeAllRanges(),Be>st?(ce.addRange(se),ce.extend(J.node,J.offset)):(se.setEnd(J.node,J.offset),ce.addRange(se))}}}}for(ye=[],ce=F;ce=ce.parentNode;)ce.nodeType===1&&ye.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<ye.length;F++){var ge=ye[F];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}co=!!Au,Tu=Au=null}finally{et=g,Y.p=a,G.T=i}}e.current=n,jt=2}}function Np(){if(jt===2){jt=0;var e=dr,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=et;et|=4;try{up(e,n.alternate,n)}finally{et=g,Y.p=a,G.T=i}}jt=3}}function Hp(){if(jt===4||jt===3){jt=0,gt();var e=dr,n=Es,i=Oi,a=wp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?jt=5:(jt=0,Es=dr=null,zp(e,e.pendingLanes));var g=e.pendingLanes;if(g===0&&(fr=null),pi(i),n=n.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(_t,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}}(Oi&3)!==0&&Ql(),li(e),g=e.pendingLanes,(i&261930)!==0&&(g&42)!==0?e===pu?Ra++:(Ra=0,pu=e):Ra=0,Da(0)}}function zp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ua(n)))}function Ql(){return jp(),Np(),Hp(),Ip()}function Ip(){if(jt!==5)return!1;var e=dr,n=fu;fu=0;var i=pi(Oi),a=G.T,g=Y.p;try{Y.p=32>i?32:i,G.T=null,i=du,du=null;var C=dr,O=Oi;if(jt=0,Es=dr=null,Oi=0,(et&6)!==0)throw Error(l(331));var F=et;if(et|=4,Sp(C.current),_p(C,C.current,O,i),et=F,Da(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(_t,C)}catch{}return!0}finally{Y.p=g,G.T=a,zp(e,n)}}function Up(e,n,i){n=Bn(i,n),n=Vc(e.stateNode,n,2),e=ar(e,n,2),e!==null&&(qn(e,2),li(e))}function nt(e,n,i){if(e.tag===3)Up(e,e,i);else for(;n!==null;){if(n.tag===3){Up(n,e,i);break}else if(n.tag===1){var a=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(fr===null||!fr.has(a))){e=Bn(i,e),i=Pd(2),a=ar(n,i,2),a!==null&&(Fd(i,a,n,e),qn(a,2),li(a));break}}n=n.return}}function _u(e,n,i){var a=e.pingCache;if(a===null){a=e.pingCache=new zy;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)||(cu=!0,g.add(i),e=qy.bind(null,e,n,i),n.then(e,e))}function qy(e,n,i){var a=e.pingCache;a!==null&&a.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,at===e&&(We&i)===i&&(wt===4||wt===3&&(We&62914560)===We&&300>ut()-Gl?(et&2)===0&&ks(e,0):uu|=i,xs===We&&(xs=0)),li(e)}function Pp(e,n){n===0&&(n=Hi()),e=jr(e,n),e!==null&&(qn(e,n),li(e))}function $y(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Pp(e,i)}function Gy(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),Pp(e,i)}function Vy(e,n){return Nt(e,n)}var Jl=null,Ts=null,vu=!1,Zl=!1,yu=!1,mr=0;function li(e){e!==Ts&&e.next===null&&(Ts===null?Jl=Ts=e:Ts=Ts.next=e),Zl=!0,vu||(vu=!0,Ky())}function Da(e,n){if(!yu&&Zl){yu=!0;do for(var i=!1,a=Jl;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-Ze(42|e)+1)-1,C&=g&~(O&~F),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,Gp(a,C))}else C=We,C=_n(a,a===at?C:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(C&3)===0||yt(a,C)||(i=!0,Gp(a,C));a=a.next}while(i);yu=!1}}function Wy(){Fp()}function Fp(){Zl=vu=!1;var e=0;mr!==0&&r0()&&(e=mr);for(var n=ut(),i=null,a=Jl;a!==null;){var g=a.next,C=qp(a,n);C===0?(a.next=null,i===null?Jl=g:i.next=g,g===null&&(Ts=i)):(i=a,(e!==0||(C&3)!==0)&&(Zl=!0)),a=g}jt!==0&&jt!==5||Da(e),mr!==0&&(mr=0)}function qp(e,n){for(var i=e.suspendedLanes,a=e.pingedLanes,g=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var O=31-Ze(C),F=1<<O,X=g[O];X===-1?((F&i)===0||(F&a)!==0)&&(g[O]=di(F,n)):X<=n&&(e.expiredLanes|=F),C&=~F}if(n=at,i=We,i=_n(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===n&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&rn(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||yt(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(a!==null&&rn(a),pi(i)){case 2:case 8:i=Ce;break;case 32:i=Te;break;case 268435456:i=Ne;break;default:i=Te}return a=$p.bind(null,e),i=Nt(i,a),e.callbackPriority=n,e.callbackNode=i,n}return a!==null&&a!==null&&rn(a),e.callbackPriority=2,e.callbackNode=null,2}function $p(e,n){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Ql()&&e.callbackNode!==i)return null;var a=We;return a=_n(e,e===at?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Ep(e,a,n),qp(e,ut()),e.callbackNode!=null&&e.callbackNode===i?$p.bind(null,e):null)}function Gp(e,n){if(Ql())return null;Ep(e,n,!0)}function Ky(){a0(function(){(et&6)!==0?Nt(fe,Wy):Fp()})}function Su(){if(mr===0){var e=ds;e===0&&(e=ui,ui<<=1,(ui&261888)===0&&(ui=256)),mr=e}return mr}function Vp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ki(""+e)}function Wp(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 Yy(e,n,i,a,g){if(n==="submit"&&i&&i.stateNode===g){var C=Vp((g[It]||null).action),O=a.submitter;O&&(n=(n=O[It]||null)?Vp(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(mr!==0){var X=O?Wp(g,O):new FormData(g);Uc(i,{pending:!0,data:X,method:g.method,action:C},null,X)}}else typeof C=="function"&&(F.preventDefault(),X=O?Wp(g,O):new FormData(g),Uc(i,{pending:!0,data:X,method:g.method,action:C},C,X))},currentTarget:g}]})}}for(var bu=0;bu<ic.length;bu++){var Cu=ic[bu],Xy=Cu.toLowerCase(),Qy=Cu[0].toUpperCase()+Cu.slice(1);Vn(Xy,"on"+Qy)}Vn(xf,"onAnimationEnd"),Vn(Ef,"onAnimationIteration"),Vn(kf,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(dy,"onTransitionRun"),Vn(py,"onTransitionStart"),Vn(my,"onTransitionCancel"),Vn(Af,"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 Ma="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(" "),Jy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ma));function Kp(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,le=F.currentTarget;if(F=F.listener,X!==C&&g.isPropagationStopped())break e;C=F,g.currentTarget=le;try{C(g)}catch(pe){pl(pe)}g.currentTarget=null,C=X}else for(O=0;O<a.length;O++){if(F=a[O],X=F.instance,le=F.currentTarget,F=F.listener,X!==C&&g.isPropagationStopped())break e;C=F,g.currentTarget=le;try{C(g)}catch(pe){pl(pe)}g.currentTarget=null,C=X}}}}function Ge(e,n){var i=n[Mn];i===void 0&&(i=n[Mn]=new Set);var a=e+"__bubble";i.has(a)||(Yp(n,e,2,!1),i.add(a))}function wu(e,n,i){var a=0;n&&(a|=4),Yp(i,e,a,n)}var eo="_reactListening"+Math.random().toString(36).slice(2);function xu(e){if(!e[eo]){e[eo]=!0,Gs.forEach(function(i){i!=="selectionchange"&&(Jy.has(i)||wu(i,!1,e),wu(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[eo]||(n[eo]=!0,wu("selectionchange",!1,n))}}function Yp(e,n,i,a){switch(xm(n)){case 2:var g=k0;break;case 8:g=A0;break;default:g=Iu}i=g.bind(null,n,i,e),g=void 0,!Ln||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 Eu(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=Pi(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}vi(function(){var le=C,pe=ea(i),ye=[];e:{var oe=Tf.get(e);if(oe!==void 0){var ce=is,Ae=e;switch(e){case"keypress":if(Xi(i)===0)break e;case"keydown":case"keyup":ce=Gv;break;case"focusin":Ae="focus",ce=Pt;break;case"focusout":Ae="blur",ce=Pt;break;case"beforeblur":case"afterblur":ce=Pt;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=fl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=he;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=Kv;break;case xf:case Ef:case kf:ce=Wo;break;case Af:ce=Xv;break;case"scroll":case"scrollend":ce=Vo;break;case"wheel":ce=Jv;break;case"copy":case"cut":case"paste":ce=zv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=sf;break;case"toggle":case"beforetoggle":ce=ey}var Be=(n&4)!==0,st=!Be&&(e==="scroll"||e==="scrollend"),ne=Be?oe!==null?oe+"Capture":null:oe;Be=[];for(var J=le,se;J!==null;){var ge=J;if(se=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||se===null||ne===null||(ge=Yi(J,ne),ge!=null&&Be.push(La(J,ge,se))),st)break;J=J.return}0<Be.length&&(oe=new ce(oe,Ae,null,i,pe),ye.push({event:oe,listeners:Be}))}}if((n&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",oe&&i!==ni&&(Ae=i.relatedTarget||i.fromElement)&&(Pi(Ae)||Ae[zi]))break e;if((ce||oe)&&(oe=pe.window===pe?pe:(oe=pe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Ae=i.relatedTarget||i.toElement,ce=le,Ae=Ae?Pi(Ae):null,Ae!==null&&(st=p(Ae),Be=Ae.tag,Ae!==st||Be!==5&&Be!==27&&Be!==6)&&(Ae=null)):(ce=null,Ae=le),ce!==Ae)){if(Be=fl,ge="onMouseLeave",ne="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Be=sf,ge="onPointerLeave",ne="onPointerEnter",J="pointer"),st=ce==null?oe:qi(ce),se=Ae==null?oe:qi(Ae),oe=new Be(ge,J+"leave",ce,i,pe),oe.target=st,oe.relatedTarget=se,ge=null,Pi(pe)===le&&(Be=new Be(ne,J+"enter",Ae,i,pe),Be.target=se,Be.relatedTarget=st,ge=Be),st=ge,ce&&Ae)t:{for(Be=Zy,ne=ce,J=Ae,se=0,ge=ne;ge;ge=Be(ge))se++;ge=0;for(var Le=J;Le;Le=Be(Le))ge++;for(;0<se-ge;)ne=Be(ne),se--;for(;0<ge-se;)J=Be(J),ge--;for(;se--;){if(ne===J||J!==null&&ne===J.alternate){Be=ne;break t}ne=Be(ne),J=Be(J)}Be=null}else Be=null;ce!==null&&Xp(ye,oe,ce,Be,!1),Ae!==null&&st!==null&&Xp(ye,st,Ae,Be,!0)}}e:{if(oe=le?qi(le):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var Qe=df;else if(hf(oe))if(pf)Qe=uy;else{Qe=oy;var Re=ly}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?le&&Zs(le.elementType)&&(Qe=df):Qe=cy;if(Qe&&(Qe=Qe(e,le))){ff(ye,Qe,i,pe);break e}Re&&Re(e,oe,le),e==="focusout"&&le&&oe.type==="number"&&le.memoizedProps.value!=null&&Ht(oe,"number",oe.value)}switch(Re=le?qi(le):window,e){case"focusin":(hf(Re)||Re.contentEditable==="true")&&(ss=Re,ec=le,la=null);break;case"focusout":la=ec=ss=null;break;case"mousedown":tc=!0;break;case"contextmenu":case"mouseup":case"dragend":tc=!1,Cf(ye,i,pe);break;case"selectionchange":if(fy)break;case"keydown":case"keyup":Cf(ye,i,pe)}var Ue;if(Xo)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else rs?cf(e,i)&&(Ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(af&&i.locale!=="ko"&&(rs||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&rs&&(Ue=ns()):(Gn=pe,na="value"in Gn?Gn.value:Gn.textContent,rs=!0)),Re=to(le,Ke),0<Re.length&&(Ke=new rf(Ke,e,null,i,pe),ye.push({event:Ke,listeners:Re}),Ue?Ke.data=Ue:(Ue=uf(i),Ue!==null&&(Ke.data=Ue)))),(Ue=ny?iy(e,i):ry(e,i))&&(Ke=to(le,"onBeforeInput"),0<Ke.length&&(Re=new rf("onBeforeInput","beforeinput",null,i,pe),ye.push({event:Re,listeners:Ke}),Re.data=Ue)),Yy(ye,e,le,i,pe)}Kp(ye,n)})}function La(e,n,i){return{instance:e,listener:n,currentTarget:i}}function to(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=Yi(e,i),g!=null&&a.unshift(La(e,g,C)),g=Yi(e,n),g!=null&&a.push(La(e,g,C))),e.tag===3)return a;e=e.return}return[]}function Zy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xp(e,n,i,a,g){for(var C=n._reactName,O=[];i!==null&&i!==a;){var F=i,X=F.alternate,le=F.stateNode;if(F=F.tag,X!==null&&X===a)break;F!==5&&F!==26&&F!==27||le===null||(X=le,g?(le=Yi(i,C),le!=null&&O.unshift(La(i,le,X))):g||(le=Yi(i,C),le!=null&&O.push(La(i,le,X)))),i=i.return}O.length!==0&&e.push({event:n,listeners:O})}var e0=/\r\n?/g,t0=/\u0000|\uFFFD/g;function Qp(e){return(typeof e=="string"?e:""+e).replace(e0,`
49
- `).replace(t0,"")}function Jp(e,n){return n=Qp(n),Qp(e)===n}function rt(e,n,i,a,g,C){switch(i){case"children":typeof a=="string"?n==="body"||n==="textarea"&&a===""||Vi(e,a):(typeof a=="number"||typeof a=="bigint")&&n!=="body"&&Vi(e,""+a);break;case"className":te(e,"class",a);break;case"tabIndex":te(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":te(e,i,a);break;case"style":ul(e,a,C);break;case"data":if(n!=="object"){te(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=Ki(""+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"&&rt(e,n,"name",g.name,g,null),rt(e,n,"formEncType",g.formEncType,g,null),rt(e,n,"formMethod",g.formMethod,g,null),rt(e,n,"formTarget",g.formTarget,g,null)):(rt(e,n,"encType",g.encType,g,null),rt(e,n,"method",g.method,g,null),rt(e,n,"target",g.target,g,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=Ki(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=yn);break;case"onScroll":a!=null&&Ge("scroll",e);break;case"onScrollEnd":a!=null&&Ge("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=Ki(""+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":Ge("beforetoggle",e),Ge("toggle",e),Gi(e,"popover",a);break;case"xlinkActuate":bt(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":bt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":bt(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":bt(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":bt(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":bt(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":bt(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":bt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":bt(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Gi(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=Go.get(i)||i,Gi(e,i,a))}}function ku(e,n,i,a,g,C){switch(i){case"style":ul(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"?Vi(e,a):(typeof a=="number"||typeof a=="bigint")&&Vi(e,""+a);break;case"onScroll":a!=null&&Ge("scroll",e);break;case"onScrollEnd":a!=null&&Ge("scrollend",e);break;case"onClick":a!=null&&(e.onclick=yn);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,""):Gi(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":Ge("error",e),Ge("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:rt(e,n,C,O,i,null)}}g&&rt(e,n,"srcSet",i.srcSet,i,null),a&&rt(e,n,"src",i.src,i,null);return;case"input":Ge("invalid",e);var F=C=O=g=null,X=null,le=null;for(a in i)if(i.hasOwnProperty(a)){var pe=i[a];if(pe!=null)switch(a){case"name":g=pe;break;case"type":O=pe;break;case"checked":X=pe;break;case"defaultChecked":le=pe;break;case"value":C=pe;break;case"defaultValue":F=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(l(137,n));break;default:rt(e,n,a,pe,i,null)}}Ut(e,C,F,X,le,O,g,!1);return;case"select":Ge("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:rt(e,n,g,F,i,null)}n=C,i=O,e.multiple=!!a,n!=null?gi(e,!!a,n,!1):i!=null&&gi(e,!!a,i,!0);return;case"textarea":Ge("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:rt(e,n,O,F,i,null)}Js(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:rt(e,n,X,a,i,null)}return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(a=0;a<Ma.length;a++)Ge(Ma[a],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in i)if(i.hasOwnProperty(le)&&(a=i[le],a!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:rt(e,n,le,a,i,null)}return;default:if(Zs(n)){for(pe in i)i.hasOwnProperty(pe)&&(a=i[pe],a!==void 0&&ku(e,n,pe,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&rt(e,n,F,a,i,null))}function n0(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,le=null,pe=null;for(ce in i){var ye=i[ce];if(i.hasOwnProperty(ce)&&ye!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":X=ye;default:a.hasOwnProperty(ce)||rt(e,n,ce,null,a,ye)}}for(var oe in a){var ce=a[oe];if(ye=i[oe],a.hasOwnProperty(oe)&&(ce!=null||ye!=null))switch(oe){case"type":C=ce;break;case"name":g=ce;break;case"checked":le=ce;break;case"defaultChecked":pe=ce;break;case"value":O=ce;break;case"defaultValue":F=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(l(137,n));break;default:ce!==ye&&rt(e,n,oe,ce,a,ye)}}Xs(e,O,F,X,le,pe,C,g);return;case"select":ce=O=F=oe=null;for(C in i)if(X=i[C],i.hasOwnProperty(C)&&X!=null)switch(C){case"value":break;case"multiple":ce=X;default:a.hasOwnProperty(C)||rt(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":oe=C;break;case"defaultValue":F=C;break;case"multiple":O=C;default:C!==X&&rt(e,n,g,C,a,X)}n=F,i=O,a=ce,oe!=null?gi(e,!!i,oe,!1):!!a!=!!i&&(n!=null?gi(e,!!i,n,!0):gi(e,!!i,i?[]:"",!1));return;case"textarea":ce=oe=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:rt(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":oe=g;break;case"defaultValue":ce=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(l(91));break;default:g!==C&&rt(e,n,O,g,a,C)}Qs(e,oe,ce);return;case"option":for(var Ae in i)if(oe=i[Ae],i.hasOwnProperty(Ae)&&oe!=null&&!a.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:rt(e,n,Ae,null,a,oe)}for(X in a)if(oe=a[X],ce=i[X],a.hasOwnProperty(X)&&oe!==ce&&(oe!=null||ce!=null))switch(X){case"selected":e.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:rt(e,n,X,oe,a,ce)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in i)oe=i[Be],i.hasOwnProperty(Be)&&oe!=null&&!a.hasOwnProperty(Be)&&rt(e,n,Be,null,a,oe);for(le in a)if(oe=a[le],ce=i[le],a.hasOwnProperty(le)&&oe!==ce&&(oe!=null||ce!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,n));break;default:rt(e,n,le,oe,a,ce)}return;default:if(Zs(n)){for(var st in i)oe=i[st],i.hasOwnProperty(st)&&oe!==void 0&&!a.hasOwnProperty(st)&&ku(e,n,st,void 0,a,oe);for(pe in a)oe=a[pe],ce=i[pe],!a.hasOwnProperty(pe)||oe===ce||oe===void 0&&ce===void 0||ku(e,n,pe,oe,a,ce);return}}for(var ne in i)oe=i[ne],i.hasOwnProperty(ne)&&oe!=null&&!a.hasOwnProperty(ne)&&rt(e,n,ne,null,a,oe);for(ye in a)oe=a[ye],ce=i[ye],!a.hasOwnProperty(ye)||oe===ce||oe==null&&ce==null||rt(e,n,ye,oe,a,ce)}function Zp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i0(){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&&Zp(O)){for(O=0,F=g.responseEnd,a+=1;a<i.length;a++){var X=i[a],le=X.startTime;if(le>F)break;var pe=X.transferSize,ye=X.initiatorType;pe&&Zp(ye)&&(X=X.responseEnd,O+=pe*(X<F?1:(F-le)/(X-le)))}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 Au=null,Tu=null;function no(e){return e.nodeType===9?e:e.ownerDocument}function em(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 tm(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 Ru(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 Du=null;function r0(){var e=window.event;return e&&e.type==="popstate"?e===Du?!1:(Du=e,!0):(Du=null,!1)}var nm=typeof setTimeout=="function"?setTimeout:void 0,s0=typeof clearTimeout=="function"?clearTimeout:void 0,im=typeof Promise=="function"?Promise:void 0,a0=typeof queueMicrotask=="function"?queueMicrotask:typeof im<"u"?function(e){return im.resolve(null).then(e).catch(l0)}:nm;function l0(e){setTimeout(function(){throw e})}function gr(e){return e==="head"}function rm(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")Oa(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Oa(i);for(var C=i.firstChild;C;){var O=C.nextSibling,F=C.nodeName;C[Ii]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=O}}else i==="body"&&Oa(e.ownerDocument.body);i=g}while(i);Ls(n)}function sm(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 Mu(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":Mu(i),Ui(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function o0(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[Ii])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 c0(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 am(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 Lu(e){return e.data==="$?"||e.data==="$~"}function Ou(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function u0(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 Bu=null;function lm(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 om(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 cm(e,n,i){switch(n=no(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 Oa(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ui(e)}var Un=new Map,um=new Set;function io(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Bi=Y.d;Y.d={f:h0,r:f0,D:d0,C:p0,L:m0,m:g0,X:v0,S:_0,M:y0};function h0(){var e=Bi.f(),n=Kl();return e||n}function f0(e){var n=Fi(e);n!==null&&n.tag===5&&n.type==="form"?Ad(n):Bi.r(e)}var Rs=typeof document>"u"?null:document;function hm(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+'"]'),um.has(g)||(um.add(g),e={rel:e,crossOrigin:i,href:n},a.querySelector(g)===null&&(n=a.createElement("link"),Gt(n,"link",e),ht(n),a.head.appendChild(n)))}}function d0(e){Bi.D(e),hm("dns-prefetch",e,null)}function p0(e,n){Bi.C(e,n),hm("preconnect",e,n)}function m0(e,n,i){Bi.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)}Un.has(C)||(e=u({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),Un.set(C,e),a.querySelector(g)!==null||n==="style"&&a.querySelector(Ba(C))||n==="script"&&a.querySelector(ja(C))||(n=a.createElement("link"),Gt(n,"link",e),ht(n),a.head.appendChild(n)))}}function g0(e,n){Bi.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(!Un.has(C)&&(e=u({rel:"modulepreload",href:e},n),Un.set(C,e),i.querySelector(g)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ja(C)))return}a=i.createElement("link"),Gt(a,"link",e),ht(a),i.head.appendChild(a)}}}function _0(e,n,i){Bi.S(e,n,i);var a=Rs;if(a&&e){var g=$i(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(Ba(C)))F.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":n},i),(i=Un.get(C))&&ju(e,i);var X=O=a.createElement("link");ht(X),Gt(X,"link",e),X._p=new Promise(function(le,pe){X.onload=le,X.onerror=pe}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,ro(O,n,a)}O={type:"stylesheet",instance:O,count:1,state:F},g.set(C,O)}}}function v0(e,n){Bi.X(e,n);var i=Rs;if(i&&e){var a=$i(i).hoistableScripts,g=Ms(e),C=a.get(g);C||(C=i.querySelector(ja(g)),C||(e=u({src:e,async:!0},n),(n=Un.get(g))&&Nu(e,n),C=i.createElement("script"),ht(C),Gt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(g,C))}}function y0(e,n){Bi.M(e,n);var i=Rs;if(i&&e){var a=$i(i).hoistableScripts,g=Ms(e),C=a.get(g);C||(C=i.querySelector(ja(g)),C||(e=u({src:e,async:!0,type:"module"},n),(n=Un.get(g))&&Nu(e,n),C=i.createElement("script"),ht(C),Gt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(g,C))}}function fm(e,n,i,a){var g=(g=_e.current)?io(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=$i(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=$i(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(Ba(e)))&&!C._p&&(O.instance=C,O.state.loading=5),Un.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},Un.set(e,i),C||S0(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=$i(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 Ba(e){return'link[rel="stylesheet"]['+e+"]"}function dm(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function S0(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),ht(n),e.head.appendChild(n))}function Ms(e){return'[src="'+an(e)+'"]'}function ja(e){return"script[async]"+e}function pm(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,ht(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"),ht(a),Gt(a,"style",g),ro(a,i.precedence,e),n.instance=a;case"stylesheet":g=Ds(i.href);var C=e.querySelector(Ba(g));if(C)return n.state.loading|=4,n.instance=C,ht(C),C;a=dm(i),(g=Un.get(g))&&ju(a,g),C=(e.ownerDocument||e).createElement("link"),ht(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,ro(C,i.precedence,e),n.instance=C;case"script":return C=Ms(i.src),(g=e.querySelector(ja(C)))?(n.instance=g,ht(g),g):(a=i,(g=Un.get(C))&&(a=u({},i),Nu(a,g)),e=e.ownerDocument||e,g=e.createElement("script"),ht(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,ro(a,i.precedence,e));return n.instance}function ro(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 ju(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Nu(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var so=null;function mm(e,n,i){if(so===null){var a=new Map,g=so=new Map;g.set(i,a)}else g=so,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[Ii]||C[Et]||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 gm(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function b0(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 _m(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function C0(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(Ba(g));if(C){n=C._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=ao.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=C,ht(C);return}C=n.ownerDocument||n,a=dm(a),(g=Un.get(g))&&ju(a,g),C=C.createElement("link"),ht(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=ao.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var Hu=0;function w0(e,n){return e.stylesheets&&e.count===0&&oo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&oo(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+n);0<e.imgBytes&&Hu===0&&(Hu=62500*i0());var g=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oo(e,e.stylesheets),e.unsuspend)){var C=e.unsuspend;e.unsuspend=null,C()}},(e.imgBytes>Hu?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(g)}}:null}function ao(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)oo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lo=null;function oo(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lo=new Map,n.forEach(x0,e),lo=null,ao.call(e))}function x0(e,n){if(!(n.state.loading&4)){var i=lo.get(e);if(i)var a=i.get(null);else{i=new Map,lo.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=ao.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 Na={$$typeof:S,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function E0(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=en(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=en(0),this.hiddenUpdates=en(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 vm(e,n,i,a,g,C,O,F,X,le,pe,ye){return e=new E0(e,n,i,O,X,le,pe,ye,F),n=1,C===!0&&(n|=24),C=bn(3,null,null,n),e.current=C,C.stateNode=e,n=gc(),n.refCount++,e.pooledCache=n,n.refCount++,C.memoizedState={element:a,isDehydrated:i,cache:n},Sc(C),e}function ym(e){return e?(e=os,e):os}function Sm(e,n,i,a,g,C){g=ym(g),a.context===null?a.context=g:a.pendingContext=g,a=sr(n),a.payload={element:i},C=C===void 0?null:C,C!==null&&(a.callback=C),i=ar(e,a,n),i!==null&&(fn(i,e,n),pa(i,e,n))}function bm(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function zu(e,n){bm(e,n),(e=e.alternate)&&bm(e,n)}function Cm(e){if(e.tag===13||e.tag===31){var n=jr(e,67108864);n!==null&&fn(n,e,67108864),zu(e,67108864)}}function wm(e){if(e.tag===13||e.tag===31){var n=kn();n=ze(n);var i=jr(e,n);i!==null&&fn(i,e,n),zu(e,n)}}var co=!0;function k0(e,n,i,a){var g=G.T;G.T=null;var C=Y.p;try{Y.p=2,Iu(e,n,i,a)}finally{Y.p=C,G.T=g}}function A0(e,n,i,a){var g=G.T;G.T=null;var C=Y.p;try{Y.p=8,Iu(e,n,i,a)}finally{Y.p=C,G.T=g}}function Iu(e,n,i,a){if(co){var g=Uu(a);if(g===null)Eu(e,n,a,uo,i),Em(e,a);else if(R0(g,e,n,i,a))a.stopPropagation();else if(Em(e,a),n&4&&-1<T0.indexOf(e)){for(;g!==null;){var C=Fi(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-Ze(O);F.entanglements[1]|=X,O&=~X}li(C),(et&6)===0&&(Vl=ut()+500,Da(0))}}break;case 31:case 13:F=jr(C,2),F!==null&&fn(F,C,2),Kl(),zu(C,2)}if(C=Uu(a),C===null&&Eu(e,n,a,uo,i),C===g)break;g=C}g!==null&&a.stopPropagation()}else Eu(e,n,a,null,i)}}function Uu(e){return e=ea(e),Pu(e)}var uo=null;function Pu(e){if(uo=null,e=Pi(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 uo=e,null}function xm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Bt()){case fe:return 2;case Ce:return 8;case Te:case je:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Fu=!1,_r=null,vr=null,yr=null,Ha=new Map,za=new Map,Sr=[],T0="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 Em(e,n){switch(e){case"focusin":case"focusout":_r=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":Ha.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":za.delete(n.pointerId)}}function Ia(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=Fi(n),n!==null&&Cm(n)),e):(e.eventSystemFlags|=a,n=e.targetContainers,g!==null&&n.indexOf(g)===-1&&n.push(g),e)}function R0(e,n,i,a,g){switch(n){case"focusin":return _r=Ia(_r,e,n,i,a,g),!0;case"dragenter":return vr=Ia(vr,e,n,i,a,g),!0;case"mouseover":return yr=Ia(yr,e,n,i,a,g),!0;case"pointerover":var C=g.pointerId;return Ha.set(C,Ia(Ha.get(C)||null,e,n,i,a,g)),!0;case"gotpointercapture":return C=g.pointerId,za.set(C,Ia(za.get(C)||null,e,n,i,a,g)),!0}return!1}function km(e){var n=Pi(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,es(e.priority,function(){wm(i)});return}}else if(n===31){if(n=o(i),n!==null){e.blockedOn=n,es(e.priority,function(){wm(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 ho(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Uu(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);ni=a,i.target.dispatchEvent(a),ni=null}else return n=Fi(i),n!==null&&Cm(n),e.blockedOn=i,!1;n.shift()}return!0}function Am(e,n,i){ho(e)&&i.delete(n)}function D0(){Fu=!1,_r!==null&&ho(_r)&&(_r=null),vr!==null&&ho(vr)&&(vr=null),yr!==null&&ho(yr)&&(yr=null),Ha.forEach(Am),za.forEach(Am)}function fo(e,n){e.blockedOn===n&&(e.blockedOn=null,Fu||(Fu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,D0)))}var po=null;function Tm(e){po!==e&&(po=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){po===e&&(po=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(Pu(a||i)===null)continue;break}var C=Fi(i);C!==null&&(e.splice(n,3),n-=3,Uc(C,{pending:!0,data:g,method:i.method,action:a},a,g))}}))}function Ls(e){function n(X){return fo(X,e)}_r!==null&&fo(_r,e),vr!==null&&fo(vr,e),yr!==null&&fo(yr,e),Ha.forEach(n),za.forEach(n);for(var i=0;i<Sr.length;i++){var a=Sr[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Sr.length&&(i=Sr[0],i.blockedOn===null);)km(i),i.blockedOn===null&&Sr.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||Tm(i);else if(O){var F=null;if(C&&C.hasAttribute("formAction")){if(g=C,O=C[It]||null)F=O.formAction;else if(Pu(g)!==null)continue}else F=O.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),Tm(i)}}}function Rm(){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 qu(e){this._internalRoot=e}mo.prototype.render=qu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var i=n.current,a=kn();Sm(i,a,e,n,null,null)},mo.prototype.unmount=qu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Sm(e.current,2,null,e,null,null),Kl(),n[zi]=null}};function mo(e){this._internalRoot=e}mo.prototype.unstable_scheduleHydration=function(e){if(e){var n=Tr();e={blockedOn:null,target:e,priority:n};for(var i=0;i<Sr.length&&n!==0&&n<Sr[i].priority;i++);Sr.splice(i,0,e),i===0&&km(e)}};var Dm=r.version;if(Dm!=="19.2.6")throw Error(l(527,Dm,"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 M0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!go.isDisabled&&go.supportsFiber)try{_t=go.inject(M0),vt=go}catch{}}return Pa.createRoot=function(e,n){if(!d(e))throw Error(l(299));var i=!1,a="",g=Hd,C=zd,O=Id;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=vm(e,1,!1,null,null,i,a,null,g,C,O,Rm),e[zi]=n.current,xu(e),new qu(n)},Pa.hydrateRoot=function(e,n,i){if(!d(e))throw Error(l(299));var a=!1,g="",C=Hd,O=zd,F=Id,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=vm(e,1,!0,n,i??null,a,g,X,C,O,F,Rm),n.context=ym(null),i=n.current,a=kn(),a=ze(a),g=sr(a),g.callback=null,ar(i,g,a),i=a,n.current.lanes=i,qn(n,i),li(n),e[zi]=n.current,xu(e),new mo(n)},Pa.version="19.2.6",Pa}var Pm;function q0(){if(Pm)return Vu.exports;Pm=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(),Vu.exports=F0(),Vu.exports}var $0=q0();const Jr=function(t,r){let d=t;const p=Wa[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=wr.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=wr.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=wr.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=wr.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=wr.getMaskFunction(k);for(let W=o-1;W>0;W-=2)for(W==6&&(W-=1);;){for(let K=0;K<2;K+=1)if(f[B][W-K]==null){let G=!1;U<D.length&&(G=(D[U]>>>H&1)==1),P(B,W-K)&&(G=!G),f[B][W-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 Z=k[Y].dataCount,z=k[Y].totalCount-Z;B=Math.max(B,Z),H=Math.max(H,z),U[Y]=new Array(Z);for(let I=0;I<U[Y].length;I+=1)U[Y][I]=255&D.getBuffer()[I+R];R+=Z;const j=wr.getErrorCorrectPolynomial(z),$=Ja(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 W=0;for(let Y=0;Y<k.length;Y+=1)W+=k[Y].totalCount;const K=new Array(W);let G=0;for(let Y=0;Y<B;Y+=1)for(let Z=0;Z<k.length;Z+=1)Y<U[Z].length&&(K[G]=U[Z][Y],G+=1);for(let Y=0;Y<H;Y+=1)for(let Z=0;Z<k.length;Z+=1)Y<P[Z].length&&(K[G]=P[Z][Y],G+=1);return K},A=function(D,k,R){const B=Fm.getRSBlocks(D,k),H=qm();for(let P=0;P<R.length;P+=1){const W=R[P];H.put(W.getMode(),4),H.put(W.getLength(),wr.getLengthInBits(W.getMode(),D)),W.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=G0(D);break;case"Alphanumeric":R=V0(D);break;case"Byte":R=W0(D);break;case"Kanji":R=K0(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=Fm.getRSBlocks(D,p),R=qm();for(let H=0;H<h.length;H++){const U=h[H];R.put(U.getMode(),4),R.put(U.getLength(),wr.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,W,K,G,Y="",Z;for(Z="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)&&(W=P*D+k,Y+="M"+W+","+G+Z);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 J0(R,R,function(U,P){if(B<=U&&U<H&&B<=P&&P<H){const W=Math.floor((U-B)/D),K=Math.floor((P-B)/D);return m.isDark(K,W)?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+="&lt;";break;case">":k+="&gt;";break;case"&":k+="&amp;";break;case'"':k+="&quot;";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,W,K,G;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},Z={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<R;U+=2){for(W=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(W,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?Z[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,W,K;const G=Array(D+1).join("██"),Y=Array(D+1).join(" ");let Z="",z="";for(U=0;U<R;U+=1){for(W=Math.floor((U-B)/D),z="",P=0;P<R;P+=1)K=1,B<=P&&P<H&&B<=U&&U<H&&m.isDark(W,Math.floor((P-B)/D))&&(K=0),z+=K?G:Y;for(W=0;W<D;W+=1)Z+=z+`
51
- `}return Z.substring(0,Z.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};Jr.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};Jr.createStringToBytes=function(t,r){const s=(function(){const d=X0(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 Xt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Wa={L:1,M:0,Q:3,H:2},Cr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},wr=(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 Cr.PATTERN000:return function(o,c){return(o+c)%2==0};case Cr.PATTERN001:return function(o,c){return o%2==0};case Cr.PATTERN010:return function(o,c){return c%3==0};case Cr.PATTERN011:return function(o,c){return(o+c)%3==0};case Cr.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case Cr.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case Cr.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case Cr.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=Ja([1],0);for(let c=0;c<f;c+=1)o=o.multiply(Ja([1,Er.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case Xt.MODE_NUMBER:return 10;case Xt.MODE_ALPHA_NUM:return 9;case Xt.MODE_8BIT_BYTE:return 8;case Xt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case Xt.MODE_NUMBER:return 12;case Xt.MODE_ALPHA_NUM:return 11;case Xt.MODE_8BIT_BYTE:return 16;case Xt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case Xt.MODE_NUMBER:return 14;case Xt.MODE_ALPHA_NUM:return 13;case Xt.MODE_8BIT_BYTE:return 16;case Xt.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})(),Er=(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})(),Ja=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]^=Er.gexp(Er.glog(l.getAt(f))+Er.glog(d.getAt(o)));return Ja(p,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const p=Er.glog(l.getAt(0))-Er.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]^=Er.gexp(Er.glog(d.getAt(o))+p);return Ja(f,0).mod(d)},l},Fm=(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 Wa.L:return t[(d-1)*4+0];case Wa.M:return t[(d-1)*4+1];case Wa.Q:return t[(d-1)*4+2];case Wa.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})(),qm=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},G0=function(t){const r=Xt.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},V0=function(t){const r=Xt.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},W0=function(t){const r=Xt.MODE_8BIT_BYTE,s=Jr.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},K0=function(t){const r=Xt.MODE_KANJI,s=Jr.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},a_=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},Y0=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},X0=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},Q0=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=a_(),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},J0=function(t,r,s){const l=Q0(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=a_();l.write(d);const p=Y0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)p.writeByte(f[o]);return p.flush(),"data:image/gif;base64,"+p};Jr.stringToBytes;const Za=[{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}],l_={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},Ps=[...Za,l_],Z0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},e1={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},o_=[Z0,e1],Nh=[...Ps,...o_];Za.map(t=>t.name);const c_=Ps.map(t=>t.name);o_.map(t=>t.name);Nh.map(t=>t.name);Nh.filter(t=>t.dispatchable).map(t=>t.name);function t1(t){return c_.includes(t)}const n1="zh-CN",i1="pm-final-only",u_=[{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"}],r1=[{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 s1(){const t={};for(const r of c_)t[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:t,autoOrchestration:!0}}function a1({sidebar:t,children:r}){const[s,l]=ee.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 l1({busy:t,state:r,onApprove:s,onCancel:l,onComment:d,onReject:p}){var _;const[f,o]=ee.useState(!1),[c,h]=ee.useState(""),[m,u]=ee.useState(null);if(!r||r.status==="idle")return null;const y=r.active,w=o1(r);if(m===w)return null;const T=r.status==="awaiting_user_approval",E=(y==null?void 0:y.title)??((_=r.pending[0])==null?void 0:_.title)??"Harness feedback",b=(y==null?void 0:y.source)==="task-retrospective"?"Task Harness Review":"Harness Feedback",v=()=>{o(!1),u(w)};return x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:T?"harness-feedback-float needs-review":"harness-feedback-float",children:[x.jsxs("div",{children:[x.jsx("strong",{children:T?`${b} needed`:b}),x.jsx("span",{children:c1(r)})]}),x.jsx("p",{title:E,children:E}),x.jsxs("div",{className:"harness-feedback-float-actions",children:[x.jsx("button",{type:"button",disabled:t,onClick:v,children:"Close"}),x.jsx("button",{type:"button",disabled:t||!y,onClick:()=>o(!0),children:T?"Review":"Open"})]})]}),f&&y?x.jsx("div",{className:"modal-backdrop harness-feedback-backdrop",children:x.jsxs("section",{className:"harness-feedback-modal",role:"dialog","aria-modal":"true","aria-label":"Harness feedback review",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:b}),x.jsxs("p",{className:"muted",children:[r.status.replaceAll("_"," ")," · queued ",r.queuedCount]})]}),x.jsx("button",{type:"button",onClick:()=>o(!1),children:"Close"})]}),x.jsxs("div",{className:"harness-feedback-modal-body",children:[x.jsxs("section",{children:[x.jsx("h3",{children:y.source==="task-retrospective"?"Task Retrospective Request":"Feedback"}),x.jsx("pre",{children:y.feedbackContent||"No feedback content found."})]}),x.jsxs("section",{children:[x.jsx("h3",{children:"Harness Engineer Analysis"}),x.jsx("pre",{children:y.analysisContent||"Analysis is not available yet."})]})]}),T?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional note for Harness Engineer...",onChange:S=>h(S.target.value)}),x.jsxs("div",{children:[x.jsx("button",{type:"button",disabled:t,onClick:()=>d(c),children:"Send Feedback"}),x.jsx("button",{type:"button",disabled:t,onClick:()=>p(c),children:"Reject"}),x.jsx("button",{type:"button",disabled:t,onClick:()=>s(c),children:"Approve"})]})]}):y?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional cancellation note...",onChange:S=>h(S.target.value)}),x.jsx("div",{children:x.jsx("button",{type:"button",disabled:t,onClick:()=>l(c),children:"Cancel"})})]}):null]})}):null]})}function o1(t){if(t.active)return["active",t.status,t.active.id,t.active.path,t.active.updatedAt??"",t.active.analysisPath??"",t.active.applyReportPath??""].join(":");const r=t.pending[0];return r?["pending",t.status,r.id,r.path,t.queuedCount].join(":"):[t.status,t.queuedCount].join(":")}function c1(t){return t.status==="queued"?`${t.queuedCount} queued`:t.status==="awaiting_user_approval"?"waiting for approval":t.status==="analyzing"?"Harness Engineer analyzing":t.status==="applying"?"Harness Engineer applying":t.status}function Bo(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 lt(t,r,s){return`${t} failed. Reason: ${Bo(r,s)}`}function Eo(t,r){return r.some(s=>t.startsWith(`${s} failed.`))?"":t}const Se={getAppPreferences(){return be("/api/settings/preferences")},updateAppPreferences(t){return be("/api/settings/preferences",{method:"PUT",body:JSON.stringify(t)})},getRuntimeDiagnostics(){return be("/api/diagnostics/runtime")},getCurrentProject(){return be("/api/projects/current")},pullCurrentProject(){return be("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return be("/api/projects/recent")},connectProject(t){return be("/api/projects/connect",{method:"POST",body:JSON.stringify(t)})},listTasks(){return be("/api/tasks")},createTask(t){return be("/api/tasks",{method:"POST",body:JSON.stringify(t)})},cleanupTask(t){return be(`/api/tasks/${encodeURIComponent(t)}/cleanup`,{method:"POST"})},getHarnessStatus(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness?${r.toString()}`)},applyHarness(t){return be("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(t)})},getHarnessFileContent(t,r){const s=new URLSearchParams({path:r,taskSlug:t});return be(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(t,r,s){const l=new URLSearchParams({path:r,taskSlug:t});return be(`/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),be(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(t){return be("/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 be(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(t={}){return be("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(t)})},restartHarnessBootstrap(t={}){return be("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessBootstrap(){return be("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(t){return be("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(t)})},getHarnessEngineerSession(){return be("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(t)})},startHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(t)})},resumeHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(t)})},restartHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessEngineerSession(){return be("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return be("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getHarnessFeedbackState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return be(`/api/projects/harness/feedback${s?`?${s}`:""}`)},decideHarnessFeedback(t){return be("/api/projects/harness/feedback/decision",{method:"POST",body:JSON.stringify(t)})},startTaskHarnessRetrospective(t){return be("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(t)})},getAutoMemoryState(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness/memory?${r.toString()}`)},getMemoryFileContent(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/memory/file?${s.toString()}`)},updateMemoryFileContent(t,r,s){const l=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/memory/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},revertMemoryRun(t){return be("/api/projects/harness/memory/revert",{method:"POST",body:JSON.stringify(t)})},retryMemoryReview(t){return be("/api/projects/harness/memory/retry",{method:"POST",body:JSON.stringify(t)})},getTaskStatus(t){return be(`/api/tasks/${encodeURIComponent(t)}/status`)},oneClickStart(t){return be(`/api/tasks/${encodeURIComponent(t)}/one-click-start`,{method:"POST"})},getTaskWorkspaceState(t){return be(`/api/tasks/${encodeURIComponent(t)}/workspace-state`)},getProjectRuntimeState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return be(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(t){return be(`/api/tasks/${encodeURIComponent(t)}/sessions`)},startRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages`)},markAllMessagesDone(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages/history`,{method:"DELETE"})},getOrchestrationState(t){return be(`/api/tasks/${encodeURIComponent(t)}/orchestration`)},updateOrchestrationState(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(t){return be(`/api/tasks/${encodeURIComponent(t)}/round`)},getGateReviewState(t){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review`)},updateGateReviewSettings(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/report`)},startTranslationSession(t,r){return be(`/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)),be(`/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)),be(`/api/tasks/${encodeURIComponent(t)}/translation/feed?${l.toString()}`)},translateUserInput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},translateLatestReply(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/latest-reply`,{method:"POST"})},sendTranslatedInput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/clear`,{method:"POST"})},stopTranslationSession(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return be("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(t,r){return be(`/api/translation/sessions/${encodeURIComponent(t)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/failures/retry`,{method:"POST"})},getTranslationState(){return be("/api/translation/state")},getTranslatorSession(){return be("/api/translation/session")},ensureTranslatorSession(t={}){return be("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(t)})},startTranslatorSession(t={}){return be("/api/translation/session/start",{method:"POST",body:JSON.stringify(t)})},resumeTranslatorSession(t={}){return be("/api/translation/session/resume",{method:"POST",body:JSON.stringify(t)})},restartTranslatorSession(t={}){return be("/api/translation/session/restart",{method:"POST",body:JSON.stringify(t)})},stopTranslatorSession(){return be("/api/translation/session/stop",{method:"POST"})},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 be(`/api/translation/source-files${s}`)},createFileTranslation(t){return be("/api/translation/files",{method:"POST",body:JSON.stringify(t)})},readFileTranslation(t){return be(`/api/translation/files/${encodeURIComponent(t)}`)},createTranslationBootstrap(t){return be("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(t)})},createTranslationMemoryUpdate(t){return be("/api/translation/memory-update",{method:"POST",body:JSON.stringify(t)})},promoteTranslation(t,r){return be(`/api/translation/files/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return be("/api/gateway/status")},updateGatewaySettings(t){return be("/api/gateway/settings",{method:"PUT",body:JSON.stringify(t)})},startGatewayQrLogin(){return be("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(t={}){return be("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(t)})},startGatewayLarkRegistration(){return be("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return be("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(t){return be("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(t)})},resetGatewayBinding(){return be("/api/gateway/binding/reset",{method:"POST"})},setGatewayConnection(t){return be("/api/gateway/connection",{method:"PUT",body:JSON.stringify({enabled:t})})}};async function be(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: ${Bo(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=u1(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)??h1(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 u1(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}function h1(t){const r=t.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const _h="vcm:ui-error-report",vh="vcm:ui-error-clear-actions",yh="vcm:ui-error-clear-message";function f1(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(_h,{detail:{message:r}}))}function d1(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(yh,{detail:{message:r}}))}function p1(t){t.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(vh,{detail:{actions:t}}))}function ji(t){const[r,s]=ee.useState(t),l=ee.useRef(t),d=ee.useCallback(p=>{const f=l.current,o=typeof p=="function"?p(f):p;l.current=o,typeof o=="string"&&o.trim()?f1(o):typeof f=="string"&&f.trim()&&d1(f),s(o)},[]);return[r,d]}var Xu={exports:{}},$m;function m1(){return $m||($m=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})()))})(Xu)),Xu.exports}var g1=m1(),Qu={exports:{}},Gm;function _1(){return Gm||(Gm=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})()))})(Qu)),Qu.exports}var v1=_1(),Ju={exports:{}},Vm;function y1(){return Vm||(Vm=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(`
48
+ `+a.stack}}var xt=Object.prototype.hasOwnProperty,Nt=t.unstable_scheduleCallback,rn=t.unstable_cancelCallback,Dn=t.unstable_shouldYield,gt=t.unstable_requestPaint,ut=t.unstable_now,Bt=t.unstable_getCurrentPriorityLevel,fe=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,Ae=t.unstable_NormalPriority,je=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,dt=t.log,qe=t.unstable_setDisableYieldValue,_t=null,vt=null;function St(e){if(typeof dt=="function"&&qe(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(_t,e)}catch{}}var Ze=Math.clz32?Math.clz32:kr,gn=Math.log,Jt=Math.LN2;function kr(e){return e>>>=0,e===0?32:31-(gn(e)/Jt|0)|0}var hi=256,fi=262144,di=4194304;function _n(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 vn(e,n,i){var a=e.pendingLanes;if(a===0)return 0;var g=0,C=e.suspendedLanes,B=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~C,a!==0?g=_n(a):(B&=F,B!==0?g=_n(B):i||(i=F&~e,i!==0&&(g=_n(i))))):(F=a&~C,F!==0?g=_n(F):B!==0?g=_n(B):i||(i=a&~e,i!==0&&(g=_n(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 yt(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function pi(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 zi(){var e=di;return di<<=1,(di&62914560)===0&&(di=4194304),e}function Zt(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 Xn(e,n,i,a,g,C){var B=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var F=e.entanglements,X=e.expirationTimes,ae=e.hiddenUpdates;for(i=B&~i;0<i;){var pe=31-Ze(i),ye=1<<pe;F[pe]=0,X[pe]=-1;var oe=ae[pe];if(oe!==null)for(ae[pe]=null,pe=0;pe<oe.length;pe++){var ce=oe[pe];ce!==null&&(ce.lane&=-536870913)}i&=~ye}a!==0&&$n(e,a,0),C!==0&&g===0&&e.tag!==0&&(e.suspendedLanes|=C&~(B&~n))}function $n(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var a=31-Ze(n);e.entangledLanes|=n,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function Mn(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var a=31-Ze(i),g=1<<a;g&n|e[a]&n&&(e[a]|=n),i&=~g}}function sn(e,n){var i=n&-n;return i=(i&42)!==0?1:ze(i),(i&(e.suspendedLanes|n))!==0?0:i}function ze(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 mi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ar(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Em(e.type))}function Zr(e,n){var i=Y.p;try{return Y.p=e,n()}finally{Y.p=i}}var yn=Math.random().toString(36).slice(2),Et="__reactFiber$"+yn,It="__reactProps$"+yn,Ii="__reactContainer$"+yn,Ln="__reactEvents$"+yn,Po="__reactListeners$"+yn,Fo="__reactHandles$"+yn,Vs="__reactResources$"+yn,Ui="__reactMarker$"+yn;function Pi(e){delete e[Et],delete e[It],delete e[Ln],delete e[Po],delete e[Fo]}function Fi(e){var n=e[Et];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Ii]||i[Et]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=cm(e);e!==null;){if(i=e[Et])return i;e=cm(e)}return n}e=i,i=e.parentNode}return null}function qi(e){if(e=e[Et]||e[Ii]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function $i(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function Gi(e){var n=e[Vs];return n||(n=e[Vs]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function pt(e){e[Ui]=!0}var Ws=new Set,Qn={};function Jn(e,n){Zn(e,n),Zn(e+"Capture",n)}function Zn(e,n){for(Qn[e]=n,e=0;e<n.length;e++)Ws.add(n[e])}var cl=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]*$"),Ks={},Ys={};function ei(e){return xt.call(Ys,e)?!0:xt.call(Ks,e)?!1:cl.test(e)?Ys[e]=!0:(Ks[e]=!0,!1)}function Vi(e,n,i){if(ei(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 ne(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 bt(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 Gt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xs(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function qo(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(B){i=""+B,C.call(this,B)}}),Object.defineProperty(e,n,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(B){i=""+B},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Qs(e){if(!e._valueTracker){var n=Xs(e)?"checked":"value";e._valueTracker=qo(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=Xs(e)?e.checked?"true":"false":e.value),e=a,e!==i?(n.setValue(e),!0):!1}function gi(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 Js(e,n,i,a,g,C,B,F){e.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?e.type=B:e.removeAttribute("type"),n!=null?B==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Gt(n)):e.value!==""+Gt(n)&&(e.value=""+Gt(n)):B!=="submit"&&B!=="reset"||e.removeAttribute("value"),n!=null?Ht(e,B,Gt(n)):i!=null?Ht(e,B,Gt(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=""+Gt(F):e.removeAttribute("name")}function Ut(e,n,i,a,g,C,B,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)){Qs(e);return}i=i!=null?""+Gt(i):"",n=n!=null?""+Gt(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,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(e.name=B),Qs(e)}function Ht(e,n,i){n==="number"&&gi(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function _i(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=""+Gt(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 Zs(e,n,i){if(n!=null&&(n=""+Gt(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+Gt(i):""}function ea(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=Gt(n),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Qs(e)}function Wi(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 ta(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 Go=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"]]),Ki=/^[\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 Yi(e){return Ki.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Sn(){}var ti=null;function na(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vi=null,ni=null;function ia(e){var n=qi(e);if(n&&(e=n.stateNode)){var i=e[It]||null;e:switch(e=n.stateNode,n.type){case"input":if(Js(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));Js(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":Zs(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&_i(e,!!i.multiple,n,!1)}}}var es=!1;function yi(e,n,i){if(es)return e(n,i);es=!0;try{var a=e(n);return a}finally{if(es=!1,(vi!==null||ni!==null)&&(Yl(),vi&&(n=vi,e=ni,ni=vi=null,ia(n),e)))for(n=0;n<e.length;n++)ia(e[n])}}function Xi(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 Vt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ii=!1;if(Vt)try{var Tr={};Object.defineProperty(Tr,"passive",{get:function(){ii=!0}}),window.addEventListener("test",Tr,Tr),window.removeEventListener("test",Tr,Tr)}catch{ii=!1}var ri=null,ts=null,ns=null;function ln(){if(ns)return ns;var e,n=ts,i=n.length,a,g="value"in ri?ri.value:ri.textContent,C=g.length;for(e=0;e<i&&n[e]===g[e];e++);var B=i-e;for(a=1;a<=B&&n[i-a]===g[C-a];a++);return ns=g.slice(e,1<a?1-a:void 0)}function Qi(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 Ji(){return!0}function is(){return!1}function Wt(e){function n(i,a,g,C,B){this._reactName=i,this._targetInst=g,this.type=a,this.nativeEvent=C,this.target=B,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)?Ji:is,this.isPropagationStopped=is,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=Ji)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ji)},persist:function(){},isPersistent:Ji}),n}var De={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rs=Wt(De),Rr=u({},De,{view:0,detail:0}),Vo=Wt(Rr),ra,on,Si,Dr=u({},Rr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xo,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!==Si&&(Si&&e.type==="mousemove"?(ra=e.screenX-Si.screenX,on=e.screenY-Si.screenY):on=ra=0,Si=e),ra)},movementY:function(e){return"movementY"in e?e.movementY:on}}),ss=Wt(Dr),Wo=u({},Dr,{dataTransfer:0}),V=Wt(Wo),de=u({},Rr,{relatedTarget:0}),Fe=Wt(de),en=u({},De,{animationName:0,elapsedTime:0,pseudoElement:0}),Mr=Wt(en),Ko=u({},De,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yo=Wt(Ko),Iv=u({},De,{data:0}),sf=Wt(Iv),Uv={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"},Fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qv(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Fv[e])?!!n[e]:!1}function Xo(){return qv}var $v=u({},Rr,{key:function(e){if(e.key){var n=Uv[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Qi(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:Xo,charCode:function(e){return e.type==="keypress"?Qi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Qi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Gv=Wt($v),Vv=u({},Dr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),af=Wt(Vv),Wv=u({},Rr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xo}),Kv=Wt(Wv),Yv=u({},De,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xv=Wt(Yv),Qv=u({},Dr,{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}),Jv=Wt(Qv),Zv=u({},De,{newState:0,oldState:0}),ey=Wt(Zv),ty=[9,13,27,32],Qo=Vt&&"CompositionEvent"in window,sa=null;Vt&&"documentMode"in document&&(sa=document.documentMode);var ny=Vt&&"TextEvent"in window&&!sa,lf=Vt&&(!Qo||sa&&8<sa&&11>=sa),of=" ",cf=!1;function uf(e,n){switch(e){case"keyup":return ty.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var as=!1;function iy(e,n){switch(e){case"compositionend":return hf(n);case"keypress":return n.which!==32?null:(cf=!0,of);case"textInput":return e=n.data,e===of&&cf?null:e;default:return null}}function ry(e,n){if(as)return e==="compositionend"||!Qo&&uf(e,n)?(e=ln(),ns=ts=ri=null,as=!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 lf&&n.locale!=="ko"?null:n.data;default:return null}}var sy={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 ff(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!sy[e.type]:n==="textarea"}function df(e,n,i,a){vi?ni?ni.push(a):ni=[a]:vi=a,n=no(n,"onChange"),0<n.length&&(i=new rs("onChange","change",null,i,a),e.push({event:i,listeners:n}))}var aa=null,la=null;function ay(e){Yp(e,0)}function pl(e){var n=$i(e);if(ul(n))return e}function pf(e,n){if(e==="change")return n}var mf=!1;if(Vt){var Jo;if(Vt){var Zo="oninput"in document;if(!Zo){var gf=document.createElement("div");gf.setAttribute("oninput","return;"),Zo=typeof gf.oninput=="function"}Jo=Zo}else Jo=!1;mf=Jo&&(!document.documentMode||9<document.documentMode)}function _f(){aa&&(aa.detachEvent("onpropertychange",vf),la=aa=null)}function vf(e){if(e.propertyName==="value"&&pl(la)){var n=[];df(n,la,e,na(e)),yi(ay,n)}}function ly(e,n,i){e==="focusin"?(_f(),aa=n,la=i,aa.attachEvent("onpropertychange",vf)):e==="focusout"&&_f()}function oy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return pl(la)}function cy(e,n){if(e==="click")return pl(n)}function uy(e,n){if(e==="input"||e==="change")return pl(n)}function hy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var bn=typeof Object.is=="function"?Object.is:hy;function oa(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(!xt.call(n,g)||!bn(e[g],n[g]))return!1}return!0}function yf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sf(e,n){var i=yf(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=yf(i)}}function bf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?bf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Cf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=gi(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=gi(e.document)}return n}function ec(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 fy=Vt&&"documentMode"in document&&11>=document.documentMode,ls=null,tc=null,ca=null,nc=!1;function wf(e,n,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;nc||ls==null||ls!==gi(a)||(a=ls,"selectionStart"in a&&ec(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}),ca&&oa(ca,a)||(ca=a,a=no(tc,"onSelect"),0<a.length&&(n=new rs("onSelect","select",null,n,i),e.push({event:n,listeners:a}),n.target=ls)))}function Lr(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var os={animationend:Lr("Animation","AnimationEnd"),animationiteration:Lr("Animation","AnimationIteration"),animationstart:Lr("Animation","AnimationStart"),transitionrun:Lr("Transition","TransitionRun"),transitionstart:Lr("Transition","TransitionStart"),transitioncancel:Lr("Transition","TransitionCancel"),transitionend:Lr("Transition","TransitionEnd")},ic={},xf={};Vt&&(xf=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function Or(e){if(ic[e])return ic[e];if(!os[e])return e;var n=os[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in xf)return ic[e]=n[i];return e}var Ef=Or("animationend"),kf=Or("animationiteration"),Af=Or("animationstart"),dy=Or("transitionrun"),py=Or("transitionstart"),my=Or("transitioncancel"),Tf=Or("transitionend"),Rf=new Map,rc="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(" ");rc.push("scrollEnd");function Gn(e,n){Rf.set(e,n),Jn(n,[e])}var ml=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=[],cs=0,sc=0;function gl(){for(var e=cs,n=sc=cs=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 B=a.pending;B===null?g.next=g:(g.next=B.next,B.next=g),a.pending=g}C!==0&&Df(i,g,C)}}function _l(e,n,i,a){On[cs++]=e,On[cs++]=n,On[cs++]=i,On[cs++]=a,sc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function ac(e,n,i,a){return _l(e,n,i,a),vl(e)}function Br(e,n){return _l(e,null,null,n),vl(e)}function Df(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-Ze(i),e=C.hiddenUpdates,a=e[g],a===null?e[g]=[n]:a.push(n),n.lane=i|536870912),C):null}function vl(e){if(50<Ma)throw Ma=0,mu=null,Error(l(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var us={};function gy(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 gy(e,n,i,a)}function lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bi(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 Mf(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 yl(e,n,i,a,g,C){var B=0;if(a=e,typeof e=="function")lc(e)&&(B=1);else if(typeof e=="string")B=b0(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 jr(i.children,g,C,n);case b:B=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:B=10;break e;case _:B=9;break e;case A:B=11;break e;case D:B=14;break e;case k:B=16,a=null;break e}B=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return n=Cn(B,i,n,g),n.elementType=e,n.type=a,n.lanes=C,n}function jr(e,n,i,a){return e=Cn(7,e,a,n),e.lanes=i,e}function oc(e,n,i){return e=Cn(6,e,null,n),e.lanes=i,e}function Lf(e){var n=Cn(18,null,null,0);return n.stateNode=e,n}function cc(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 Of=new WeakMap;function Bn(e,n){if(typeof e=="object"&&e!==null){var i=Of.get(e);return i!==void 0?i:(n={value:e,source:n,stack:Tt(n)},Of.set(e,n),n)}return{value:e,source:n,stack:Tt(n)}}var hs=[],fs=0,Sl=null,ua=0,jn=[],Nn=0,Zi=null,si=1,ai="";function Ci(e,n){hs[fs++]=ua,hs[fs++]=Sl,Sl=e,ua=n}function Bf(e,n,i){jn[Nn++]=si,jn[Nn++]=ai,jn[Nn++]=Zi,Zi=e;var a=si;e=ai;var g=32-Ze(a)-1;a&=~(1<<g),i+=1;var C=32-Ze(n)+g;if(30<C){var B=g-g%5;C=(a&(1<<B)-1).toString(32),a>>=B,g-=B,si=1<<32-Ze(n)+g|i<<g|a,ai=C+e}else si=1<<C|i<<g|a,ai=e}function uc(e){e.return!==null&&(Ci(e,1),Bf(e,1,0))}function hc(e){for(;e===Sl;)Sl=hs[--fs],hs[fs]=null,ua=hs[--fs],hs[fs]=null;for(;e===Zi;)Zi=jn[--Nn],jn[Nn]=null,ai=jn[--Nn],jn[Nn]=null,si=jn[--Nn],jn[Nn]=null}function jf(e,n){jn[Nn++]=si,jn[Nn++]=ai,jn[Nn++]=Zi,si=n.id,ai=n.overflow,Zi=e}var Pt=null,ht=null,Ye=!1,er=null,Hn=!1,fc=Error(l(519));function tr(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ha(Bn(n,e)),fc}function Nf(e){var n=e.stateNode,i=e.type,a=e.memoizedProps;switch(n[Et]=e,n[It]=a,i){case"dialog":Ge("cancel",n),Ge("close",n);break;case"iframe":case"object":case"embed":Ge("load",n);break;case"video":case"audio":for(i=0;i<Oa.length;i++)Ge(Oa[i],n);break;case"source":Ge("error",n);break;case"img":case"image":case"link":Ge("error",n),Ge("load",n);break;case"details":Ge("toggle",n);break;case"input":Ge("invalid",n),Ut(n,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ge("invalid",n);break;case"textarea":Ge("invalid",n),ea(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||Zp(n.textContent,i)?(a.popover!=null&&(Ge("beforetoggle",n),Ge("toggle",n)),a.onScroll!=null&&Ge("scroll",n),a.onScrollEnd!=null&&Ge("scrollend",n),a.onClick!=null&&(n.onclick=Sn),n=!0):n=!1,n||tr(e,!0)}function Hf(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:Hn=!1;return;case 27:case 3:Hn=!0;return;default:Pt=Pt.return}}function ds(e){if(e!==Pt)return!1;if(!Ye)return Hf(e),Ye=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Du(e.type,e.memoizedProps)),i=!i),i&&ht&&tr(e),Hf(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ht=om(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));ht=om(e)}else n===27?(n=ht,mr(e.type)?(e=ju,ju=null,ht=e):ht=n):ht=Pt?In(e.stateNode.nextSibling):null;return!0}function Nr(){ht=Pt=null,Ye=!1}function dc(){var e=er;return e!==null&&(fn===null?fn=e:fn.push.apply(fn,e),er=null),e}function ha(e){er===null?er=[e]:er.push(e)}var pc=N(null),Hr=null,wi=null;function nr(e,n,i){I(pc,n._currentValue),n._currentValue=i}function xi(e){e._currentValue=pc.current,$(pc)}function mc(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 gc(e,n,i,a){var g=e.child;for(g!==null&&(g.return=e);g!==null;){var C=g.dependencies;if(C!==null){var B=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),mc(C.return,i,e),a||(B=null);break e}C=F.next}}else if(g.tag===18){if(B=g.return,B===null)throw Error(l(341));B.lanes|=i,C=B.alternate,C!==null&&(C.lanes|=i),mc(B,i,e),B=null}else B=g.child;if(B!==null)B.return=g;else for(B=g;B!==null;){if(B===e){B=null;break}if(g=B.sibling,g!==null){g.return=B.return,B=g;break}B=B.return}g=B}}function ps(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 B=g.alternate;if(B===null)throw Error(l(387));if(B=B.memoizedProps,B!==null){var F=g.type;bn(g.pendingProps.value,B.value)||(e!==null?e.push(F):e=[F])}}else if(g===Q.current){if(B=g.alternate,B===null)throw Error(l(387));B.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(e!==null?e.push(za):e=[za])}g=g.return}e!==null&&gc(n,e,i,a),n.flags|=262144}function bl(e){for(e=e.firstContext;e!==null;){if(!bn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function zr(e){Hr=e,wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return zf(Hr,e)}function Cl(e,n){return Hr===null&&zr(e),zf(e,n)}function zf(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},wi===null){if(e===null)throw Error(l(308));wi=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else wi=wi.next=n;return i}var _y=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()})}},vy=t.unstable_scheduleCallback,yy=t.unstable_NormalPriority,Rt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _c(){return{controller:new _y,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&vy(yy,function(){e.controller.abort()})}var da=null,vc=0,ms=0,gs=null;function Sy(e,n){if(da===null){var i=da=[];vc=0,ms=bu(),gs={status:"pending",value:void 0,then:function(a){i.push(a)}}}return vc++,n.then(If,If),n}function If(){if(--vc===0&&da!==null){gs!==null&&(gs.status="fulfilled");var e=da;da=null,ms=0,gs=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function by(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 Uf=G.S;G.S=function(e,n){wp=ut(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Sy(e,n),Uf!==null&&Uf(e,n)};var Ir=N(null);function yc(){var e=Ir.current;return e!==null?e:at.pooledCache}function wl(e,n){n===null?I(Ir,Ir.current):I(Ir,n.pool)}function Pf(){var e=yc();return e===null?null:{parent:Rt._currentValue,pool:e}}var _s=Error(l(460)),Sc=Error(l(474)),xl=Error(l(542)),El={then:function(){}};function Ff(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qf(e,n,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(Sn,Sn),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Gf(e),e;default:if(typeof n.status=="string")n.then(Sn,Sn);else{if(e=at,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,Gf(e),e}throw Pr=n,_s}}function Ur(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Pr=i,_s):i}}var Pr=null;function $f(){if(Pr===null)throw Error(l(459));var e=Pr;return Pr=null,e}function Gf(e){if(e===_s||e===xl)throw Error(l(483))}var vs=null,pa=0;function kl(e){var n=pa;return pa+=1,vs===null&&(vs=[]),qf(vs,e,n)}function ma(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Al(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 Vf(e){function n(te,J){if(e){var se=te.deletions;se===null?(te.deletions=[J],te.flags|=16):se.push(J)}}function i(te,J){if(!e)return null;for(;J!==null;)n(te,J),J=J.sibling;return null}function a(te){for(var J=new Map;te!==null;)te.key!==null?J.set(te.key,te):J.set(te.index,te),te=te.sibling;return J}function g(te,J){return te=bi(te,J),te.index=0,te.sibling=null,te}function C(te,J,se){return te.index=se,e?(se=te.alternate,se!==null?(se=se.index,se<J?(te.flags|=67108866,J):se):(te.flags|=67108866,J)):(te.flags|=1048576,J)}function B(te){return e&&te.alternate===null&&(te.flags|=67108866),te}function F(te,J,se,me){return J===null||J.tag!==6?(J=oc(se,te.mode,me),J.return=te,J):(J=g(J,se),J.return=te,J)}function X(te,J,se,me){var Me=se.type;return Me===E?pe(te,J,se.props.children,me,se.key):J!==null&&(J.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===k&&Ur(Me)===J.type)?(J=g(J,se.props),ma(J,se),J.return=te,J):(J=yl(se.type,se.key,se.props,null,te.mode,me),ma(J,se),J.return=te,J)}function ae(te,J,se,me){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=cc(se,te.mode,me),J.return=te,J):(J=g(J,se.children||[]),J.return=te,J)}function pe(te,J,se,me,Me){return J===null||J.tag!==7?(J=jr(se,te.mode,me,Me),J.return=te,J):(J=g(J,se),J.return=te,J)}function ye(te,J,se){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=oc(""+J,te.mode,se),J.return=te,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case w:return se=yl(J.type,J.key,J.props,null,te.mode,se),ma(se,J),se.return=te,se;case T:return J=cc(J,te.mode,se),J.return=te,J;case k:return J=Ur(J),ye(te,J,se)}if(K(J)||U(J))return J=jr(J,te.mode,se,null),J.return=te,J;if(typeof J.then=="function")return ye(te,kl(J),se);if(J.$$typeof===S)return ye(te,Cl(te,J),se);Al(te,J)}return null}function oe(te,J,se,me){var Me=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Me!==null?null:F(te,J,""+se,me);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case w:return se.key===Me?X(te,J,se,me):null;case T:return se.key===Me?ae(te,J,se,me):null;case k:return se=Ur(se),oe(te,J,se,me)}if(K(se)||U(se))return Me!==null?null:pe(te,J,se,me,null);if(typeof se.then=="function")return oe(te,J,kl(se),me);if(se.$$typeof===S)return oe(te,J,Cl(te,se),me);Al(te,se)}return null}function ce(te,J,se,me,Me){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return te=te.get(se)||null,F(J,te,""+me,Me);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case w:return te=te.get(me.key===null?se:me.key)||null,X(J,te,me,Me);case T:return te=te.get(me.key===null?se:me.key)||null,ae(J,te,me,Me);case k:return me=Ur(me),ce(te,J,se,me,Me)}if(K(me)||U(me))return te=te.get(se)||null,pe(J,te,me,Me,null);if(typeof me.then=="function")return ce(te,J,se,kl(me),Me);if(me.$$typeof===S)return ce(te,J,se,Cl(J,me),Me);Al(J,me)}return null}function ke(te,J,se,me){for(var Me=null,Qe=null,Re=J,Ue=J=0,Ke=null;Re!==null&&Ue<se.length;Ue++){Re.index>Ue?(Ke=Re,Re=null):Ke=Re.sibling;var Je=oe(te,Re,se[Ue],me);if(Je===null){Re===null&&(Re=Ke);break}e&&Re&&Je.alternate===null&&n(te,Re),J=C(Je,J,Ue),Qe===null?Me=Je:Qe.sibling=Je,Qe=Je,Re=Ke}if(Ue===se.length)return i(te,Re),Ye&&Ci(te,Ue),Me;if(Re===null){for(;Ue<se.length;Ue++)Re=ye(te,se[Ue],me),Re!==null&&(J=C(Re,J,Ue),Qe===null?Me=Re:Qe.sibling=Re,Qe=Re);return Ye&&Ci(te,Ue),Me}for(Re=a(Re);Ue<se.length;Ue++)Ke=ce(Re,te,Ue,se[Ue],me),Ke!==null&&(e&&Ke.alternate!==null&&Re.delete(Ke.key===null?Ue:Ke.key),J=C(Ke,J,Ue),Qe===null?Me=Ke:Qe.sibling=Ke,Qe=Ke);return e&&Re.forEach(function(Sr){return n(te,Sr)}),Ye&&Ci(te,Ue),Me}function Oe(te,J,se,me){if(se==null)throw Error(l(151));for(var Me=null,Qe=null,Re=J,Ue=J=0,Ke=null,Je=se.next();Re!==null&&!Je.done;Ue++,Je=se.next()){Re.index>Ue?(Ke=Re,Re=null):Ke=Re.sibling;var Sr=oe(te,Re,Je.value,me);if(Sr===null){Re===null&&(Re=Ke);break}e&&Re&&Sr.alternate===null&&n(te,Re),J=C(Sr,J,Ue),Qe===null?Me=Sr:Qe.sibling=Sr,Qe=Sr,Re=Ke}if(Je.done)return i(te,Re),Ye&&Ci(te,Ue),Me;if(Re===null){for(;!Je.done;Ue++,Je=se.next())Je=ye(te,Je.value,me),Je!==null&&(J=C(Je,J,Ue),Qe===null?Me=Je:Qe.sibling=Je,Qe=Je);return Ye&&Ci(te,Ue),Me}for(Re=a(Re);!Je.done;Ue++,Je=se.next())Je=ce(Re,te,Ue,Je.value,me),Je!==null&&(e&&Je.alternate!==null&&Re.delete(Je.key===null?Ue:Je.key),J=C(Je,J,Ue),Qe===null?Me=Je:Qe.sibling=Je,Qe=Je);return e&&Re.forEach(function(L0){return n(te,L0)}),Ye&&Ci(te,Ue),Me}function st(te,J,se,me){if(typeof se=="object"&&se!==null&&se.type===E&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case w:e:{for(var Me=se.key;J!==null;){if(J.key===Me){if(Me=se.type,Me===E){if(J.tag===7){i(te,J.sibling),me=g(J,se.props.children),me.return=te,te=me;break e}}else if(J.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===k&&Ur(Me)===J.type){i(te,J.sibling),me=g(J,se.props),ma(me,se),me.return=te,te=me;break e}i(te,J);break}else n(te,J);J=J.sibling}se.type===E?(me=jr(se.props.children,te.mode,me,se.key),me.return=te,te=me):(me=yl(se.type,se.key,se.props,null,te.mode,me),ma(me,se),me.return=te,te=me)}return B(te);case T:e:{for(Me=se.key;J!==null;){if(J.key===Me)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){i(te,J.sibling),me=g(J,se.children||[]),me.return=te,te=me;break e}else{i(te,J);break}else n(te,J);J=J.sibling}me=cc(se,te.mode,me),me.return=te,te=me}return B(te);case k:return se=Ur(se),st(te,J,se,me)}if(K(se))return ke(te,J,se,me);if(U(se)){if(Me=U(se),typeof Me!="function")throw Error(l(150));return se=Me.call(se),Oe(te,J,se,me)}if(typeof se.then=="function")return st(te,J,kl(se),me);if(se.$$typeof===S)return st(te,J,Cl(te,se),me);Al(te,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,J!==null&&J.tag===6?(i(te,J.sibling),me=g(J,se),me.return=te,te=me):(i(te,J),me=oc(se,te.mode,me),me.return=te,te=me),B(te)):i(te,J)}return function(te,J,se,me){try{pa=0;var Me=st(te,J,se,me);return vs=null,Me}catch(Re){if(Re===_s||Re===xl)throw Re;var Qe=Cn(29,Re,null,te.mode);return Qe.lanes=me,Qe.return=te,Qe}finally{}}}var Fr=Vf(!0),Wf=Vf(!1),ir=!1;function bc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cc(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 rr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function sr(e,n,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(et&2)!==0){var g=a.pending;return g===null?n.next=n:(n.next=g.next,g.next=n),a.pending=n,n=vl(e),Df(e,null,i),n}return _l(e,a,n,i),vl(e)}function ga(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,Mn(e,i)}}function wc(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 B={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};C===null?g=C=B:C=C.next=B,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 xc=!1;function _a(){if(xc){var e=gs;if(e!==null)throw e}}function va(e,n,i,a){xc=!1;var g=e.updateQueue;ir=!1;var C=g.firstBaseUpdate,B=g.lastBaseUpdate,F=g.shared.pending;if(F!==null){g.shared.pending=null;var X=F,ae=X.next;X.next=null,B===null?C=ae:B.next=ae,B=X;var pe=e.alternate;pe!==null&&(pe=pe.updateQueue,F=pe.lastBaseUpdate,F!==B&&(F===null?pe.firstBaseUpdate=ae:F.next=ae,pe.lastBaseUpdate=X))}if(C!==null){var ye=g.baseState;B=0,pe=ae=X=null,F=C;do{var oe=F.lane&-536870913,ce=oe!==F.lane;if(ce?(We&oe)===oe:(a&oe)===oe){oe!==0&&oe===ms&&(xc=!0),pe!==null&&(pe=pe.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var ke=e,Oe=F;oe=n;var st=i;switch(Oe.tag){case 1:if(ke=Oe.payload,typeof ke=="function"){ye=ke.call(st,ye,oe);break e}ye=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Oe.payload,oe=typeof ke=="function"?ke.call(st,ye,oe):ke,oe==null)break e;ye=u({},ye,oe);break e;case 2:ir=!0}}oe=F.callback,oe!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=g.callbacks,ce===null?g.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:F.tag,payload:F.payload,callback:F.callback,next:null},pe===null?(ae=pe=ce,X=ye):pe=pe.next=ce,B|=oe;if(F=F.next,F===null){if(F=g.shared.pending,F===null)break;ce=F,F=ce.next,ce.next=null,g.lastBaseUpdate=ce,g.shared.pending=null}}while(!0);pe===null&&(X=ye),g.baseState=X,g.firstBaseUpdate=ae,g.lastBaseUpdate=pe,C===null&&(g.shared.lanes=0),ur|=B,e.lanes=B,e.memoizedState=ye}}function Kf(e,n){if(typeof e!="function")throw Error(l(191,e));e.call(n)}function Yf(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Kf(i[e],n)}var ys=N(null),Tl=N(0);function Xf(e,n){e=Oi,I(Tl,e),I(ys,n),Oi=e|n.baseLanes}function Ec(){I(Tl,Oi),I(ys,ys.current)}function kc(){Oi=Tl.current,$(ys),$(Tl)}var wn=N(null),zn=null;function ar(e){var n=e.alternate;I(kt,kt.current&1),I(wn,e),zn===null&&(n===null||ys.current!==null||n.memoizedState!==null)&&(zn=e)}function Ac(e){I(kt,kt.current),I(wn,e),zn===null&&(zn=e)}function Qf(e){e.tag===22?(I(kt,kt.current),I(wn,e),zn===null&&(zn=e)):lr()}function lr(){I(kt,kt.current),I(wn,wn.current)}function xn(e){$(wn),zn===e&&(zn=null),$(kt)}var kt=N(0);function Rl(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Ou(i)||Bu(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 Ei=0,Ie=null,it=null,Dt=null,Dl=!1,Ss=!1,qr=!1,Ml=0,ya=0,bs=null,Cy=0;function Ct(){throw Error(l(321))}function Tc(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 Rc(e,n,i,a,g,C){return Ei=C,Ie=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=e===null||e.memoizedState===null?Bd:$c,qr=!1,C=i(a,g),qr=!1,Ss&&(C=Zf(n,i,a,g)),Jf(e),C}function Jf(e){G.H=Ca;var n=it!==null&&it.next!==null;if(Ei=0,Dt=it=Ie=null,Dl=!1,ya=0,bs=null,n)throw Error(l(300));e===null||Mt||(e=e.dependencies,e!==null&&bl(e)&&(Mt=!0))}function Zf(e,n,i,a){Ie=e;var g=0;do{if(Ss&&(bs=null),ya=0,Ss=!1,25<=g)throw Error(l(301));if(g+=1,Dt=it=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=jd,C=n(i,a)}while(Ss);return C}function wy(){var e=G.H,n=e.useState()[0];return n=typeof n.then=="function"?Sa(n):n,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(Ie.flags|=1024),n}function Dc(){var e=Ml!==0;return Ml=0,e}function Mc(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function Lc(e){if(Dl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Dl=!1}Ei=0,Dt=it=Ie=null,Ss=!1,ya=Ml=0,bs=null}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?Ie.memoizedState=Dt=e:Dt=Dt.next=e,Dt}function At(){if(it===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var n=Dt===null?Ie.memoizedState:Dt.next;if(n!==null)Dt=n,it=e;else{if(e===null)throw Ie.alternate===null?Error(l(467)):Error(l(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Dt===null?Ie.memoizedState=Dt=e:Dt=Dt.next=e}return Dt}function Ll(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sa(e){var n=ya;return ya+=1,bs===null&&(bs=[]),e=qf(bs,e,n),n=Ie,(Dt===null?n.memoizedState:Dt.next)===null&&(n=n.alternate,G.H=n===null||n.memoizedState===null?Bd:$c),e}function Ol(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sa(e);if(e.$$typeof===S)return Ft(e)}throw Error(l(438,String(e)))}function Oc(e){var n=null,i=Ie.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var a=Ie.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=Ll(),Ie.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]=O;return n.index++,i}function ki(e,n){return typeof n=="function"?n(e):n}function Bl(e){var n=At();return Bc(n,it,e)}function Bc(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 B=g.next;g.next=C.next,C.next=B}n.baseQueue=g=C,a.pending=null}if(C=e.baseState,g===null)e.memoizedState=C;else{n=g.next;var F=B=null,X=null,ae=n,pe=!1;do{var ye=ae.lane&-536870913;if(ye!==ae.lane?(We&ye)===ye:(Ei&ye)===ye){var oe=ae.revertLane;if(oe===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),ye===ms&&(pe=!0);else if((Ei&oe)===oe){ae=ae.next,oe===ms&&(pe=!0);continue}else ye={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},X===null?(F=X=ye,B=C):X=X.next=ye,Ie.lanes|=oe,ur|=oe;ye=ae.action,qr&&i(C,ye),C=ae.hasEagerState?ae.eagerState:i(C,ye)}else oe={lane:ye,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},X===null?(F=X=oe,B=C):X=X.next=oe,Ie.lanes|=ye,ur|=ye;ae=ae.next}while(ae!==null&&ae!==n);if(X===null?B=C:X.next=F,!bn(C,e.memoizedState)&&(Mt=!0,pe&&(i=gs,i!==null)))throw i;e.memoizedState=C,e.baseState=B,e.baseQueue=X,a.lastRenderedState=C}return g===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function jc(e){var n=At(),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 B=g=g.next;do C=e(C,B.action),B=B.next;while(B!==g);bn(C,n.memoizedState)||(Mt=!0),n.memoizedState=C,n.baseQueue===null&&(n.baseState=C),i.lastRenderedState=C}return[C,a]}function ed(e,n,i){var a=Ie,g=At(),C=Ye;if(C){if(i===void 0)throw Error(l(407));i=i()}else i=n();var B=!bn((it||g).memoizedState,i);if(B&&(g.memoizedState=i,Mt=!0),g=g.queue,zc(id.bind(null,a,g,e),[e]),g.getSnapshot!==n||B||Dt!==null&&Dt.memoizedState.tag&1){if(a.flags|=2048,Cs(9,{destroy:void 0},nd.bind(null,a,g,i,n),null),at===null)throw Error(l(349));C||(Ei&127)!==0||td(a,n,i)}return i}function td(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Ie.updateQueue,n===null?(n=Ll(),Ie.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function nd(e,n,i,a){n.value=i,n.getSnapshot=a,rd(n)&&sd(e)}function id(e,n,i){return i(function(){rd(n)&&sd(e)})}function rd(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!bn(e,i)}catch{return!0}}function sd(e){var n=Br(e,2);n!==null&&dn(n,e,2)}function Nc(e){var n=tn();if(typeof e=="function"){var i=e;if(e=i(),qr){St(!0);try{i()}finally{St(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:e},n}function ad(e,n,i,a){return e.baseState=i,Bc(e,it,typeof a=="function"?a:ki)}function xy(e,n,i,a,g){if(Hl(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(B){C.listeners.push(B)}};G.T!==null?i(!0):C.isTransition=!1,a(C),i=n.pending,i===null?(C.next=n.pending=C,ld(n,C)):(C.next=i.next,n.pending=i.next=C)}}function ld(e,n){var i=n.action,a=n.payload,g=e.state;if(n.isTransition){var C=G.T,B={};G.T=B;try{var F=i(g,a),X=G.S;X!==null&&X(B,F),od(e,n,F)}catch(ae){Hc(e,n,ae)}finally{C!==null&&B.types!==null&&(C.types=B.types),G.T=C}}else try{C=i(g,a),od(e,n,C)}catch(ae){Hc(e,n,ae)}}function od(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){cd(e,n,a)},function(a){return Hc(e,n,a)}):cd(e,n,i)}function cd(e,n,i){n.status="fulfilled",n.value=i,ud(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,ld(e,i)))}function Hc(e,n,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do n.status="rejected",n.reason=i,ud(n),n=n.next;while(n!==a)}e.action=null}function ud(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function hd(e,n){return n}function fd(e,n){if(Ye){var i=at.formState;if(i!==null){e:{var a=Ie;if(Ye){if(ht){t:{for(var g=ht,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){ht=In(g.nextSibling),a=g.data==="F!";break e}}tr(a)}a=!1}a&&(n=i[0])}}return i=tn(),i.memoizedState=i.baseState=n,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hd,lastRenderedState:n},i.queue=a,i=Md.bind(null,Ie,a),a.dispatch=i,a=Nc(!1),C=qc.bind(null,Ie,!1,a.queue),a=tn(),g={state:n,dispatch:null,action:e,pending:null},a.queue=g,i=xy.bind(null,Ie,g,C,i),g.dispatch=i,a.memoizedState=e,[n,i,!1]}function dd(e){var n=At();return pd(n,it,e)}function pd(e,n,i){if(n=Bc(e,n,hd)[0],e=Bl(ki)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var a=Sa(n)}catch(B){throw B===_s?xl:B}else a=n;n=At();var g=n.queue,C=g.dispatch;return i!==n.memoizedState&&(Ie.flags|=2048,Cs(9,{destroy:void 0},Ey.bind(null,g,i),null)),[a,C,e]}function Ey(e,n){e.action=n}function md(e){var n=At(),i=it;if(i!==null)return pd(n,i,e);At(),n=n.memoizedState,i=At();var a=i.queue.dispatch;return i.memoizedState=e,[n,a,!1]}function Cs(e,n,i,a){return e={tag:e,create:i,deps:a,inst:n,next:null},n=Ie.updateQueue,n===null&&(n=Ll(),Ie.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 gd(){return At().memoizedState}function jl(e,n,i,a){var g=tn();Ie.flags|=e,g.memoizedState=Cs(1|n,{destroy:void 0},i,a===void 0?null:a)}function Nl(e,n,i,a){var g=At();a=a===void 0?null:a;var C=g.memoizedState.inst;it!==null&&a!==null&&Tc(a,it.memoizedState.deps)?g.memoizedState=Cs(n,C,i,a):(Ie.flags|=e,g.memoizedState=Cs(1|n,C,i,a))}function _d(e,n){jl(8390656,8,e,n)}function zc(e,n){Nl(2048,8,e,n)}function ky(e){Ie.flags|=4;var n=Ie.updateQueue;if(n===null)n=Ll(),Ie.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function vd(e){var n=At().memoizedState;return ky({ref:n,nextImpl:e}),function(){if((et&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function yd(e,n){return Nl(4,2,e,n)}function Sd(e,n){return Nl(4,4,e,n)}function bd(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 Cd(e,n,i){i=i!=null?i.concat([e]):null,Nl(4,4,bd.bind(null,n,e),i)}function Ic(){}function wd(e,n){var i=At();n=n===void 0?null:n;var a=i.memoizedState;return n!==null&&Tc(n,a[1])?a[0]:(i.memoizedState=[e,n],e)}function xd(e,n){var i=At();n=n===void 0?null:n;var a=i.memoizedState;if(n!==null&&Tc(n,a[1]))return a[0];if(a=e(),qr){St(!0);try{e()}finally{St(!1)}}return i.memoizedState=[a,n],a}function Uc(e,n,i){return i===void 0||(Ei&1073741824)!==0&&(We&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=Ep(),Ie.lanes|=e,ur|=e,i)}function Ed(e,n,i,a){return bn(i,n)?i:ys.current!==null?(e=Uc(e,i,a),bn(e,n)||(Mt=!0),e):(Ei&42)===0||(Ei&1073741824)!==0&&(We&261930)===0?(Mt=!0,e.memoizedState=i):(e=Ep(),Ie.lanes|=e,ur|=e,n)}function kd(e,n,i,a,g){var C=Y.p;Y.p=C!==0&&8>C?C:8;var B=G.T,F={};G.T=F,qc(e,!1,n,i);try{var X=g(),ae=G.S;if(ae!==null&&ae(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var pe=by(X,a);ba(e,n,pe,An(e))}else ba(e,n,a,An(e))}catch(ye){ba(e,n,{then:function(){},status:"rejected",reason:ye},An())}finally{Y.p=C,B!==null&&F.types!==null&&(B.types=F.types),G.T=B}}function Ay(){}function Pc(e,n,i,a){if(e.tag!==5)throw Error(l(476));var g=Ad(e).queue;kd(e,g,n,Z,i===null?Ay:function(){return Td(e),i(a)})}function Ad(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:Z},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ki,lastRenderedState:i},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Td(e){var n=Ad(e);n.next===null&&(n=e.alternate.memoizedState),ba(e,n.next.queue,{},An())}function Fc(){return Ft(za)}function Rd(){return At().memoizedState}function Dd(){return At().memoizedState}function Ty(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=An();e=rr(i);var a=sr(n,e,i);a!==null&&(dn(a,n,i),ga(a,n,i)),n={cache:_c()},e.payload=n;return}n=n.return}}function Ry(e,n,i){var a=An();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Hl(e)?Ld(n,i):(i=ac(e,n,i,a),i!==null&&(dn(i,e,a),Od(i,n,a)))}function Md(e,n,i){var a=An();ba(e,n,i,a)}function ba(e,n,i,a){var g={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Hl(e))Ld(n,g);else{var C=e.alternate;if(e.lanes===0&&(C===null||C.lanes===0)&&(C=n.lastRenderedReducer,C!==null))try{var B=n.lastRenderedState,F=C(B,i);if(g.hasEagerState=!0,g.eagerState=F,bn(F,B))return _l(e,n,g,0),at===null&&gl(),!1}catch{}finally{}if(i=ac(e,n,g,a),i!==null)return dn(i,e,a),Od(i,n,a),!0}return!1}function qc(e,n,i,a){if(a={lane:2,revertLane:bu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Hl(e)){if(n)throw Error(l(479))}else n=ac(e,i,a,2),n!==null&&dn(n,e,2)}function Hl(e){var n=e.alternate;return e===Ie||n!==null&&n===Ie}function Ld(e,n){Ss=Dl=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function Od(e,n,i){if((i&4194048)!==0){var a=n.lanes;a&=e.pendingLanes,i|=a,n.lanes=i,Mn(e,i)}}var Ca={readContext:Ft,use:Ol,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Ca.useEffectEvent=Ct;var Bd={readContext:Ft,use:Ol,useCallback:function(e,n){return tn().memoizedState=[e,n===void 0?null:n],e},useContext:Ft,useEffect:_d,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,jl(4194308,4,bd.bind(null,n,e),i)},useLayoutEffect:function(e,n){return jl(4194308,4,e,n)},useInsertionEffect:function(e,n){jl(4,2,e,n)},useMemo:function(e,n){var i=tn();n=n===void 0?null:n;var a=e();if(qr){St(!0);try{e()}finally{St(!1)}}return i.memoizedState=[a,n],a},useReducer:function(e,n,i){var a=tn();if(i!==void 0){var g=i(n);if(qr){St(!0);try{i(n)}finally{St(!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=Ry.bind(null,Ie,e),[a.memoizedState,e]},useRef:function(e){var n=tn();return e={current:e},n.memoizedState=e},useState:function(e){e=Nc(e);var n=e.queue,i=Md.bind(null,Ie,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:Ic,useDeferredValue:function(e,n){var i=tn();return Uc(i,e,n)},useTransition:function(){var e=Nc(!1);return e=kd.bind(null,Ie,e.queue,!0,!1),tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var a=Ie,g=tn();if(Ye){if(i===void 0)throw Error(l(407));i=i()}else{if(i=n(),at===null)throw Error(l(349));(We&127)!==0||td(a,n,i)}g.memoizedState=i;var C={value:i,getSnapshot:n};return g.queue=C,_d(id.bind(null,a,C,e),[e]),a.flags|=2048,Cs(9,{destroy:void 0},nd.bind(null,a,C,i,n),null),i},useId:function(){var e=tn(),n=at.identifierPrefix;if(Ye){var i=ai,a=si;i=(a&~(1<<32-Ze(a)-1)).toString(32)+i,n="_"+n+"R_"+i,i=Ml++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=Cy++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Fc,useFormState:fd,useActionState:fd,useOptimistic:function(e){var n=tn();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=qc.bind(null,Ie,!0,i),i.dispatch=n,[e,n]},useMemoCache:Oc,useCacheRefresh:function(){return tn().memoizedState=Ty.bind(null,Ie)},useEffectEvent:function(e){var n=tn(),i={impl:e};return n.memoizedState=i,function(){if((et&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},$c={readContext:Ft,use:Ol,useCallback:wd,useContext:Ft,useEffect:zc,useImperativeHandle:Cd,useInsertionEffect:yd,useLayoutEffect:Sd,useMemo:xd,useReducer:Bl,useRef:gd,useState:function(){return Bl(ki)},useDebugValue:Ic,useDeferredValue:function(e,n){var i=At();return Ed(i,it.memoizedState,e,n)},useTransition:function(){var e=Bl(ki)[0],n=At().memoizedState;return[typeof e=="boolean"?e:Sa(e),n]},useSyncExternalStore:ed,useId:Rd,useHostTransitionStatus:Fc,useFormState:dd,useActionState:dd,useOptimistic:function(e,n){var i=At();return ad(i,it,e,n)},useMemoCache:Oc,useCacheRefresh:Dd};$c.useEffectEvent=vd;var jd={readContext:Ft,use:Ol,useCallback:wd,useContext:Ft,useEffect:zc,useImperativeHandle:Cd,useInsertionEffect:yd,useLayoutEffect:Sd,useMemo:xd,useReducer:jc,useRef:gd,useState:function(){return jc(ki)},useDebugValue:Ic,useDeferredValue:function(e,n){var i=At();return it===null?Uc(i,e,n):Ed(i,it.memoizedState,e,n)},useTransition:function(){var e=jc(ki)[0],n=At().memoizedState;return[typeof e=="boolean"?e:Sa(e),n]},useSyncExternalStore:ed,useId:Rd,useHostTransitionStatus:Fc,useFormState:md,useActionState:md,useOptimistic:function(e,n){var i=At();return it!==null?ad(i,it,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Oc,useCacheRefresh:Dd};jd.useEffectEvent=vd;function Gc(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 Vc={enqueueSetState:function(e,n,i){e=e._reactInternals;var a=An(),g=rr(a);g.payload=n,i!=null&&(g.callback=i),n=sr(e,g,a),n!==null&&(dn(n,e,a),ga(n,e,a))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var a=An(),g=rr(a);g.tag=1,g.payload=n,i!=null&&(g.callback=i),n=sr(e,g,a),n!==null&&(dn(n,e,a),ga(n,e,a))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=An(),a=rr(i);a.tag=2,n!=null&&(a.callback=n),n=sr(e,a,i),n!==null&&(dn(n,e,i),ga(n,e,i))}};function Nd(e,n,i,a,g,C,B){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,C,B):n.prototype&&n.prototype.isPureReactComponent?!oa(i,a)||!oa(g,C):!0}function Hd(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&&Vc.enqueueReplaceState(n,n.state,null)}function $r(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 zd(e){ml(e)}function Id(e){console.error(e)}function Ud(e){ml(e)}function zl(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(a){setTimeout(function(){throw a})}}function Pd(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 Wc(e,n,i){return i=rr(i),i.tag=3,i.payload={element:null},i.callback=function(){zl(e,n)},i}function Fd(e){return e=rr(e),e.tag=3,e}function qd(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(){Pd(n,i,a)}}var B=i.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(e.callback=function(){Pd(n,i,a),typeof g!="function"&&(hr===null?hr=new Set([this]):hr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function Dy(e,n,i,a,g){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(n=i.alternate,n!==null&&ps(n,i,g,!0),i=wn.current,i!==null){switch(i.tag){case 31:case 13:return zn===null?Xl():i.alternate===null&&wt===0&&(wt=3),i.flags&=-257,i.flags|=65536,i.lanes=g,a===El?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([a]):n.add(a),vu(e,a,g)),!1;case 22:return i.flags|=65536,a===El?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)),vu(e,a,g)),!1}throw Error(l(435,i.tag))}return vu(e,a,g),Xl(),!1}if(Ye)return n=wn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=g,a!==fc&&(e=Error(l(422),{cause:a}),ha(Bn(e,i)))):(a!==fc&&(n=Error(l(423),{cause:a}),ha(Bn(n,i))),e=e.current.alternate,e.flags|=65536,g&=-g,e.lanes|=g,a=Bn(a,i),g=Wc(e.stateNode,a,g),wc(e,g),wt!==4&&(wt=2)),!1;var C=Error(l(520),{cause:a});if(C=Bn(C,i),Da===null?Da=[C]:Da.push(C),wt!==4&&(wt=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=Wc(i.stateNode,a,e),wc(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"&&(hr===null||!hr.has(C))))return i.flags|=65536,g&=-g,i.lanes|=g,g=Fd(g),qd(g,e,i,a),wc(i,g),!1}i=i.return}while(i!==null);return!1}var Kc=Error(l(461)),Mt=!1;function qt(e,n,i,a){n.child=e===null?Wf(n,null,i,a):Fr(n,e.child,i,a)}function $d(e,n,i,a,g){i=i.render;var C=n.ref;if("ref"in a){var B={};for(var F in a)F!=="ref"&&(B[F]=a[F])}else B=a;return zr(n),a=Rc(e,n,i,B,C,g),F=Dc(),e!==null&&!Mt?(Mc(e,n,g),Ai(e,n,g)):(Ye&&F&&uc(n),n.flags|=1,qt(e,n,a,g),n.child)}function Gd(e,n,i,a,g){if(e===null){var C=i.type;return typeof C=="function"&&!lc(C)&&C.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=C,Vd(e,n,C,a,g)):(e=yl(i.type,null,a,n,n.mode,g),e.ref=n.ref,e.return=n,n.child=e)}if(C=e.child,!nu(e,g)){var B=C.memoizedProps;if(i=i.compare,i=i!==null?i:oa,i(B,a)&&e.ref===n.ref)return Ai(e,n,g)}return n.flags|=1,e=bi(C,a),e.ref=n.ref,e.return=n,n.child=e}function Vd(e,n,i,a,g){if(e!==null){var C=e.memoizedProps;if(oa(C,a)&&e.ref===n.ref)if(Mt=!1,n.pendingProps=a=C,nu(e,g))(e.flags&131072)!==0&&(Mt=!0);else return n.lanes=e.lanes,Ai(e,n,g)}return Yc(e,n,i,a,g)}function Wd(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 Kd(e,n,C,i,a)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&wl(n,C!==null?C.cachePool:null),C!==null?Xf(n,C):Ec(),Qf(n);else return a=n.lanes=536870912,Kd(e,n,C!==null?C.baseLanes|i:i,i,a)}else C!==null?(wl(n,C.cachePool),Xf(n,C),lr(),n.memoizedState=null):(e!==null&&wl(n,null),Ec(),lr());return qt(e,n,g,i),n.child}function wa(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Kd(e,n,i,a,g){var C=yc();return C=C===null?null:{parent:Rt._currentValue,pool:C},n.memoizedState={baseLanes:i,cachePool:C},e!==null&&wl(n,null),Ec(),Qf(n),e!==null&&ps(e,n,a,!0),n.childLanes=g,null}function Il(e,n){return n=Pl({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Yd(e,n,i){return Fr(n,e.child,null,i),e=Il(n,n.pendingProps),e.flags|=2,xn(n),n.memoizedState=null,e}function My(e,n,i){var a=n.pendingProps,g=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Ye){if(a.mode==="hidden")return e=Il(n,a),n.lanes=536870912,wa(null,e);if(Ac(n),(e=ht)?(e=lm(e,Hn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Zi!==null?{id:si,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},i=Lf(e),i.return=n,n.child=i,Pt=n,ht=null)):e=null,e===null)throw tr(n);return n.lanes=536870912,null}return Il(n,a)}var C=e.memoizedState;if(C!==null){var B=C.dehydrated;if(Ac(n),g)if(n.flags&256)n.flags&=-257,n=Yd(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(l(558));else if(Mt||ps(e,n,i,!1),g=(i&e.childLanes)!==0,Mt||g){if(a=at,a!==null&&(B=sn(a,i),B!==0&&B!==C.retryLane))throw C.retryLane=B,Br(e,B),dn(a,e,B),Kc;Xl(),n=Yd(e,n,i)}else e=C.treeContext,ht=In(B.nextSibling),Pt=n,Ye=!0,er=null,Hn=!1,e!==null&&jf(n,e),n=Il(n,a),n.flags|=4096;return n}return e=bi(e.child,{mode:a.mode,children:a.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Ul(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 Yc(e,n,i,a,g){return zr(n),i=Rc(e,n,i,a,void 0,g),a=Dc(),e!==null&&!Mt?(Mc(e,n,g),Ai(e,n,g)):(Ye&&a&&uc(n),n.flags|=1,qt(e,n,i,g),n.child)}function Xd(e,n,i,a,g,C){return zr(n),n.updateQueue=null,i=Zf(n,a,i,g),Jf(e),a=Dc(),e!==null&&!Mt?(Mc(e,n,C),Ai(e,n,C)):(Ye&&a&&uc(n),n.flags|=1,qt(e,n,i,C),n.child)}function Qd(e,n,i,a,g){if(zr(n),n.stateNode===null){var C=us,B=i.contextType;typeof B=="object"&&B!==null&&(C=Ft(B)),C=new i(a,C),n.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=Vc,n.stateNode=C,C._reactInternals=n,C=n.stateNode,C.props=a,C.state=n.memoizedState,C.refs={},bc(n),B=i.contextType,C.context=typeof B=="object"&&B!==null?Ft(B):us,C.state=n.memoizedState,B=i.getDerivedStateFromProps,typeof B=="function"&&(Gc(n,i,B,a),C.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(B=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),B!==C.state&&Vc.enqueueReplaceState(C,C.state,null),va(n,a,C,g),_a(),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=$r(i,F);C.props=X;var ae=C.context,pe=i.contextType;B=us,typeof pe=="object"&&pe!==null&&(B=Ft(pe));var ye=i.getDerivedStateFromProps;pe=typeof ye=="function"||typeof C.getSnapshotBeforeUpdate=="function",F=n.pendingProps!==F,pe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F||ae!==B)&&Hd(n,C,a,B),ir=!1;var oe=n.memoizedState;C.state=oe,va(n,a,C,g),_a(),ae=n.memoizedState,F||oe!==ae||ir?(typeof ye=="function"&&(Gc(n,i,ye,a),ae=n.memoizedState),(X=ir||Nd(n,i,X,a,oe,ae,B))?(pe||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=ae),C.props=a,C.state=ae,C.context=B,a=X):(typeof C.componentDidMount=="function"&&(n.flags|=4194308),a=!1)}else{C=n.stateNode,Cc(e,n),B=n.memoizedProps,pe=$r(i,B),C.props=pe,ye=n.pendingProps,oe=C.context,ae=i.contextType,X=us,typeof ae=="object"&&ae!==null&&(X=Ft(ae)),F=i.getDerivedStateFromProps,(ae=typeof F=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(B!==ye||oe!==X)&&Hd(n,C,a,X),ir=!1,oe=n.memoizedState,C.state=oe,va(n,a,C,g),_a();var ce=n.memoizedState;B!==ye||oe!==ce||ir||e!==null&&e.dependencies!==null&&bl(e.dependencies)?(typeof F=="function"&&(Gc(n,i,F,a),ce=n.memoizedState),(pe=ir||Nd(n,i,pe,a,oe,ce,X)||e!==null&&e.dependencies!==null&&bl(e.dependencies))?(ae||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(a,ce,X),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(a,ce,X)),typeof C.componentDidUpdate=="function"&&(n.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof C.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(n.flags|=1024),n.memoizedProps=a,n.memoizedState=ce),C.props=a,C.state=ce,C.context=X,a=pe):(typeof C.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(n.flags|=1024),a=!1)}return C=a,Ul(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=Fr(n,e.child,null,g),n.child=Fr(n,null,i,g)):qt(e,n,i,g),n.memoizedState=C.state,e=n.child):e=Ai(e,n,g),e}function Jd(e,n,i,a){return Nr(),n.flags|=256,qt(e,n,i,a),n.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Pf()}}function Jc(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=kn),e}function Zd(e,n,i){var a=n.pendingProps,g=!1,C=(n.flags&128)!==0,B;if((B=C)||(B=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),B&&(g=!0,n.flags&=-129),B=(n.flags&32)!==0,n.flags&=-33,e===null){if(Ye){if(g?ar(n):lr(),(e=ht)?(e=lm(e,Hn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Zi!==null?{id:si,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},i=Lf(e),i.return=n,n.child=i,Pt=n,ht=null)):e=null,e===null)throw tr(n);return Bu(e)?n.lanes=32:n.lanes=536870912,null}var F=a.children;return a=a.fallback,g?(lr(),g=n.mode,F=Pl({mode:"hidden",children:F},g),a=jr(a,g,i,null),F.return=n,a.return=n,F.sibling=a,n.child=F,a=n.child,a.memoizedState=Qc(i),a.childLanes=Jc(e,B,i),n.memoizedState=Xc,wa(null,a)):(ar(n),Zc(n,F))}var X=e.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(C)n.flags&256?(ar(n),n.flags&=-257,n=eu(e,n,i)):n.memoizedState!==null?(lr(),n.child=e.child,n.flags|=128,n=null):(lr(),F=a.fallback,g=n.mode,a=Pl({mode:"visible",children:a.children},g),F=jr(F,g,i,null),F.flags|=2,a.return=n,F.return=n,a.sibling=F,n.child=a,Fr(n,e.child,null,i),a=n.child,a.memoizedState=Qc(i),a.childLanes=Jc(e,B,i),n.memoizedState=Xc,n=wa(null,a));else if(ar(n),Bu(F)){if(B=F.nextSibling&&F.nextSibling.dataset,B)var ae=B.dgst;B=ae,a=Error(l(419)),a.stack="",a.digest=B,ha({value:a,source:null,stack:null}),n=eu(e,n,i)}else if(Mt||ps(e,n,i,!1),B=(i&e.childLanes)!==0,Mt||B){if(B=at,B!==null&&(a=sn(B,i),a!==0&&a!==X.retryLane))throw X.retryLane=a,Br(e,a),dn(B,e,a),Kc;Ou(F)||Xl(),n=eu(e,n,i)}else Ou(F)?(n.flags|=192,n.child=e.child,n=null):(e=X.treeContext,ht=In(F.nextSibling),Pt=n,Ye=!0,er=null,Hn=!1,e!==null&&jf(n,e),n=Zc(n,a.children),n.flags|=4096);return n}return g?(lr(),F=a.fallback,g=n.mode,X=e.child,ae=X.sibling,a=bi(X,{mode:"hidden",children:a.children}),a.subtreeFlags=X.subtreeFlags&65011712,ae!==null?F=bi(ae,F):(F=jr(F,g,i,null),F.flags|=2),F.return=n,a.return=n,a.sibling=F,n.child=a,wa(null,a),a=n.child,F=e.child.memoizedState,F===null?F=Qc(i):(g=F.cachePool,g!==null?(X=Rt._currentValue,g=g.parent!==X?{parent:X,pool:X}:g):g=Pf(),F={baseLanes:F.baseLanes|i,cachePool:g}),a.memoizedState=F,a.childLanes=Jc(e,B,i),n.memoizedState=Xc,wa(e.child,a)):(ar(n),i=e.child,e=i.sibling,i=bi(i,{mode:"visible",children:a.children}),i.return=n,i.sibling=null,e!==null&&(B=n.deletions,B===null?(n.deletions=[e],n.flags|=16):B.push(e)),n.child=i,n.memoizedState=null,i)}function Zc(e,n){return n=Pl({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Pl(e,n){return e=Cn(22,e,null,n),e.lanes=0,e}function eu(e,n,i){return Fr(n,e.child,null,i),e=Zc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function ep(e,n,i){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n),mc(e.return,n,i)}function tu(e,n,i,a,g,C){var B=e.memoizedState;B===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:g,treeForkCount:C}:(B.isBackwards=n,B.rendering=null,B.renderingStartTime=0,B.last=a,B.tail=i,B.tailMode=g,B.treeForkCount=C)}function tp(e,n,i){var a=n.pendingProps,g=a.revealOrder,C=a.tail;a=a.children;var B=kt.current,F=(B&2)!==0;if(F?(B=B&1|2,n.flags|=128):B&=1,I(kt,B),qt(e,n,a,i),a=Ye?ua:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ep(e,i,n);else if(e.tag===19)ep(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&&Rl(e)===null&&(g=i),i=i.sibling;i=g,i===null?(g=n.child,n.child=null):(g=i.sibling,i.sibling=null),tu(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&&Rl(e)===null){n.child=g;break}e=g.sibling,g.sibling=i,i=g,g=e}tu(n,!0,i,null,C,a);break;case"together":tu(n,!1,null,null,void 0,a);break;default:n.memoizedState=null}return n.child}function Ai(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),ur|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(ps(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=bi(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=bi(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function nu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&bl(e)))}function Ly(e,n,i){switch(n.tag){case 3:q(n,n.stateNode.containerInfo),nr(n,Rt,e.memoizedState.cache),Nr();break;case 27:case 5:le(n);break;case 4:q(n,n.stateNode.containerInfo);break;case 10:nr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ac(n),null;break;case 13:var a=n.memoizedState;if(a!==null)return a.dehydrated!==null?(ar(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Zd(e,n,i):(ar(n),e=Ai(e,n,i),e!==null?e.sibling:null);ar(n);break;case 19:var g=(e.flags&128)!==0;if(a=(i&n.childLanes)!==0,a||(ps(e,n,i,!1),a=(i&n.childLanes)!==0),g){if(a)return tp(e,n,i);n.flags|=128}if(g=n.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),I(kt,kt.current),a)break;return null;case 22:return n.lanes=0,Wd(e,n,i,n.pendingProps);case 24:nr(n,Rt,e.memoizedState.cache)}return Ai(e,n,i)}function np(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)Mt=!0;else{if(!nu(e,i)&&(n.flags&128)===0)return Mt=!1,Ly(e,n,i);Mt=(e.flags&131072)!==0}else Mt=!1,Ye&&(n.flags&1048576)!==0&&Bf(n,ua,n.index);switch(n.lanes=0,n.tag){case 16:e:{var a=n.pendingProps;if(e=Ur(n.elementType),n.type=e,typeof e=="function")lc(e)?(a=$r(e,a),n.tag=1,n=Qd(null,n,e,a,i)):(n.tag=0,n=Yc(null,n,e,a,i));else{if(e!=null){var g=e.$$typeof;if(g===A){n.tag=11,n=$d(null,n,e,a,i);break e}else if(g===D){n.tag=14,n=Gd(null,n,e,a,i);break e}}throw n=W(e)||e,Error(l(306,n,""))}}return n;case 0:return Yc(e,n,n.type,n.pendingProps,i);case 1:return a=n.type,g=$r(a,n.pendingProps),Qd(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,Cc(e,n),va(n,a,null,i);var B=n.memoizedState;if(a=B.cache,nr(n,Rt,a),a!==C.cache&&gc(n,[Rt],i,!0),_a(),a=B.element,C.isDehydrated)if(C={element:a,isDehydrated:!1,cache:B.cache},n.updateQueue.baseState=C,n.memoizedState=C,n.flags&256){n=Jd(e,n,a,i);break e}else if(a!==g){g=Bn(Error(l(424)),n),ha(g),n=Jd(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(ht=In(e.firstChild),Pt=n,Ye=!0,er=null,Hn=!0,i=Wf(n,null,a,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Nr(),a===g){n=Ai(e,n,i);break e}qt(e,n,a,i)}n=n.child}return n;case 26:return Ul(e,n),e===null?(i=dm(n.type,null,n.pendingProps,null))?n.memoizedState=i:Ye||(i=n.type,e=n.pendingProps,a=io(ge.current).createElement(i),a[Et]=n,a[It]=e,$t(a,i,e),pt(a),n.stateNode=a):n.memoizedState=dm(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return le(n),e===null&&Ye&&(a=n.stateNode=um(n.type,n.pendingProps,ge.current),Pt=n,Hn=!0,g=ht,mr(n.type)?(ju=g,ht=In(a.firstChild)):ht=g),qt(e,n,n.pendingProps.children,i),Ul(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Ye&&((g=a=ht)&&(a=o0(a,n.type,n.pendingProps,Hn),a!==null?(n.stateNode=a,Pt=n,ht=In(a.firstChild),Hn=!1,g=!0):g=!1),g||tr(n)),le(n),g=n.type,C=n.pendingProps,B=e!==null?e.memoizedProps:null,a=C.children,Du(g,C)?a=null:B!==null&&Du(g,B)&&(n.flags|=32),n.memoizedState!==null&&(g=Rc(e,n,wy,null,null,i),za._currentValue=g),Ul(e,n),qt(e,n,a,i),n.child;case 6:return e===null&&Ye&&((e=i=ht)&&(i=c0(i,n.pendingProps,Hn),i!==null?(n.stateNode=i,Pt=n,ht=null,e=!0):e=!1),e||tr(n)),null;case 13:return Zd(e,n,i);case 4:return q(n,n.stateNode.containerInfo),a=n.pendingProps,e===null?n.child=Fr(n,null,a,i):qt(e,n,a,i),n.child;case 11:return $d(e,n,n.type,n.pendingProps,i);case 7:return qt(e,n,n.pendingProps,i),n.child;case 8:return qt(e,n,n.pendingProps.children,i),n.child;case 12:return qt(e,n,n.pendingProps.children,i),n.child;case 10:return a=n.pendingProps,nr(n,n.type,a.value),qt(e,n,a.children,i),n.child;case 9:return g=n.type._context,a=n.pendingProps.children,zr(n),g=Ft(g),a=a(g),n.flags|=1,qt(e,n,a,i),n.child;case 14:return Gd(e,n,n.type,n.pendingProps,i);case 15:return Vd(e,n,n.type,n.pendingProps,i);case 19:return tp(e,n,i);case 31:return My(e,n,i);case 22:return Wd(e,n,i,n.pendingProps);case 24:return zr(n),a=Ft(Rt),e===null?(g=yc(),g===null&&(g=at,C=_c(),g.pooledCache=C,C.refCount++,C!==null&&(g.pooledCacheLanes|=i),g=C),n.memoizedState={parent:a,cache:g},bc(n),nr(n,Rt,g)):((e.lanes&i)!==0&&(Cc(e,n),va(n,null,null,i),_a()),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),nr(n,Rt,a)):(a=C.cache,nr(n,Rt,a),a!==g.cache&&gc(n,[Rt],i,!0))),qt(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function Ti(e){e.flags|=4}function iu(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(Rp())e.flags|=8192;else throw Pr=El,Sc}else e.flags&=-16777217}function ip(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vm(n))if(Rp())e.flags|=8192;else throw Pr=El,Sc}function Fl(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?zi():536870912,e.lanes|=n,ks|=n)}function xa(e,n){if(!Ye)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 ft(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 Oy(e,n,i){var a=n.pendingProps;switch(hc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(n),null;case 1:return ft(n),null;case 3:return i=n.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),xi(Rt),ue(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ds(n)?Ti(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,dc())),ft(n),null;case 26:var g=n.type,C=n.memoizedState;return e===null?(Ti(n),C!==null?(ft(n),ip(n,C)):(ft(n),iu(n,g,null,a,i))):C?C!==e.memoizedState?(Ti(n),ft(n),ip(n,C)):(ft(n),n.flags&=-16777217):(e=e.memoizedProps,e!==a&&Ti(n),ft(n),iu(n,g,e,a,i)),null;case 27:if(he(n),i=ge.current,g=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&Ti(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return ft(n),null}e=ie.current,ds(n)?Nf(n):(e=um(g,a,i),n.stateNode=e,Ti(n))}return ft(n),null;case 5:if(he(n),g=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&Ti(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return ft(n),null}if(C=ie.current,ds(n))Nf(n);else{var B=io(ge.current);switch(C){case 1:C=B.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:C=B.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":C=B.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":C=B.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":C=B.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof a.is=="string"?B.createElement("select",{is:a.is}):B.createElement("select"),a.multiple?C.multiple=!0:a.size&&(C.size=a.size);break;default:C=typeof a.is=="string"?B.createElement(g,{is:a.is}):B.createElement(g)}}C[Et]=n,C[It]=a;e:for(B=n.child;B!==null;){if(B.tag===5||B.tag===6)C.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===n)break e;for(;B.sibling===null;){if(B.return===null||B.return===n)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}n.stateNode=C;e:switch($t(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&&Ti(n)}}return ft(n),iu(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,i),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==a&&Ti(n);else{if(typeof a!="string"&&n.stateNode===null)throw Error(l(166));if(e=ge.current,ds(n)){if(e=n.stateNode,i=n.memoizedProps,a=null,g=Pt,g!==null)switch(g.tag){case 27:case 5:a=g.memoizedProps}e[Et]=n,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Zp(e.nodeValue,i)),e||tr(n,!0)}else e=io(e).createTextNode(a),e[Et]=n,n.stateNode=e}return ft(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(a=ds(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[Et]=n}else Nr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ft(n),e=!1}else i=dc(),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 ft(n),null;case 13:if(a=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(g=ds(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[Et]=n}else Nr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;ft(n),g=!1}else g=dc(),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),Fl(n,n.updateQueue),ft(n),null);case 4:return ue(),e===null&&Eu(n.stateNode.containerInfo),ft(n),null;case 10:return xi(n.type),ft(n),null;case 19:if($(kt),a=n.memoizedState,a===null)return ft(n),null;if(g=(n.flags&128)!==0,C=a.rendering,C===null)if(g)xa(a,!1);else{if(wt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(C=Rl(e),C!==null){for(n.flags|=128,xa(a,!1),e=C.updateQueue,n.updateQueue=e,Fl(n,e),n.subtreeFlags=0,e=i,i=n.child;i!==null;)Mf(i,e),i=i.sibling;return I(kt,kt.current&1|2),Ye&&Ci(n,a.treeForkCount),n.child}e=e.sibling}a.tail!==null&&ut()>Wl&&(n.flags|=128,g=!0,xa(a,!1),n.lanes=4194304)}else{if(!g)if(e=Rl(C),e!==null){if(n.flags|=128,g=!0,e=e.updateQueue,n.updateQueue=e,Fl(n,e),xa(a,!0),a.tail===null&&a.tailMode==="hidden"&&!C.alternate&&!Ye)return ft(n),null}else 2*ut()-a.renderingStartTime>Wl&&i!==536870912&&(n.flags|=128,g=!0,xa(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=ut(),e.sibling=null,i=kt.current,I(kt,g?i&1|2:i&1),Ye&&Ci(n,a.treeForkCount),e):(ft(n),null);case 22:case 23:return xn(n),kc(),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&&(ft(n),n.subtreeFlags&6&&(n.flags|=8192)):ft(n),i=n.updateQueue,i!==null&&Fl(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&&$(Ir),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),xi(Rt),ft(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function By(e,n){switch(hc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return xi(Rt),ue(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return he(n),null;case 31:if(n.memoizedState!==null){if(xn(n),n.alternate===null)throw Error(l(340));Nr()}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));Nr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $(kt),null;case 4:return ue(),null;case 10:return xi(n.type),null;case 22:case 23:return xn(n),kc(),e!==null&&$(Ir),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return xi(Rt),null;case 25:return null;default:return null}}function rp(e,n){switch(hc(n),n.tag){case 3:xi(Rt),ue();break;case 26:case 27:case 5:he(n);break;case 4:ue();break;case 31:n.memoizedState!==null&&xn(n);break;case 13:xn(n);break;case 19:$(kt);break;case 10:xi(n.type);break;case 22:case 23:xn(n),kc(),e!==null&&$(Ir);break;case 24:xi(Rt)}}function Ea(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,B=i.inst;a=C(),B.destroy=a}i=i.next}while(i!==g)}}catch(F){nt(n,n.return,F)}}function or(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 B=a.inst,F=B.destroy;if(F!==void 0){B.destroy=void 0,g=n;var X=i,ae=F;try{ae()}catch(pe){nt(g,X,pe)}}}a=a.next}while(a!==C)}}catch(pe){nt(n,n.return,pe)}}function sp(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{Yf(n,i)}catch(a){nt(e,e.return,a)}}}function ap(e,n,i){i.props=$r(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){nt(e,n,a)}}function ka(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){nt(e,n,g)}}function li(e,n){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(g){nt(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){nt(e,n,g)}else i.current=null}function lp(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){nt(e,e.return,g)}}function ru(e,n,i){try{var a=e.stateNode;n0(a,e.type,i,n),a[It]=n}catch(g){nt(e,e.return,g)}}function op(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mr(e.type)||e.tag===4}function su(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||op(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&&mr(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 au(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=Sn));else if(a!==4&&(a===27&&mr(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(au(e,n,i),e=e.sibling;e!==null;)au(e,n,i),e=e.sibling}function ql(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&&mr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(ql(e,n,i),e=e.sibling;e!==null;)ql(e,n,i),e=e.sibling}function cp(e){var n=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,g=n.attributes;g.length;)n.removeAttributeNode(g[0]);$t(n,a,i),n[Et]=e,n[It]=i}catch(C){nt(e,e.return,C)}}var Ri=!1,Lt=!1,lu=!1,up=typeof WeakSet=="function"?WeakSet:Set,zt=null;function jy(e,n){if(e=e.containerInfo,Tu=uo,e=Cf(e),ec(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 B=0,F=-1,X=-1,ae=0,pe=0,ye=e,oe=null;t:for(;;){for(var ce;ye!==i||g!==0&&ye.nodeType!==3||(F=B+g),ye!==C||a!==0&&ye.nodeType!==3||(X=B+a),ye.nodeType===3&&(B+=ye.nodeValue.length),(ce=ye.firstChild)!==null;)oe=ye,ye=ce;for(;;){if(ye===e)break t;if(oe===i&&++ae===g&&(F=B),oe===C&&++pe===a&&(X=B),(ce=ye.nextSibling)!==null)break;ye=oe,oe=ye.parentNode}ye=ce}i=F===-1||X===-1?null:{start:F,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ru={focusedElem:e,selectionRange:i},uo=!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 ke=$r(i.type,g);e=a.getSnapshotBeforeUpdate(ke,C),a.__reactInternalSnapshotBeforeUpdate=e}catch(Oe){nt(i,i.return,Oe)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)Lu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lu(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 hp(e,n,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Mi(e,i),a&4&&Ea(5,i);break;case 1:if(Mi(e,i),a&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(B){nt(i,i.return,B)}else{var g=$r(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(g,n,e.__reactInternalSnapshotBeforeUpdate)}catch(B){nt(i,i.return,B)}}a&64&&sp(i),a&512&&ka(i,i.return);break;case 3:if(Mi(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{Yf(e,n)}catch(B){nt(i,i.return,B)}}break;case 27:n===null&&a&4&&cp(i);case 26:case 5:Mi(e,i),n===null&&a&4&&lp(i),a&512&&ka(i,i.return);break;case 12:Mi(e,i);break;case 31:Mi(e,i),a&4&&pp(e,i);break;case 13:Mi(e,i),a&4&&mp(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=$y.bind(null,i),u0(e,i))));break;case 22:if(a=i.memoizedState!==null||Ri,!a){n=n!==null&&n.memoizedState!==null||Lt,g=Ri;var C=Lt;Ri=a,(Lt=n)&&!C?Li(e,i,(i.subtreeFlags&8772)!==0):Mi(e,i),Ri=g,Lt=C}break;case 30:break;default:Mi(e,i)}}function fp(e){var n=e.alternate;n!==null&&(e.alternate=null,fp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Pi(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 mt=null,cn=!1;function Di(e,n,i){for(i=i.child;i!==null;)dp(e,n,i),i=i.sibling}function dp(e,n,i){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(_t,i)}catch{}switch(i.tag){case 26:Lt||li(i,n),Di(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Lt||li(i,n);var a=mt,g=cn;mr(i.type)&&(mt=i.stateNode,cn=!1),Di(e,n,i),ja(i.stateNode),mt=a,cn=g;break;case 5:Lt||li(i,n);case 6:if(a=mt,g=cn,mt=null,Di(e,n,i),mt=a,cn=g,mt!==null)if(cn)try{(mt.nodeType===9?mt.body:mt.nodeName==="HTML"?mt.ownerDocument.body:mt).removeChild(i.stateNode)}catch(C){nt(i,n,C)}else try{mt.removeChild(i.stateNode)}catch(C){nt(i,n,C)}break;case 18:mt!==null&&(cn?(e=mt,sm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Bs(e)):sm(mt,i.stateNode));break;case 4:a=mt,g=cn,mt=i.stateNode.containerInfo,cn=!0,Di(e,n,i),mt=a,cn=g;break;case 0:case 11:case 14:case 15:or(2,i,n),Lt||or(4,i,n),Di(e,n,i);break;case 1:Lt||(li(i,n),a=i.stateNode,typeof a.componentWillUnmount=="function"&&ap(i,n,a)),Di(e,n,i);break;case 21:Di(e,n,i);break;case 22:Lt=(a=Lt)||i.memoizedState!==null,Di(e,n,i),Lt=a;break;default:Di(e,n,i)}}function pp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bs(e)}catch(i){nt(n,n.return,i)}}}function mp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bs(e)}catch(i){nt(n,n.return,i)}}function Ny(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new up),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new up),n;default:throw Error(l(435,e.tag))}}function $l(e,n){var i=Ny(e);n.forEach(function(a){if(!i.has(a)){i.add(a);var g=Gy.bind(null,e,a);a.then(g,g)}})}function un(e,n){var i=n.deletions;if(i!==null)for(var a=0;a<i.length;a++){var g=i[a],C=e,B=n,F=B;e:for(;F!==null;){switch(F.tag){case 27:if(mr(F.type)){mt=F.stateNode,cn=!1;break e}break;case 5:mt=F.stateNode,cn=!1;break e;case 3:case 4:mt=F.stateNode.containerInfo,cn=!0;break e}F=F.return}if(mt===null)throw Error(l(160));dp(C,B,g),mt=null,cn=!1,C=g.alternate,C!==null&&(C.return=null),g.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)gp(n,e),n=n.sibling}var Vn=null;function gp(e,n){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:un(n,e),hn(e),a&4&&(or(3,e,e.return),Ea(3,e),or(5,e,e.return));break;case 1:un(n,e),hn(e),a&512&&(Lt||i===null||li(i,i.return)),a&64&&Ri&&(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=Vn;if(un(n,e),hn(e),a&512&&(Lt||i===null||li(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[Ui]||C[Et]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=g.createElement(a),g.head.insertBefore(C,g.querySelector("head > title"))),$t(C,a,i),C[Et]=e,pt(C),a=C;break e;case"link":var B=gm("link","href",g).get(a+(i.href||""));if(B){for(var F=0;F<B.length;F++)if(C=B[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)){B.splice(F,1);break t}}C=g.createElement(a),$t(C,a,i),g.head.appendChild(C);break;case"meta":if(B=gm("meta","content",g).get(a+(i.content||""))){for(F=0;F<B.length;F++)if(C=B[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)){B.splice(F,1);break t}}C=g.createElement(a),$t(C,a,i),g.head.appendChild(C);break;default:throw Error(l(468,a))}C[Et]=e,pt(C),a=C}e.stateNode=a}else _m(g,e.type,e.stateNode);else e.stateNode=mm(g,a,e.memoizedProps);else C!==a?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,a===null?_m(g,e.type,e.stateNode):mm(g,a,e.memoizedProps)):a===null&&e.stateNode!==null&&ru(e,e.memoizedProps,i.memoizedProps)}break;case 27:un(n,e),hn(e),a&512&&(Lt||i===null||li(i,i.return)),i!==null&&a&4&&ru(e,e.memoizedProps,i.memoizedProps);break;case 5:if(un(n,e),hn(e),a&512&&(Lt||i===null||li(i,i.return)),e.flags&32){g=e.stateNode;try{Wi(g,"")}catch(ke){nt(e,e.return,ke)}}a&4&&e.stateNode!=null&&(g=e.memoizedProps,ru(e,g,i!==null?i.memoizedProps:g)),a&1024&&(lu=!0);break;case 6:if(un(n,e),hn(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(ke){nt(e,e.return,ke)}}break;case 3:if(ao=null,g=Vn,Vn=ro(n.containerInfo),un(n,e),Vn=g,hn(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Bs(n.containerInfo)}catch(ke){nt(e,e.return,ke)}lu&&(lu=!1,_p(e));break;case 4:a=Vn,Vn=ro(e.stateNode.containerInfo),un(n,e),hn(e),Vn=a;break;case 12:un(n,e),hn(e);break;case 31:un(n,e),hn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,$l(e,a)));break;case 13:un(n,e),hn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Vl=ut()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,$l(e,a)));break;case 22:g=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,ae=Ri,pe=Lt;if(Ri=ae||g,Lt=pe||X,un(n,e),Lt=pe,Ri=ae,hn(e),a&8192)e:for(n=e.stateNode,n._visibility=g?n._visibility&-2:n._visibility|1,g&&(i===null||X||Ri||Lt||Gr(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){X=i=n;try{if(C=X.stateNode,g)B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{F=X.stateNode;var ye=X.memoizedProps.style,oe=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;F.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(ke){nt(X,X.return,ke)}}}else if(n.tag===6){if(i===null){X=n;try{X.stateNode.nodeValue=g?"":X.memoizedProps}catch(ke){nt(X,X.return,ke)}}}else if(n.tag===18){if(i===null){X=n;try{var ce=X.stateNode;g?am(ce,!0):am(X.stateNode,!1)}catch(ke){nt(X,X.return,ke)}}}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,$l(e,i))));break;case 19:un(n,e),hn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,$l(e,a)));break;case 30:break;case 21:break;default:un(n,e),hn(e)}}function hn(e){var n=e.flags;if(n&2){try{for(var i,a=e.return;a!==null;){if(op(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var g=i.stateNode,C=su(e);ql(e,C,g);break;case 5:var B=i.stateNode;i.flags&32&&(Wi(B,""),i.flags&=-33);var F=su(e);ql(e,F,B);break;case 3:case 4:var X=i.stateNode.containerInfo,ae=su(e);au(e,ae,X);break;default:throw Error(l(161))}}catch(pe){nt(e,e.return,pe)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function _p(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;_p(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Mi(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)hp(e,n.alternate,n),n=n.sibling}function Gr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:or(4,n,n.return),Gr(n);break;case 1:li(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&ap(n,n.return,i),Gr(n);break;case 27:ja(n.stateNode);case 26:case 5:li(n,n.return),Gr(n);break;case 22:n.memoizedState===null&&Gr(n);break;case 30:Gr(n);break;default:Gr(n)}e=e.sibling}}function Li(e,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var a=n.alternate,g=e,C=n,B=C.flags;switch(C.tag){case 0:case 11:case 15:Li(g,C,i),Ea(4,C);break;case 1:if(Li(g,C,i),a=C,g=a.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ae){nt(a,a.return,ae)}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++)Kf(X[g],F)}catch(ae){nt(a,a.return,ae)}}i&&B&64&&sp(C),ka(C,C.return);break;case 27:cp(C);case 26:case 5:Li(g,C,i),i&&a===null&&B&4&&lp(C),ka(C,C.return);break;case 12:Li(g,C,i);break;case 31:Li(g,C,i),i&&B&4&&pp(g,C);break;case 13:Li(g,C,i),i&&B&4&&mp(g,C);break;case 22:C.memoizedState===null&&Li(g,C,i),ka(C,C.return);break;case 30:break;default:Li(g,C,i)}n=n.sibling}}function ou(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&&fa(i))}function cu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&fa(e))}function Wn(e,n,i,a){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)vp(e,n,i,a),n=n.sibling}function vp(e,n,i,a){var g=n.flags;switch(n.tag){case 0:case 11:case 15:Wn(e,n,i,a),g&2048&&Ea(9,n);break;case 1:Wn(e,n,i,a);break;case 3:Wn(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&&fa(e)));break;case 12:if(g&2048){Wn(e,n,i,a),e=n.stateNode;try{var C=n.memoizedProps,B=C.id,F=C.onPostCommit;typeof F=="function"&&F(B,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){nt(n,n.return,X)}}else Wn(e,n,i,a);break;case 31:Wn(e,n,i,a);break;case 13:Wn(e,n,i,a);break;case 23:break;case 22:C=n.stateNode,B=n.alternate,n.memoizedState!==null?C._visibility&2?Wn(e,n,i,a):Aa(e,n):C._visibility&2?Wn(e,n,i,a):(C._visibility|=2,ws(e,n,i,a,(n.subtreeFlags&10256)!==0||!1)),g&2048&&ou(B,n);break;case 24:Wn(e,n,i,a),g&2048&&cu(n.alternate,n);break;default:Wn(e,n,i,a)}}function ws(e,n,i,a,g){for(g=g&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var C=e,B=n,F=i,X=a,ae=B.flags;switch(B.tag){case 0:case 11:case 15:ws(C,B,F,X,g),Ea(8,B);break;case 23:break;case 22:var pe=B.stateNode;B.memoizedState!==null?pe._visibility&2?ws(C,B,F,X,g):Aa(C,B):(pe._visibility|=2,ws(C,B,F,X,g)),g&&ae&2048&&ou(B.alternate,B);break;case 24:ws(C,B,F,X,g),g&&ae&2048&&cu(B.alternate,B);break;default:ws(C,B,F,X,g)}n=n.sibling}}function Aa(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:Aa(i,a),g&2048&&ou(a.alternate,a);break;case 24:Aa(i,a),g&2048&&cu(a.alternate,a);break;default:Aa(i,a)}n=n.sibling}}var Ta=8192;function xs(e,n,i){if(e.subtreeFlags&Ta)for(e=e.child;e!==null;)yp(e,n,i),e=e.sibling}function yp(e,n,i){switch(e.tag){case 26:xs(e,n,i),e.flags&Ta&&e.memoizedState!==null&&C0(i,Vn,e.memoizedState,e.memoizedProps);break;case 5:xs(e,n,i);break;case 3:case 4:var a=Vn;Vn=ro(e.stateNode.containerInfo),xs(e,n,i),Vn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Ta,Ta=16777216,xs(e,n,i),Ta=a):xs(e,n,i));break;default:xs(e,n,i)}}function Sp(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 Ra(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,Cp(a,e)}Sp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)bp(e),e=e.sibling}function bp(e){switch(e.tag){case 0:case 11:case 15:Ra(e),e.flags&2048&&or(9,e,e.return);break;case 3:Ra(e);break;case 12:Ra(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Gl(e)):Ra(e);break;default:Ra(e)}}function Gl(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,Cp(a,e)}Sp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:or(8,n,n.return),Gl(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,Gl(n));break;default:Gl(n)}e=e.sibling}}function Cp(e,n){for(;zt!==null;){var i=zt;switch(i.tag){case 0:case 11:case 15:or(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:fa(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(fp(a),a===i){zt=null;break e}if(g!==null){g.return=C,zt=g;break e}zt=C}}}var Hy={getCacheForType:function(e){var n=Ft(Rt),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return Ft(Rt).controller.signal}},zy=typeof WeakMap=="function"?WeakMap:Map,et=0,at=null,$e=null,We=0,tt=0,En=null,cr=!1,Es=!1,uu=!1,Oi=0,wt=0,ur=0,Vr=0,hu=0,kn=0,ks=0,Da=null,fn=null,fu=!1,Vl=0,wp=0,Wl=1/0,Kl=null,hr=null,jt=0,fr=null,As=null,Bi=0,du=0,pu=null,xp=null,Ma=0,mu=null;function An(){return(et&2)!==0&&We!==0?We&-We:G.T!==null?bu():Ar()}function Ep(){if(kn===0)if((We&536870912)===0||Ye){var e=fi;fi<<=1,(fi&3932160)===0&&(fi=262144),kn=e}else kn=536870912;return e=wn.current,e!==null&&(e.flags|=32),kn}function dn(e,n,i){(e===at&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(Ts(e,0),dr(e,We,kn,!1)),qn(e,i),((et&2)===0||e!==at)&&(e===at&&((et&2)===0&&(Vr|=i),wt===4&&dr(e,We,kn,!1)),oi(e))}function kp(e,n,i){if((et&6)!==0)throw Error(l(327));var a=!i&&(n&127)===0&&(n&e.expiredLanes)===0||yt(e,n),g=a?Py(e,n):_u(e,n,!0),C=a;do{if(g===0){Es&&!a&&dr(e,n,0,!1);break}else{if(i=e.current.alternate,C&&!Iy(i)){g=_u(e,n,!1),C=!1;continue}if(g===2){if(C=n,e.errorRecoveryDisabledLanes&C)var B=0;else B=e.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){n=B;e:{var F=e;g=Da;var X=F.current.memoizedState.isDehydrated;if(X&&(Ts(F,B).flags|=256),B=_u(F,B,!1),B!==2){if(uu&&!X){F.errorRecoveryDisabledLanes|=C,Vr|=C,g=4;break e}C=fn,fn=g,C!==null&&(fn===null?fn=C:fn.push.apply(fn,C))}g=B}if(C=!1,g!==2)continue}}if(g===1){Ts(e,0),dr(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:dr(a,n,kn,!cr);break e;case 2:fn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(g=Vl+300-ut(),10<g)){if(dr(a,n,kn,!cr),vn(a,0,!0)!==0)break e;Bi=n,a.timeoutHandle=im(Ap.bind(null,a,i,fn,Kl,fu,n,kn,Vr,ks,cr,C,"Throttled",-0,0),g);break e}Ap(a,i,fn,Kl,fu,n,kn,Vr,ks,cr,C,null,-0,0)}}break}while(!0);oi(e)}function Ap(e,n,i,a,g,C,B,F,X,ae,pe,ye,oe,ce){if(e.timeoutHandle=-1,ye=n.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Sn},yp(n,C,ye);var ke=(C&62914560)===C?Vl-ut():(C&4194048)===C?wp-ut():0;if(ke=w0(ye,ke),ke!==null){Bi=C,e.cancelPendingCommit=ke(jp.bind(null,e,n,C,i,a,g,B,F,X,pe,ye,null,oe,ce)),dr(e,C,B,!ae);return}}jp(e,n,C,i,a,g,B,F,X)}function Iy(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 dr(e,n,i,a){n&=~hu,n&=~Vr,e.suspendedLanes|=n,e.pingedLanes&=~n,a&&(e.warmLanes|=n),a=e.expirationTimes;for(var g=n;0<g;){var C=31-Ze(g),B=1<<C;a[C]=-1,g&=~B}i!==0&&$n(e,i,n)}function Yl(){return(et&6)===0?(La(0),!1):!0}function gu(){if($e!==null){if(tt===0)var e=$e.return;else e=$e,wi=Hr=null,Lc(e),vs=null,pa=0,e=$e;for(;e!==null;)rp(e.alternate,e),e=e.return;$e=null}}function Ts(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,s0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Bi=0,gu(),at=e,$e=i=bi(e.current,null),We=n,tt=0,En=null,cr=!1,Es=yt(e,n),uu=!1,ks=kn=hu=Vr=ur=wt=0,fn=Da=null,fu=!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-Ze(a),C=1<<g;n|=e[g],a&=~C}return Oi=n,gl(),i}function Tp(e,n){Ie=null,G.H=Ca,n===_s||n===xl?(n=$f(),tt=3):n===Sc?(n=$f(),tt=4):tt=n===Kc?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,En=n,$e===null&&(wt=1,zl(e,Bn(n,e.current)))}function Rp(){var e=wn.current;return e===null?!0:(We&4194048)===We?zn===null:(We&62914560)===We||(We&536870912)!==0?e===zn:!1}function Dp(){var e=G.H;return G.H=Ca,e===null?Ca:e}function Mp(){var e=G.A;return G.A=Hy,e}function Xl(){wt=4,cr||(We&4194048)!==We&&wn.current!==null||(Es=!0),(ur&134217727)===0&&(Vr&134217727)===0||at===null||dr(at,We,kn,!1)}function _u(e,n,i){var a=et;et|=2;var g=Dp(),C=Mp();(at!==e||We!==n)&&(Kl=null,Ts(e,n)),n=!1;var B=wt;e:do try{if(tt!==0&&$e!==null){var F=$e,X=En;switch(tt){case 8:gu(),B=6;break e;case 3:case 2:case 9:case 6:wn.current===null&&(n=!0);var ae=tt;if(tt=0,En=null,Rs(e,F,X,ae),i&&Es){B=0;break e}break;default:ae=tt,tt=0,En=null,Rs(e,F,X,ae)}}Uy(),B=wt;break}catch(pe){Tp(e,pe)}while(!0);return n&&e.shellSuspendCounter++,wi=Hr=null,et=a,G.H=g,G.A=C,$e===null&&(at=null,We=0,gl()),B}function Uy(){for(;$e!==null;)Lp($e)}function Py(e,n){var i=et;et|=2;var a=Dp(),g=Mp();at!==e||We!==n?(Kl=null,Wl=ut()+500,Ts(e,n)):Es=yt(e,n);e:do try{if(tt!==0&&$e!==null){n=$e;var C=En;t:switch(tt){case 1:tt=0,En=null,Rs(e,n,C,1);break;case 2:case 9:if(Ff(C)){tt=0,En=null,Op(n);break}n=function(){tt!==2&&tt!==9||at!==e||(tt=7),oi(e)},C.then(n,n);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:Ff(C)?(tt=0,En=null,Op(n)):(tt=0,En=null,Rs(e,n,C,7));break;case 5:var B=null;switch($e.tag){case 26:B=$e.memoizedState;case 5:case 27:var F=$e;if(B?vm(B):F.stateNode.complete){tt=0,En=null;var X=F.sibling;if(X!==null)$e=X;else{var ae=F.return;ae!==null?($e=ae,Ql(ae)):$e=null}break t}}tt=0,En=null,Rs(e,n,C,5);break;case 6:tt=0,En=null,Rs(e,n,C,6);break;case 8:gu(),wt=6;break e;default:throw Error(l(462))}}Fy();break}catch(pe){Tp(e,pe)}while(!0);return wi=Hr=null,G.H=a,G.A=g,et=i,$e!==null?0:(at=null,We=0,gl(),wt)}function Fy(){for(;$e!==null&&!Dn();)Lp($e)}function Lp(e){var n=np(e.alternate,e,Oi);e.memoizedProps=e.pendingProps,n===null?Ql(e):$e=n}function Op(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=Xd(i,n,n.pendingProps,n.type,void 0,We);break;case 11:n=Xd(i,n,n.pendingProps,n.type.render,n.ref,We);break;case 5:Lc(n);default:rp(i,n),n=$e=Mf(n,Oi),n=np(i,n,Oi)}e.memoizedProps=e.pendingProps,n===null?Ql(e):$e=n}function Rs(e,n,i,a){wi=Hr=null,Lc(n),vs=null,pa=0;var g=n.return;try{if(Dy(e,g,n,i,We)){wt=1,zl(e,Bn(i,e.current)),$e=null;return}}catch(C){if(g!==null)throw $e=g,C;wt=1,zl(e,Bn(i,e.current)),$e=null;return}n.flags&32768?(Ye||a===1?e=!0:Es||(We&536870912)!==0?e=!1:(cr=e=!0,(a===2||a===9||a===3||a===6)&&(a=wn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Bp(n,e)):Ql(n)}function Ql(e){var n=e;do{if((n.flags&32768)!==0){Bp(n,cr);return}e=n.return;var i=Oy(n.alternate,n,Oi);if(i!==null){$e=i;return}if(n=n.sibling,n!==null){$e=n;return}$e=n=e}while(n!==null);wt===0&&(wt=5)}function Bp(e,n){do{var i=By(e.alternate,e);if(i!==null){i.flags&=32767,$e=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){$e=e;return}$e=e=i}while(e!==null);wt=6,$e=null}function jp(e,n,i,a,g,C,B,F,X){e.cancelPendingCommit=null;do Jl();while(jt!==0);if((et&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(C=n.lanes|n.childLanes,C|=sc,Xn(e,i,C,B,F,X),e===at&&($e=at=null,We=0),As=n,fr=e,Bi=i,du=C,pu=g,xp=a,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Vy(Ae,function(){return Up(),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,B=et,et|=4;try{jy(e,n,i)}finally{et=B,Y.p=g,G.T=a}}jt=1,Np(),Hp(),zp()}}function Np(){if(jt===1){jt=0;var e=fr,n=As,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=et;et|=4;try{gp(n,e);var C=Ru,B=Cf(e.containerInfo),F=C.focusedElem,X=C.selectionRange;if(B!==F&&F&&F.ownerDocument&&bf(F.ownerDocument.documentElement,F)){if(X!==null&&ec(F)){var ae=X.start,pe=X.end;if(pe===void 0&&(pe=ae),"selectionStart"in F)F.selectionStart=ae,F.selectionEnd=Math.min(pe,F.value.length);else{var ye=F.ownerDocument||document,oe=ye&&ye.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),ke=F.textContent.length,Oe=Math.min(X.start,ke),st=X.end===void 0?Oe:Math.min(X.end,ke);!ce.extend&&Oe>st&&(B=st,st=Oe,Oe=B);var te=Sf(F,Oe),J=Sf(F,st);if(te&&J&&(ce.rangeCount!==1||ce.anchorNode!==te.node||ce.anchorOffset!==te.offset||ce.focusNode!==J.node||ce.focusOffset!==J.offset)){var se=ye.createRange();se.setStart(te.node,te.offset),ce.removeAllRanges(),Oe>st?(ce.addRange(se),ce.extend(J.node,J.offset)):(se.setEnd(J.node,J.offset),ce.addRange(se))}}}}for(ye=[],ce=F;ce=ce.parentNode;)ce.nodeType===1&&ye.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<ye.length;F++){var me=ye[F];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}uo=!!Tu,Ru=Tu=null}finally{et=g,Y.p=a,G.T=i}}e.current=n,jt=2}}function Hp(){if(jt===2){jt=0;var e=fr,n=As,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=et;et|=4;try{hp(e,n.alternate,n)}finally{et=g,Y.p=a,G.T=i}}jt=3}}function zp(){if(jt===4||jt===3){jt=0,gt();var e=fr,n=As,i=Bi,a=xp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?jt=5:(jt=0,As=fr=null,Ip(e,e.pendingLanes));var g=e.pendingLanes;if(g===0&&(hr=null),mi(i),n=n.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(_t,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,B=0;B<a.length;B++){var F=a[B];C(F.value,{componentStack:F.stack})}}finally{G.T=n,Y.p=g}}(Bi&3)!==0&&Jl(),oi(e),g=e.pendingLanes,(i&261930)!==0&&(g&42)!==0?e===mu?Ma++:(Ma=0,mu=e):Ma=0,La(0)}}function Ip(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,fa(n)))}function Jl(){return Np(),Hp(),zp(),Up()}function Up(){if(jt!==5)return!1;var e=fr,n=du;du=0;var i=mi(Bi),a=G.T,g=Y.p;try{Y.p=32>i?32:i,G.T=null,i=pu,pu=null;var C=fr,B=Bi;if(jt=0,As=fr=null,Bi=0,(et&6)!==0)throw Error(l(331));var F=et;if(et|=4,bp(C.current),vp(C,C.current,B,i),et=F,La(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(_t,C)}catch{}return!0}finally{Y.p=g,G.T=a,Ip(e,n)}}function Pp(e,n,i){n=Bn(i,n),n=Wc(e.stateNode,n,2),e=sr(e,n,2),e!==null&&(qn(e,2),oi(e))}function nt(e,n,i){if(e.tag===3)Pp(e,e,i);else for(;n!==null;){if(n.tag===3){Pp(n,e,i);break}else if(n.tag===1){var a=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(hr===null||!hr.has(a))){e=Bn(i,e),i=Fd(2),a=sr(n,i,2),a!==null&&(qd(i,a,n,e),qn(a,2),oi(a));break}}n=n.return}}function vu(e,n,i){var a=e.pingCache;if(a===null){a=e.pingCache=new zy;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)||(uu=!0,g.add(i),e=qy.bind(null,e,n,i),n.then(e,e))}function qy(e,n,i){var a=e.pingCache;a!==null&&a.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,at===e&&(We&i)===i&&(wt===4||wt===3&&(We&62914560)===We&&300>ut()-Vl?(et&2)===0&&Ts(e,0):hu|=i,ks===We&&(ks=0)),oi(e)}function Fp(e,n){n===0&&(n=zi()),e=Br(e,n),e!==null&&(qn(e,n),oi(e))}function $y(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Fp(e,i)}function Gy(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),Fp(e,i)}function Vy(e,n){return Nt(e,n)}var Zl=null,Ds=null,yu=!1,eo=!1,Su=!1,pr=0;function oi(e){e!==Ds&&e.next===null&&(Ds===null?Zl=Ds=e:Ds=Ds.next=e),eo=!0,yu||(yu=!0,Ky())}function La(e,n){if(!Su&&eo){Su=!0;do for(var i=!1,a=Zl;a!==null;){if(e!==0){var g=a.pendingLanes;if(g===0)var C=0;else{var B=a.suspendedLanes,F=a.pingedLanes;C=(1<<31-Ze(42|e)+1)-1,C&=g&~(B&~F),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,Vp(a,C))}else C=We,C=vn(a,a===at?C:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(C&3)===0||yt(a,C)||(i=!0,Vp(a,C));a=a.next}while(i);Su=!1}}function Wy(){qp()}function qp(){eo=yu=!1;var e=0;pr!==0&&r0()&&(e=pr);for(var n=ut(),i=null,a=Zl;a!==null;){var g=a.next,C=$p(a,n);C===0?(a.next=null,i===null?Zl=g:i.next=g,g===null&&(Ds=i)):(i=a,(e!==0||(C&3)!==0)&&(eo=!0)),a=g}jt!==0&&jt!==5||La(e),pr!==0&&(pr=0)}function $p(e,n){for(var i=e.suspendedLanes,a=e.pingedLanes,g=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var B=31-Ze(C),F=1<<B,X=g[B];X===-1?((F&i)===0||(F&a)!==0)&&(g[B]=pi(F,n)):X<=n&&(e.expiredLanes|=F),C&=~F}if(n=at,i=We,i=vn(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===n&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&rn(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||yt(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(a!==null&&rn(a),mi(i)){case 2:case 8:i=Ce;break;case 32:i=Ae;break;case 268435456:i=Ne;break;default:i=Ae}return a=Gp.bind(null,e),i=Nt(i,a),e.callbackPriority=n,e.callbackNode=i,n}return a!==null&&a!==null&&rn(a),e.callbackPriority=2,e.callbackNode=null,2}function Gp(e,n){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Jl()&&e.callbackNode!==i)return null;var a=We;return a=vn(e,e===at?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(kp(e,a,n),$p(e,ut()),e.callbackNode!=null&&e.callbackNode===i?Gp.bind(null,e):null)}function Vp(e,n){if(Jl())return null;kp(e,n,!0)}function Ky(){a0(function(){(et&6)!==0?Nt(fe,Wy):qp()})}function bu(){if(pr===0){var e=ms;e===0&&(e=hi,hi<<=1,(hi&261888)===0&&(hi=256)),pr=e}return pr}function Wp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yi(""+e)}function Kp(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 Yy(e,n,i,a,g){if(n==="submit"&&i&&i.stateNode===g){var C=Wp((g[It]||null).action),B=a.submitter;B&&(n=(n=B[It]||null)?Wp(n.formAction):B.getAttribute("formAction"),n!==null&&(C=n,B=null));var F=new rs("action","action",null,a,g);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(pr!==0){var X=B?Kp(g,B):new FormData(g);Pc(i,{pending:!0,data:X,method:g.method,action:C},null,X)}}else typeof C=="function"&&(F.preventDefault(),X=B?Kp(g,B):new FormData(g),Pc(i,{pending:!0,data:X,method:g.method,action:C},C,X))},currentTarget:g}]})}}for(var Cu=0;Cu<rc.length;Cu++){var wu=rc[Cu],Xy=wu.toLowerCase(),Qy=wu[0].toUpperCase()+wu.slice(1);Gn(Xy,"on"+Qy)}Gn(Ef,"onAnimationEnd"),Gn(kf,"onAnimationIteration"),Gn(Af,"onAnimationStart"),Gn("dblclick","onDoubleClick"),Gn("focusin","onFocus"),Gn("focusout","onBlur"),Gn(dy,"onTransitionRun"),Gn(py,"onTransitionStart"),Gn(my,"onTransitionCancel"),Gn(Tf,"onTransitionEnd"),Zn("onMouseEnter",["mouseout","mouseover"]),Zn("onMouseLeave",["mouseout","mouseover"]),Zn("onPointerEnter",["pointerout","pointerover"]),Zn("onPointerLeave",["pointerout","pointerover"]),Jn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oa="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(" "),Jy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oa));function Yp(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 B=a.length-1;0<=B;B--){var F=a[B],X=F.instance,ae=F.currentTarget;if(F=F.listener,X!==C&&g.isPropagationStopped())break e;C=F,g.currentTarget=ae;try{C(g)}catch(pe){ml(pe)}g.currentTarget=null,C=X}else for(B=0;B<a.length;B++){if(F=a[B],X=F.instance,ae=F.currentTarget,F=F.listener,X!==C&&g.isPropagationStopped())break e;C=F,g.currentTarget=ae;try{C(g)}catch(pe){ml(pe)}g.currentTarget=null,C=X}}}}function Ge(e,n){var i=n[Ln];i===void 0&&(i=n[Ln]=new Set);var a=e+"__bubble";i.has(a)||(Xp(n,e,2,!1),i.add(a))}function xu(e,n,i){var a=0;n&&(a|=4),Xp(i,e,a,n)}var to="_reactListening"+Math.random().toString(36).slice(2);function Eu(e){if(!e[to]){e[to]=!0,Ws.forEach(function(i){i!=="selectionchange"&&(Jy.has(i)||xu(i,!1,e),xu(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[to]||(n[to]=!0,xu("selectionchange",!1,n))}}function Xp(e,n,i,a){switch(Em(n)){case 2:var g=k0;break;case 8:g=A0;break;default:g=Uu}i=g.bind(null,n,i,e),g=void 0,!ii||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 ku(e,n,i,a,g){var C=a;if((n&1)===0&&(n&2)===0&&a!==null)e:for(;;){if(a===null)return;var B=a.tag;if(B===3||B===4){var F=a.stateNode.containerInfo;if(F===g)break;if(B===4)for(B=a.return;B!==null;){var X=B.tag;if((X===3||X===4)&&B.stateNode.containerInfo===g)return;B=B.return}for(;F!==null;){if(B=Fi(F),B===null)return;if(X=B.tag,X===5||X===6||X===26||X===27){a=C=B;continue e}F=F.parentNode}}a=a.return}yi(function(){var ae=C,pe=na(i),ye=[];e:{var oe=Rf.get(e);if(oe!==void 0){var ce=rs,ke=e;switch(e){case"keypress":if(Qi(i)===0)break e;case"keydown":case"keyup":ce=Gv;break;case"focusin":ke="focus",ce=Fe;break;case"focusout":ke="blur",ce=Fe;break;case"beforeblur":case"afterblur":ce=Fe;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=ss;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=V;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=Kv;break;case Ef:case kf:case Af:ce=Mr;break;case Tf:ce=Xv;break;case"scroll":case"scrollend":ce=Vo;break;case"wheel":ce=Jv;break;case"copy":case"cut":case"paste":ce=Yo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=af;break;case"toggle":case"beforetoggle":ce=ey}var Oe=(n&4)!==0,st=!Oe&&(e==="scroll"||e==="scrollend"),te=Oe?oe!==null?oe+"Capture":null:oe;Oe=[];for(var J=ae,se;J!==null;){var me=J;if(se=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||se===null||te===null||(me=Xi(J,te),me!=null&&Oe.push(Ba(J,me,se))),st)break;J=J.return}0<Oe.length&&(oe=new ce(oe,ke,null,i,pe),ye.push({event:oe,listeners:Oe}))}}if((n&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",oe&&i!==ti&&(ke=i.relatedTarget||i.fromElement)&&(Fi(ke)||ke[Ii]))break e;if((ce||oe)&&(oe=pe.window===pe?pe:(oe=pe.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(ke=i.relatedTarget||i.toElement,ce=ae,ke=ke?Fi(ke):null,ke!==null&&(st=p(ke),Oe=ke.tag,ke!==st||Oe!==5&&Oe!==27&&Oe!==6)&&(ke=null)):(ce=null,ke=ae),ce!==ke)){if(Oe=ss,me="onMouseLeave",te="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=af,me="onPointerLeave",te="onPointerEnter",J="pointer"),st=ce==null?oe:$i(ce),se=ke==null?oe:$i(ke),oe=new Oe(me,J+"leave",ce,i,pe),oe.target=st,oe.relatedTarget=se,me=null,Fi(pe)===ae&&(Oe=new Oe(te,J+"enter",ke,i,pe),Oe.target=se,Oe.relatedTarget=st,me=Oe),st=me,ce&&ke)t:{for(Oe=Zy,te=ce,J=ke,se=0,me=te;me;me=Oe(me))se++;me=0;for(var Me=J;Me;Me=Oe(Me))me++;for(;0<se-me;)te=Oe(te),se--;for(;0<me-se;)J=Oe(J),me--;for(;se--;){if(te===J||J!==null&&te===J.alternate){Oe=te;break t}te=Oe(te),J=Oe(J)}Oe=null}else Oe=null;ce!==null&&Qp(ye,oe,ce,Oe,!1),ke!==null&&st!==null&&Qp(ye,st,ke,Oe,!0)}}e:{if(oe=ae?$i(ae):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var Qe=pf;else if(ff(oe))if(mf)Qe=uy;else{Qe=oy;var Re=ly}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&ta(ae.elementType)&&(Qe=pf):Qe=cy;if(Qe&&(Qe=Qe(e,ae))){df(ye,Qe,i,pe);break e}Re&&Re(e,oe,ae),e==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&Ht(oe,"number",oe.value)}switch(Re=ae?$i(ae):window,e){case"focusin":(ff(Re)||Re.contentEditable==="true")&&(ls=Re,tc=ae,ca=null);break;case"focusout":ca=tc=ls=null;break;case"mousedown":nc=!0;break;case"contextmenu":case"mouseup":case"dragend":nc=!1,wf(ye,i,pe);break;case"selectionchange":if(fy)break;case"keydown":case"keyup":wf(ye,i,pe)}var Ue;if(Qo)e:{switch(e){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else as?uf(e,i)&&(Ke="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ke="onCompositionStart");Ke&&(lf&&i.locale!=="ko"&&(as||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&as&&(Ue=ln()):(ri=pe,ts="value"in ri?ri.value:ri.textContent,as=!0)),Re=no(ae,Ke),0<Re.length&&(Ke=new sf(Ke,e,null,i,pe),ye.push({event:Ke,listeners:Re}),Ue?Ke.data=Ue:(Ue=hf(i),Ue!==null&&(Ke.data=Ue)))),(Ue=ny?iy(e,i):ry(e,i))&&(Ke=no(ae,"onBeforeInput"),0<Ke.length&&(Re=new sf("onBeforeInput","beforeinput",null,i,pe),ye.push({event:Re,listeners:Ke}),Re.data=Ue)),Yy(ye,e,ae,i,pe)}Yp(ye,n)})}function Ba(e,n,i){return{instance:e,listener:n,currentTarget:i}}function no(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=Xi(e,i),g!=null&&a.unshift(Ba(e,g,C)),g=Xi(e,n),g!=null&&a.push(Ba(e,g,C))),e.tag===3)return a;e=e.return}return[]}function Zy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qp(e,n,i,a,g){for(var C=n._reactName,B=[];i!==null&&i!==a;){var F=i,X=F.alternate,ae=F.stateNode;if(F=F.tag,X!==null&&X===a)break;F!==5&&F!==26&&F!==27||ae===null||(X=ae,g?(ae=Xi(i,C),ae!=null&&B.unshift(Ba(i,ae,X))):g||(ae=Xi(i,C),ae!=null&&B.push(Ba(i,ae,X)))),i=i.return}B.length!==0&&e.push({event:n,listeners:B})}var e0=/\r\n?/g,t0=/\u0000|\uFFFD/g;function Jp(e){return(typeof e=="string"?e:""+e).replace(e0,`
49
+ `).replace(t0,"")}function Zp(e,n){return n=Jp(n),Jp(e)===n}function rt(e,n,i,a,g,C){switch(i){case"children":typeof a=="string"?n==="body"||n==="textarea"&&a===""||Wi(e,a):(typeof a=="number"||typeof a=="bigint")&&n!=="body"&&Wi(e,""+a);break;case"className":ne(e,"class",a);break;case"tabIndex":ne(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":ne(e,i,a);break;case"style":dl(e,a,C);break;case"data":if(n!=="object"){ne(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=Yi(""+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"&&rt(e,n,"name",g.name,g,null),rt(e,n,"formEncType",g.formEncType,g,null),rt(e,n,"formMethod",g.formMethod,g,null),rt(e,n,"formTarget",g.formTarget,g,null)):(rt(e,n,"encType",g.encType,g,null),rt(e,n,"method",g.method,g,null),rt(e,n,"target",g.target,g,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=Yi(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Sn);break;case"onScroll":a!=null&&Ge("scroll",e);break;case"onScrollEnd":a!=null&&Ge("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=Yi(""+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":Ge("beforetoggle",e),Ge("toggle",e),Vi(e,"popover",a);break;case"xlinkActuate":bt(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":bt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":bt(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":bt(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":bt(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":bt(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":bt(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":bt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":bt(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Vi(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=Go.get(i)||i,Vi(e,i,a))}}function Au(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"?Wi(e,a):(typeof a=="number"||typeof a=="bigint")&&Wi(e,""+a);break;case"onScroll":a!=null&&Ge("scroll",e);break;case"onScrollEnd":a!=null&&Ge("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Sn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qn.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,""):Vi(e,i,a)}}}function $t(e,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",e),Ge("load",e);var a=!1,g=!1,C;for(C in i)if(i.hasOwnProperty(C)){var B=i[C];if(B!=null)switch(C){case"src":a=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:rt(e,n,C,B,i,null)}}g&&rt(e,n,"srcSet",i.srcSet,i,null),a&&rt(e,n,"src",i.src,i,null);return;case"input":Ge("invalid",e);var F=C=B=g=null,X=null,ae=null;for(a in i)if(i.hasOwnProperty(a)){var pe=i[a];if(pe!=null)switch(a){case"name":g=pe;break;case"type":B=pe;break;case"checked":X=pe;break;case"defaultChecked":ae=pe;break;case"value":C=pe;break;case"defaultValue":F=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(l(137,n));break;default:rt(e,n,a,pe,i,null)}}Ut(e,C,F,X,ae,B,g,!1);return;case"select":Ge("invalid",e),a=B=C=null;for(g in i)if(i.hasOwnProperty(g)&&(F=i[g],F!=null))switch(g){case"value":C=F;break;case"defaultValue":B=F;break;case"multiple":a=F;default:rt(e,n,g,F,i,null)}n=C,i=B,e.multiple=!!a,n!=null?_i(e,!!a,n,!1):i!=null&&_i(e,!!a,i,!0);return;case"textarea":Ge("invalid",e),C=g=a=null;for(B in i)if(i.hasOwnProperty(B)&&(F=i[B],F!=null))switch(B){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:rt(e,n,B,F,i,null)}ea(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:rt(e,n,X,a,i,null)}return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(a=0;a<Oa.length;a++)Ge(Oa[a],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in i)if(i.hasOwnProperty(ae)&&(a=i[ae],a!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:rt(e,n,ae,a,i,null)}return;default:if(ta(n)){for(pe in i)i.hasOwnProperty(pe)&&(a=i[pe],a!==void 0&&Au(e,n,pe,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&rt(e,n,F,a,i,null))}function n0(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,B=null,F=null,X=null,ae=null,pe=null;for(ce in i){var ye=i[ce];if(i.hasOwnProperty(ce)&&ye!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":X=ye;default:a.hasOwnProperty(ce)||rt(e,n,ce,null,a,ye)}}for(var oe in a){var ce=a[oe];if(ye=i[oe],a.hasOwnProperty(oe)&&(ce!=null||ye!=null))switch(oe){case"type":C=ce;break;case"name":g=ce;break;case"checked":ae=ce;break;case"defaultChecked":pe=ce;break;case"value":B=ce;break;case"defaultValue":F=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(l(137,n));break;default:ce!==ye&&rt(e,n,oe,ce,a,ye)}}Js(e,B,F,X,ae,pe,C,g);return;case"select":ce=B=F=oe=null;for(C in i)if(X=i[C],i.hasOwnProperty(C)&&X!=null)switch(C){case"value":break;case"multiple":ce=X;default:a.hasOwnProperty(C)||rt(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":oe=C;break;case"defaultValue":F=C;break;case"multiple":B=C;default:C!==X&&rt(e,n,g,C,a,X)}n=F,i=B,a=ce,oe!=null?_i(e,!!i,oe,!1):!!a!=!!i&&(n!=null?_i(e,!!i,n,!0):_i(e,!!i,i?[]:"",!1));return;case"textarea":ce=oe=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:rt(e,n,F,null,a,g)}for(B in a)if(g=a[B],C=i[B],a.hasOwnProperty(B)&&(g!=null||C!=null))switch(B){case"value":oe=g;break;case"defaultValue":ce=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(l(91));break;default:g!==C&&rt(e,n,B,g,a,C)}Zs(e,oe,ce);return;case"option":for(var ke in i)if(oe=i[ke],i.hasOwnProperty(ke)&&oe!=null&&!a.hasOwnProperty(ke))switch(ke){case"selected":e.selected=!1;break;default:rt(e,n,ke,null,a,oe)}for(X in a)if(oe=a[X],ce=i[X],a.hasOwnProperty(X)&&oe!==ce&&(oe!=null||ce!=null))switch(X){case"selected":e.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:rt(e,n,X,oe,a,ce)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Oe in i)oe=i[Oe],i.hasOwnProperty(Oe)&&oe!=null&&!a.hasOwnProperty(Oe)&&rt(e,n,Oe,null,a,oe);for(ae in a)if(oe=a[ae],ce=i[ae],a.hasOwnProperty(ae)&&oe!==ce&&(oe!=null||ce!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,n));break;default:rt(e,n,ae,oe,a,ce)}return;default:if(ta(n)){for(var st in i)oe=i[st],i.hasOwnProperty(st)&&oe!==void 0&&!a.hasOwnProperty(st)&&Au(e,n,st,void 0,a,oe);for(pe in a)oe=a[pe],ce=i[pe],!a.hasOwnProperty(pe)||oe===ce||oe===void 0&&ce===void 0||Au(e,n,pe,oe,a,ce);return}}for(var te in i)oe=i[te],i.hasOwnProperty(te)&&oe!=null&&!a.hasOwnProperty(te)&&rt(e,n,te,null,a,oe);for(ye in a)oe=a[ye],ce=i[ye],!a.hasOwnProperty(ye)||oe===ce||oe==null&&ce==null||rt(e,n,ye,oe,a,ce)}function em(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i0(){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,B=g.initiatorType,F=g.duration;if(C&&F&&em(B)){for(B=0,F=g.responseEnd,a+=1;a<i.length;a++){var X=i[a],ae=X.startTime;if(ae>F)break;var pe=X.transferSize,ye=X.initiatorType;pe&&em(ye)&&(X=X.responseEnd,B+=pe*(X<F?1:(F-ae)/(X-ae)))}if(--a,n+=8*(C+B)/(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 Tu=null,Ru=null;function io(e){return e.nodeType===9?e:e.ownerDocument}function tm(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 nm(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 Du(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 Mu=null;function r0(){var e=window.event;return e&&e.type==="popstate"?e===Mu?!1:(Mu=e,!0):(Mu=null,!1)}var im=typeof setTimeout=="function"?setTimeout:void 0,s0=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,a0=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(e){return rm.resolve(null).then(e).catch(l0)}:im;function l0(e){setTimeout(function(){throw e})}function mr(e){return e==="head"}function sm(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),Bs(n);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")ja(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,ja(i);for(var C=i.firstChild;C;){var B=C.nextSibling,F=C.nodeName;C[Ui]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=B}}else i==="body"&&ja(e.ownerDocument.body);i=g}while(i);Bs(n)}function am(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 Lu(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":Lu(i),Pi(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function o0(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[Ui])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 c0(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 lm(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 Ou(e){return e.data==="$?"||e.data==="$~"}function Bu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function u0(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 ju=null;function om(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 cm(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 um(e,n,i){switch(n=io(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 ja(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Pi(e)}var Un=new Map,hm=new Set;function ro(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ji=Y.d;Y.d={f:h0,r:f0,D:d0,C:p0,L:m0,m:g0,X:v0,S:_0,M:y0};function h0(){var e=ji.f(),n=Yl();return e||n}function f0(e){var n=qi(e);n!==null&&n.tag===5&&n.type==="form"?Td(n):ji.r(e)}var Ms=typeof document>"u"?null:document;function fm(e,n,i){var a=Ms;if(a&&typeof n=="string"&&n){var g=an(n);g='link[rel="'+e+'"][href="'+g+'"]',typeof i=="string"&&(g+='[crossorigin="'+i+'"]'),hm.has(g)||(hm.add(g),e={rel:e,crossOrigin:i,href:n},a.querySelector(g)===null&&(n=a.createElement("link"),$t(n,"link",e),pt(n),a.head.appendChild(n)))}}function d0(e){ji.D(e),fm("dns-prefetch",e,null)}function p0(e,n){ji.C(e,n),fm("preconnect",e,n)}function m0(e,n,i){ji.L(e,n,i);var a=Ms;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=Ls(e);break;case"script":C=Os(e)}Un.has(C)||(e=u({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),Un.set(C,e),a.querySelector(g)!==null||n==="style"&&a.querySelector(Na(C))||n==="script"&&a.querySelector(Ha(C))||(n=a.createElement("link"),$t(n,"link",e),pt(n),a.head.appendChild(n)))}}function g0(e,n){ji.m(e,n);var i=Ms;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=Os(e)}if(!Un.has(C)&&(e=u({rel:"modulepreload",href:e},n),Un.set(C,e),i.querySelector(g)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ha(C)))return}a=i.createElement("link"),$t(a,"link",e),pt(a),i.head.appendChild(a)}}}function _0(e,n,i){ji.S(e,n,i);var a=Ms;if(a&&e){var g=Gi(a).hoistableStyles,C=Ls(e);n=n||"default";var B=g.get(C);if(!B){var F={loading:0,preload:null};if(B=a.querySelector(Na(C)))F.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":n},i),(i=Un.get(C))&&Nu(e,i);var X=B=a.createElement("link");pt(X),$t(X,"link",e),X._p=new Promise(function(ae,pe){X.onload=ae,X.onerror=pe}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,so(B,n,a)}B={type:"stylesheet",instance:B,count:1,state:F},g.set(C,B)}}}function v0(e,n){ji.X(e,n);var i=Ms;if(i&&e){var a=Gi(i).hoistableScripts,g=Os(e),C=a.get(g);C||(C=i.querySelector(Ha(g)),C||(e=u({src:e,async:!0},n),(n=Un.get(g))&&Hu(e,n),C=i.createElement("script"),pt(C),$t(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(g,C))}}function y0(e,n){ji.M(e,n);var i=Ms;if(i&&e){var a=Gi(i).hoistableScripts,g=Os(e),C=a.get(g);C||(C=i.querySelector(Ha(g)),C||(e=u({src:e,async:!0,type:"module"},n),(n=Un.get(g))&&Hu(e,n),C=i.createElement("script"),pt(C),$t(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(g,C))}}function dm(e,n,i,a){var g=(g=ge.current)?ro(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=Ls(i.href),i=Gi(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=Ls(i.href);var C=Gi(g).hoistableStyles,B=C.get(e);if(B||(g=g.ownerDocument||g,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(e,B),(C=g.querySelector(Na(e)))&&!C._p&&(B.instance=C,B.state.loading=5),Un.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},Un.set(e,i),C||S0(g,e,i,B.state))),n&&a===null)throw Error(l(528,""));return B}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=Os(i),i=Gi(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 Ls(e){return'href="'+an(e)+'"'}function Na(e){return'link[rel="stylesheet"]['+e+"]"}function pm(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function S0(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}),$t(n,"link",i),pt(n),e.head.appendChild(n))}function Os(e){return'[src="'+an(e)+'"]'}function Ha(e){return"script[async]"+e}function mm(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,pt(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"),pt(a),$t(a,"style",g),so(a,i.precedence,e),n.instance=a;case"stylesheet":g=Ls(i.href);var C=e.querySelector(Na(g));if(C)return n.state.loading|=4,n.instance=C,pt(C),C;a=pm(i),(g=Un.get(g))&&Nu(a,g),C=(e.ownerDocument||e).createElement("link"),pt(C);var B=C;return B._p=new Promise(function(F,X){B.onload=F,B.onerror=X}),$t(C,"link",a),n.state.loading|=4,so(C,i.precedence,e),n.instance=C;case"script":return C=Os(i.src),(g=e.querySelector(Ha(C)))?(n.instance=g,pt(g),g):(a=i,(g=Un.get(C))&&(a=u({},i),Hu(a,g)),e=e.ownerDocument||e,g=e.createElement("script"),pt(g),$t(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,so(a,i.precedence,e));return n.instance}function so(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,B=0;B<a.length;B++){var F=a[B];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 Nu(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Hu(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var ao=null;function gm(e,n,i){if(ao===null){var a=new Map,g=ao=new Map;g.set(i,a)}else g=ao,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[Ui]||C[Et]||e==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var B=C.getAttribute(n)||"";B=e+B;var F=a.get(B);F?F.push(C):a.set(B,[C])}}return a}function _m(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function b0(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 vm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function C0(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=Ls(a.href),C=n.querySelector(Na(g));if(C){n=C._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=lo.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=C,pt(C);return}C=n.ownerDocument||n,a=pm(a),(g=Un.get(g))&&Nu(a,g),C=C.createElement("link"),pt(C);var B=C;B._p=new Promise(function(F,X){B.onload=F,B.onerror=X}),$t(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=lo.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var zu=0;function w0(e,n){return e.stylesheets&&e.count===0&&co(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&co(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+n);0<e.imgBytes&&zu===0&&(zu=62500*i0());var g=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&co(e,e.stylesheets),e.unsuspend)){var C=e.unsuspend;e.unsuspend=null,C()}},(e.imgBytes>zu?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(g)}}:null}function lo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)co(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var oo=null;function co(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oo=new Map,n.forEach(x0,e),oo=null,lo.call(e))}function x0(e,n){if(!(n.state.loading&4)){var i=oo.get(e);if(i)var a=i.get(null);else{i=new Map,oo.set(e,i);for(var g=e.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<g.length;C++){var B=g[C];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(i.set(B.dataset.precedence,B),a=B)}a&&i.set(null,a)}g=n.instance,B=g.getAttribute("data-precedence"),C=i.get(B)||a,C===a&&i.set(null,g),i.set(B,g),this.count++,a=lo.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 za={$$typeof:S,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function E0(e,n,i,a,g,C,B,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=Zt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zt(0),this.hiddenUpdates=Zt(null),this.identifierPrefix=a,this.onUncaughtError=g,this.onCaughtError=C,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function ym(e,n,i,a,g,C,B,F,X,ae,pe,ye){return e=new E0(e,n,i,B,X,ae,pe,ye,F),n=1,C===!0&&(n|=24),C=Cn(3,null,null,n),e.current=C,C.stateNode=e,n=_c(),n.refCount++,e.pooledCache=n,n.refCount++,C.memoizedState={element:a,isDehydrated:i,cache:n},bc(C),e}function Sm(e){return e?(e=us,e):us}function bm(e,n,i,a,g,C){g=Sm(g),a.context===null?a.context=g:a.pendingContext=g,a=rr(n),a.payload={element:i},C=C===void 0?null:C,C!==null&&(a.callback=C),i=sr(e,a,n),i!==null&&(dn(i,e,n),ga(i,e,n))}function Cm(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Iu(e,n){Cm(e,n),(e=e.alternate)&&Cm(e,n)}function wm(e){if(e.tag===13||e.tag===31){var n=Br(e,67108864);n!==null&&dn(n,e,67108864),Iu(e,67108864)}}function xm(e){if(e.tag===13||e.tag===31){var n=An();n=ze(n);var i=Br(e,n);i!==null&&dn(i,e,n),Iu(e,n)}}var uo=!0;function k0(e,n,i,a){var g=G.T;G.T=null;var C=Y.p;try{Y.p=2,Uu(e,n,i,a)}finally{Y.p=C,G.T=g}}function A0(e,n,i,a){var g=G.T;G.T=null;var C=Y.p;try{Y.p=8,Uu(e,n,i,a)}finally{Y.p=C,G.T=g}}function Uu(e,n,i,a){if(uo){var g=Pu(a);if(g===null)ku(e,n,a,ho,i),km(e,a);else if(R0(g,e,n,i,a))a.stopPropagation();else if(km(e,a),n&4&&-1<T0.indexOf(e)){for(;g!==null;){var C=qi(g);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var B=_n(C.pendingLanes);if(B!==0){var F=C;for(F.pendingLanes|=2,F.entangledLanes|=2;B;){var X=1<<31-Ze(B);F.entanglements[1]|=X,B&=~X}oi(C),(et&6)===0&&(Wl=ut()+500,La(0))}}break;case 31:case 13:F=Br(C,2),F!==null&&dn(F,C,2),Yl(),Iu(C,2)}if(C=Pu(a),C===null&&ku(e,n,a,ho,i),C===g)break;g=C}g!==null&&a.stopPropagation()}else ku(e,n,a,null,i)}}function Pu(e){return e=na(e),Fu(e)}var ho=null;function Fu(e){if(ho=null,e=Fi(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 ho=e,null}function Em(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Bt()){case fe:return 2;case Ce:return 8;case Ae:case je:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var qu=!1,gr=null,_r=null,vr=null,Ia=new Map,Ua=new Map,yr=[],T0="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 km(e,n){switch(e){case"focusin":case"focusout":gr=null;break;case"dragenter":case"dragleave":_r=null;break;case"mouseover":case"mouseout":vr=null;break;case"pointerover":case"pointerout":Ia.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ua.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=qi(n),n!==null&&wm(n)),e):(e.eventSystemFlags|=a,n=e.targetContainers,g!==null&&n.indexOf(g)===-1&&n.push(g),e)}function R0(e,n,i,a,g){switch(n){case"focusin":return gr=Pa(gr,e,n,i,a,g),!0;case"dragenter":return _r=Pa(_r,e,n,i,a,g),!0;case"mouseover":return vr=Pa(vr,e,n,i,a,g),!0;case"pointerover":var C=g.pointerId;return Ia.set(C,Pa(Ia.get(C)||null,e,n,i,a,g)),!0;case"gotpointercapture":return C=g.pointerId,Ua.set(C,Pa(Ua.get(C)||null,e,n,i,a,g)),!0}return!1}function Am(e){var n=Fi(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,Zr(e.priority,function(){xm(i)});return}}else if(n===31){if(n=o(i),n!==null){e.blockedOn=n,Zr(e.priority,function(){xm(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 fo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=Pu(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);ti=a,i.target.dispatchEvent(a),ti=null}else return n=qi(i),n!==null&&wm(n),e.blockedOn=i,!1;n.shift()}return!0}function Tm(e,n,i){fo(e)&&i.delete(n)}function D0(){qu=!1,gr!==null&&fo(gr)&&(gr=null),_r!==null&&fo(_r)&&(_r=null),vr!==null&&fo(vr)&&(vr=null),Ia.forEach(Tm),Ua.forEach(Tm)}function po(e,n){e.blockedOn===n&&(e.blockedOn=null,qu||(qu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,D0)))}var mo=null;function Rm(e){mo!==e&&(mo=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){mo===e&&(mo=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(Fu(a||i)===null)continue;break}var C=qi(i);C!==null&&(e.splice(n,3),n-=3,Pc(C,{pending:!0,data:g,method:i.method,action:a},a,g))}}))}function Bs(e){function n(X){return po(X,e)}gr!==null&&po(gr,e),_r!==null&&po(_r,e),vr!==null&&po(vr,e),Ia.forEach(n),Ua.forEach(n);for(var i=0;i<yr.length;i++){var a=yr[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<yr.length&&(i=yr[0],i.blockedOn===null);)Am(i),i.blockedOn===null&&yr.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],B=g[It]||null;if(typeof C=="function")B||Rm(i);else if(B){var F=null;if(C&&C.hasAttribute("formAction")){if(g=C,B=C[It]||null)F=B.formAction;else if(Fu(g)!==null)continue}else F=B.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),Rm(i)}}}function Dm(){function e(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(B){return g=B})},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 $u(e){this._internalRoot=e}go.prototype.render=$u.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var i=n.current,a=An();bm(i,a,e,n,null,null)},go.prototype.unmount=$u.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;bm(e.current,2,null,e,null,null),Yl(),n[Ii]=null}};function go(e){this._internalRoot=e}go.prototype.unstable_scheduleHydration=function(e){if(e){var n=Ar();e={blockedOn:null,target:e,priority:n};for(var i=0;i<yr.length&&n!==0&&n<yr[i].priority;i++);yr.splice(i,0,e),i===0&&Am(e)}};var Mm=r.version;if(Mm!=="19.2.6")throw Error(l(527,Mm,"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 M0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_o.isDisabled&&_o.supportsFiber)try{_t=_o.inject(M0),vt=_o}catch{}}return qa.createRoot=function(e,n){if(!d(e))throw Error(l(299));var i=!1,a="",g=zd,C=Id,B=Ud;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&&(B=n.onRecoverableError)),n=ym(e,1,!1,null,null,i,a,null,g,C,B,Dm),e[Ii]=n.current,Eu(e),new $u(n)},qa.hydrateRoot=function(e,n,i){if(!d(e))throw Error(l(299));var a=!1,g="",C=zd,B=Id,F=Ud,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&&(B=i.onCaughtError),i.onRecoverableError!==void 0&&(F=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),n=ym(e,1,!0,n,i??null,a,g,X,C,B,F,Dm),n.context=Sm(null),i=n.current,a=An(),a=ze(a),g=rr(a),g.callback=null,sr(i,g,a),i=a,n.current.lanes=i,qn(n,i),oi(n),e[Ii]=n.current,Eu(e),new go(n)},qa.version="19.2.6",qa}var Fm;function q0(){if(Fm)return Wu.exports;Fm=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=F0(),Wu.exports}var $0=q0();const Qr=function(t,r){let d=t;const p=Ya[r];let f=null,o=0,c=null;const h=[],m={},u=function(D,k){o=d*4+17,f=(function(R){const O=new Array(R);for(let H=0;H<R;H+=1){O[H]=new Array(R);for(let U=0;U<R;U+=1)O[H][U]=null}return O})(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 O=-1;O<=7;O+=1)k+O<=-1||o<=k+O||(0<=R&&R<=6&&(O==0||O==6)||0<=O&&O<=6&&(R==0||R==6)||2<=R&&R<=4&&2<=O&&O<=4?f[D+R][k+O]=!0:f[D+R][k+O]=!1)},w=function(){let D=0,k=0;for(let R=0;R<8;R+=1){u(!0,R);const O=Cr.getLostPoint(m);(R==0||D>O)&&(D=O,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=Cr.getPatternPosition(d);for(let k=0;k<D.length;k+=1)for(let R=0;R<D.length;R+=1){const O=D[k],H=D[R];if(f[O][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[O+U][H+P]=!0:f[O+U][H+P]=!1}},b=function(D){const k=Cr.getBCHTypeNumber(d);for(let R=0;R<18;R+=1){const O=!D&&(k>>R&1)==1;f[Math.floor(R/3)][R%3+o-8-3]=O}for(let R=0;R<18;R+=1){const O=!D&&(k>>R&1)==1;f[R%3+o-8-3][Math.floor(R/3)]=O}},v=function(D,k){const R=p<<3|k,O=Cr.getBCHTypeInfo(R);for(let H=0;H<15;H+=1){const U=!D&&(O>>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&&(O>>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,O=o-1,H=7,U=0;const P=Cr.getMaskFunction(k);for(let W=o-1;W>0;W-=2)for(W==6&&(W-=1);;){for(let K=0;K<2;K+=1)if(f[O][W-K]==null){let G=!1;U<D.length&&(G=(D[U]>>>H&1)==1),P(O,W-K)&&(G=!G),f[O][W-K]=G,H-=1,H==-1&&(U+=1,H=7)}if(O+=R,O<0||o<=O){O-=R,R=-R;break}}},S=function(D,k){let R=0,O=0,H=0;const U=new Array(k.length),P=new Array(k.length);for(let Y=0;Y<k.length;Y+=1){const Z=k[Y].dataCount,z=k[Y].totalCount-Z;O=Math.max(O,Z),H=Math.max(H,z),U[Y]=new Array(Z);for(let I=0;I<U[Y].length;I+=1)U[Y][I]=255&D.getBuffer()[I+R];R+=Z;const j=Cr.getErrorCorrectPolynomial(z),$=el(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 W=0;for(let Y=0;Y<k.length;Y+=1)W+=k[Y].totalCount;const K=new Array(W);let G=0;for(let Y=0;Y<O;Y+=1)for(let Z=0;Z<k.length;Z+=1)Y<U[Z].length&&(K[G]=U[Z][Y],G+=1);for(let Y=0;Y<H;Y+=1)for(let Z=0;Z<k.length;Z+=1)Y<P[Z].length&&(K[G]=P[Z][Y],G+=1);return K},A=function(D,k,R){const O=qm.getRSBlocks(D,k),H=$m();for(let P=0;P<R.length;P+=1){const W=R[P];H.put(W.getMode(),4),H.put(W.getLength(),Cr.getLengthInBits(W.getMode(),D)),W.write(H)}let U=0;for(let P=0;P<O.length;P+=1)U+=O[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,O)};m.addData=function(D,k){k=k||"Byte";let R=null;switch(k){case"Numeric":R=G0(D);break;case"Alphanumeric":R=V0(D);break;case"Byte":R=W0(D);break;case"Kanji":R=K0(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=qm.getRSBlocks(D,p),R=$m();for(let H=0;H<h.length;H++){const U=h[H];R.put(U.getMode(),4),R.put(U.getLength(),Cr.getLengthInBits(U.getMode(),D)),U.write(R)}let O=0;for(let H=0;H<k.length;H++)O+=k[H].dataCount;if(R.getLengthInBits()<=O*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 O=0;O<m.getModuleCount();O+=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(O,H)?"#000000":"#ffffff",R+=";",R+='"/>';R+="</tr>"}return R+="</tbody>",R+="</table>",R},m.createSvgTag=function(D,k,R,O){let H={};typeof arguments[0]=="object"&&(H=arguments[0],D=H.cellSize,k=H.margin,R=H.alt,O=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,O=typeof O=="string"?{text:O}:O||{},O.text=O.text||null,O.id=O.text?O.id||"qrcode-title":null;const U=m.getModuleCount()*D+k*2;let P,W,K,G,Y="",Z;for(Z="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+=O.text||R.text?' role="img" aria-labelledby="'+L([O.id,R.id].join(" ").trim())+'"':"",Y+=">",Y+=O.text?'<title id="'+L(O.id)+'">'+L(O.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)&&(W=P*D+k,Y+="M"+W+","+G+Z);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,O=k,H=R-k;return J0(R,R,function(U,P){if(O<=U&&U<H&&O<=P&&P<H){const W=Math.floor((U-O)/D),K=Math.floor((P-O)/D);return m.isDark(K,W)?0:1}else return 1})},m.createImgTag=function(D,k,R){D=D||2,k=typeof k>"u"?D*4:k;const O=m.getModuleCount()*D+k*2;let H="";return H+="<img",H+=' src="',H+=m.createDataURL(D,k),H+='"',H+=' width="',H+=O,H+='"',H+=' height="',H+=O,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 O=D.charAt(R);switch(O){case"<":k+="&lt;";break;case">":k+="&gt;";break;case"&":k+="&amp;";break;case'"':k+="&quot;";break;default:k+=O;break}}return k},M=function(D){D=typeof D>"u"?2:D;const R=m.getModuleCount()*1+D*2,O=D,H=R-D;let U,P,W,K,G;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},Z={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<R;U+=2){for(W=Math.floor((U-O)/1),K=Math.floor((U+1-O)/1),P=0;P<R;P+=1)G="█",O<=P&&P<H&&O<=U&&U<H&&m.isDark(W,Math.floor((P-O)/1))&&(G=" "),O<=P&&P<H&&O<=U+1&&U+1<H&&m.isDark(K,Math.floor((P-O)/1))?G+=" ":G+="█",z+=D<1&&U+1>=H?Z[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,O=k,H=R-k;let U,P,W,K;const G=Array(D+1).join("██"),Y=Array(D+1).join(" ");let Z="",z="";for(U=0;U<R;U+=1){for(W=Math.floor((U-O)/D),z="",P=0;P<R;P+=1)K=1,O<=P&&P<H&&O<=U&&U<H&&m.isDark(W,Math.floor((P-O)/D))&&(K=0),z+=K?G:Y;for(W=0;W<D;W+=1)Z+=z+`
51
+ `}return Z.substring(0,Z.length-1)},m.renderTo2dContext=function(D,k){k=k||2;const R=m.getModuleCount();for(let O=0;O<R;O++)for(let H=0;H<R;H++)D.fillStyle=m.isDark(O,H)?"black":"white",D.fillRect(H*k,O*k,k,k)},m};Qr.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};Qr.createStringToBytes=function(t,r){const s=(function(){const d=X0(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 Yt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ya={L:1,M:0,Q:3,H:2},br={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Cr=(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 br.PATTERN000:return function(o,c){return(o+c)%2==0};case br.PATTERN001:return function(o,c){return o%2==0};case br.PATTERN010:return function(o,c){return c%3==0};case br.PATTERN011:return function(o,c){return(o+c)%3==0};case br.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case br.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case br.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case br.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=el([1],0);for(let c=0;c<f;c+=1)o=o.multiply(el([1,xr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case Yt.MODE_NUMBER:return 10;case Yt.MODE_ALPHA_NUM:return 9;case Yt.MODE_8BIT_BYTE:return 8;case Yt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case Yt.MODE_NUMBER:return 12;case Yt.MODE_ALPHA_NUM:return 11;case Yt.MODE_8BIT_BYTE:return 16;case Yt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case Yt.MODE_NUMBER:return 14;case Yt.MODE_ALPHA_NUM:return 13;case Yt.MODE_8BIT_BYTE:return 16;case Yt.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})(),xr=(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})(),el=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]^=xr.gexp(xr.glog(l.getAt(f))+xr.glog(d.getAt(o)));return el(p,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const p=xr.glog(l.getAt(0))-xr.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]^=xr.gexp(xr.glog(d.getAt(o))+p);return el(f,0).mod(d)},l},qm=(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 Ya.L:return t[(d-1)*4+0];case Ya.M:return t[(d-1)*4+1];case Ya.Q:return t[(d-1)*4+2];case Ya.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})(),$m=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},G0=function(t){const r=Yt.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},V0=function(t){const r=Yt.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},W0=function(t){const r=Yt.MODE_8BIT_BYTE,s=Qr.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},K0=function(t){const r=Yt.MODE_KANJI,s=Qr.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},l_=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},Y0=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},X0=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},Q0=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=l_(),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},J0=function(t,r,s){const l=Q0(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=l_();l.write(d);const p=Y0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)p.writeByte(f[o]);return p.flush(),"data:image/gif;base64,"+p};Qr.stringToBytes;const tl=[{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}],o_={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},qs=[...tl,o_],Z0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},e1={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},c_=[Z0,e1],Hh=[...qs,...c_];tl.map(t=>t.name);const u_=qs.map(t=>t.name);c_.map(t=>t.name);Hh.map(t=>t.name);Hh.filter(t=>t.dispatchable).map(t=>t.name);function t1(t){return u_.includes(t)}const n1="zh-CN",i1="pm-final-only",h_=[{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"}],r1=[{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 s1(){const t={};for(const r of u_)t[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:t,autoOrchestration:!0}}function a1({sidebar:t,children:r}){const[s,l]=ee.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 Bo(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 lt(t,r,s){return`${t} failed. Reason: ${Bo(r,s)}`}function ko(t,r){return r.some(s=>t.startsWith(`${s} failed.`))?"":t}const Se={getAppPreferences(){return be("/api/settings/preferences")},updateAppPreferences(t){return be("/api/settings/preferences",{method:"PUT",body:JSON.stringify(t)})},getRuntimeDiagnostics(){return be("/api/diagnostics/runtime")},getCurrentProject(){return be("/api/projects/current")},pullCurrentProject(){return be("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return be("/api/projects/recent")},connectProject(t){return be("/api/projects/connect",{method:"POST",body:JSON.stringify(t)})},listTasks(){return be("/api/tasks")},createTask(t){return be("/api/tasks",{method:"POST",body:JSON.stringify(t)})},cleanupTask(t){return be(`/api/tasks/${encodeURIComponent(t)}/cleanup`,{method:"POST"})},getHarnessStatus(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness?${r.toString()}`)},applyHarness(t){return be("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(t)})},getHarnessFileContent(t,r){const s=new URLSearchParams({path:r,taskSlug:t});return be(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(t,r,s){const l=new URLSearchParams({path:r,taskSlug:t});return be(`/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),be(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(t){return be("/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 be(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(t={}){return be("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(t)})},restartHarnessBootstrap(t={}){return be("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessBootstrap(){return be("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(t){return be("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(t)})},getHarnessEngineerSession(){return be("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(t)})},startHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(t)})},resumeHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(t)})},restartHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessEngineerSession(){return be("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return be("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getHarnessFeedbackState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return be(`/api/projects/harness/feedback${s?`?${s}`:""}`)},startTaskHarnessRetrospective(t){return be("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(t)})},getAutoMemoryState(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness/memory?${r.toString()}`)},getMemoryFileContent(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/memory/file?${s.toString()}`)},updateMemoryFileContent(t,r,s){const l=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/memory/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},revertMemoryRun(t){return be("/api/projects/harness/memory/revert",{method:"POST",body:JSON.stringify(t)})},retryMemoryReview(t){return be("/api/projects/harness/memory/retry",{method:"POST",body:JSON.stringify(t)})},getTaskStatus(t){return be(`/api/tasks/${encodeURIComponent(t)}/status`)},oneClickStart(t){return be(`/api/tasks/${encodeURIComponent(t)}/one-click-start`,{method:"POST"})},getTaskWorkspaceState(t){return be(`/api/tasks/${encodeURIComponent(t)}/workspace-state`)},getProjectRuntimeState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return be(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(t){return be(`/api/tasks/${encodeURIComponent(t)}/sessions`)},startRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages`)},markAllMessagesDone(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages/history`,{method:"DELETE"})},getOrchestrationState(t){return be(`/api/tasks/${encodeURIComponent(t)}/orchestration`)},updateOrchestrationState(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(t){return be(`/api/tasks/${encodeURIComponent(t)}/round`)},getGateReviewState(t){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review`)},updateGateReviewSettings(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/report`)},startTranslationSession(t,r){return be(`/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)),be(`/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)),be(`/api/tasks/${encodeURIComponent(t)}/translation/feed?${l.toString()}`)},translateUserInput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},translateLatestReply(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/latest-reply`,{method:"POST"})},sendTranslatedInput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/clear`,{method:"POST"})},stopTranslationSession(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return be("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(t,r){return be(`/api/translation/sessions/${encodeURIComponent(t)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/failures/retry`,{method:"POST"})},getTranslationState(){return be("/api/translation/state")},getTranslatorSession(){return be("/api/translation/session")},ensureTranslatorSession(t={}){return be("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(t)})},startTranslatorSession(t={}){return be("/api/translation/session/start",{method:"POST",body:JSON.stringify(t)})},resumeTranslatorSession(t={}){return be("/api/translation/session/resume",{method:"POST",body:JSON.stringify(t)})},restartTranslatorSession(t={}){return be("/api/translation/session/restart",{method:"POST",body:JSON.stringify(t)})},stopTranslatorSession(){return be("/api/translation/session/stop",{method:"POST"})},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 be(`/api/translation/source-files${s}`)},createFileTranslation(t){return be("/api/translation/files",{method:"POST",body:JSON.stringify(t)})},readFileTranslation(t){return be(`/api/translation/files/${encodeURIComponent(t)}`)},createTranslationBootstrap(t){return be("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(t)})},createTranslationMemoryUpdate(t){return be("/api/translation/memory-update",{method:"POST",body:JSON.stringify(t)})},promoteTranslation(t,r){return be(`/api/translation/files/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return be("/api/gateway/status")},updateGatewaySettings(t){return be("/api/gateway/settings",{method:"PUT",body:JSON.stringify(t)})},startGatewayQrLogin(){return be("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(t={}){return be("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(t)})},startGatewayLarkRegistration(){return be("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return be("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(t){return be("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(t)})},resetGatewayBinding(){return be("/api/gateway/binding/reset",{method:"POST"})},setGatewayConnection(t){return be("/api/gateway/connection",{method:"PUT",body:JSON.stringify({enabled:t})})}};async function be(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: ${Bo(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=l1(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)??o1(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 l1(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}function o1(t){const r=t.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const vh="vcm:ui-error-report",yh="vcm:ui-error-clear-actions",Sh="vcm:ui-error-clear-message";function c1(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(vh,{detail:{message:r}}))}function u1(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(Sh,{detail:{message:r}}))}function h1(t){t.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(yh,{detail:{actions:t}}))}function Ni(t){const[r,s]=ee.useState(t),l=ee.useRef(t),d=ee.useCallback(p=>{const f=l.current,o=typeof p=="function"?p(f):p;l.current=o,typeof o=="string"&&o.trim()?c1(o):typeof f=="string"&&f.trim()&&u1(f),s(o)},[]);return[r,d]}var Qu={exports:{}},Gm;function f1(){return Gm||(Gm=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})()))})(Qu)),Qu.exports}var d1=f1(),Ju={exports:{}},Vm;function p1(){return Vm||(Vm=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 O={start:{x:D+1,y:M+1},end:{x:R,y:k+1}};A.push({range:O,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})()))})(Ju)),Ju.exports}var m1=p1(),Zu={exports:{}},Wm;function g1(){return Wm||(Wm=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
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 W=this._rowColumns.get(U);if(!W)return console.warn("columns is null. Race condition?"),null;let K=H<W.length?W[H]:W.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 W=new URL(H);["http:","https:"].includes(W.protocol)||(P=!0)}catch{P=!0}P||_.push({text:H,range:U,activate:(W,K)=>S?S.activate(W,K,U):T(0,K),hover:(W,K)=>{var G;return(G=S==null?void 0:S.hover)==null?void 0:G.call(S,W,K,U)},leave:(W,K)=>{var G;return(G=S==null?void 0:S.leave)==null?void 0:G.call(S,W,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}?
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))||"",O=(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",O),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:O,offset:H})=>{const U=O instanceof Text?O.parentNode:O;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 W=this._rowColumns.get(U);if(!W)return console.warn("columns is null. Race condition?"),null;let K=H<W.length?W[H]:W.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 O,H;if(this._isMouseOut)return;const R=k==null?void 0:k.map((U=>({link:U})));(O=this._activeProviderReplies)==null||O.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 O=k;O<=R;O++){if(S.has(O)){L.splice(M--,1);break}S.add(O)}}}}_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 O=0;O<L;O++)if(D!==-1||v.hasContent(O)){if(v.loadCell(O,A),A.hasExtendedAttrs()&&A.extended.urlId){if(D===-1){D=O,M=A.extended.urlId;continue}k=A.extended.urlId!==M}else D!==-1&&(k=!0);if(k||D!==-1&&O===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:O+(k||O!==L-1?0:1),y:E}};let P=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const W=new URL(H);["http:","https:"].includes(W.protocol)||(P=!0)}catch{P=!0}P||_.push({text:H,range:U,activate:(W,K)=>S?S.activate(W,K,U):T(0,K),hover:(W,K)=>{var G;return(G=S==null?void 0:S.hover)==null?void 0:G.call(S,W,K,U)},leave:(W,K)=>{var G;return(G=S==null?void 0:S.leave)==null?void 0:G.call(S,W,K,U)}})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(D=O,M=A.extended.urlId):(D=-1,M=-1)}}b(_)}};function T(E,b){if(confirm(`Do you want to navigate to ${b}?
54
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),W=c(844),K=c(6114),G=c(8437),Y=c(2584),Z=c(7399),z=c(5941),j=c(9074),N=c(2585),$=c(5435),I=c(4567),ie=c(779);class ve extends U.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Q={}){super(Q),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.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,ue)=>this.refresh(q,ue)))),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,W.toDisposable)((()=>{var q,ue;this._customKeyEventHandler=void 0,(ue=(q=this.element)==null?void 0:q.parentNode)==null||ue.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const q of Q){let ue,ae="";switch(q.index){case 256:ue="foreground",ae="10";break;case 257:ue="background",ae="11";break;case 258:ue="cursor",ae="12";break;default:ue="ansi",ae="4;"+q.index}switch(q.type){case 0:const de=H.color.toColorRGB(ue==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ue]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${ae};${(0,z.toRgbString)(de)}${Y.C1_ESCAPED.ST}`);break;case 1:if(ue==="ansi")this._themeService.modifyColors((re=>re.ansi[q.index]=H.channels.toColor(...q.color)));else{const re=ue;this._themeService.modifyColors((xe=>xe[re]=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 ue=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,de=q.getWidth(ue),re=this._renderService.dimensions.css.cell.width*de,xe=this.buffer.y*this._renderService.dimensions.css.cell.height,me=ue*this._renderService.dimensions.css.cell.width;this.textarea.style.left=me+"px",this.textarea.style.top=xe+"px",this.textarea.style.width=re+"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 ue;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"),((ue=this.element)==null?void 0:ue.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=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 ue(re){const xe=Q._mouseService.getMouseReportCoords(re,Q.screenElement);if(!xe)return!1;let me,Me;switch(re.overrideType||re.type){case"mousemove":Me=32,re.buttons===void 0?(me=3,re.button!==void 0&&(me=re.button<3?re.button:3)):me=1&re.buttons?0:4&re.buttons?1:2&re.buttons?2:3;break;case"mouseup":Me=0,me=re.button<3?re.button:3;break;case"mousedown":Me=1,me=re.button<3?re.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(re)===!1||Q.viewport.getLinesScrolled(re)===0)return!1;Me=re.deltaY<0?0:1,me=4;break;default:return!1}return!(Me===void 0||me===void 0||me>4)&&Q.coreMouseService.triggerMouseEvent({col:xe.col,row:xe.row,x:xe.x,y:xe.y,button:me,action:Me,ctrl:re.ctrlKey,alt:re.altKey,shift:re.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:re=>(ue(re),re.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(re)),wheel:re=>(ue(re),this.cancel(re,!0)),mousedrag:re=>{re.buttons&&ue(re)},mousemove:re=>{re.buttons||ue(re)}};this.register(this.coreMouseService.onProtocolChange((re=>{re?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(re)),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&re?ae.mousemove||(q.addEventListener("mousemove",de.mousemove),ae.mousemove=de.mousemove):(q.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&re?ae.wheel||(q.addEventListener("wheel",de.wheel,{passive:!1}),ae.wheel=de.wheel):(q.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&re?ae.mouseup||(ae.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&re?ae.mousedrag||(ae.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(q,"mousedown",(re=>{if(re.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(re))return ue(re),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(re)}))),this.register((0,m.addDisposableDomListener)(q,"wheel",(re=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(re)===!1)return!1;if(!this.buffer.hasScrollback){const xe=this.viewport.getLinesScrolled(re);if(xe===0)return;const me=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(re.deltaY<0?"A":"B");let Me="";for(let De=0;De<Math.abs(xe);De++)Me+=me;return this.coreService.triggerDataEvent(Me,!0),this.cancel(re,!0)}return this.viewport.handleWheel(re)?this.cancel(re):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(q,"touchstart",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(re),this.cancel(re)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(q,"touchmove",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(re)?void 0:this.cancel(re)}),{passive:!1}))}refresh(Q,q){var ue;(ue=this._renderService)==null||ue.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,ue=0){var ae;ue===1?(super.scrollLines(Q,q,ue),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,ue){this._selectionService.setSelection(Q,q,ue)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Q;(Q=this._selectionService)==null||Q.clearSelection()}selectAll(){var Q;(Q=this._selectionService)==null||Q.selectAll()}selectLines(Q,q){var ue;(ue=this._selectionService)==null||ue.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 ue=(0,Z.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),ue.type===3||ue.type===2){const ae=this.rows-1;return this.scrollLines(ue.type===2?-ae:ae),this.cancel(Q,!0)}return ue.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(ue.cancel&&this.cancel(Q,!0),!ue.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):(ue.key!==Y.C0.ETX&&ue.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ue.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(ue.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,q){const ue=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"?ue:ue&&(!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 ue,ae;(ue=this._charSizeService)==null||ue.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,ue;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(),(ue=this.viewport)==null||ue.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),ue=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${ue};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${de};${ae}t`)}}cancel(Q,q){if(this.options.cancelEvents||q)return Q.preventDefault(),Q.stopPropagation(),!1}}o.Terminal=ve},9924:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const 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 W=y(D,k)==="A"?-1:1,K=R.buffer.lines.get(H+W*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 W;W=m(R,H,U,P).length>0?H-u(H,U):R;const K=H,G=(function(Y,Z,z,j,N,$){let I;return I=m(z,j,N,$).length>0?j-u(j,N):Z,Y<z&&I<=j||Y>=z&&I<j?"C":"D"})(k,R,B,H,U,P);return E(w(k,W,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,W,K,G){var Y,Z=arguments.length,z=Z<3?W:G===null?G=Object.getOwnPropertyDescriptor(W,K):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,W,K,G);else for(var j=P.length-1;j>=0;j--)(Y=P[j])&&(z=(Z<3?Y(z):Z>3?Y(W,K,z):Y(W,K))||z);return Z>3&&z&&Object.defineProperty(W,K,z),z},m=this&&this.__param||function(P,W){return function(K,G){W(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,W,K,G,Y,Z,z,j,N,$,I,ie,ve){super(),this._terminal=P,this._document=W,this._element=K,this._screenElement=G,this._viewportElement=Y,this._helperContainer=Z,this._linkifier2=z,this._charSizeService=N,this._optionsService=$,this._bufferService=I,this._coreBrowserService=ie,this._themeService=ve,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(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((_e=>this._injectCss(_e)))),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((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),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 W=`${this._terminalSelector} .${M} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${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}`;W+=`${this._terminalSelector} .${M} .xterm-dim { color: ${v.color.multiplyOpacity(P.foreground,.5).css};}`,W+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const K=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;W+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${G} { 50% { box-shadow: none; }}`,W+=`@keyframes ${Y} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,W+=`${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);}`,W+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,z]of P.ansi.entries())W+=`${this._terminalSelector} .${D}${Z} { color: ${z.css}; }${this._terminalSelector} .${D}${Z}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${Z} { background-color: ${z.css}; }`;W+=`${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=W}_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,W){for(let K=this._rowElements.length;K<=W;K++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,W){this._refreshRowElements(P,W),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(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,W,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,W,K),this.renderRows(0,this._bufferService.rows-1),!P||!W)return;this._selectionRenderModel.update(this._terminal,P,W,K);const G=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(K){const N=P[0]>W[0];j.appendChild(this._createSelectionElement(Z,N?W[0]:P[0],N?P[0]:W[0],z-Z+1))}else{const N=G===Z?P[0]:0,$=Z===Y?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(Z,N,$));const I=z-Z-1;if(j.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,I)),Z!==z){const ie=Y===z?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,ie))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,W,K,G=1){const Y=this._document.createElement("div"),Z=W*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(K-W);return Z+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-Z),Y.style.height=G*this.dimensions.css.cell.height+"px",Y.style.top=P*this.dimensions.css.cell.height+"px",Y.style.left=`${Z}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,W){const K=this._bufferService.buffer,G=K.ybase+K.y,Y=Math.min(K.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=W;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,Z,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,W,K,G,Y,Z){K<0&&(P=0),G<0&&(W=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,ve=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=K;_e<=G;++_e){const Q=_e+j.ydisp,q=this._rowElements[_e],ue=j.lines.get(Q);if(!q||!ue)break;q.replaceChildren(...this._rowFactory.createRow(ue,Q,Q===N,ie,ve,$,I,this.dimensions.css.cell.width,this._widthCache,Z?_e===K?P:0:-1,Z?(_e===G?W: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,W,K,G){const Y=[],Z=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,ve=0,_e=0,Q=!1,q=0,ue=!1,ae=0;const de=[],re=K!==-1&&G!==-1;for(let xe=0;xe<N;xe++){M.loadCell(xe,this._workCell);let me=this._workCell.getWidth();if(me===0)continue;let Me=!1,De=xe,ke=this._workCell;if(Z.length>0&&xe===Z[0][0]){Me=!0;const Fe=Z.shift();ke=new v.JoinedCellData(this._workCell,M.translateToString(!0,Fe[0],Fe[1]),Fe[1]-Fe[0]),De=Fe[1]-1,me=ke.getWidth()}const Tt=this._isCellInSelection(xe,D),xt=k&&xe===H,Nt=re&&xe>=K&&xe<=G;let rn=!1;this._decorationService.forEachDecorationAtCell(xe,D,void 0,(Fe=>{rn=!0}));let Rn=ke.getChars()||y.WHITESPACE_CELL_CHAR;if(Rn===" "&&(ke.isUnderline()||ke.isOverline())&&(Rn=" "),ae=me*P-W.get(Rn,ke.isBold(),ke.isItalic()),j){if($&&(Tt&&ue||!Tt&&!ue&&ke.bg===ie)&&(Tt&&ue&&z.selectionForeground||ke.fg===ve)&&ke.extended.ext===_e&&Nt===Q&&ae===q&&!xt&&!Me&&!rn){ke.isInvisible()?I+=y.WHITESPACE_CELL_CHAR:I+=Rn,$++;continue}$&&(j.textContent=I),j=this._document.createElement("span"),$=0,I=""}else j=this._document.createElement("span");if(ie=ke.bg,ve=ke.fg,_e=ke.extended.ext,Q=Nt,q=ae,ue=Tt,Me&&H>=xe&&H<=De&&(H=xe),!this._coreService.isCursorHidden&&xt&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&de.push("xterm-cursor-blink"),de.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(ke.isBold()&&de.push("xterm-bold"),ke.isItalic()&&de.push("xterm-italic"),ke.isDim()&&de.push("xterm-dim"),I=ke.isInvisible()?y.WHITESPACE_CELL_CHAR:ke.getChars()||y.WHITESPACE_CELL_CHAR,ke.isUnderline()&&(de.push(`xterm-underline-${ke.extended.underlineStyle}`),I===" "&&(I=" "),!ke.isUnderlineColorDefault()))if(ke.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(ke.getUnderlineColor()).join(",")})`;else{let Fe=ke.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ke.isBold()&&Fe<8&&(Fe+=8),j.style.textDecorationColor=z.ansi[Fe].css}ke.isOverline()&&(de.push("xterm-overline"),I===" "&&(I=" ")),ke.isStrikethrough()&&de.push("xterm-strikethrough"),Nt&&(j.style.textDecoration="underline");let gt=ke.getFgColor(),ut=ke.getFgColorMode(),Bt=ke.getBgColor(),fe=ke.getBgColorMode();const Ce=!!ke.isInverse();if(Ce){const Fe=gt;gt=Bt,Bt=Fe;const _t=ut;ut=fe,fe=_t}let Te,je,Ne,pt=!1;switch(this._decorationService.forEachDecorationAtCell(xe,D,void 0,(Fe=>{Fe.options.layer!=="top"&&pt||(Fe.backgroundColorRGB&&(fe=50331648,Bt=Fe.backgroundColorRGB.rgba>>8&16777215,Te=Fe.backgroundColorRGB),Fe.foregroundColorRGB&&(ut=50331648,gt=Fe.foregroundColorRGB.rgba>>8&16777215,je=Fe.foregroundColorRGB),pt=Fe.options.layer==="top")})),!pt&&Tt&&(Te=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Bt=Te.rgba>>8&16777215,fe=50331648,pt=!0,z.selectionForeground&&(ut=50331648,gt=z.selectionForeground.rgba>>8&16777215,je=z.selectionForeground)),pt&&de.push("xterm-decoration-top"),fe){case 16777216:case 33554432:Ne=z.ansi[Bt],de.push(`xterm-bg-${Bt}`);break;case 50331648:Ne=E.channels.toColor(Bt>>16,Bt>>8&255,255&Bt),this._addStyle(j,`background-color:#${L((Bt>>>0).toString(16),"0",6)}`);break;default:Ce?(Ne=z.foreground,de.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ne=z.background}switch(Te||ke.isDim()&&(Te=E.color.multiplyOpacity(Ne,.5)),ut){case 16777216:case 33554432:ke.isBold()&&gt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(gt+=8),this._applyMinimumContrast(j,Ne,z.ansi[gt],ke,Te,void 0)||de.push(`xterm-fg-${gt}`);break;case 50331648:const Fe=E.channels.toColor(gt>>16&255,gt>>8&255,255&gt);this._applyMinimumContrast(j,Ne,Fe,ke,Te,je)||this._addStyle(j,`color:#${L(gt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Ne,z.foreground,ke,Te,je)||Ce&&de.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}de.length&&(j.className=de.join(" "),de.length=0),xt||Me||rn?j.textContent=I:$++,ae!==this.defaultSpacing&&(j.style.letterSpacing=`${ae}px`),Y.push(j),xe=De}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 W=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);P=E.color.ensureContrastRatio(B||D,H||k,W),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 h_{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++)h_._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,W=P<3?R:H===null?H=Object.getOwnPropertyDescriptor(R,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(k,R,B,H);else for(var K=k.length-1;K>=0;K--)(U=k[K])&&(W=(P<3?U(W):P>3?U(R,B,W):U(R,B))||W);return P>3&&W&&Object.defineProperty(R,B,W),W},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,W,K,G){super(),this._element=k,this._screenElement=R,this._linkifier=B,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=W,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 W=k[1];W<=R[1];W++){const K=B.translateBufferLineToString(W,!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 W=B.lines.get(P),K=B.translateBufferLineToString(P,!0);W!=null&&W.isWrapped?H[H.length-1]+=K:H.push(K)}if(k[1]!==R[1]){const P=B.lines.get(R[1]),W=B.translateBufferLineToString(R[1],!0,0,R[0]);P&&P.isWrapped?H[H.length-1]+=W:H.push(W)}}return H.map((U=>U.replace(M," "))).join(v.isWindows?`\r
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),O=c(6731),H=c(8055),U=c(8969),P=c(8460),W=c(844),K=c(6114),G=c(8437),Y=c(2584),Z=c(7399),z=c(5941),j=c(9074),N=c(2585),$=c(5435),I=c(4567),ie=c(779);class _e 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 W.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,ue)=>this.refresh(q,ue)))),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,W.toDisposable)((()=>{var q,ue;this._customKeyEventHandler=void 0,(ue=(q=this.element)==null?void 0:q.parentNode)==null||ue.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const q of Q){let ue,le="";switch(q.index){case 256:ue="foreground",le="10";break;case 257:ue="background",le="11";break;case 258:ue="cursor",le="12";break;default:ue="ansi",le="4;"+q.index}switch(q.type){case 0:const he=H.color.toColorRGB(ue==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ue]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${le};${(0,z.toRgbString)(he)}${Y.C1_ESCAPED.ST}`);break;case 1:if(ue==="ansi")this._themeService.modifyColors((re=>re.ansi[q.index]=H.channels.toColor(...q.color)));else{const re=ue;this._themeService.modifyColors((Ee=>Ee[re]=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 ue=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,he=q.getWidth(ue),re=this._renderService.dimensions.css.cell.width*he,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,Be=ue*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Be+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=re+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"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 ue;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"),((ue=this.element)==null?void 0:ue.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=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",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",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",(le=>this._handleTextAreaFocus(le)))),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(O.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((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(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((le=>this.scrollLines(le.amount,le.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,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",(le=>this._selectionService.handleMouseDown(le)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&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 ue(re){const Ee=Q._mouseService.getMouseReportCoords(re,Q.screenElement);if(!Ee)return!1;let Be,ve;switch(re.overrideType||re.type){case"mousemove":ve=32,re.buttons===void 0?(Be=3,re.button!==void 0&&(Be=re.button<3?re.button:3)):Be=1&re.buttons?0:4&re.buttons?1:2&re.buttons?2:3;break;case"mouseup":ve=0,Be=re.button<3?re.button:3;break;case"mousedown":ve=1,Be=re.button<3?re.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(re)===!1||Q.viewport.getLinesScrolled(re)===0)return!1;ve=re.deltaY<0?0:1,Be=4;break;default:return!1}return!(ve===void 0||Be===void 0||Be>4)&&Q.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:Be,action:ve,ctrl:re.ctrlKey,alt:re.altKey,shift:re.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},he={mouseup:re=>(ue(re),re.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(re)),wheel:re=>(ue(re),this.cancel(re,!0)),mousedrag:re=>{re.buttons&&ue(re)},mousemove:re=>{re.buttons||ue(re)}};this.register(this.coreMouseService.onProtocolChange((re=>{re?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(re)),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&re?le.mousemove||(q.addEventListener("mousemove",he.mousemove),le.mousemove=he.mousemove):(q.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&re?le.wheel||(q.addEventListener("wheel",he.wheel,{passive:!1}),le.wheel=he.wheel):(q.removeEventListener("wheel",le.wheel),le.wheel=null),2&re?le.mouseup||(le.mouseup=he.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&re?le.mousedrag||(le.mousedrag=he.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(q,"mousedown",(re=>{if(re.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(re))return ue(re),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(re)}))),this.register((0,m.addDisposableDomListener)(q,"wheel",(re=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(re)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(re);if(Ee===0)return;const Be=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(re.deltaY<0?"A":"B");let ve="";for(let Te=0;Te<Math.abs(Ee);Te++)ve+=Be;return this.coreService.triggerDataEvent(ve,!0),this.cancel(re,!0)}return this.viewport.handleWheel(re)?this.cancel(re):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(q,"touchstart",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(re),this.cancel(re)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(q,"touchmove",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(re)?void 0:this.cancel(re)}),{passive:!1}))}refresh(Q,q){var ue;(ue=this._renderService)==null||ue.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,ue=0){var le;ue===1?(super.scrollLines(Q,q,ue),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.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,ue){this._selectionService.setSelection(Q,q,ue)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Q;(Q=this._selectionService)==null||Q.clearSelection()}selectAll(){var Q;(Q=this._selectionService)==null||Q.selectAll()}selectLines(Q,q){var ue;(ue=this._selectionService)==null||ue.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 ue=(0,Z.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),ue.type===3||ue.type===2){const le=this.rows-1;return this.scrollLines(ue.type===2?-le:le),this.cancel(Q,!0)}return ue.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(ue.cancel&&this.cancel(Q,!0),!ue.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):(ue.key!==Y.C0.ETX&&ue.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ue.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(ue.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,q){const ue=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"?ue:ue&&(!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 ue,le;(ue=this._charSizeService)==null||ue.measure(),(le=this.viewport)==null||le.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,ue;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(),(ue=this.viewport)==null||ue.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),ue=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${ue};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const le=this._renderService.dimensions.css.cell.width.toFixed(0),he=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${he};${le}t`)}}cancel(Q,q){if(this.options.cancelEvents||q)return Q.preventDefault(),Q.stopPropagation(),!1}}o.Terminal=_e},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 O=D.get(R);if(!O)continue;const H=(k=D.get(R+1))==null?void 0:k.isWrapped;if(A+=O.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 O=S.length-1;O>=0;O--)(D=S[O])&&(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 O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,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 O=0;const H=D-u(D,R),U=k-u(k,R);for(let P=0;P<Math.abs(H-U);P++){const W=y(D,k)==="A"?-1:1,K=R.buffer.lines.get(H+W*P);K!=null&&K.isWrapped&&O++}return O})(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,O,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,O,H,U,P){let W;W=m(R,H,U,P).length>0?H-u(H,U):R;const K=H,G=(function(Y,Z,z,j,N,$){let I;return I=m(z,j,N,$).length>0?j-u(j,N):Z,Y<z&&I<=j||Y>=z&&I<j?"C":"D"})(k,R,O,H,U,P);return E(w(k,W,O,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,W,K,G){var Y,Z=arguments.length,z=Z<3?W:G===null?G=Object.getOwnPropertyDescriptor(W,K):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,W,K,G);else for(var j=P.length-1;j>=0;j--)(Y=P[j])&&(z=(Z<3?Y(z):Z>3?Y(W,K,z):Y(W,K))||z);return Z>3&&z&&Object.defineProperty(W,K,z),z},m=this&&this.__param||function(P,W){return function(K,G){W(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",O="xterm-selection";let H=1,U=o.DomRenderer=class extends S.Disposable{constructor(P,W,K,G,Y,Z,z,j,N,$,I,ie,_e){super(),this._terminal=P,this._document=W,this._element=K,this._screenElement=G,this._viewportElement=Y,this._helperContainer=Z,this._linkifier2=z,this._charSizeService=N,this._optionsService=$,this._bufferService=I,this._coreBrowserService=ie,this._themeService=_e,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(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,T.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ge=>this._injectCss(ge)))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ge=>this._handleLinkHover(ge)))),this.register(this._linkifier2.onHideLinkUnderline((ge=>this._handleLinkLeave(ge)))),this.register((0,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 W=`${this._terminalSelector} .${M} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${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}`;W+=`${this._terminalSelector} .${M} .xterm-dim { color: ${v.color.multiplyOpacity(P.foreground,.5).css};}`,W+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const K=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;W+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${G} { 50% { box-shadow: none; }}`,W+=`@keyframes ${Y} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,W+=`${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);}`,W+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,z]of P.ansi.entries())W+=`${this._terminalSelector} .${D}${Z} { color: ${z.css}; }${this._terminalSelector} .${D}${Z}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${Z} { background-color: ${z.css}; }`;W+=`${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=W}_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,W){for(let K=this._rowElements.length;K<=W;K++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,W){this._refreshRowElements(P,W),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(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,W,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,W,K),this.renderRows(0,this._bufferService.rows-1),!P||!W)return;this._selectionRenderModel.update(this._terminal,P,W,K);const G=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(K){const N=P[0]>W[0];j.appendChild(this._createSelectionElement(Z,N?W[0]:P[0],N?P[0]:W[0],z-Z+1))}else{const N=G===Z?P[0]:0,$=Z===Y?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(Z,N,$));const I=z-Z-1;if(j.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,I)),Z!==z){const ie=Y===z?W[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,ie))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,W,K,G=1){const Y=this._document.createElement("div"),Z=W*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(K-W);return Z+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-Z),Y.style.height=G*this.dimensions.css.cell.height+"px",Y.style.top=P*this.dimensions.css.cell.height+"px",Y.style.left=`${Z}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,W){const K=this._bufferService.buffer,G=K.ybase+K.y,Y=Math.min(K.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=W;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,Z,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,W,K,G,Y,Z){K<0&&(P=0),G<0&&(W=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,_e=this._optionsService.rawOptions.cursorInactiveStyle;for(let ge=K;ge<=G;++ge){const Q=ge+j.ydisp,q=this._rowElements[ge],ue=j.lines.get(Q);if(!q||!ue)break;q.replaceChildren(...this._rowFactory.createRow(ue,Q,Q===N,ie,_e,$,I,this.dimensions.css.cell.width,this._widthCache,Z?ge===K?P:0:-1,Z?(ge===G?W: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 O,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--)(O=M[P])&&(U=(H<3?O(U):H>3?O(D,k,U):O(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,O,H,U){this._document=M,this._characterJoinerService=D,this._optionsService=k,this._coreBrowserService=R,this._coreService=O,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,O,H,U,P,W,K,G){const Y=[],Z=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,_e=0,ge=0,Q=!1,q=0,ue=!1,le=0;const he=[],re=K!==-1&&G!==-1;for(let Ee=0;Ee<N;Ee++){M.loadCell(Ee,this._workCell);let Be=this._workCell.getWidth();if(Be===0)continue;let ve=!1,Te=Ee,xe=this._workCell;if(Z.length>0&&Ee===Z[0][0]){ve=!0;const qe=Z.shift();xe=new v.JoinedCellData(this._workCell,M.translateToString(!0,qe[0],qe[1]),qe[1]-qe[0]),Te=qe[1]-1,Be=xe.getWidth()}const Tt=this._isCellInSelection(Ee,D),xt=k&&Ee===H,Nt=re&&Ee>=K&&Ee<=G;let rn=!1;this._decorationService.forEachDecorationAtCell(Ee,D,void 0,(qe=>{rn=!0}));let Dn=xe.getChars()||y.WHITESPACE_CELL_CHAR;if(Dn===" "&&(xe.isUnderline()||xe.isOverline())&&(Dn=" "),le=Be*P-W.get(Dn,xe.isBold(),xe.isItalic()),j){if($&&(Tt&&ue||!Tt&&!ue&&xe.bg===ie)&&(Tt&&ue&&z.selectionForeground||xe.fg===_e)&&xe.extended.ext===ge&&Nt===Q&&le===q&&!xt&&!ve&&!rn){xe.isInvisible()?I+=y.WHITESPACE_CELL_CHAR:I+=Dn,$++;continue}$&&(j.textContent=I),j=this._document.createElement("span"),$=0,I=""}else j=this._document.createElement("span");if(ie=xe.bg,_e=xe.fg,ge=xe.extended.ext,Q=Nt,q=le,ue=Tt,ve&&H>=Ee&&H<=Te&&(H=Ee),!this._coreService.isCursorHidden&&xt&&this._coreService.isCursorInitialized){if(he.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&he.push("xterm-cursor-blink"),he.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":he.push("xterm-cursor-outline");break;case"block":he.push("xterm-cursor-block");break;case"bar":he.push("xterm-cursor-bar");break;case"underline":he.push("xterm-cursor-underline")}}if(xe.isBold()&&he.push("xterm-bold"),xe.isItalic()&&he.push("xterm-italic"),xe.isDim()&&he.push("xterm-dim"),I=xe.isInvisible()?y.WHITESPACE_CELL_CHAR:xe.getChars()||y.WHITESPACE_CELL_CHAR,xe.isUnderline()&&(he.push(`xterm-underline-${xe.extended.underlineStyle}`),I===" "&&(I=" "),!xe.isUnderlineColorDefault()))if(xe.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(xe.getUnderlineColor()).join(",")})`;else{let qe=xe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&xe.isBold()&&qe<8&&(qe+=8),j.style.textDecorationColor=z.ansi[qe].css}xe.isOverline()&&(he.push("xterm-overline"),I===" "&&(I=" ")),xe.isStrikethrough()&&he.push("xterm-strikethrough"),Nt&&(j.style.textDecoration="underline");let gt=xe.getFgColor(),ut=xe.getFgColorMode(),Bt=xe.getBgColor(),fe=xe.getBgColorMode();const Ce=!!xe.isInverse();if(Ce){const qe=gt;gt=Bt,Bt=qe;const _t=ut;ut=fe,fe=_t}let Ae,je,Ne,dt=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,D,void 0,(qe=>{qe.options.layer!=="top"&&dt||(qe.backgroundColorRGB&&(fe=50331648,Bt=qe.backgroundColorRGB.rgba>>8&16777215,Ae=qe.backgroundColorRGB),qe.foregroundColorRGB&&(ut=50331648,gt=qe.foregroundColorRGB.rgba>>8&16777215,je=qe.foregroundColorRGB),dt=qe.options.layer==="top")})),!dt&&Tt&&(Ae=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Bt=Ae.rgba>>8&16777215,fe=50331648,dt=!0,z.selectionForeground&&(ut=50331648,gt=z.selectionForeground.rgba>>8&16777215,je=z.selectionForeground)),dt&&he.push("xterm-decoration-top"),fe){case 16777216:case 33554432:Ne=z.ansi[Bt],he.push(`xterm-bg-${Bt}`);break;case 50331648:Ne=E.channels.toColor(Bt>>16,Bt>>8&255,255&Bt),this._addStyle(j,`background-color:#${L((Bt>>>0).toString(16),"0",6)}`);break;default:Ce?(Ne=z.foreground,he.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ne=z.background}switch(Ae||xe.isDim()&&(Ae=E.color.multiplyOpacity(Ne,.5)),ut){case 16777216:case 33554432:xe.isBold()&&gt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(gt+=8),this._applyMinimumContrast(j,Ne,z.ansi[gt],xe,Ae,void 0)||he.push(`xterm-fg-${gt}`);break;case 50331648:const qe=E.channels.toColor(gt>>16&255,gt>>8&255,255&gt);this._applyMinimumContrast(j,Ne,qe,xe,Ae,je)||this._addStyle(j,`color:#${L(gt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Ne,z.foreground,xe,Ae,je)||Ce&&he.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}he.length&&(j.className=he.join(" "),he.length=0),xt||ve||rn?j.textContent=I:$++,le!==this.defaultSpacing&&(j.style.letterSpacing=`${le}px`),Y.push(j),Ee=Te}return j&&$&&(j.textContent=I),Y}_applyMinimumContrast(M,D,k,R,O,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const U=this._getContrastCache(R);let P;if(O||H||(P=U.getColor(D.rgba,k.rgba)),P===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);P=E.color.ensureContrastRatio(O||D,H||k,W),U.setColor((O||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 f_{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),O=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!==O){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,O=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 O=this._characterJoiners[R].handler(D);for(let H=0;H<O.length;H++)f_._mergeRanges(k,O[H])}catch(O){console.error(O)}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 O=S.getWidth(R),H=S.getString(R).length||y.WHITESPACE_CELL_CHAR.length;if(O!==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(((O,H)=>this._renderRows(O,H)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.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((O=>this._registerIntersectionObserver(O,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,O,H){var U,P=arguments.length,W=P<3?R:H===null?H=Object.getOwnPropertyDescriptor(R,O):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(k,R,O,H);else for(var K=k.length-1;K>=0;K--)(U=k[K])&&(W=(P<3?U(W):P>3?U(R,O,W):U(R,O))||W);return P>3&&W&&Object.defineProperty(R,O,W),W},m=this&&this.__param||function(k,R){return function(O,H){R(O,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,O,H,U,P,W,K,G){super(),this._element=k,this._screenElement=R,this._linkifier=O,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=W,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 O=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 W=k[1];W<=R[1];W++){const K=O.translateBufferLineToString(W,!0,U,P);H.push(K)}}else{const U=k[1]===R[1]?R[0]:void 0;H.push(O.translateBufferLineToString(k[1],!0,k[0],U));for(let P=k[1]+1;P<=R[1]-1;P++){const W=O.lines.get(P),K=O.translateBufferLineToString(P,!0);W!=null&&W.isWrapped?H[H.length-1]+=K:H.push(K)}if(k[1]!==R[1]){const P=O.lines.get(R[1]),W=O.translateBufferLineToString(R[1],!0,0,R[0]);P&&P.isWrapped?H[H.length-1]+=W:H.push(W)}}return H.map((U=>U.replace(M," "))).join(v.isWindows?`\r
56
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 W=U.translateBufferLineToString(k[1],!1);let K=this._convertViewportColToCharacterIndex(P,k[0]),G=K;const Y=k[0]-K;let Z=0,z=0,j=0,N=0;if(W.charAt(K)===" "){for(;K>0&&W.charAt(K-1)===" ";)K--;for(;G<W.length&&W.charAt(G+1)===" ";)G++}else{let ie=k[0],ve=k[0];P.getWidth(ie)===0&&(Z++,ie--),P.getWidth(ve)===2&&(z++,ve++);const _e=P.getString(ve).length;for(_e>1&&(N+=_e-1,G+=_e-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?(Z++,ie--):Q>1&&(j+=Q-1,K-=Q-1),K--,ie--}for(;ve<P.length&&G+1<W.length&&!this._isCharWordSeparator(P.loadCell(ve+1,this._workCell));){P.loadCell(ve+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ve++):Q>1&&(N+=Q-1,G+=Q-1),G++,ve++}}G++;let $=K+Y-Z+j,I=Math.min(this._bufferService.cols,G-K+Z+z-j-N);if(R||W.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 ve=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ve){const _e=this._bufferService.cols-ve.start;$-=_e,I+=_e}}}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 ve=this._getWordAt([0,k[1]+1],!1,!1,!0);ve&&(I+=ve.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 W=D.length-1;W>=0;W--)(H=D[W])&&(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,W=D>>8&255,K=_(E.relativeLuminance2(U,P,W),E.relativeLuminance2(R,B,H));for(;K<k&&(U>0||P>0||W>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),W-=Math.max(0,Math.ceil(.1*W)),K=_(E.relativeLuminance2(U,P,W),E.relativeLuminance2(R,B,H));return(U<<24|P<<16|W<<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,W=D>>8&255,K=_(E.relativeLuminance2(U,P,W),E.relativeLuminance2(R,B,H));for(;K<k&&(U<255||P<255||W<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),W=Math.min(255,W+Math.ceil(.1*(255-W))),K=_(E.relativeLuminance2(U,P,W),E.relativeLuminance2(R,B,H));return(U<<24|P<<16|W<<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),W=_(R,E.relativeLuminance(P>>8));if(W<k){const K=L(M,D,k);return W>_(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(Z,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(Z,z,j,N);else for(var ve=Z.length-1;ve>=0;ve--)($=Z[ve])&&(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(Z,z){return function(j,N){z(j,N,Z)}};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(Z,z){if(Z>24)return z.setWinLines||!1;switch(Z){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var P;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let W=0;class K extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,$,I,ie,ve,_e,Q=new w.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=ie,this._coreMouseService=ve,this._unicodeService=_e,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,ue)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ue.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,ue,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ue,data:ae})})),this._parser.setDcsHandlerFallback(((q,ue,ae)=>{ue==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ue,payload:ae})})),this._parser.setPrintHandler(((q,ue,ae)=>this.print(q,ue,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,ue)=>this.requestStatusString(q,ue))))}_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 ve=this._parseStack.paused;if(ve){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))),ve||this._dirtyRowTracker.clearRange(),z.length>H)for(let q=ie;q<z.length;q+=H){const ue=q+H<z.length?q+H:z.length,ae=typeof z=="string"?this._stringDecoder.decode(z.substring(q,ue),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,ue),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ae))return this._preserveStack($,I,ae,q),this._logSlowResolvingAsync(N),N}else if(!ve){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,q))return this._preserveStack($,I,q,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===$&&this._activeBuffer.y===I||this._onCursorMove.fire();const _e=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(_e,this._bufferService.rows-1))}print(z,j,N){let $,I;const ie=this._charsetService.charset,ve=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,ue=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,ue);let de=this._parser.precedingJoinState;for(let re=j;re<N;++re){if($=z[re],$<127&&ie){const De=ie[String.fromCharCode($)];De&&($=De.charCodeAt(0))}const xe=this._unicodeService.charProperties($,de);I=M.UnicodeService.extractWidth(xe);const me=M.UnicodeService.extractShouldJoin(xe),Me=me?M.UnicodeService.extractWidth(de):0;if(de=xe,ve&&this._onA11yChar.fire((0,E.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-Me>_e){if(Q){const De=ae;let ke=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(De,ke,0,Me,!1);ke<_e;)De.setCellFromCodepoint(ke++,0,1,ue)}else if(this._activeBuffer.x=_e-1,I===2)continue}if(me&&this._activeBuffer.x){const De=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-De,$,I);for(let ke=I-Me;--ke>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}else if(q&&(ae.insertCells(this._activeBuffer.x,I-Me,this._activeBuffer.getNullCell(ue)),ae.getWidth(_e-1)===2&&ae.setCellFromCodepoint(_e-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,ue)),ae.setCellFromCodepoint(this._activeBuffer.x++,$,I,ue),I>0)for(;--I;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}this._parser.precedingJoinState=de,this._activeBuffer.x<_e&&N-j>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,ue),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),ve=new Uint32Array(ie.length*N);let _e=0;for(let q=0;q<ie.length;){const ue=ie.codePointAt(q)||0;ve[_e++]=ue,q+=ue>65535?2:1}let Q=_e;for(let q=1;q<N;++q)ve.copyWithin(Q,0,_e),Q+=_e;return this.print(ve,0,Q),!0}sendDeviceAttributesPrimary(z){return z.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let 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:ve,cols:_e}=this._bufferService,{active:Q,alt:q}=ve,ue=this._optionsService.rawOptions,ae=me=>me?1:2,de=z.params[0];return re=de,xe=j?de===2?4:de===4?ae(ie.modes.insertMode):de===12?3:de===20?ae(ue.convertEol):0:de===1?ae(N.applicationCursorKeys):de===3?ue.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:de===6?ae(N.origin):de===7?ae(N.wraparound):de===8?3:de===9?ae($==="X10"):de===12?ae(ue.cursorBlink):de===25?ae(!ie.isCursorHidden):de===45?ae(N.reverseWraparound):de===66?ae(N.applicationKeypad):de===67?4:de===1e3?ae($==="VT200"):de===1002?ae($==="DRAG"):de===1003?ae($==="ANY"):de===1004?ae(N.sendFocus):de===1005?4:de===1006?ae(I==="SGR"):de===1015?4:de===1016?ae(I==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?ae(Q===q):de===2004?ae(N.bracketedPasteMode):0,ie.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${re};${xe}$y`),!0;var re,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 ve=z.getSubParams(j+ie);let _e=0;do $[1]===5&&(I=1),$[ie+_e+1+I]=ve[_e];while(++_e<ve.length&&_e+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 ve=2;ve<$.length;++ve)$[ve]===-1&&($[ve]=0);switch($[0]){case 38:N.fg=this._updateAttrColor(N.fg,$[1],$[3],$[4],$[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,$[1],$[3],$[4],$[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,$[1],$[3],$[4],$[5])}return 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 ve=(0,R.parseColor)(I);ve&&j.push({type:1,index:ie,color:ve})}}}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(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,z){Z>z&&(W=Z,Z=z,z=W),Z<this.start&&(this.start=Z),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(Z){return 0<=Z&&Z<256}G=h([m(0,L.IBufferService)],G)},844:(f,o)=>{function c(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,u,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 W;W=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 Z=R.length-P-1,z=H;for(;Z>=0;){const N=Math.min(z,Y);if(R[G]===void 0)break;if(R[G].copyCellsFrom(R[Z],z-N,Y-N,N,!0),Y-=N,Y===0&&(G--,Y=U[G]),z-=N,z===0){Z--;const $=Math.max(Z,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-W;for(;j-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+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 W=0;for(let G=D.length-1;G>=0;G--)D[G].index+=W,this.lines.onInsertEmitter.fire(D[G]),W+=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})()))})(Ju)),Ju.exports}var S1=y1();class b1{constructor(r,s){Mm(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: ${Bo(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 jo({sessionId:t,active:r=!0,onEvent:s}){const l=ee.useRef(null),d=ee.useRef(null),p=ee.useRef(null),f=ee.useRef(null),o=ee.useRef(null),c=ee.useRef(""),h=ee.useRef(""),m=ee.useRef(r),u=ee.useRef(s),[y,w]=ee.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,_=Wm(v,c.current,h.current);if(!_){T("empty"),v==null||v.focus();return}T(await Ym(_)?"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<Xm||M.height<Qm||(A.fit(),L.cols<Jm||L.rows<Zm)?!1:(S.resize(L.cols,L.rows),v.focus&&L.focus(),!0)}return ee.useEffect(()=>{u.current=s},[s]),ee.useEffect(()=>{m.current=r},[r]),ee.useEffect(()=>{var W;if(!l.current)return;const v=new S1.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:k1}),_=new g1.FitAddon;v.loadAddon(_),v.loadAddon(new v1.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=x1(K);return G?(h.current=G,f_(G).then(Y=>{T(Y?"copied":"ready")}),!0):!1}),L=K=>{const G=Wm(v,c.current,h.current);!G||!K.clipboardData||(K.clipboardData.setData("text/plain",G),K.preventDefault(),T("copied"))};(W=v.element)==null||W.addEventListener("copy",L),v.attachCustomKeyEventHandler(K=>{if(!w1(K))return!0;const G=v.getSelection()||c.current;return G?(K.preventDefault(),K.stopPropagation(),Ym(G).then(Y=>{T(Y?"copied":"failed")}),!1):!0});const M=l.current.getBoundingClientRect();M.width>=Xm&&M.height>=Qm&&_.fit();const D=new b1(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>=Jm&&v.rows>=Zm&&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]),ee.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]),ee.useEffect(()=>{const v=()=>{m.current&&b()};return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]),ee.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:Km,onPointerDown:Km,onClick:()=>void E(),children:C1(y)})]})}function C1(t){return t==="copied"?"Copied":t==="empty"?"No selection":t==="failed"?"Copy failed":t==="ready"?"Copy ready":"Copy"}function Wm(t,r,s){return(t==null?void 0:t.getSelection())||s||r}function w1(t){return t.type==="keydown"&&t.metaKey&&!t.ctrlKey&&!t.altKey&&t.key.toLowerCase()==="c"}function x1(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 Km(t){t.preventDefault(),t.stopPropagation()}async function Ym(t){return await f_(t)?!0:E1(t)}async function f_(t){var r;try{if((r=navigator.clipboard)!=null&&r.writeText)return await navigator.clipboard.writeText(t),!0}catch{return!1}return!1}function E1(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 Xm=160,Qm=80,Jm=20,Zm=5,k1={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"},d_=[{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"}],p_=[{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"}],A1=[{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"}],m_=[...A1,{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 Hh({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:d_.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:p_.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:m_.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 T1({busy:t,effort:r,model:s,open:l,permissionMode:d,taskSlug:p,bootstrapStatus:f,engineerSession:o,status:c,memoryState:h,onClose:m,onEffortChange:u,onModelChange:y,onPermissionModeChange:w,onEngineerResume:T,onEngineerRestart:E,onEngineerStart:b,onEngineerStop:v,onEngineerNotifyHarnessUpdated:_,onOpenRepositoryDiff:S,onReviewTaskHarness:A,onRefresh:L,onMemoryStateChange:M}){const[D,k]=ee.useState(null),[R,B]=ee.useState(null),[H,U]=ee.useState(""),[P,W]=ee.useState(!1),[K,G]=ee.useState(!1),[,Y]=ji(null),[Z,z]=ee.useState(null),j=(c==null?void 0:c.files)??[],N=j.filter(me=>me.kind.startsWith("agent-")),$=N.filter(me=>eg(me)),I=N.filter(me=>!eg(me)),ie=j.filter(me=>me.kind.startsWith("skill-")),ve=j.filter(me=>me.kind.startsWith("tool-")),_e=j.filter(me=>me.kind==="root-claude"||me.kind==="gitignore"||me.kind==="pull-request-template"),Q=!!(R&&H!==R.content);ee.useEffect(()=>{l||(k(null),B(null),U(""),W(!1),Y(null))},[j,l,D]),ee.useEffect(()=>{if(!l||!D||!p||D.startsWith("memory-review:"))return;let me=!1;return G(!0),Y(null),W(!1),(D.startsWith(".ai/vcm/memory/")?Se.getMemoryFileContent(p,D).then(De=>({path:De.path,title:De.title,content:De.content,editable:De.editable,source:"memory"})):Se.getHarnessFileContent(p,D).then(De=>({path:De.path,title:De.title,content:De.content,editable:De.editable,readonlyReason:De.readonlyReason,source:"harness"}))).then(De=>{me||(B(De),U(De.content))}).catch(De=>{me||Y(lt(`Load harness file ${D}`,De))}).finally(()=>{me||G(!1)}),()=>{me=!0}},[l,D,p]);async function q(){if(!(!R||!R.editable||!Q||!p)){G(!0),Y(null);try{if(R.source==="memory"){const me=await Se.updateMemoryFileContent(p,R.path,{content:H}),Me=await Se.getMemoryFileContent(p,R.path);B({path:Me.path,title:Me.title,content:Me.content,editable:!0,source:"memory"}),U(Me.content),M(me)}else{const me=await Se.updateHarnessFileContent(p,R.path,{content:H});B({path:me.file.path,title:me.file.title,content:me.file.content,editable:me.file.editable,readonlyReason:me.file.readonlyReason,source:"harness"}),U(me.file.content)}W(!1),L()}catch(me){Y(lt(`Save harness file ${R.path}`,me))}finally{G(!1)}}}function ue(){k(null),B(null),U(""),W(!1),Y(null)}async function ae(me){Y(null);try{await L1(me),z(me),window.setTimeout(()=>{z(Me=>Me===me?null:Me)},1200)}catch(Me){Y(lt(`Copy harness file path ${me}`,Me))}}function de(me){const Me=`memory-review:${me.runId}`;k(Me),B({path:me.runId,title:`Memory Diff: ${me.runId}`,content:me.diff||"No memory diff was recorded.",editable:!1,readonlyReason:`Applied by ${me.source}. Status: ${me.status}.`,source:"memory-diff"}),U(me.diff||"No memory diff was recorded."),W(!1)}async function re(me){if(!(!p||!me.canRevert||!window.confirm(`Revert memory changes from ${me.runId}?`))){G(!0),Y(null);try{const Me=await Se.revertMemoryRun({taskSlug:p,runId:me.runId});M(Me),ue()}catch(Me){Y(lt(`Revert memory review ${me.runId}`,Me))}finally{G(!1)}}}async function xe(){if(p){G(!0),Y(null);try{M(await Se.retryMemoryReview({taskSlug:p}))}catch(me){Y(lt("Retry Auto Memory review",me))}finally{G(!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:A,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:t,onClick:S,children:"Review Diff"}),x.jsx("button",{type:"button",disabled:t,onClick:L,children:"Refresh"}),x.jsx("button",{type:"button",onClick:m,children:"Close"})]})]}),x.jsxs("div",{className:"harness-studio-layout",children:[x.jsx("aside",{className:D?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:D?x.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[x.jsxs("header",{className:"harness-studio-file-editor-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:(R==null?void 0:R.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.path)??D})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[R?x.jsx(Yn,{status:R.editable?"ok":"unknown"}):null,P?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:K||!p||!(R!=null&&R.editable)||!Q,onClick:()=>void q(),children:"Save"}),x.jsx("button",{type:"button",disabled:K,onClick:()=>{U((R==null?void 0:R.content)??""),W(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:K||!p||!(R!=null&&R.editable),onClick:()=>W(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:ue,children:"Return"})]})]}),R!=null&&R.readonlyReason?x.jsx("p",{className:"muted",children:R.readonlyReason}):null,x.jsx("textarea",{className:P?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:H,spellCheck:!1,readOnly:!P,disabled:K,onChange:me=>U(me.target.value)})]}):x.jsxs(x.Fragment,{children:[x.jsx(Fa,{title:"VCM Roles",files:$,selectedPath:D,copiedPath:Z,onCopy:me=>void ae(me),onSelect:k}),x.jsx(Fa,{title:"Auxiliary Roles",files:I,selectedPath:D,copiedPath:Z,onCopy:me=>void ae(me),onSelect:k}),x.jsx(R1,{state:h,busy:K,copiedPath:Z,onCopy:me=>void ae(me),onSelect:k,onViewDiff:de,onRevert:me=>void re(me),onRetry:()=>void xe()}),x.jsx(ko,{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(j.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:tg(o)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(me=>x.jsx("li",{children:me},me))}):null]})}),x.jsx(Fa,{title:"Skills",files:ie,selectedPath:D,copiedPath:Z,onCopy:me=>void ae(me),onSelect:k,collapsible:!0}),x.jsx(Fa,{title:"Root Context",files:_e,selectedPath:D,copiedPath:Z,onCopy:me=>void ae(me),onSelect:k,collapsible:!0}),x.jsx(Fa,{title:"Tools",files:ve,selectedPath:D,copiedPath:Z,onCopy:me=>void ae(me),onSelect:k,collapsible:!0}),x.jsx(ko,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(me=>x.jsxs("li",{children:[x.jsx("span",{children:me.path??me.label}),x.jsx(Yn,{status:me.status})]},me.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:tg(o)})]}),x.jsx(Yn,{status:(o==null?void 0:o.status)??"unknown"})]}),x.jsx(Hh,{role:"harness-engineer",session:o??void 0,permissionMode:d,model:s,effort:r,busy:t,onPermissionModeChange:w,onModelChange:y,onEffortChange:u,onStart:b,onResume:T,onRestart:E,onStop:v,onNotifyHarnessUpdated:_}),x.jsx("div",{className:"harness-engineer-terminal",children:(o==null?void 0:o.status)==="running"?x.jsx(jo,{sessionId:o.id,active:l},o.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:o!=null&&o.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function 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 Fa({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(ko,{title:t,children:o}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:t}),o]})}function R1({state:t,busy:r,copiedPath:s,onCopy:l,onSelect:d,onViewDiff:p,onRevert:f,onRetry:o}){var c,h;return x.jsxs(ko,{title:"Memory",children:[x.jsxs("div",{className:"harness-memory-status",children:[x.jsx("span",{children:"Status"}),x.jsx(Yn,{status:M1(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:D1(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 ko({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 eg(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 tg(t){return t?t.status==="running"?`${t.status} / ${t.activityStatus??"idle"}`:t.status:"not started"}function D1(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}function M1(t){return t==="collecting"||t==="reviewing"?"running":t==="failed"?"failed":t==="idle"?"ok":"unknown"}async function L1(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 O1({open:t,taskSlug:r,onClose:s}){var k;const[l,d]=ee.useState(null),[p,f]=ee.useState(null),[o,c]=ee.useState(null),[h,m]=ee.useState(null),[u,y]=ee.useState(null),[w,T]=ee.useState(!1),[E,b]=ee.useState(!1),[,v]=ji(null),[_,S]=ee.useState(null),A=ee.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 Se.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(W=>W.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){v(lt(R?`Load commit diff ${R}`:"Load latest commit diff",H))}finally{T(!1)}}ee.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 Se.getRepositoryFileDiff(r,R);m(B),c(R)}catch(B){v(lt(`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 Se.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(lt("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(B1,{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:[bh(R.status)," · ",ng(R.stage)," · ",Sh(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(j1,{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:[Sh(A.category)," · ",bh(A.status)," · ",ng(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:g_(A.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:w?"Loading commit diff...":"No diff selected."})})]})]})}):null}function B1({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 j1({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:[Sh(s.category)," · ",bh(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:g_(s.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function Sh(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 ng(t){return t.replaceAll("_"," ")}function bh(t){return t.replaceAll("_"," ")}function g_(t){return t.split(`
62
- `).filter(r=>!H1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${N1(r)}`,children:r||" "},`${s}:${r}`))}function N1(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 H1(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 z1({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:I1(p)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(Hh,{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(jo,{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 I1(t){if(!t)return"not started";const r=t.status==="running"?` · ${t.activityStatus??"idle"}`:"";return`${t.status}${r}`}function U1(t,r){const s={};return(t[t.length-1]===""?[...t,""]:t).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const P1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,F1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,q1={};function ig(t,r){return(q1.jsx?F1:P1).test(t)}const $1=/[ \t\n\f\r]/g;function G1(t){return typeof t=="object"?t.type==="text"?rg(t.value):!1:rg(t)}function rg(t){return t.replace($1,"")===""}class il{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}il.prototype.normal={};il.prototype.property={};il.prototype.space=void 0;function __(t,r){const s={},l={};for(const d of t)Object.assign(s,d.property),Object.assign(l,d.normal);return new il(s,l,r)}function Ch(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 V1=0;const Pe=Zr(),Ot=Zr(),wh=Zr(),we=Zr(),ct=Zr(),zs=Zr(),An=Zr();function Zr(){return 2**++V1}const xh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:Ot,commaOrSpaceSeparated:An,commaSeparated:zs,number:we,overloadedBoolean:wh,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),Zu=Object.keys(xh);class zh extends pn{constructor(r,s,l,d){let p=-1;if(super(r,s),sg(this,"space",d),typeof l=="number")for(;++p<Zu.length;){const f=Zu[p];sg(this,Zu[p],(l&xh[f])===xh[f])}}}zh.prototype.defined=!0;function sg(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 zh(l,t.transform(t.attributes||{},l),d,t.space);t.mustUseProperty&&t.mustUseProperty.includes(l)&&(p.mustUseProperty=!0),r[l]=p,s[Ch(l)]=l,s[Ch(p.attribute)]=l}return new il(r,s,t.space)}const v_=Fs({properties:{ariaActiveDescendant:null,ariaAtomic:Ot,ariaAutoComplete:null,ariaBusy:Ot,ariaChecked:Ot,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Ot,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Ot,ariaFlowTo:ct,ariaGrabbed:Ot,ariaHasPopup:null,ariaHidden:Ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:we,ariaLive:null,ariaModal:Ot,ariaMultiLine:Ot,ariaMultiSelectable:Ot,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:Ot,ariaReadOnly:Ot,ariaRelevant:null,ariaRequired:Ot,ariaRoleDescription:ct,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:Ot,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 y_(t,r){return r in t?t[r]:r}function S_(t,r){return y_(t,r.toLowerCase())}const W1=Fs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zs,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:ct,autoFocus:Pe,autoPlay:Pe,blocking:ct,capture:null,charSet:null,checked:Pe,cite:null,className:ct,cols:we,colSpan:null,content:null,contentEditable:Ot,controls:Pe,controlsList:ct,coords:we|zs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:wh,draggable:Ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:ct,height:we,hidden:wh,high:we,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:ct,itemRef:ct,itemScope:Pe,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,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:Pe,optimum:we,pattern:null,ping:ct,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:ct,required:Pe,reversed:Pe,rows:we,rowSpan:we,sandbox:ct,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:Ot,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:Pe,useMap:null,value:Ot,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,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:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:Ot,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:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:S_}),K1=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:An,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:ct,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:Pe,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:An,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:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,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:An,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:An,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:An,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_}),b_=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()}}),C_=Fs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:S_}),w_=Fs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,r){return"xml:"+r.slice(3).toLowerCase()}}),Y1={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"},X1=/[A-Z]/g,ag=/-[a-z]/g,Q1=/^data[-\w.:]+$/i;function J1(t,r){const s=Ch(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"&&Q1.test(r)){if(r.charAt(4)==="-"){const p=r.slice(5).replace(ag,eS);l="data"+p.charAt(0).toUpperCase()+p.slice(1)}else{const p=r.slice(4);if(!ag.test(p)){let f=p.replace(X1,Z1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=zh}return new d(l,r)}function Z1(t){return"-"+t.toLowerCase()}function eS(t){return t.charAt(1).toUpperCase()}const tS=__([v_,W1,b_,C_,w_],"html"),Ih=__([v_,K1,b_,C_,w_],"svg");function nS(t){return t.join(" ").trim()}var Bs={},eh,lg;function iS(){if(lg)return eh;lg=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(W){var K=W.match(r);K&&(_+=K.length);var G=W.lastIndexOf(c);S=~G?W.length-G:S+W.length}function L(){var W={line:_,column:S};return function(K){return K.position=new M(W),R(),K}}function M(W){this.start=W,this.end={line:_,column:S},this.source=v.source}M.prototype.content=b;function D(W){var K=new Error(v.source+":"+_+":"+S+": "+W);if(K.reason=W,K.filename=v.source,K.line=_,K.column=S,K.source=b,!v.silent)throw K}function k(W){var K=W.exec(b);if(K){var G=K[0];return A(G),b=b.slice(G.length),K}}function R(){k(s)}function B(W){var K;for(W=W||[];K=H();)K!==!1&&W.push(K);return W}function H(){var W=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,W({type:y,comment:G})}}function U(){var W=L(),K=k(l);if(K){if(H(),!k(d))return D("property missing ':'");var G=k(p),Y=W({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 W=[];B(W);for(var K;K=U();)K!==!1&&(W.push(K),B(W));return W}return R(),P()}function E(b){return b?b.replace(o,u):u}return eh=T,eh}var og;function rS(){if(og)return Bs;og=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(iS());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 qa={},cg;function sS(){if(cg)return qa;cg=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.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 qa.camelCase=c,qa}var $a,ug;function aS(){if(ug)return $a;ug=1;var t=$a&&$a.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=t(rS()),s=sS();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,$a=l,$a}var lS=aS();const oS=s_(lS),x_=E_("end"),Uh=E_("start");function E_(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 cS(t){const r=Uh(t),s=x_(t);if(r&&s)return{start:r,end:s}}function Ka(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?hg(t.position):"start"in t||"end"in t?hg(t):"line"in t||"column"in t?Eh(t):""}function Eh(t){return fg(t&&t.line)+":"+fg(t&&t.column)}function hg(t){return Eh(t&&t.start)+"-"+Eh(t&&t.end)}function fg(t){return t&&typeof t=="number"?t:1}class Jt 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=Ka(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}}Jt.prototype.file="";Jt.prototype.name="";Jt.prototype.reason="";Jt.prototype.message="";Jt.prototype.stack="";Jt.prototype.column=void 0;Jt.prototype.line=void 0;Jt.prototype.ancestors=void 0;Jt.prototype.cause=void 0;Jt.prototype.fatal=void 0;Jt.prototype.place=void 0;Jt.prototype.ruleId=void 0;Jt.prototype.source=void 0;const Ph={}.hasOwnProperty,uS=new Map,hS=/[A-Z]/g,fS=new Set(["table","tbody","thead","tfoot","tr"]),dS=new Set(["td","th"]),k_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pS(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=CS(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=bS(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"?Ih:tS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},p=A_(d,t,void 0);return p&&typeof p!="string"?p:d.create(t,d.Fragment,{children:p||void 0},void 0)}function A_(t,r,s){if(r.type==="element")return mS(t,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return gS(t,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return vS(t,r,s);if(r.type==="mdxjsEsm")return _S(t,r);if(r.type==="root")return yS(t,r,s);if(r.type==="text")return SS(t,r)}function mS(t,r,s){const l=t.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Ih,t.schema=d),t.ancestors.push(r);const p=R_(t,r.tagName,!1),f=wS(t,r);let o=qh(t,r);return fS.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!G1(c):!0})),T_(t,f,p,r),Fh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,p,f,s)}function gS(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)}el(t,r.position)}function _S(t,r){if(r.data&&r.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(r.data.estree);el(t,r.position)}function vS(t,r,s){const l=t.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Ih,t.schema=d),t.ancestors.push(r);const p=r.name===null?t.Fragment:R_(t,r.name,!0),f=xS(t,r),o=qh(t,r);return T_(t,f,p,r),Fh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,p,f,s)}function yS(t,r,s){const l={};return Fh(l,qh(t,r)),t.create(r,t.Fragment,l,s)}function SS(t,r){return r.value}function T_(t,r,s,l){typeof s!="string"&&s!==t.Fragment&&t.passNode&&(r.node=l)}function Fh(t,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(t.children=s)}}function bS(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 CS(t,r){return s;function s(l,d,p,f){const o=Array.isArray(p.children),c=Uh(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 wS(t,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&Ph.call(r.properties,d)){const p=ES(t,d,r.properties[d]);if(p){const[f,o]=p;t.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&dS.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 xS(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 el(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 el(t,r.position);else p=l.value===null?!0:l.value;s[d]=p}return s}function qh(t,r){const s=[];let l=-1;const d=t.passKeys?new Map:uS;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=A_(t,p,f);o!==void 0&&s.push(o)}return s}function ES(t,r,s){const l=J1(t.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?U1(s):nS(s)),l.property==="style"){let d=typeof s=="object"?s:kS(t,String(s));return t.stylePropertyNameCase==="css"&&(d=AS(d)),["style",d]}return[t.elementAttributeNameCase==="react"&&l.space?Y1[l.property]||l.property:l.attribute,s]}}function kS(t,r){try{return oS(r,{reactCompat:!0})}catch(s){if(t.ignoreInvalidStyle)return{};const l=s,d=new Jt("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=k_+"#cannot-parse-style-attribute",d}}function R_(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=ig(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=ig(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return Ph.call(t.components,d)?t.components[d]:d}if(t.evaluater)return t.evaluater.evaluateExpression(l);el(t)}function el(t,r){const s=new Jt("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=k_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function AS(t){const r={};let s;for(s in t)Ph.call(t,s)&&(r[TS(s)]=t[s]);return r}function TS(t){let r=t.replace(hS,RS);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function RS(t){return"-"+t.toLowerCase()}const th={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"]},DS={};function $h(t,r){const s=DS,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return D_(t,l,d)}function D_(t,r,s){if(MS(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 dg(t.children,r,s)}return Array.isArray(t)?dg(t,r,s):""}function dg(t,r,s){const l=[];let d=-1;for(;++d<t.length;)l[d]=D_(t[d],r,s);return l.join("")}function MS(t){return!!(t&&typeof t=="object")}const pg=document.createElement("i");function Gh(t){const r="&"+t+";";pg.innerHTML=r;const s=pg.textContent;return s.charCodeAt(s.length-1)===59&&t!=="semi"||s===r?!1:s}function Tn(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 Pn(t,r){return t.length>0?(Tn(t,t.length,0,r),t):r}const mg={}.hasOwnProperty;function M_(t){const r={};let s=-1;for(;++s<t.length;)LS(r,t[s]);return r}function LS(t,r){let s;for(s in r){const d=(mg.call(t,s)?t[s]:void 0)||(t[s]={}),p=r[s];let f;if(p)for(f in p){mg.call(d,f)||(d[f]=[]);const o=p[f];OS(d[f],Array.isArray(o)?o:o?[o]:[])}}}function OS(t,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?t:l).push(r[s]);Tn(t,0,0,l)}function L_(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 nn=kr(/[A-Za-z]/),Qt=kr(/[\dA-Za-z]/),BS=kr(/[#-'*+\--9=?A-Z^-~]/);function Ao(t){return t!==null&&(t<32||t===127)}const kh=kr(/\d/),jS=kr(/[\dA-Fa-f]/),NS=kr(/[!-/:-@[-`{-~]/);function Oe(t){return t!==null&&t<-2}function ot(t){return t!==null&&(t<0||t===32)}function Ve(t){return t===-2||t===-1||t===32}const No=kr(new RegExp("\\p{P}|\\p{S}","u")),Qr=kr(/\s/);function kr(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&&Qt(t.charCodeAt(s+1))&&Qt(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 Xe(t,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let p=0;return f;function f(c){return Ve(c)?(t.enter(s),o(c)):r(c)}function o(c){return Ve(c)&&p++<d?(t.consume(c),o):(t.exit(s),r(c))}}const HS={tokenize:zS};function zS(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"),Xe(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 IS={tokenize:US},gg={tokenize:PS};function US(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 Tn(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(gg,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(gg,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++;Tn(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 PS(t,r,s){return Xe(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||ot(t)||Qr(t))return 1;if(No(t))return 2}function Ho(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 Ah={name:"attention",resolveAll:FS,tokenize:qS};function FS(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};_g(u,-c),_g(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=Pn(h,[["enter",t[l][1],r],["exit",t[l][1],r]])),h=Pn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",p,r]]),h=Pn(h,Ho(r.parser.constructs.insideSpan.null,t.slice(l+1,s),r)),h=Pn(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=Pn(h,[["enter",t[s][1],r],["exit",t[s][1],r]])):m=0,Tn(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 qS(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 _g(t,r){t.column+=r,t.offset+=r,t._bufferIndex+=r}const $S={name:"autolink",tokenize:GS};function GS(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 nn(w)?(t.consume(w),f):w===64?s(w):h(w)}function f(w){return w===43||w===45||w===46||Qt(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||Qt(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||Ao(w)?s(w):(t.consume(w),c)}function h(w){return w===64?(t.consume(w),m):BS(w)?(t.consume(w),h):s(w)}function m(w){return Qt(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||Qt(w))&&l++<63){const T=w===45?y:u;return t.consume(w),T}return s(w)}}const rl={partial:!0,tokenize:VS};function VS(t,r,s){return l;function l(p){return Ve(p)?Xe(t,d,"linePrefix")(p):d(p)}function d(p){return p===null||Oe(p)?r(p):s(p)}}const O_={continuation:{tokenize:KS},exit:YS,name:"blockQuote",tokenize:WS};function WS(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 Ve(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),r):(t.exit("blockQuotePrefix"),r(f))}}function KS(t,r,s){const l=this;return d;function d(f){return Ve(f)?Xe(t,p,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):p(f)}function p(f){return t.attempt(O_,r,s)(f)}}function YS(t){t.exit("blockQuote")}const B_={name:"characterEscape",tokenize:XS};function XS(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 NS(p)?(t.enter("characterEscapeValue"),t.consume(p),t.exit("characterEscapeValue"),t.exit("characterEscape"),r):s(p)}}const j_={name:"characterReference",tokenize:QS};function QS(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=Qt,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=jS,m):(t.enter("characterReferenceValue"),p=7,f=kh,m(u))}function m(u){if(u===59&&d){const y=t.exit("characterReferenceValue");return f===Qt&&!Gh(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 vg={partial:!0,tokenize:ZS},yg={concrete:!0,name:"codeFenced",tokenize:JS};function JS(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"),Ve(M)?Xe(t,u,"whitespace")(M):u(M))}function u(M){return M===null||Oe(M)?(t.exit("codeFencedFence"),l.interrupt?r(M):t.check(vg,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)):Ve(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Xe(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&&Ve(M)?Xe(t,_,"linePrefix",p+1)(M):_(M)}function _(M){return M===null||Oe(M)?t.check(vg,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"),Ve(K)?Xe(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"),Ve(K)?Xe(M,W,"whitespace")(K):W(K)):k(K)}function W(K){return K===null||Oe(K)?(M.exit("codeFencedFence"),D(K)):k(K)}}}function ZS(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 nh={name:"codeIndented",tokenize:tb},eb={partial:!0,tokenize:nb};function tb(t,r,s){const l=this;return d;function d(h){return t.enter("codeIndented"),Xe(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(eb,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 nb(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):Xe(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 ib={name:"codeText",previous:sb,resolve:rb,tokenize:ab};function rb(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 sb(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ab(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 lb{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&&Ga(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),Ga(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ga(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);Ga(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ga(this.left,s.reverse())}}}function Ga(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 N_(t){const r={};let s=-1,l,d,p,f,o,c,h;const m=new lb(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,ob(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 Tn(t,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function ob(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 cb={resolve:hb,tokenize:fb},ub={partial:!0,tokenize:db};function hb(t){return N_(t),t}function fb(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(ub,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 db(t,r,s){const l=this;return d;function d(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Xe(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 H_(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||Ao(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||ot(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||Ao(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 z_(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=!Ve(w)),w===92?y:u)}function y(w){return w===91||w===92||w===93?(t.consume(w),o++,u):u(w)}}function I_(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"),Xe(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 Ya(t,r){let s;return l;function l(d){return Oe(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),s=!0,l):Ve(d)?Xe(t,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const pb={name:"definition",tokenize:gb},mb={partial:!0,tokenize:_b};function gb(t,r,s){const l=this;let d;return p;function p(w){return t.enter("definition"),f(w)}function f(w){return z_.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 ot(w)?Ya(t,h)(w):h(w)}function h(w){return H_(t,m,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return t.attempt(mb,u,u)(w)}function u(w){return Ve(w)?Xe(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 _b(t,r,s){return l;function l(o){return ot(o)?Ya(t,d)(o):s(o)}function d(o){return I_(t,p,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function p(o){return Ve(o)?Xe(t,f,"whitespace")(o):f(o)}function f(o){return o===null||Oe(o)?r(o):s(o)}}const vb={name:"hardBreakEscape",tokenize:yb};function yb(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 Sb={name:"headingAtx",resolve:bb,tokenize:Cb};function bb(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"},Tn(t,l,s-l+1,[["enter",d,r],["enter",p,r],["exit",p,r],["exit",d,r]])),t}function Cb(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||ot(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)):Ve(m)?Xe(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||ot(m)?(t.exit("atxHeadingText"),o(m)):(t.consume(m),h)}}const wb=["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"],Sg=["pre","script","style","textarea"],xb={concrete:!0,name:"htmlFlow",resolveTo:Ab,tokenize:Tb},Eb={partial:!0,tokenize:Db},kb={partial:!0,tokenize:Rb};function Ab(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 Tb(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):nn(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):nn(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 nn(I)?(t.consume(I),f=String.fromCharCode(I),b):s(I)}function b(I){if(I===null||I===47||I===62||ot(I)){const ie=I===47,ve=f.toLowerCase();return!ie&&!p&&Sg.includes(ve)?(d=1,l.interrupt?r(I):U(I)):wb.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||Qt(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 Ve(I)?(t.consume(I),_):B(I)}function S(I){return I===47?(t.consume(I),B):I===58||I===95||nn(I)?(t.consume(I),A):Ve(I)?(t.consume(I),S):B(I)}function A(I){return I===45||I===46||I===58||I===95||Qt(I)?(t.consume(I),A):L(I)}function L(I){return I===61?(t.consume(I),M):Ve(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):Ve(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||ot(I)?L(I):(t.consume(I),k)}function R(I){return I===47||I===62||Ve(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):Ve(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(Eb,$,P)(I)):I===null||Oe(I)?(t.exit("htmlFlowData"),P(I)):(t.consume(I),U)}function P(I){return t.check(kb,W,$)(I)}function W(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="",Z):U(I)}function Z(I){if(I===62){const ie=f.toLowerCase();return Sg.includes(ie)?(t.consume(I),N):U(I)}return nn(I)&&f.length<8?(t.consume(I),f+=String.fromCharCode(I),Z):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 Rb(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 Db(t,r,s){return l;function l(d){return t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),t.attempt(rl,r,s)}}const Mb={name:"htmlText",tokenize:Lb};function Lb(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):nn(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):nn(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 nn(j)?(t.consume(j),M):s(j)}function M(j){return j===45||Qt(j)?(t.consume(j),M):D(j)}function D(j){return Oe(j)?(f=D,Y(j)):Ve(j)?(t.consume(j),D):G(j)}function k(j){return j===45||Qt(j)?(t.consume(j),k):j===47||j===62||ot(j)?R(j):s(j)}function R(j){return j===47?(t.consume(j),G):j===58||j===95||nn(j)?(t.consume(j),B):Oe(j)?(f=R,Y(j)):Ve(j)?(t.consume(j),R):G(j)}function B(j){return j===45||j===46||j===58||j===95||Qt(j)?(t.consume(j),B):H(j)}function H(j){return j===61?(t.consume(j),U):Oe(j)?(f=H,Y(j)):Ve(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)):Ve(j)?(t.consume(j),U):(t.consume(j),W)}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 W(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ot(j)?R(j):(t.consume(j),W)}function K(j){return j===47||j===62||ot(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"),Z}function Z(j){return Ve(j)?Xe(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 Vh={name:"labelEnd",resolveAll:Nb,resolveTo:Hb,tokenize:zb},Ob={tokenize:Ib},Bb={tokenize:Ub},jb={tokenize:Pb};function Nb(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&&Tn(t,0,t.length,s),t}function Hb(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=Pn(o,t.slice(p+1,p+l+3)),o=Pn(o,[["enter",m,r]]),o=Pn(o,Ho(r.parser.constructs.insideSpan.null,t.slice(p+l+4,f-3),r)),o=Pn(o,[["exit",m,r],t[f-2],t[f-1],["exit",h,r]]),o=Pn(o,t.slice(f+1)),o=Pn(o,[["exit",c,r]]),Tn(t,p,t.length,o),t}function zb(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(Ob,m,f?m:u)(y):y===91?t.attempt(Bb,m,f?h:u)(y):f?m(y):u(y)}function h(y){return t.attempt(jb,m,u)(y)}function m(y){return r(y)}function u(y){return p._balanced=!0,s(y)}}function Ib(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 ot(u)?Ya(t,p)(u):p(u)}function p(u){return u===41?m(u):H_(t,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ot(u)?Ya(t,c)(u):m(u)}function o(u){return s(u)}function c(u){return u===34||u===39||u===40?I_(t,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):m(u)}function h(u){return ot(u)?Ya(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 Ub(t,r,s){const l=this;return d;function d(o){return z_.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 Pb(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 Fb={name:"labelStartImage",resolveAll:Vh.resolveAll,tokenize:qb};function qb(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 $b={name:"labelStartLink",resolveAll:Vh.resolveAll,tokenize:Gb};function Gb(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 ih={name:"lineEnding",tokenize:Vb};function Vb(t,r){return s;function s(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Xe(t,r,"linePrefix")}}const wo={name:"thematicBreak",tokenize:Wb};function Wb(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"),Ve(h)?Xe(t,o,"whitespace")(h):o(h))}}const dn={continuation:{tokenize:Qb},exit:Zb,name:"list",tokenize:Xb},Kb={partial:!0,tokenize:eC},Yb={partial:!0,tokenize:Jb};function Xb(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:kh(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(wo,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 kh(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(rl,l.interrupt?s:m,t.attempt(Kb,y,u))}function m(w){return l.containerState.initialBlankLine=!0,p++,y(w)}function u(w){return Ve(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 Qb(t,r,s){const l=this;return l.containerState._closeFlow=void 0,t.check(rl,d,p);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Xe(t,r,"listItemIndent",l.containerState.size+1)(o)}function p(o){return l.containerState.furtherBlankLines||!Ve(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(Yb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Xe(t,t.attempt(dn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Jb(t,r,s){const l=this;return Xe(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 Zb(t){t.exit(this.containerState.type)}function eC(t,r,s){const l=this;return Xe(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!Ve(p)&&f&&f[1].type==="listItemPrefixWhitespace"?r(p):s(p)}}const bg={name:"setextUnderline",resolveTo:tC,tokenize:nC};function tC(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 nC(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"),Ve(h)?Xe(t,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Oe(h)?(t.exit("setextHeadingLine"),r(h)):s(h)}}const iC={tokenize:rC};function rC(t){const r=this,s=t.attempt(rl,l,t.attempt(this.parser.constructs.flowInitial,d,Xe(t,t.attempt(this.parser.constructs.flow,d,t.attempt(cb,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 sC={resolveAll:P_()},aC=U_("string"),lC=U_("text");function U_(t){return{resolveAll:P_(t==="text"?oC: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 P_(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 oC(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 cC={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:O_},uC={91:pb},hC={[-2]:nh,[-1]:nh,32:nh},fC={35:Sb,42:wo,45:[bg,wo],60:xb,61:bg,95:wo,96:yg,126:yg},dC={38:j_,92:B_},pC={[-5]:ih,[-4]:ih,[-3]:ih,33:Fb,38:j_,42:Ah,60:[$S,Mb],91:$b,92:[vb,B_],93:Vh,95:Ah,96:ib},mC={null:[Ah,sC]},gC={null:[42,95]},_C={null:[]},vC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gC,contentInitial:uC,disable:_C,document:cC,flow:fC,flowInitial:hC,insideSpan:mC,string:dC,text:pC},Symbol.toStringTag,{value:"Module"}));function yC(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=Pn(f,H),b(),f[f.length-1]!==null?[]:(k(r,0),h.events=Ho(p,h.events,h),h.events)}function y(H,U){return bC(w(H),U)}function w(H){return SC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:W,offset:K}=l;return{_bufferIndex:H,_index:U,line:P,column:W,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(W,K,G){let Y,Z,z,j;return Array.isArray(W)?$(W):"tokenize"in W?$([W]):N(W);function N(_e){return Q;function Q(q){const ue=q!==null&&_e[q],ae=q!==null&&_e.null,de=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return $(de)(q)}}function $(_e){return Y=_e,Z=0,_e.length===0?G:I(_e[Z])}function I(_e){return Q;function Q(q){return j=R(),z=_e,_e.partial||(h.currentConstruct=_e),_e.name&&h.parser.constructs.disable.null.includes(_e.name)?ve():_e.tokenize.call(U?Object.assign(Object.create(h),U):h,c,ie,ve)(q)}}function ie(_e){return H(z,j),K}function ve(_e){return j.restore(),++Z<Y.length?I(Y[Z]):G}}}function k(H,U){H.resolveAll&&!p.includes(H)&&p.push(H),H.resolve&&Tn(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,W=h.events.length,K=Array.from(o);return{from:W,restore:G};function G(){l=H,h.previous=U,h.currentConstruct=P,h.events.length=W,o=K,B()}}function B(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function SC(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 bC(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=`
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),O=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(O&&H&&R)&&this._areCoordsInSelection(R,O,H)}isCellInSelection(k,R){const O=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!O||!H)&&this._areCoordsInSelection([k,R],O,H)}_areCoordsInSelection(k,R,O){return k[1]>R[1]&&k[1]<O[1]||R[1]===O[1]&&k[1]===R[1]&&k[0]>=R[0]&&k[0]<O[0]||R[1]<O[1]&&k[1]===O[1]&&k[0]<O[0]||R[1]<O[1]&&k[1]===R[1]&&k[0]>=R[0]}_selectWordAtCursor(k,R){var U,P;const O=(P=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:P.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(O,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 O=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=O?0:(R>O&&(R-=O),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 O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const H=O.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 O=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const H=(0,y.moveToCellSequence)(O[0]-1,O[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,O=!(!k||!R||k[0]===R[0]&&k[1]===R[1]);O?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,O)):this._oldHasSelection&&this._fireOnSelectionChange(k,R,O)}_fireOnSelectionChange(k,R,O){this._oldSelectionStart=k,this._oldSelectionEnd=R,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(k,R){let O=R;for(let H=0;R>=H;H++){const U=k.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:U>1&&R!==H&&(O+=U-1)}return O}setSelection(k,R,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,R],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,R,O=!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 W=U.translateBufferLineToString(k[1],!1);let K=this._convertViewportColToCharacterIndex(P,k[0]),G=K;const Y=k[0]-K;let Z=0,z=0,j=0,N=0;if(W.charAt(K)===" "){for(;K>0&&W.charAt(K-1)===" ";)K--;for(;G<W.length&&W.charAt(G+1)===" ";)G++}else{let ie=k[0],_e=k[0];P.getWidth(ie)===0&&(Z++,ie--),P.getWidth(_e)===2&&(z++,_e++);const ge=P.getString(_e).length;for(ge>1&&(N+=ge-1,G+=ge-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?(Z++,ie--):Q>1&&(j+=Q-1,K-=Q-1),K--,ie--}for(;_e<P.length&&G+1<W.length&&!this._isCharWordSeparator(P.loadCell(_e+1,this._workCell));){P.loadCell(_e+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,_e++):Q>1&&(N+=Q-1,G+=Q-1),G++,_e++}}G++;let $=K+Y-Z+j,I=Math.min(this._bufferService.cols,G-K+Z+z-j-N);if(R||W.slice(K,G).trim()!==""){if(O&&$===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 _e=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(_e){const ge=this._bufferService.cols-_e.start;$-=ge,I+=ge}}}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 _e=this._getWordAt([0,k[1]+1],!1,!1,!0);_e&&(I+=_e.length)}}return{start:$,length:I}}}_selectWordAt(k,R){const O=this._getWordAt(k,R);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[O.start,k[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(k){const R=this._getWordAt(k,!0);if(R){let O=k[1];for(;R.start<0;)R.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,O]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const R=this._bufferService.buffer.getWrappedRangeForLine(k),O={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)(O,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,O){var H,U=arguments.length,P=U<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(D,k,R,O);else for(var W=D.length-1;W>=0;W--)(H=D[W])&&(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,O){k(R,O,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 O=k[R/36%6|0],H=k[R/6%6|0],U=k[R%6];D.push({css:y.channels.toCss(O,H,U),rgba:y.channels.toRgba(O,H,U)})}for(let R=0;R<24;R++){const O=8+10*R;D.push({css:y.channels.toCss(O,O,O),rgba:y.channels.toRgba(O,O,O)})}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 O=0;O<R;O++)k.ansi[O+16]=M(D.extendedAnsi[O],o.DEFAULT_ANSI_COLORS[O+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,O=L.rgba>>24&255,H=L.rgba>>16&255,U=L.rgba>>8&255;return c=O+Math.round((D-O)*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,O=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*(O<=.03928?O/12.92:Math.pow((O+.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,O=M>>16&255,H=M>>8&255;let U=D>>24&255,P=D>>16&255,W=D>>8&255,K=_(E.relativeLuminance2(U,P,W),E.relativeLuminance2(R,O,H));for(;K<k&&(U>0||P>0||W>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),W-=Math.max(0,Math.ceil(.1*W)),K=_(E.relativeLuminance2(U,P,W),E.relativeLuminance2(R,O,H));return(U<<24|P<<16|W<<8|255)>>>0}function L(M,D,k){const R=M>>24&255,O=M>>16&255,H=M>>8&255;let U=D>>24&255,P=D>>16&255,W=D>>8&255,K=_(E.relativeLuminance2(U,P,W),E.relativeLuminance2(R,O,H));for(;K<k&&(U<255||P<255||W<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),W=Math.min(255,W+Math.ceil(.1*(255-W))),K=_(E.relativeLuminance2(U,P,W),E.relativeLuminance2(R,O,H));return(U<<24|P<<16|W<<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,O=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((O-P)*u),y.toRgba(c,h,m)},S.ensureContrastRatio=function(M,D,k){const R=E.relativeLuminance(M>>8),O=E.relativeLuminance(D>>8);if(_(R,O)<k){if(O<R){const P=A(M,D,k),W=_(R,E.relativeLuminance(P>>8));if(W<k){const K=L(M,D,k);return W>_(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(Z,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(Z,z,j,N);else for(var _e=Z.length-1;_e>=0;_e--)($=Z[_e])&&(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(Z,z){return function(j,N){z(j,N,Z)}};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),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(Z,z){if(Z>24)return z.setWinLines||!1;switch(Z){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var P;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let W=0;class K extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,$,I,ie,_e,ge,Q=new w.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=ie,this._coreMouseService=_e,this._unicodeService=ge,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,ue)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ue.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,ue,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ue,data:le})})),this._parser.setDcsHandlerFallback(((q,ue,le)=>{ue==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ue,payload:le})})),this._parser.setPrintHandler(((q,ue,le)=>this.print(q,ue,le))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new D.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new D.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new D.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new D.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new D.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new D.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new D.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new D.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new D.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new D.OscHandler((q=>this.restoreCursorColor(q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const q in 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,ue)=>this.requestStatusString(q,ue))))}_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 _e=this._parseStack.paused;if(_e){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))),_e||this._dirtyRowTracker.clearRange(),z.length>H)for(let q=ie;q<z.length;q+=H){const ue=q+H<z.length?q+H:z.length,le=typeof z=="string"?this._stringDecoder.decode(z.substring(q,ue),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,ue),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,le))return this._preserveStack($,I,le,q),this._logSlowResolvingAsync(N),N}else if(!_e){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,q))return this._preserveStack($,I,q,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===$&&this._activeBuffer.y===I||this._onCursorMove.fire();const ge=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(ge,this._bufferService.rows-1))}print(z,j,N){let $,I;const ie=this._charsetService.charset,_e=this._optionsService.rawOptions.screenReaderMode,ge=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,ue=this._curAttrData;let le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ue);let he=this._parser.precedingJoinState;for(let re=j;re<N;++re){if($=z[re],$<127&&ie){const Te=ie[String.fromCharCode($)];Te&&($=Te.charCodeAt(0))}const Ee=this._unicodeService.charProperties($,he);I=M.UnicodeService.extractWidth(Ee);const Be=M.UnicodeService.extractShouldJoin(Ee),ve=Be?M.UnicodeService.extractWidth(he):0;if(he=Ee,_e&&this._onA11yChar.fire((0,E.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-ve>ge){if(Q){const Te=le;let xe=this._activeBuffer.x-ve;for(this._activeBuffer.x=ve,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ve>0&&le instanceof b.BufferLine&&le.copyCellsFrom(Te,xe,0,ve,!1);xe<ge;)Te.setCellFromCodepoint(xe++,0,1,ue)}else if(this._activeBuffer.x=ge-1,I===2)continue}if(Be&&this._activeBuffer.x){const Te=le.getWidth(this._activeBuffer.x-1)?1:2;le.addCodepointToCell(this._activeBuffer.x-Te,$,I);for(let xe=I-ve;--xe>=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}else if(q&&(le.insertCells(this._activeBuffer.x,I-ve,this._activeBuffer.getNullCell(ue)),le.getWidth(ge-1)===2&&le.setCellFromCodepoint(ge-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,ue)),le.setCellFromCodepoint(this._activeBuffer.x++,$,I,ue),I>0)for(;--I;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ue)}this._parser.precedingJoinState=he,this._activeBuffer.x<ge&&N-j>0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,ue),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(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),_e=new Uint32Array(ie.length*N);let ge=0;for(let q=0;q<ie.length;){const ue=ie.codePointAt(q)||0;_e[ge++]=ue,q+=ue>65535?2:1}let Q=ge;for(let q=1;q<N;++q)_e.copyWithin(Q,0,ge),Q+=ge;return this.print(_e,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:_e,cols:ge}=this._bufferService,{active:Q,alt:q}=_e,ue=this._optionsService.rawOptions,le=Be=>Be?1:2,he=z.params[0];return re=he,Ee=j?he===2?4:he===4?le(ie.modes.insertMode):he===12?3:he===20?le(ue.convertEol):0:he===1?le(N.applicationCursorKeys):he===3?ue.windowOptions.setWinLines?ge===80?2:ge===132?1:0:0:he===6?le(N.origin):he===7?le(N.wraparound):he===8?3:he===9?le($==="X10"):he===12?le(ue.cursorBlink):he===25?le(!ie.isCursorHidden):he===45?le(N.reverseWraparound):he===66?le(N.applicationKeypad):he===67?4:he===1e3?le($==="VT200"):he===1002?le($==="DRAG"):he===1003?le($==="ANY"):he===1004?le(N.sendFocus):he===1005?4:he===1006?le(I==="SGR"):he===1015?4:he===1016?le(I==="SGR_PIXELS"):he===1048?1:he===47||he===1047||he===1049?le(Q===q):he===2004?le(N.bracketedPasteMode):0,ie.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${re};${Ee}$y`),!0;var re,Ee}_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 _e=z.getSubParams(j+ie);let ge=0;do $[1]===5&&(I=1),$[ie+ge+1+I]=_e[ge];while(++ge<_e.length&&ge+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 _e=2;_e<$.length;++_e)$[_e]===-1&&($[_e]=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 _e=(0,R.parseColor)(I);_e&&j.push({type:1,index:ie,color:_e})}}}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(O[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(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,z){Z>z&&(W=Z,Z=z,z=W),Z<this.start&&(this.start=Z),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(Z){return 0<=Z&&Z<256}G=h([m(0,L.IBufferService)],G)},844:(f,o)=>{function c(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,u,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 O=this.ybase+this.y;if(O>=D&&O<D+R.length)continue;const H=R[R.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(R,this._cols,_),P=U.length-R.length;let W;W=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 Z=R.length-P-1,z=H;for(;Z>=0;){const N=Math.min(z,Y);if(R[G]===void 0)break;if(R[G].copyCellsFrom(R[Z],z-N,Y-N,N,!0),Y-=N,Y===0&&(G--,Y=U[G]),z-=N,z===0){Z--;const $=Math.max(Z,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-W;for(;j-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+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 O=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>O+P){for(let Y=U.newLines.length-1;Y>=0;Y--)this.lines.set(G--,U.newLines[Y]);G++,D.push({index:O+1,amount:U.newLines.length}),P+=U.newLines.length,U=L[++H]}else this.lines.set(G,k[O--]);let W=0;for(let G=D.length-1;G>=0;G--)D[G].index+=W,this.lines.onInsertEmitter.fire(D[G]),W+=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,O=u-A,H=Math.min(R,O);_[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 O=R?R.length-1:-1;for(;O>=0&&(A=R[O](this._params),A!==!0);O--)if(A instanceof Promise)return this._preserveStack(3,R,O,M,k),A;O<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 O=S.length-1;O>=0;O--)(D=S[O])&&(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})()))})(Zu)),Zu.exports}var _1=g1();class v1{constructor(r,s){Lm(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: ${Bo(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 jo({sessionId:t,active:r=!0,onEvent:s}){const l=ee.useRef(null),d=ee.useRef(null),p=ee.useRef(null),f=ee.useRef(null),o=ee.useRef(null),c=ee.useRef(""),h=ee.useRef(""),m=ee.useRef(r),u=ee.useRef(s),[y,w]=ee.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,_=Km(v,c.current,h.current);if(!_){T("empty"),v==null||v.focus();return}T(await Xm(_)?"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<Qm||M.height<Jm||(A.fit(),L.cols<Zm||L.rows<eg)?!1:(S.resize(L.cols,L.rows),v.focus&&L.focus(),!0)}return ee.useEffect(()=>{u.current=s},[s]),ee.useEffect(()=>{m.current=r},[r]),ee.useEffect(()=>{var W;if(!l.current)return;const v=new _1.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:w1}),_=new d1.FitAddon;v.loadAddon(_),v.loadAddon(new m1.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=b1(K);return G?(h.current=G,d_(G).then(Y=>{T(Y?"copied":"ready")}),!0):!1}),L=K=>{const G=Km(v,c.current,h.current);!G||!K.clipboardData||(K.clipboardData.setData("text/plain",G),K.preventDefault(),T("copied"))};(W=v.element)==null||W.addEventListener("copy",L),v.attachCustomKeyEventHandler(K=>{if(!S1(K))return!0;const G=v.getSelection()||c.current;return G?(K.preventDefault(),K.stopPropagation(),Xm(G).then(Y=>{T(Y?"copied":"failed")}),!1):!0});const M=l.current.getBoundingClientRect();M.width>=Qm&&M.height>=Jm&&_.fit();const D=new v1(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>=Zm&&v.rows>=eg&&D.resize(v.cols,v.rows);const k=v.onData(K=>{D.sendInput(K)});let R=0,O=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),O=window.requestAnimationFrame(U),H=window.setTimeout(U,120),()=>{var K;R&&window.cancelAnimationFrame(R),O&&window.cancelAnimationFrame(O),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]),ee.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]),ee.useEffect(()=>{const v=()=>{m.current&&b()};return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]),ee.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:Ym,onPointerDown:Ym,onClick:()=>void E(),children:y1(y)})]})}function y1(t){return t==="copied"?"Copied":t==="empty"?"No selection":t==="failed"?"Copy failed":t==="ready"?"Copy ready":"Copy"}function Km(t,r,s){return(t==null?void 0:t.getSelection())||s||r}function S1(t){return t.type==="keydown"&&t.metaKey&&!t.ctrlKey&&!t.altKey&&t.key.toLowerCase()==="c"}function b1(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 Ym(t){t.preventDefault(),t.stopPropagation()}async function Xm(t){return await d_(t)?!0:C1(t)}async function d_(t){var r;try{if((r=navigator.clipboard)!=null&&r.writeText)return await navigator.clipboard.writeText(t),!0}catch{return!1}return!1}function C1(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 Qm=160,Jm=80,Zm=20,eg=5,w1={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"},p_=[{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"}],m_=[{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"}],x1=[{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"}],g_=[...x1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function Kn({status:t}){return x.jsx("span",{className:`status-badge status-${t}`,children:t.replaceAll("_"," ")})}function zh({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:p_.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:m_.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:g_.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(Kn,{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 E1({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,onOpenRepositoryDiff:A,onReviewTaskHarness:L,onRefresh:M,onMemoryStateChange:D}){const[k,R]=ee.useState(null),[O,H]=ee.useState(null),[U,P]=ee.useState(""),[W,K]=ee.useState(!1),[G,Y]=ee.useState(!1),[,Z]=Ni(null),[z,j]=ee.useState(null),N=(c==null?void 0:c.files)??[],$=N.filter(ve=>ve.kind.startsWith("agent-")),I=$.filter(ve=>tg(ve)),ie=$.filter(ve=>!tg(ve)),_e=N.filter(ve=>ve.kind.startsWith("skill-")),ge=N.filter(ve=>ve.kind.startsWith("tool-")),Q=N.filter(ve=>ve.kind==="root-claude"||ve.kind==="gitignore"||ve.kind==="pull-request-template"),q=!!(O&&U!==O.content);ee.useEffect(()=>{l||(R(null),H(null),P(""),K(!1),Z(null))},[N,l,k]),ee.useEffect(()=>{if(!l||!k||!p||k.startsWith("memory-review:"))return;let ve=!1;return Y(!0),Z(null),K(!1),(k.startsWith(".ai/vcm/memory/")?Se.getMemoryFileContent(p,k).then(xe=>({path:xe.path,title:xe.title,content:xe.content,editable:xe.editable,source:"memory"})):Se.getHarnessFileContent(p,k).then(xe=>({path:xe.path,title:xe.title,content:xe.content,editable:xe.editable,readonlyReason:xe.readonlyReason,source:"harness"}))).then(xe=>{ve||(H(xe),P(xe.content))}).catch(xe=>{ve||Z(lt(`Load harness file ${k}`,xe))}).finally(()=>{ve||Y(!1)}),()=>{ve=!0}},[l,k,p]);async function ue(){if(!(!O||!O.editable||!q||!p)){Y(!0),Z(null);try{if(O.source==="memory"){const ve=await Se.updateMemoryFileContent(p,O.path,{content:U}),Te=await Se.getMemoryFileContent(p,O.path);H({path:Te.path,title:Te.title,content:Te.content,editable:!0,source:"memory"}),P(Te.content),D(ve)}else{const ve=await Se.updateHarnessFileContent(p,O.path,{content:U});H({path:ve.file.path,title:ve.file.title,content:ve.file.content,editable:ve.file.editable,readonlyReason:ve.file.readonlyReason,source:"harness"}),P(ve.file.content)}K(!1),M()}catch(ve){Z(lt(`Save harness file ${O.path}`,ve))}finally{Y(!1)}}}function le(){R(null),H(null),P(""),K(!1),Z(null)}async function he(ve){Z(null);try{await D1(ve),j(ve),window.setTimeout(()=>{j(Te=>Te===ve?null:Te)},1200)}catch(Te){Z(lt(`Copy harness file path ${ve}`,Te))}}function re(ve){const Te=`memory-review:${ve.runId}`;R(Te),H({path:ve.runId,title:`Memory Diff: ${ve.runId}`,content:ve.diff||"No memory diff was recorded.",editable:!1,readonlyReason:`Applied by ${ve.source}. Status: ${ve.status}.`,source:"memory-diff"}),P(ve.diff||"No memory diff was recorded."),K(!1)}async function Ee(ve){if(!(!p||!ve.canRevert||!window.confirm(`Revert memory changes from ${ve.runId}?`))){Y(!0),Z(null);try{const Te=await Se.revertMemoryRun({taskSlug:p,runId:ve.runId});D(Te),le()}catch(Te){Z(lt(`Revert memory review ${ve.runId}`,Te))}finally{Y(!1)}}}async function Be(){if(p){Y(!0),Z(null);try{D(await Se.retryMemoryReview({taskSlug:p}))}catch(ve){Z(lt("Retry Auto Memory review",ve))}finally{Y(!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:L,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:t,onClick:A,children:"Review Diff"}),x.jsx("button",{type:"button",disabled:t,onClick:M,children:"Refresh"}),x.jsx("button",{type:"button",onClick:u,children:"Close"})]})]}),x.jsxs("div",{className:"harness-studio-layout",children:[x.jsx("aside",{className:k?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:k?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:(O==null?void 0:O.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(O==null?void 0:O.path)??k})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[O?x.jsx(Kn,{status:O.editable?"ok":"unknown"}):null,W?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:G||!p||!(O!=null&&O.editable)||!q,onClick:()=>void ue(),children:"Save"}),x.jsx("button",{type:"button",disabled:G,onClick:()=>{P((O==null?void 0:O.content)??""),K(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:G||!p||!(O!=null&&O.editable),onClick:()=>K(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:le,children:"Return"})]})]}),O!=null&&O.readonlyReason?x.jsx("p",{className:"muted",children:O.readonlyReason}):null,x.jsx("textarea",{className:W?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:U,spellCheck:!1,readOnly:!W,disabled:G,onChange:ve=>P(ve.target.value)})]}):x.jsxs("div",{className:"harness-studio-left-scroll",children:[x.jsx($a,{title:"VCM Roles",files:I,selectedPath:k,copiedPath:z,onCopy:ve=>void he(ve),onSelect:R}),x.jsx($a,{title:"Auxiliary Roles",files:ie,selectedPath:k,copiedPath:z,onCopy:ve=>void he(ve),onSelect:R}),x.jsx(A1,{state:m,busy:G,copiedPath:z,onCopy:ve=>void he(ve),onSelect:R,onViewDiff:re,onRevert:ve=>void Ee(ve),onRetry:()=>void Be()}),x.jsx(k1,{state:h}),x.jsx(nl,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(js,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),x.jsx(js,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),x.jsx(js,{label:"Managed files",value:String(N.length)}),x.jsx(js,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),x.jsx(js,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),x.jsx(js,{label:"Engineer",value:ng(o)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(ve=>x.jsx("li",{children:ve},ve))}):null]})}),x.jsx($a,{title:"Skills",files:_e,selectedPath:k,copiedPath:z,onCopy:ve=>void he(ve),onSelect:R,collapsible:!0}),x.jsx($a,{title:"Root Context",files:Q,selectedPath:k,copiedPath:z,onCopy:ve=>void he(ve),onSelect:R,collapsible:!0}),x.jsx($a,{title:"Tools",files:ge,selectedPath:k,copiedPath:z,onCopy:ve=>void he(ve),onSelect:R,collapsible:!0}),x.jsx(nl,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(ve=>x.jsxs("li",{children:[x.jsx("span",{children:ve.path??ve.label}),x.jsx(Kn,{status:ve.status})]},ve.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:ng(o)})]}),x.jsx(Kn,{status:(o==null?void 0:o.status)??"unknown"})]}),x.jsx(zh,{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(jo,{sessionId:o.id,active:l},o.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:o!=null&&o.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function js({label:t,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:t}),x.jsx("strong",{children:r})]})}function k1({state:t}){return x.jsx(nl,{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(r=>x.jsxs("li",{children:[x.jsx("span",{title:r.path,children:r.title}),x.jsx("code",{children:r.reporterRole??"unknown"})]},r.path)):x.jsx("li",{children:x.jsx("span",{children:"No pending harness feedback."})})})})}function $a({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(Kn,{status:c.action})]},c.path)):x.jsx("li",{children:x.jsx("span",{children:"No files."})})});return f?x.jsx(nl,{title:t,children:o}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:t}),o]})}function A1({state:t,busy:r,copiedPath:s,onCopy:l,onSelect:d,onViewDiff:p,onRevert:f,onRetry:o}){var c,h;return x.jsxs(nl,{title:"Memory",children:[x.jsxs("div",{className:"harness-memory-status",children:[x.jsx("span",{children:"Status"}),x.jsx(Kn,{status:R1(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:T1(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(Kn,{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 nl({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 tg(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 ng(t){return t?t.status==="running"?`${t.status} / ${t.activityStatus??"idle"}`:t.status:"not started"}function T1(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}function R1(t){return t==="collecting"||t==="reviewing"?"running":t==="failed"?"failed":t==="idle"?"ok":"unknown"}async function D1(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 M1({open:t,taskSlug:r,onClose:s}){var k;const[l,d]=ee.useState(null),[p,f]=ee.useState(null),[o,c]=ee.useState(null),[h,m]=ee.useState(null),[u,y]=ee.useState(null),[w,T]=ee.useState(!1),[E,b]=ee.useState(!1),[,v]=Ni(null),[_,S]=ee.useState(null),A=ee.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 O;T(!0),v(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await Se.getRepositoryDiff(r,R);d(H),m(null),f(((O=H.commit)==null?void 0:O.sha)??null),c(U=>{var P;return U&&H.files.some(W=>W.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){v(lt(R?`Load commit diff ${R}`:"Load latest commit diff",H))}finally{T(!1)}}ee.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 O=await Se.getRepositoryFileDiff(r,R);m(O),c(R)}catch(O){v(lt(`Load task file diff for ${R}`,O))}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 Se.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(lt("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 O=R.target.value||null;f(O),L(O)},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(L1,{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:[Ch(R.status)," · ",ig(R.stage)," · ",bh(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(O1,{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:[bh(A.category)," · ",Ch(A.status)," · ",ig(A.stage)]})]}),x.jsxs("span",{className:"repository-diff-stats",children:["+",A.additions," / -",A.deletions]})]}),A.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,A.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${A.path} diff`,children:__(A.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:w?"Loading commit diff...":"No diff selected."})})]})]})}):null}function L1({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 O1({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:[bh(s.category)," · ",Ch(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:__(s.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function bh(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 ig(t){return t.replaceAll("_"," ")}function Ch(t){return t.replaceAll("_"," ")}function __(t){return t.split(`
62
+ `).filter(r=>!j1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${B1(r)}`,children:r||" "},`${s}:${r}`))}function B1(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 j1(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 N1({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:H1(p)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(zh,{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(jo,{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 H1(t){if(!t)return"not started";const r=t.status==="running"?` · ${t.activityStatus??"idle"}`:"";return`${t.status}${r}`}function z1(t,r){const s={};return(t[t.length-1]===""?[...t,""]:t).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const I1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,U1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P1={};function rg(t,r){return(P1.jsx?U1:I1).test(t)}const F1=/[ \t\n\f\r]/g;function q1(t){return typeof t=="object"?t.type==="text"?sg(t.value):!1:sg(t)}function sg(t){return t.replace(F1,"")===""}class al{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}al.prototype.normal={};al.prototype.property={};al.prototype.space=void 0;function v_(t,r){const s={},l={};for(const d of t)Object.assign(s,d.property),Object.assign(l,d.normal);return new al(s,l,r)}function wh(t){return t.toLowerCase()}class mn{constructor(r,s){this.attribute=s,this.property=r}}mn.prototype.attribute="";mn.prototype.booleanish=!1;mn.prototype.boolean=!1;mn.prototype.commaOrSpaceSeparated=!1;mn.prototype.commaSeparated=!1;mn.prototype.defined=!1;mn.prototype.mustUseProperty=!1;mn.prototype.number=!1;mn.prototype.overloadedBoolean=!1;mn.prototype.property="";mn.prototype.spaceSeparated=!1;mn.prototype.space=void 0;let $1=0;const Pe=Jr(),Ot=Jr(),xh=Jr(),we=Jr(),ct=Jr(),Us=Jr(),Tn=Jr();function Jr(){return 2**++$1}const Eh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Pe,booleanish:Ot,commaOrSpaceSeparated:Tn,commaSeparated:Us,number:we,overloadedBoolean:xh,spaceSeparated:ct},Symbol.toStringTag,{value:"Module"})),eh=Object.keys(Eh);class Ih extends mn{constructor(r,s,l,d){let p=-1;if(super(r,s),ag(this,"space",d),typeof l=="number")for(;++p<eh.length;){const f=eh[p];ag(this,eh[p],(l&Eh[f])===Eh[f])}}}Ih.prototype.defined=!0;function ag(t,r,s){s&&(t[r]=s)}function $s(t){const r={},s={};for(const[l,d]of Object.entries(t.properties)){const p=new Ih(l,t.transform(t.attributes||{},l),d,t.space);t.mustUseProperty&&t.mustUseProperty.includes(l)&&(p.mustUseProperty=!0),r[l]=p,s[wh(l)]=l,s[wh(p.attribute)]=l}return new al(r,s,t.space)}const y_=$s({properties:{ariaActiveDescendant:null,ariaAtomic:Ot,ariaAutoComplete:null,ariaBusy:Ot,ariaChecked:Ot,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:Ot,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:Ot,ariaFlowTo:ct,ariaGrabbed:Ot,ariaHasPopup:null,ariaHidden:Ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:we,ariaLive:null,ariaModal:Ot,ariaMultiLine:Ot,ariaMultiSelectable:Ot,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:Ot,ariaReadOnly:Ot,ariaRelevant:null,ariaRequired:Ot,ariaRoleDescription:ct,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:Ot,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 S_(t,r){return r in t?t[r]:r}function b_(t,r){return S_(t,r.toLowerCase())}const G1=$s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Us,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:Pe,allowPaymentRequest:Pe,allowUserMedia:Pe,alt:null,as:null,async:Pe,autoCapitalize:null,autoComplete:ct,autoFocus:Pe,autoPlay:Pe,blocking:ct,capture:null,charSet:null,checked:Pe,cite:null,className:ct,cols:we,colSpan:null,content:null,contentEditable:Ot,controls:Pe,controlsList:ct,coords:we|Us,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Pe,defer:Pe,dir:null,dirName:null,disabled:Pe,download:xh,draggable:Ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Pe,formTarget:null,headers:ct,height:we,hidden:xh,high:we,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:Pe,inputMode:null,integrity:null,is:null,isMap:Pe,itemId:null,itemProp:ct,itemRef:ct,itemScope:Pe,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Pe,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:Pe,muted:Pe,name:null,nonce:null,noModule:Pe,noValidate:Pe,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:Pe,optimum:we,pattern:null,ping:ct,placeholder:null,playsInline:Pe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Pe,referrerPolicy:null,rel:ct,required:Pe,reversed:Pe,rows:we,rowSpan:we,sandbox:ct,scope:null,scoped:Pe,seamless:Pe,selected:Pe,shadowRootClonable:Pe,shadowRootDelegatesFocus:Pe,shadowRootMode:null,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:Ot,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:Pe,useMap:null,value:Ot,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,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:Pe,declare:Pe,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:Pe,noHref:Pe,noShade:Pe,noWrap:Pe,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:Ot,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:Pe,disableRemotePlayback:Pe,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:b_}),V1=$s({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:ct,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:Pe,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:Us,g2:Us,glyphName:Us,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:ct,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:S_}),C_=$s({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()}}),w_=$s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:b_}),x_=$s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,r){return"xml:"+r.slice(3).toLowerCase()}}),W1={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"},K1=/[A-Z]/g,lg=/-[a-z]/g,Y1=/^data[-\w.:]+$/i;function X1(t,r){const s=wh(r);let l=r,d=mn;if(s in t.normal)return t.property[t.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&Y1.test(r)){if(r.charAt(4)==="-"){const p=r.slice(5).replace(lg,J1);l="data"+p.charAt(0).toUpperCase()+p.slice(1)}else{const p=r.slice(4);if(!lg.test(p)){let f=p.replace(K1,Q1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Ih}return new d(l,r)}function Q1(t){return"-"+t.toLowerCase()}function J1(t){return t.charAt(1).toUpperCase()}const Z1=v_([y_,G1,C_,w_,x_],"html"),Uh=v_([y_,V1,C_,w_,x_],"svg");function eS(t){return t.join(" ").trim()}var Ns={},th,og;function tS(){if(og)return th;og=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(W){var K=W.match(r);K&&(_+=K.length);var G=W.lastIndexOf(c);S=~G?W.length-G:S+W.length}function L(){var W={line:_,column:S};return function(K){return K.position=new M(W),R(),K}}function M(W){this.start=W,this.end={line:_,column:S},this.source=v.source}M.prototype.content=b;function D(W){var K=new Error(v.source+":"+_+":"+S+": "+W);if(K.reason=W,K.filename=v.source,K.line=_,K.column=S,K.source=b,!v.silent)throw K}function k(W){var K=W.exec(b);if(K){var G=K[0];return A(G),b=b.slice(G.length),K}}function R(){k(s)}function O(W){var K;for(W=W||[];K=H();)K!==!1&&W.push(K);return W}function H(){var W=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,W({type:y,comment:G})}}function U(){var W=L(),K=k(l);if(K){if(H(),!k(d))return D("property missing ':'");var G=k(p),Y=W({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 W=[];O(W);for(var K;K=U();)K!==!1&&(W.push(K),O(W));return W}return R(),P()}function E(b){return b?b.replace(o,u):u}return th=T,th}var cg;function nS(){if(cg)return Ns;cg=1;var t=Ns&&Ns.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.default=s;const r=t(tS());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 Ns}var Ga={},ug;function iS(){if(ug)return Ga;ug=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.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 Ga.camelCase=c,Ga}var Va,hg;function rS(){if(hg)return Va;hg=1;var t=Va&&Va.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=t(nS()),s=iS();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,Va=l,Va}var sS=rS();const aS=a_(sS),E_=k_("end"),Ph=k_("start");function k_(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 lS(t){const r=Ph(t),s=E_(t);if(r&&s)return{start:r,end:s}}function Xa(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?fg(t.position):"start"in t||"end"in t?fg(t):"line"in t||"column"in t?kh(t):""}function kh(t){return dg(t&&t.line)+":"+dg(t&&t.column)}function fg(t){return kh(t&&t.start)+"-"+kh(t&&t.end)}function dg(t){return t&&typeof t=="number"?t:1}class Qt 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=Xa(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}}Qt.prototype.file="";Qt.prototype.name="";Qt.prototype.reason="";Qt.prototype.message="";Qt.prototype.stack="";Qt.prototype.column=void 0;Qt.prototype.line=void 0;Qt.prototype.ancestors=void 0;Qt.prototype.cause=void 0;Qt.prototype.fatal=void 0;Qt.prototype.place=void 0;Qt.prototype.ruleId=void 0;Qt.prototype.source=void 0;const Fh={}.hasOwnProperty,oS=new Map,cS=/[A-Z]/g,uS=new Set(["table","tbody","thead","tfoot","tr"]),hS=new Set(["td","th"]),A_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function fS(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=SS(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=yS(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"?Uh:Z1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},p=T_(d,t,void 0);return p&&typeof p!="string"?p:d.create(t,d.Fragment,{children:p||void 0},void 0)}function T_(t,r,s){if(r.type==="element")return dS(t,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return pS(t,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return gS(t,r,s);if(r.type==="mdxjsEsm")return mS(t,r);if(r.type==="root")return _S(t,r,s);if(r.type==="text")return vS(t,r)}function dS(t,r,s){const l=t.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Uh,t.schema=d),t.ancestors.push(r);const p=D_(t,r.tagName,!1),f=bS(t,r);let o=$h(t,r);return uS.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!q1(c):!0})),R_(t,f,p,r),qh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,p,f,s)}function pS(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)}il(t,r.position)}function mS(t,r){if(r.data&&r.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(r.data.estree);il(t,r.position)}function gS(t,r,s){const l=t.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Uh,t.schema=d),t.ancestors.push(r);const p=r.name===null?t.Fragment:D_(t,r.name,!0),f=CS(t,r),o=$h(t,r);return R_(t,f,p,r),qh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,p,f,s)}function _S(t,r,s){const l={};return qh(l,$h(t,r)),t.create(r,t.Fragment,l,s)}function vS(t,r){return r.value}function R_(t,r,s,l){typeof s!="string"&&s!==t.Fragment&&t.passNode&&(r.node=l)}function qh(t,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(t.children=s)}}function yS(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 SS(t,r){return s;function s(l,d,p,f){const o=Array.isArray(p.children),c=Ph(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 bS(t,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&Fh.call(r.properties,d)){const p=wS(t,d,r.properties[d]);if(p){const[f,o]=p;t.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&hS.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 CS(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 il(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 il(t,r.position);else p=l.value===null?!0:l.value;s[d]=p}return s}function $h(t,r){const s=[];let l=-1;const d=t.passKeys?new Map:oS;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=T_(t,p,f);o!==void 0&&s.push(o)}return s}function wS(t,r,s){const l=X1(t.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?z1(s):eS(s)),l.property==="style"){let d=typeof s=="object"?s:xS(t,String(s));return t.stylePropertyNameCase==="css"&&(d=ES(d)),["style",d]}return[t.elementAttributeNameCase==="react"&&l.space?W1[l.property]||l.property:l.attribute,s]}}function xS(t,r){try{return aS(r,{reactCompat:!0})}catch(s){if(t.ignoreInvalidStyle)return{};const l=s,d=new Qt("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=A_+"#cannot-parse-style-attribute",d}}function D_(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=rg(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=rg(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return Fh.call(t.components,d)?t.components[d]:d}if(t.evaluater)return t.evaluater.evaluateExpression(l);il(t)}function il(t,r){const s=new Qt("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=A_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function ES(t){const r={};let s;for(s in t)Fh.call(t,s)&&(r[kS(s)]=t[s]);return r}function kS(t){let r=t.replace(cS,AS);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function AS(t){return"-"+t.toLowerCase()}const nh={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"]},TS={};function Gh(t,r){const s=TS,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return M_(t,l,d)}function M_(t,r,s){if(RS(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 pg(t.children,r,s)}return Array.isArray(t)?pg(t,r,s):""}function pg(t,r,s){const l=[];let d=-1;for(;++d<t.length;)l[d]=M_(t[d],r,s);return l.join("")}function RS(t){return!!(t&&typeof t=="object")}const mg=document.createElement("i");function Vh(t){const r="&"+t+";";mg.innerHTML=r;const s=mg.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 Pn(t,r){return t.length>0?(Rn(t,t.length,0,r),t):r}const gg={}.hasOwnProperty;function L_(t){const r={};let s=-1;for(;++s<t.length;)DS(r,t[s]);return r}function DS(t,r){let s;for(s in r){const d=(gg.call(t,s)?t[s]:void 0)||(t[s]={}),p=r[s];let f;if(p)for(f in p){gg.call(d,f)||(d[f]=[]);const o=p[f];MS(d[f],Array.isArray(o)?o:o?[o]:[])}}}function MS(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 O_(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 Yn(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nn=Er(/[A-Za-z]/),Xt=Er(/[\dA-Za-z]/),LS=Er(/[#-'*+\--9=?A-Z^-~]/);function Ao(t){return t!==null&&(t<32||t===127)}const Ah=Er(/\d/),OS=Er(/[\dA-Fa-f]/),BS=Er(/[!-/:-@[-`{-~]/);function Le(t){return t!==null&&t<-2}function ot(t){return t!==null&&(t<0||t===32)}function Ve(t){return t===-2||t===-1||t===32}const No=Er(new RegExp("\\p{P}|\\p{S}","u")),Xr=Er(/\s/);function Er(t){return r;function r(s){return s!==null&&s>-1&&t.test(String.fromCharCode(s))}}function Gs(t){const r=[];let s=-1,l=0,d=0;for(;++s<t.length;){const p=t.charCodeAt(s);let f="";if(p===37&&Xt(t.charCodeAt(s+1))&&Xt(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 Xe(t,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let p=0;return f;function f(c){return Ve(c)?(t.enter(s),o(c)):r(c)}function o(c){return Ve(c)&&p++<d?(t.consume(c),o):(t.exit(s),r(c))}}const jS={tokenize:NS};function NS(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"),Xe(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 Le(o)?(t.consume(o),t.exit("chunkText"),p):(t.consume(o),f)}}const HS={tokenize:zS},_g={tokenize:IS};function zS(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(_g,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(_g,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 Le(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,O;for(;k--;)if(r.events[k][0]==="exit"&&r.events[k][1].type==="chunkFlow"){if(R){O=r.events[k][1].end;break}R=!0}for(v(l),M=D;M<r.events.length;)r.events[M][1].end={...O},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 IS(t,r,s){return Xe(t,t.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ps(t){if(t===null||ot(t)||Xr(t))return 1;if(No(t))return 2}function Ho(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 Th={name:"attention",resolveAll:US,tokenize:PS};function US(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};vg(u,-c),vg(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=Pn(h,[["enter",t[l][1],r],["exit",t[l][1],r]])),h=Pn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",p,r]]),h=Pn(h,Ho(r.parser.constructs.insideSpan.null,t.slice(l+1,s),r)),h=Pn(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=Pn(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=Ps(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=Ps(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 vg(t,r){t.column+=r,t.offset+=r,t._bufferIndex+=r}const FS={name:"autolink",tokenize:qS};function qS(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 nn(w)?(t.consume(w),f):w===64?s(w):h(w)}function f(w){return w===43||w===45||w===46||Xt(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||Xt(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||Ao(w)?s(w):(t.consume(w),c)}function h(w){return w===64?(t.consume(w),m):LS(w)?(t.consume(w),h):s(w)}function m(w){return Xt(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||Xt(w))&&l++<63){const T=w===45?y:u;return t.consume(w),T}return s(w)}}const ll={partial:!0,tokenize:$S};function $S(t,r,s){return l;function l(p){return Ve(p)?Xe(t,d,"linePrefix")(p):d(p)}function d(p){return p===null||Le(p)?r(p):s(p)}}const B_={continuation:{tokenize:VS},exit:WS,name:"blockQuote",tokenize:GS};function GS(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 Ve(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),r):(t.exit("blockQuotePrefix"),r(f))}}function VS(t,r,s){const l=this;return d;function d(f){return Ve(f)?Xe(t,p,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):p(f)}function p(f){return t.attempt(B_,r,s)(f)}}function WS(t){t.exit("blockQuote")}const j_={name:"characterEscape",tokenize:KS};function KS(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 BS(p)?(t.enter("characterEscapeValue"),t.consume(p),t.exit("characterEscapeValue"),t.exit("characterEscape"),r):s(p)}}const N_={name:"characterReference",tokenize:YS};function YS(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=Xt,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=OS,m):(t.enter("characterReferenceValue"),p=7,f=Ah,m(u))}function m(u){if(u===59&&d){const y=t.exit("characterReferenceValue");return f===Xt&&!Vh(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 yg={partial:!0,tokenize:QS},Sg={concrete:!0,name:"codeFenced",tokenize:XS};function XS(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"),Ve(M)?Xe(t,u,"whitespace")(M):u(M))}function u(M){return M===null||Le(M)?(t.exit("codeFencedFence"),l.interrupt?r(M):t.check(yg,E,A)(M)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),y(M))}function y(M){return M===null||Le(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),u(M)):Ve(M)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Xe(t,w,"whitespace")(M)):M===96&&M===o?s(M):(t.consume(M),y)}function w(M){return M===null||Le(M)?u(M):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),T(M))}function T(M){return M===null||Le(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&&Ve(M)?Xe(t,_,"linePrefix",p+1)(M):_(M)}function _(M){return M===null||Le(M)?t.check(yg,E,A)(M):(t.enter("codeFlowValue"),S(M))}function S(M){return M===null||Le(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 O;function O(K){return M.enter("lineEnding"),M.consume(K),M.exit("lineEnding"),H}function H(K){return M.enter("codeFencedFence"),Ve(K)?Xe(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"),Ve(K)?Xe(M,W,"whitespace")(K):W(K)):k(K)}function W(K){return K===null||Le(K)?(M.exit("codeFencedFence"),D(K)):k(K)}}}function QS(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 ih={name:"codeIndented",tokenize:ZS},JS={partial:!0,tokenize:eb};function ZS(t,r,s){const l=this;return d;function d(h){return t.enter("codeIndented"),Xe(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):Le(h)?t.attempt(JS,f,c)(h):(t.enter("codeFlowValue"),o(h))}function o(h){return h===null||Le(h)?(t.exit("codeFlowValue"),f(h)):(t.consume(h),o)}function c(h){return t.exit("codeIndented"),r(h)}}function eb(t,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):Le(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),d):Xe(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):Le(f)?d(f):s(f)}}const tb={name:"codeText",previous:ib,resolve:nb,tokenize:rb};function nb(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 ib(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function rb(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)):Le(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||Le(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 sb{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&&Wa(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),Wa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Wa(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);Wa(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Wa(this.left,s.reverse())}}}function Wa(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 H_(t){const r={};let s=-1,l,d,p,f,o,c,h;const m=new sb(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,ab(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 ab(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 lb={resolve:cb,tokenize:ub},ob={partial:!0,tokenize:hb};function cb(t){return H_(t),t}function ub(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):Le(o)?t.check(ob,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 hb(t,r,s){const l=this;return d;function d(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Xe(t,p,"linePrefix")}function p(f){if(f===null||Le(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 z_(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||Ao(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||Le(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||ot(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||Ao(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 I_(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):Le(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||Le(w)||o++>999?(t.exit("chunkString"),m(w)):(t.consume(w),c||(c=!Ve(w)),w===92?y:u)}function y(w){return w===91||w===92||w===93?(t.consume(w),o++,u):u(w)}}function U_(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):Le(y)?(t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),Xe(t,h,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===f||y===null||Le(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 Qa(t,r){let s;return l;function l(d){return Le(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),s=!0,l):Ve(d)?Xe(t,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const fb={name:"definition",tokenize:pb},db={partial:!0,tokenize:mb};function pb(t,r,s){const l=this;let d;return p;function p(w){return t.enter("definition"),f(w)}function f(w){return I_.call(l,t,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function o(w){return d=Yn(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 ot(w)?Qa(t,h)(w):h(w)}function h(w){return z_(t,m,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return t.attempt(db,u,u)(w)}function u(w){return Ve(w)?Xe(t,y,"whitespace")(w):y(w)}function y(w){return w===null||Le(w)?(t.exit("definition"),l.parser.defined.push(d),r(w)):s(w)}}function mb(t,r,s){return l;function l(o){return ot(o)?Qa(t,d)(o):s(o)}function d(o){return U_(t,p,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function p(o){return Ve(o)?Xe(t,f,"whitespace")(o):f(o)}function f(o){return o===null||Le(o)?r(o):s(o)}}const gb={name:"hardBreakEscape",tokenize:_b};function _b(t,r,s){return l;function l(p){return t.enter("hardBreakEscape"),t.consume(p),d}function d(p){return Le(p)?(t.exit("hardBreakEscape"),r(p)):s(p)}}const vb={name:"headingAtx",resolve:yb,tokenize:Sb};function yb(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 Sb(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||ot(m)?(t.exit("atxHeadingSequence"),o(m)):s(m)}function o(m){return m===35?(t.enter("atxHeadingSequence"),c(m)):m===null||Le(m)?(t.exit("atxHeading"),r(m)):Ve(m)?Xe(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||ot(m)?(t.exit("atxHeadingText"),o(m)):(t.consume(m),h)}}const bb=["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"],bg=["pre","script","style","textarea"],Cb={concrete:!0,name:"htmlFlow",resolveTo:Eb,tokenize:kb},wb={partial:!0,tokenize:Tb},xb={partial:!0,tokenize:Ab};function Eb(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 kb(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):nn(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):nn(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 nn(I)?(t.consume(I),f=String.fromCharCode(I),b):s(I)}function b(I){if(I===null||I===47||I===62||ot(I)){const ie=I===47,_e=f.toLowerCase();return!ie&&!p&&bg.includes(_e)?(d=1,l.interrupt?r(I):U(I)):bb.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||Xt(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 Ve(I)?(t.consume(I),_):O(I)}function S(I){return I===47?(t.consume(I),O):I===58||I===95||nn(I)?(t.consume(I),A):Ve(I)?(t.consume(I),S):O(I)}function A(I){return I===45||I===46||I===58||I===95||Xt(I)?(t.consume(I),A):L(I)}function L(I){return I===61?(t.consume(I),M):Ve(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):Ve(I)?(t.consume(I),M):k(I)}function D(I){return I===c?(t.consume(I),c=null,R):I===null||Le(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||ot(I)?L(I):(t.consume(I),k)}function R(I){return I===47||I===62||Ve(I)?S(I):s(I)}function O(I){return I===62?(t.consume(I),H):s(I)}function H(I){return I===null||Le(I)?U(I):Ve(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):Le(I)&&(d===6||d===7)?(t.exit("htmlFlowData"),t.check(wb,$,P)(I)):I===null||Le(I)?(t.exit("htmlFlowData"),P(I)):(t.consume(I),U)}function P(I){return t.check(xb,W,$)(I)}function W(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),K}function K(I){return I===null||Le(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="",Z):U(I)}function Z(I){if(I===62){const ie=f.toLowerCase();return bg.includes(ie)?(t.consume(I),N):U(I)}return nn(I)&&f.length<8?(t.consume(I),f+=String.fromCharCode(I),Z):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||Le(I)?(t.exit("htmlFlowData"),$(I)):(t.consume(I),N)}function $(I){return t.exit("htmlFlow"),r(I)}}function Ab(t,r,s){const l=this;return d;function d(f){return Le(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 Tb(t,r,s){return l;function l(d){return t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),t.attempt(ll,r,s)}}const Rb={name:"htmlText",tokenize:Db};function Db(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):nn(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):nn(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):Le(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):Le(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):Le(j)?(f=_,Y(j)):(t.consume(j),_)}function S(j){return j===null?s(j):j===63?(t.consume(j),A):Le(j)?(f=S,Y(j)):(t.consume(j),S)}function A(j){return j===62?G(j):S(j)}function L(j){return nn(j)?(t.consume(j),M):s(j)}function M(j){return j===45||Xt(j)?(t.consume(j),M):D(j)}function D(j){return Le(j)?(f=D,Y(j)):Ve(j)?(t.consume(j),D):G(j)}function k(j){return j===45||Xt(j)?(t.consume(j),k):j===47||j===62||ot(j)?R(j):s(j)}function R(j){return j===47?(t.consume(j),G):j===58||j===95||nn(j)?(t.consume(j),O):Le(j)?(f=R,Y(j)):Ve(j)?(t.consume(j),R):G(j)}function O(j){return j===45||j===46||j===58||j===95||Xt(j)?(t.consume(j),O):H(j)}function H(j){return j===61?(t.consume(j),U):Le(j)?(f=H,Y(j)):Ve(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):Le(j)?(f=U,Y(j)):Ve(j)?(t.consume(j),U):(t.consume(j),W)}function P(j){return j===d?(t.consume(j),d=void 0,K):j===null?s(j):Le(j)?(f=P,Y(j)):(t.consume(j),P)}function W(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ot(j)?R(j):(t.consume(j),W)}function K(j){return j===47||j===62||ot(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"),Z}function Z(j){return Ve(j)?Xe(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 Wh={name:"labelEnd",resolveAll:Bb,resolveTo:jb,tokenize:Nb},Mb={tokenize:Hb},Lb={tokenize:zb},Ob={tokenize:Ib};function Bb(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 jb(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=Pn(o,t.slice(p+1,p+l+3)),o=Pn(o,[["enter",m,r]]),o=Pn(o,Ho(r.parser.constructs.insideSpan.null,t.slice(p+l+4,f-3),r)),o=Pn(o,[["exit",m,r],t[f-2],t[f-1],["exit",h,r]]),o=Pn(o,t.slice(f+1)),o=Pn(o,[["exit",c,r]]),Rn(t,p,t.length,o),t}function Nb(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(Yn(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(Mb,m,f?m:u)(y):y===91?t.attempt(Lb,m,f?h:u)(y):f?m(y):u(y)}function h(y){return t.attempt(Ob,m,u)(y)}function m(y){return r(y)}function u(y){return p._balanced=!0,s(y)}}function Hb(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 ot(u)?Qa(t,p)(u):p(u)}function p(u){return u===41?m(u):z_(t,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ot(u)?Qa(t,c)(u):m(u)}function o(u){return s(u)}function c(u){return u===34||u===39||u===40?U_(t,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):m(u)}function h(u){return ot(u)?Qa(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 zb(t,r,s){const l=this;return d;function d(o){return I_.call(l,t,p,f,"reference","referenceMarker","referenceString")(o)}function p(o){return l.parser.defined.includes(Yn(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Ib(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 Ub={name:"labelStartImage",resolveAll:Wh.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 Fb={name:"labelStartLink",resolveAll:Wh.resolveAll,tokenize:qb};function qb(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 rh={name:"lineEnding",tokenize:$b};function $b(t,r){return s;function s(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Xe(t,r,"linePrefix")}}const xo={name:"thematicBreak",tokenize:Gb};function Gb(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||Le(h))?(t.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(t.consume(h),l++,c):(t.exit("thematicBreakSequence"),Ve(h)?Xe(t,o,"whitespace")(h):o(h))}}const pn={continuation:{tokenize:Yb},exit:Qb,name:"list",tokenize:Kb},Vb={partial:!0,tokenize:Jb},Wb={partial:!0,tokenize:Xb};function Kb(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:Ah(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(xo,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 Ah(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(ll,l.interrupt?s:m,t.attempt(Vb,y,u))}function m(w){return l.containerState.initialBlankLine=!0,p++,y(w)}function u(w){return Ve(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 Yb(t,r,s){const l=this;return l.containerState._closeFlow=void 0,t.check(ll,d,p);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Xe(t,r,"listItemIndent",l.containerState.size+1)(o)}function p(o){return l.containerState.furtherBlankLines||!Ve(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(Wb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Xe(t,t.attempt(pn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Xb(t,r,s){const l=this;return Xe(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 Qb(t){t.exit(this.containerState.type)}function Jb(t,r,s){const l=this;return Xe(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!Ve(p)&&f&&f[1].type==="listItemPrefixWhitespace"?r(p):s(p)}}const Cg={name:"setextUnderline",resolveTo:Zb,tokenize:eC};function Zb(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 eC(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"),Ve(h)?Xe(t,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Le(h)?(t.exit("setextHeadingLine"),r(h)):s(h)}}const tC={tokenize:nC};function nC(t){const r=this,s=t.attempt(ll,l,t.attempt(this.parser.constructs.flowInitial,d,Xe(t,t.attempt(this.parser.constructs.flow,d,t.attempt(lb,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 iC={resolveAll:F_()},rC=P_("string"),sC=P_("text");function P_(t){return{resolveAll:F_(t==="text"?aC: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 F_(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 aC(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 lC={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:B_},oC={91:fb},cC={[-2]:ih,[-1]:ih,32:ih},uC={35:vb,42:xo,45:[Cg,xo],60:Cb,61:Cg,95:xo,96:Sg,126:Sg},hC={38:N_,92:j_},fC={[-5]:rh,[-4]:rh,[-3]:rh,33:Ub,38:N_,42:Th,60:[FS,Rb],91:Fb,92:[gb,j_],93:Wh,95:Th,96:tb},dC={null:[Th,iC]},pC={null:[42,95]},mC={null:[]},gC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pC,contentInitial:oC,disable:mC,document:lC,flow:uC,flowInitial:cC,insideSpan:dC,string:hC,text:fC},Symbol.toStringTag,{value:"Module"}));function _C(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=Pn(f,H),b(),f[f.length-1]!==null?[]:(k(r,0),h.events=Ho(p,h.events,h),h.events)}function y(H,U){return yC(w(H),U)}function w(H){return vC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:W,offset:K}=l;return{_bufferIndex:H,_index:U,line:P,column:W,offset:K}}function E(H){d[H.line]=H.column,O()}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){Le(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,O()):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(W,K,G){let Y,Z,z,j;return Array.isArray(W)?$(W):"tokenize"in W?$([W]):N(W);function N(ge){return Q;function Q(q){const ue=q!==null&&ge[q],le=q!==null&&ge.null,he=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(le)?le:le?[le]:[]];return $(he)(q)}}function $(ge){return Y=ge,Z=0,ge.length===0?G:I(ge[Z])}function I(ge){return Q;function Q(q){return j=R(),z=ge,ge.partial||(h.currentConstruct=ge),ge.name&&h.parser.constructs.disable.null.includes(ge.name)?_e():ge.tokenize.call(U?Object.assign(Object.create(h),U):h,c,ie,_e)(q)}}function ie(ge){return H(z,j),K}function _e(ge){return j.restore(),++Z<Y.length?I(Y[Z]):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,W=h.events.length,K=Array.from(o);return{from:W,restore:G};function G(){l=H,h.previous=U,h.currentConstruct=P,h.events.length=W,o=K,O()}}function O(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function vC(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 yC(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
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 CC(t){const l={constructs:M_([vC,...(t||{}).extensions||[]]),content:d(HS),defined:[],document:d(IS),flow:d(iC),lazy:{},string:d(aC),text:d(lC)};return l;function d(p){return f;function f(o){return yC(l,p,o)}}}function wC(t){for(;!N_(t););return t}const Cg=/[\0\t\n\r]/g;function xC(){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(Cg.lastIndex=u,h=Cg.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 EC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function kC(t){return t.replace(EC,AC)}function AC(t,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),p=d===120||d===88;return L_(s.slice(p?2:1),p?16:10)}return Gh(s)||t}const F_={}.hasOwnProperty;function TC(t,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),RC(s)(wC(CC(s).document().write(xC()(t,r,!0))))}function RC(t){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p(xt),autolinkProtocol:R,autolinkEmail:R,atxHeading:p(Me),blockQuote:p(ae),characterEscape:R,characterReference:R,codeFenced:p(de),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:p(de,f),codeText:p(re,f),codeTextData:R,data:R,codeFlowValue:R,definition:p(xe),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:p(me),hardBreakEscape:p(De),hardBreakTrailing:p(De),htmlFlow:p(ke,f),htmlFlowData:R,htmlText:p(ke,f),htmlTextData:R,image:p(Tt),label:f,link:p(xt),listItem:p(rn),listItemValue:y,listOrdered:p(Nt,u),listUnordered:p(Nt),paragraph:p(Rn),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:p(Me),strong:p(gt),thematicBreak:p(Bt)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ue,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:_e,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(W),htmlTextData:B,image:c(Y),label:z,labelText:Z,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()}};q_(r,(t||{}).mdastExtensions||[]);const s={};return l;function l(fe){let Ce={type:"root",children:[]};const Te={stack:[Ce],tokenStack:[],config:r,enter:o,exit:h,buffer:f,resume:m,data:s},je=[];let Ne=-1;for(;++Ne<fe.length;)if(fe[Ne][1].type==="listOrdered"||fe[Ne][1].type==="listUnordered")if(fe[Ne][0]==="enter")je.push(Ne);else{const pt=je.pop();Ne=d(fe,pt,Ne)}for(Ne=-1;++Ne<fe.length;){const pt=r[fe[Ne][0]];F_.call(pt,fe[Ne][1].type)&&pt[fe[Ne][1].type].call(Object.assign({sliceSerialize:fe[Ne][2].sliceSerialize},Te),fe[Ne][1])}if(Te.tokenStack.length>0){const pt=Te.tokenStack[Te.tokenStack.length-1];(pt[1]||wg).call(Te,void 0,pt[0])}for(Ce.position={start:xr(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:xr(fe.length>0?fe[fe.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(fe,Ce,Te){let je=Ce-1,Ne=-1,pt=!1,Fe,_t,vt,St;for(;++je<=Te;){const Ze=fe[je];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Ne++:Ne--,St=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(Fe&&!St&&!Ne&&!vt&&(vt=je),St=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:St=void 0}if(!Ne&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Ne===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(Fe){let mn=je;for(_t=void 0;mn--;){const Zt=fe[mn];if(Zt[1].type==="lineEnding"||Zt[1].type==="lineEndingBlank"){if(Zt[0]==="exit")continue;_t&&(fe[_t][1].type="lineEndingBlank",pt=!0),Zt[1].type="lineEnding",_t=mn}else if(!(Zt[1].type==="linePrefix"||Zt[1].type==="blockQuotePrefix"||Zt[1].type==="blockQuotePrefixWhitespace"||Zt[1].type==="blockQuoteMarker"||Zt[1].type==="listItemIndent"))break}vt&&(!_t||vt<_t)&&(Fe._spread=!0),Fe.end=Object.assign({},_t?fe[_t][1].start:Ze[1].end),fe.splice(_t||je,0,["exit",Fe,Ze[2]]),je++,Te++}if(Ze[1].type==="listItemPrefix"){const mn={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};Fe=mn,fe.splice(je,0,["enter",mn,Ze[2]]),je++,Te++,vt=void 0,St=!0}}}return fe[Ce][1]._spread=pt,Te}function p(fe,Ce){return Te;function Te(je){o.call(this,fe(je),je),Ce&&Ce.call(this,je)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(fe,Ce,Te){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Ce,Te||void 0]),fe.position={start:xr(Ce.start),end:void 0}}function c(fe){return Ce;function Ce(Te){fe&&fe.call(this,Te),h.call(this,Te)}}function h(fe,Ce){const Te=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==fe.type&&(Ce?Ce.call(this,fe,je[0]):(je[1]||wg).call(this,fe,je[0]));else throw new Error("Cannot close `"+fe.type+"` ("+Ka({start:fe.start,end:fe.end})+"): it’s not open");Te.position.end=xr(fe.end)}function m(){return $h(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function y(fe){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=fe}function T(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=fe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe.replace(/(\r?\n|\r)$/g,"")}function _(fe){const Ce=this.resume(),Te=this.stack[this.stack.length-1];Te.label=Ce,Te.identifier=Xn(this.sliceSerialize(fe)).toLowerCase()}function S(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=fe}function A(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=fe}function L(fe){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Te=this.sliceSerialize(fe).length;Ce.depth=Te}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function D(fe){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function R(fe){const Te=this.stack[this.stack.length-1].children;let je=Te[Te.length-1];(!je||je.type!=="text")&&(je=ut(),je.position={start:xr(fe.start),end:void 0},Te.push(je)),this.stack.push(je)}function B(fe){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(fe),Ce.position.end=xr(fe.end)}function H(fe){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=Ce.children[Ce.children.length-1];Te.position.end=xr(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Ce.type)&&(R.call(this,fe),B.call(this,fe))}function U(){this.data.atHardBreak=!0}function P(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe}function W(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe}function K(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe}function G(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Ce,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function Y(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Ce,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function Z(fe){const Ce=this.sliceSerialize(fe),Te=this.stack[this.stack.length-2];Te.label=kC(Ce),Te.identifier=Xn(Ce).toLowerCase()}function z(){const fe=this.stack[this.stack.length-1],Ce=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const je=fe.children;Te.children=je}else Te.alt=Ce}function j(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=fe}function N(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=fe}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ie(fe){const Ce=this.resume(),Te=this.stack[this.stack.length-1];Te.label=Ce,Te.identifier=Xn(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function ve(fe){this.data.characterReferenceType=fe.type}function _e(fe){const Ce=this.sliceSerialize(fe),Te=this.data.characterReferenceType;let je;Te?(je=L_(Ce,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Gh(Ce);const Ne=this.stack[this.stack.length-1];Ne.value+=je}function Q(fe){const Ce=this.stack.pop();Ce.position.end=xr(fe.end)}function q(fe){B.call(this,fe);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(fe)}function ue(fe){B.call(this,fe);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(fe)}function ae(){return{type:"blockquote",children:[]}}function de(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function xe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function De(){return{type:"break"}}function ke(){return{type:"html",value:""}}function Tt(){return{type:"image",title:null,url:"",alt:null}}function xt(){return{type:"link",title:null,url:"",children:[]}}function Nt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function rn(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Rn(){return{type:"paragraph",children:[]}}function gt(){return{type:"strong",children:[]}}function ut(){return{type:"text",value:""}}function Bt(){return{type:"thematicBreak"}}}function xr(t){return{line:t.line,column:t.column,offset:t.offset}}function q_(t,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?q_(t,l):DC(t,l)}}function DC(t,r){let s;for(s in r)if(F_.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 wg(t,r){throw t?new Error("Cannot close `"+t.type+"` ("+Ka({start:t.start,end:t.end})+"): a different token (`"+r.type+"`, "+Ka({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Ka({start:r.start,end:r.end})+") is still open")}function MC(t){const r=this;r.parser=s;function s(l){return TC(l,{...r.data("settings"),...t,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function LC(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 OC(t,r){const s={type:"element",tagName:"br",properties:{},children:[]};return t.patch(r,s),[t.applyData(r,s),{type:"text",value:`
66
- `}]}function BC(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 jC(t,r){const s={type:"element",tagName:"del",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function NC(t,r){const s={type:"element",tagName:"em",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function HC(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 zC(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 IC(t,r){if(t.options.allowDangerousHtml){const s={type:"raw",value:r.value};return t.patch(r,s),t.applyData(r,s)}}function $_(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 UC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return $_(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 PC(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 FC(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 qC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return $_(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 $C(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 GC(t,r,s){const l=t.all(r),d=s?VC(s):G_(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:`
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 SC(t){const l={constructs:L_([gC,...(t||{}).extensions||[]]),content:d(jS),defined:[],document:d(HS),flow:d(tC),lazy:{},string:d(rC),text:d(sC)};return l;function d(p){return f;function f(o){return _C(l,p,o)}}}function bC(t){for(;!H_(t););return t}const wg=/[\0\t\n\r]/g;function CC(){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(wg.lastIndex=u,h=wg.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 wC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xC(t){return t.replace(wC,EC)}function EC(t,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),p=d===120||d===88;return O_(s.slice(p?2:1),p?16:10)}return Vh(s)||t}const q_={}.hasOwnProperty;function kC(t,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),AC(s)(bC(SC(s).document().write(CC()(t,r,!0))))}function AC(t){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:p(xt),autolinkProtocol:R,autolinkEmail:R,atxHeading:p(ve),blockQuote:p(le),characterEscape:R,characterReference:R,codeFenced:p(he),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:p(he,f),codeText:p(re,f),codeTextData:R,data:R,codeFlowValue:R,definition:p(Ee),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:p(Be),hardBreakEscape:p(Te),hardBreakTrailing:p(Te),htmlFlow:p(xe,f),htmlFlowData:R,htmlText:p(xe,f),htmlTextData:R,image:p(Tt),label:f,link:p(xt),listItem:p(rn),listItemValue:y,listOrdered:p(Nt,u),listUnordered:p(Nt),paragraph:p(Dn),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:p(ve),strong:p(gt),thematicBreak:p(Bt)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ue,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:_e,characterReferenceMarkerNumeric:_e,characterReferenceValue:ge,characterReference:Q,codeFenced:c(b),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:O,codeIndented:c(v),codeText:c(K),codeTextData:O,data:O,definition:c(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:O,htmlText:c(W),htmlTextData:O,image:c(Y),label:z,labelText:Z,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()}};$_(r,(t||{}).mdastExtensions||[]);const s={};return l;function l(fe){let Ce={type:"root",children:[]};const Ae={stack:[Ce],tokenStack:[],config:r,enter:o,exit:h,buffer:f,resume:m,data:s},je=[];let Ne=-1;for(;++Ne<fe.length;)if(fe[Ne][1].type==="listOrdered"||fe[Ne][1].type==="listUnordered")if(fe[Ne][0]==="enter")je.push(Ne);else{const dt=je.pop();Ne=d(fe,dt,Ne)}for(Ne=-1;++Ne<fe.length;){const dt=r[fe[Ne][0]];q_.call(dt,fe[Ne][1].type)&&dt[fe[Ne][1].type].call(Object.assign({sliceSerialize:fe[Ne][2].sliceSerialize},Ae),fe[Ne][1])}if(Ae.tokenStack.length>0){const dt=Ae.tokenStack[Ae.tokenStack.length-1];(dt[1]||xg).call(Ae,void 0,dt[0])}for(Ce.position={start:wr(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:wr(fe.length>0?fe[fe.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(fe,Ce,Ae){let je=Ce-1,Ne=-1,dt=!1,qe,_t,vt,St;for(;++je<=Ae;){const Ze=fe[je];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?Ne++:Ne--,St=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(qe&&!St&&!Ne&&!vt&&(vt=je),St=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:St=void 0}if(!Ne&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||Ne===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(qe){let gn=je;for(_t=void 0;gn--;){const Jt=fe[gn];if(Jt[1].type==="lineEnding"||Jt[1].type==="lineEndingBlank"){if(Jt[0]==="exit")continue;_t&&(fe[_t][1].type="lineEndingBlank",dt=!0),Jt[1].type="lineEnding",_t=gn}else if(!(Jt[1].type==="linePrefix"||Jt[1].type==="blockQuotePrefix"||Jt[1].type==="blockQuotePrefixWhitespace"||Jt[1].type==="blockQuoteMarker"||Jt[1].type==="listItemIndent"))break}vt&&(!_t||vt<_t)&&(qe._spread=!0),qe.end=Object.assign({},_t?fe[_t][1].start:Ze[1].end),fe.splice(_t||je,0,["exit",qe,Ze[2]]),je++,Ae++}if(Ze[1].type==="listItemPrefix"){const gn={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};qe=gn,fe.splice(je,0,["enter",gn,Ze[2]]),je++,Ae++,vt=void 0,St=!0}}}return fe[Ce][1]._spread=dt,Ae}function p(fe,Ce){return Ae;function Ae(je){o.call(this,fe(je),je),Ce&&Ce.call(this,je)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(fe,Ce,Ae){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Ce,Ae||void 0]),fe.position={start:wr(Ce.start),end:void 0}}function c(fe){return Ce;function Ce(Ae){fe&&fe.call(this,Ae),h.call(this,Ae)}}function h(fe,Ce){const Ae=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==fe.type&&(Ce?Ce.call(this,fe,je[0]):(je[1]||xg).call(this,fe,je[0]));else throw new Error("Cannot close `"+fe.type+"` ("+Xa({start:fe.start,end:fe.end})+"): it’s not open");Ae.position.end=wr(fe.end)}function m(){return Gh(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function y(fe){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=fe}function T(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=fe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe.replace(/(\r?\n|\r)$/g,"")}function _(fe){const Ce=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Ce,Ae.identifier=Yn(this.sliceSerialize(fe)).toLowerCase()}function S(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=fe}function A(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=fe}function L(fe){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Ae=this.sliceSerialize(fe).length;Ce.depth=Ae}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function D(fe){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function R(fe){const Ae=this.stack[this.stack.length-1].children;let je=Ae[Ae.length-1];(!je||je.type!=="text")&&(je=ut(),je.position={start:wr(fe.start),end:void 0},Ae.push(je)),this.stack.push(je)}function O(fe){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(fe),Ce.position.end=wr(fe.end)}function H(fe){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=Ce.children[Ce.children.length-1];Ae.position.end=wr(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Ce.type)&&(R.call(this,fe),O.call(this,fe))}function U(){this.data.atHardBreak=!0}function P(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe}function W(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe}function K(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=fe}function G(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Ce,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function Y(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Ce,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function Z(fe){const Ce=this.sliceSerialize(fe),Ae=this.stack[this.stack.length-2];Ae.label=xC(Ce),Ae.identifier=Yn(Ce).toLowerCase()}function z(){const fe=this.stack[this.stack.length-1],Ce=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const je=fe.children;Ae.children=je}else Ae.alt=Ce}function j(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=fe}function N(){const fe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=fe}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ie(fe){const Ce=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Ce,Ae.identifier=Yn(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function _e(fe){this.data.characterReferenceType=fe.type}function ge(fe){const Ce=this.sliceSerialize(fe),Ae=this.data.characterReferenceType;let je;Ae?(je=O_(Ce,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Vh(Ce);const Ne=this.stack[this.stack.length-1];Ne.value+=je}function Q(fe){const Ce=this.stack.pop();Ce.position.end=wr(fe.end)}function q(fe){O.call(this,fe);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(fe)}function ue(fe){O.call(this,fe);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(fe)}function le(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function re(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Be(){return{type:"emphasis",children:[]}}function ve(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function xe(){return{type:"html",value:""}}function Tt(){return{type:"image",title:null,url:"",alt:null}}function xt(){return{type:"link",title:null,url:"",children:[]}}function Nt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function rn(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Dn(){return{type:"paragraph",children:[]}}function gt(){return{type:"strong",children:[]}}function ut(){return{type:"text",value:""}}function Bt(){return{type:"thematicBreak"}}}function wr(t){return{line:t.line,column:t.column,offset:t.offset}}function $_(t,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?$_(t,l):TC(t,l)}}function TC(t,r){let s;for(s in r)if(q_.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 xg(t,r){throw t?new Error("Cannot close `"+t.type+"` ("+Xa({start:t.start,end:t.end})+"): a different token (`"+r.type+"`, "+Xa({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Xa({start:r.start,end:r.end})+") is still open")}function RC(t){const r=this;r.parser=s;function s(l){return kC(l,{...r.data("settings"),...t,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function DC(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 MC(t,r){const s={type:"element",tagName:"br",properties:{},children:[]};return t.patch(r,s),[t.applyData(r,s),{type:"text",value:`
66
+ `}]}function LC(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 OC(t,r){const s={type:"element",tagName:"del",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function BC(t,r){const s={type:"element",tagName:"em",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function jC(t,r){const s=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),d=Gs(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 NC(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 HC(t,r){if(t.options.allowDangerousHtml){const s={type:"raw",value:r.value};return t.patch(r,s),t.applyData(r,s)}}function G_(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 zC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return G_(t,r);const d={src:Gs(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 IC(t,r){const s={src:Gs(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 UC(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 G_(t,r);const d={href:Gs(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 FC(t,r){const s={href:Gs(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 qC(t,r,s){const l=t.all(r),d=s?$C(s):V_(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
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 VC(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=G_(s[l])}return r}function G_(t){const r=t.spread;return r??t.children.length>1}function WC(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 KC(t,r){const s={type:"element",tagName:"p",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function YC(t,r){const s={type:"root",children:t.wrap(t.all(r))};return t.patch(r,s),t.applyData(r,s)}function XC(t,r){const s={type:"element",tagName:"strong",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function QC(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=Uh(r.children[1]),c=x_(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 JC(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 ZC(t,r){const s={type:"element",tagName:"td",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}const xg=9,Eg=32;function ew(t){const r=String(t),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const p=[];for(;l;)p.push(kg(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return p.push(kg(r.slice(d),d>0,!1)),p.join("")}function kg(t,r,s){let l=0,d=t.length;if(r){let p=t.codePointAt(l);for(;p===xg||p===Eg;)l++,p=t.codePointAt(l)}if(s){let p=t.codePointAt(d-1);for(;p===xg||p===Eg;)d--,p=t.codePointAt(d-1)}return d>l?t.slice(l,d):""}function tw(t,r){const s={type:"text",value:ew(String(r.value))};return t.patch(r,s),t.applyData(r,s)}function nw(t,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(r,s),t.applyData(r,s)}const iw={blockquote:LC,break:OC,code:BC,delete:jC,emphasis:NC,footnoteReference:HC,heading:zC,html:IC,imageReference:UC,image:PC,inlineCode:FC,linkReference:qC,link:$C,listItem:GC,list:WC,paragraph:KC,root:YC,strong:XC,table:QC,tableCell:ZC,tableRow:JC,text:tw,thematicBreak:nw,toml:_o,yaml:_o,definition:_o,footnoteDefinition:_o};function _o(){}const V_=-1,zo=0,Xa=1,To=2,Wh=3,Kh=4,Yh=5,Xh=6,W_=7,K_=8,rw=typeof self=="object"?self:globalThis,Ag=(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 rw[t](r)},sw=(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 zo:case V_:return s(f,d);case Xa:{const o=s([],d);for(const c of f)o.push(l(c));return o}case To:{const o=s({},d);for(const[c,h]of f)o[l(c)]=l(h);return o}case Wh:return s(new Date(f),d);case Kh:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case Yh:{const o=s(new Map,d);for(const[c,h]of f)o.set(l(c),l(h));return o}case Xh:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case W_:{const{name:o,message:c}=f;return s(Ag(o,c),d)}case K_: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(Ag(p,f),d)};return l},Tg=t=>sw(new Map,t)(0),js="",{toString:aw}={},{keys:lw}=Object,Va=t=>{const r=typeof t;if(r!=="object"||!t)return[zo,r];const s=aw.call(t).slice(8,-1);switch(s){case"Array":return[Xa,js];case"Object":return[To,js];case"Date":return[Wh,js];case"RegExp":return[Kh,js];case"Map":return[Yh,js];case"Set":return[Xh,js];case"DataView":return[Xa,s]}return s.includes("Array")?[Xa,s]:s.includes("Error")?[W_,s]:[To,s]},vo=([t,r])=>t===zo&&(r==="function"||r==="symbol"),ow=(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]=Va(f);switch(o){case zo:{let m=f;switch(c){case"bigint":o=K_,m=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return d([V_],f)}return d([o,m],f)}case Xa:{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 To:{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 lw(f))(t||!vo(Va(f[y])))&&m.push([p(y),p(f[y])]);return u}case Wh:return d([o,f.toISOString()],f);case Kh:{const{source:m,flags:u}=f;return d([o,{source:m,flags:u}],f)}case Yh:{const m=[],u=d([o,m],f);for(const[y,w]of f)(t||!(vo(Va(y))||vo(Va(w))))&&m.push([p(y),p(w)]);return u}case Xh:{const m=[],u=d([o,m],f);for(const y of f)(t||!vo(Va(y)))&&m.push(p(y));return u}}const{message:h}=f;return d([o,{name:c,message:h}],f)};return p},Rg=(t,{json:r,lossy:s}={})=>{const l=[];return ow(!(r||s),!!r,new Map,l)(t),l},Ro=typeof structuredClone=="function"?(t,r)=>r&&("json"in r||"lossy"in r)?Tg(Rg(t,r)):structuredClone(t):(t,r)=>Tg(Rg(t,r));function cw(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 uw(t,r){return"Back to reference "+(t+1)+(r>1?"-"+r:"")}function hw(t){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",s=t.options.footnoteBackContent||cw,l=t.options.footnoteBackLabel||uw,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:{...Ro(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
69
+ `});const h={type:"element",tagName:"li",properties:p,children:f};return t.patch(r,h),t.applyData(r,h)}function $C(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=V_(s[l])}return r}function V_(t){const r=t.spread;return r??t.children.length>1}function GC(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 VC(t,r){const s={type:"element",tagName:"p",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function WC(t,r){const s={type:"root",children:t.wrap(t.all(r))};return t.patch(r,s),t.applyData(r,s)}function KC(t,r){const s={type:"element",tagName:"strong",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function YC(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=Ph(r.children[1]),c=E_(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 XC(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 QC(t,r){const s={type:"element",tagName:"td",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}const Eg=9,kg=32;function JC(t){const r=String(t),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const p=[];for(;l;)p.push(Ag(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return p.push(Ag(r.slice(d),d>0,!1)),p.join("")}function Ag(t,r,s){let l=0,d=t.length;if(r){let p=t.codePointAt(l);for(;p===Eg||p===kg;)l++,p=t.codePointAt(l)}if(s){let p=t.codePointAt(d-1);for(;p===Eg||p===kg;)d--,p=t.codePointAt(d-1)}return d>l?t.slice(l,d):""}function ZC(t,r){const s={type:"text",value:JC(String(r.value))};return t.patch(r,s),t.applyData(r,s)}function ew(t,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(r,s),t.applyData(r,s)}const tw={blockquote:DC,break:MC,code:LC,delete:OC,emphasis:BC,footnoteReference:jC,heading:NC,html:HC,imageReference:zC,image:IC,inlineCode:UC,linkReference:PC,link:FC,listItem:qC,list:GC,paragraph:VC,root:WC,strong:KC,table:YC,tableCell:QC,tableRow:XC,text:ZC,thematicBreak:ew,toml:vo,yaml:vo,definition:vo,footnoteDefinition:vo};function vo(){}const W_=-1,zo=0,Ja=1,To=2,Kh=3,Yh=4,Xh=5,Qh=6,K_=7,Y_=8,nw=typeof self=="object"?self:globalThis,Tg=(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 nw[t](r)},iw=(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 zo:case W_:return s(f,d);case Ja:{const o=s([],d);for(const c of f)o.push(l(c));return o}case To:{const o=s({},d);for(const[c,h]of f)o[l(c)]=l(h);return o}case Kh:return s(new Date(f),d);case Yh:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case Xh:{const o=s(new Map,d);for(const[c,h]of f)o.set(l(c),l(h));return o}case Qh:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case K_:{const{name:o,message:c}=f;return s(Tg(o,c),d)}case Y_: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(Tg(p,f),d)};return l},Rg=t=>iw(new Map,t)(0),Hs="",{toString:rw}={},{keys:sw}=Object,Ka=t=>{const r=typeof t;if(r!=="object"||!t)return[zo,r];const s=rw.call(t).slice(8,-1);switch(s){case"Array":return[Ja,Hs];case"Object":return[To,Hs];case"Date":return[Kh,Hs];case"RegExp":return[Yh,Hs];case"Map":return[Xh,Hs];case"Set":return[Qh,Hs];case"DataView":return[Ja,s]}return s.includes("Array")?[Ja,s]:s.includes("Error")?[K_,s]:[To,s]},yo=([t,r])=>t===zo&&(r==="function"||r==="symbol"),aw=(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]=Ka(f);switch(o){case zo:{let m=f;switch(c){case"bigint":o=Y_,m=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return d([W_],f)}return d([o,m],f)}case Ja:{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 To:{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 sw(f))(t||!yo(Ka(f[y])))&&m.push([p(y),p(f[y])]);return u}case Kh:return d([o,f.toISOString()],f);case Yh:{const{source:m,flags:u}=f;return d([o,{source:m,flags:u}],f)}case Xh:{const m=[],u=d([o,m],f);for(const[y,w]of f)(t||!(yo(Ka(y))||yo(Ka(w))))&&m.push([p(y),p(w)]);return u}case Qh:{const m=[],u=d([o,m],f);for(const y of f)(t||!yo(Ka(y)))&&m.push(p(y));return u}}const{message:h}=f;return d([o,{name:c,message:h}],f)};return p},Dg=(t,{json:r,lossy:s}={})=>{const l=[];return aw(!(r||s),!!r,new Map,l)(t),l},Ro=typeof structuredClone=="function"?(t,r)=>r&&("json"in r||"lossy"in r)?Rg(Dg(t,r)):structuredClone(t):(t,r)=>Rg(Dg(t,r));function lw(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 ow(t,r){return"Back to reference "+(t+1)+(r>1?"-"+r:"")}function cw(t){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",s=t.options.footnoteBackContent||lw,l=t.options.footnoteBackLabel||ow,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=Gs(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:{...Ro(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
70
70
  `},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
71
- `}]}}const Io=(function(t){if(t==null)return mw;if(typeof t=="function")return Uo(t);if(typeof t=="object")return Array.isArray(t)?fw(t):dw(t);if(typeof t=="string")return pw(t);throw new Error("Expected function, string, or object as test")});function fw(t){const r=[];let s=-1;for(;++s<t.length;)r[s]=Io(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 dw(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 pw(t){return Uo(r);function r(s){return s&&s.type===t}}function Uo(t){return r;function r(s,l,d){return!!(gw(s)&&t.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function mw(){return!0}function gw(t){return t!==null&&typeof t=="object"&&"type"in t}const Y_=[],_w=!0,Th=!1,vw="skip";function X_(t,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const p=Io(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=Y_,T,E,b;if((!r||p(c,h,m[m.length-1]||void 0))&&(w=yw(s(c,m)),w[0]===Th))return w;if("children"in c&&c.children){const v=c;if(v.children&&w[0]!==vw)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]===Th)return T;E=typeof T[1]=="number"?T[1]:E+f}}return w}}}function yw(t){return Array.isArray(t)?t:typeof t=="number"?[_w,t]:t==null?Y_:[t]}function Qh(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),X_(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 Rh={}.hasOwnProperty,Sw={};function bw(t,r){const s=r||Sw,l=new Map,d=new Map,p=new Map,f={...iw,...s.handlers},o={all:h,applyData:ww,definitionById:l,footnoteById:d,footnoteCounts:p,footnoteOrder:[],handlers:f,one:c,options:s,patch:Cw,wrap:Ew};return Qh(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(Rh.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=Ro(b);return v.children=o.all(m),v}return Ro(m)}return(o.options.unknownHandler||xw)(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=Dg(T.value)),!Array.isArray(T)&&T.type==="element")){const E=T.children[0];E&&E.type==="text"&&(E.value=Dg(E.value))}Array.isArray(T)?u.push(...T):u.push(T)}}}return u}}function Cw(t,r){t.position&&(r.position=cS(t))}function ww(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,Ro(p)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function xw(t,r){const s=r.data||{},l="value"in r&&!(Rh.call(s,"hProperties")||Rh.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 Ew(t,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
71
+ `}]}}const Io=(function(t){if(t==null)return dw;if(typeof t=="function")return Uo(t);if(typeof t=="object")return Array.isArray(t)?uw(t):hw(t);if(typeof t=="string")return fw(t);throw new Error("Expected function, string, or object as test")});function uw(t){const r=[];let s=-1;for(;++s<t.length;)r[s]=Io(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 hw(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 fw(t){return Uo(r);function r(s){return s&&s.type===t}}function Uo(t){return r;function r(s,l,d){return!!(pw(s)&&t.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function dw(){return!0}function pw(t){return t!==null&&typeof t=="object"&&"type"in t}const X_=[],mw=!0,Rh=!1,gw="skip";function Q_(t,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const p=Io(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=X_,T,E,b;if((!r||p(c,h,m[m.length-1]||void 0))&&(w=_w(s(c,m)),w[0]===Rh))return w;if("children"in c&&c.children){const v=c;if(v.children&&w[0]!==gw)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]===Rh)return T;E=typeof T[1]=="number"?T[1]:E+f}}return w}}}function _w(t){return Array.isArray(t)?t:typeof t=="number"?[mw,t]:t==null?X_:[t]}function Jh(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),Q_(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 Dh={}.hasOwnProperty,vw={};function yw(t,r){const s=r||vw,l=new Map,d=new Map,p=new Map,f={...tw,...s.handlers},o={all:h,applyData:bw,definitionById:l,footnoteById:d,footnoteCounts:p,footnoteOrder:[],handlers:f,one:c,options:s,patch:Sw,wrap:ww};return Jh(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(Dh.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=Ro(b);return v.children=o.all(m),v}return Ro(m)}return(o.options.unknownHandler||Cw)(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=Mg(T.value)),!Array.isArray(T)&&T.type==="element")){const E=T.children[0];E&&E.type==="text"&&(E.value=Mg(E.value))}Array.isArray(T)?u.push(...T):u.push(T)}}}return u}}function Sw(t,r){t.position&&(r.position=lS(t))}function bw(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,Ro(p)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function Cw(t,r){const s=r.data||{},l="value"in r&&!(Dh.call(s,"hProperties")||Dh.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 ww(t,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
72
72
  `});++l<t.length;)l&&s.push({type:"text",value:`
73
73
  `}),s.push(t[l]);return r&&t.length>0&&s.push({type:"text",value:`
74
- `}),s}function Dg(t){let r=0,s=t.charCodeAt(r);for(;s===9||s===32;)r++,s=t.charCodeAt(r);return t.slice(r)}function Mg(t,r){const s=bw(t,r),l=s.one(t,void 0),d=hw(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 kw(t,r){return t&&"run"in t?async function(s,l){const d=Mg(s,{file:l,...r});await t.run(d,l)}:function(s,l){return Mg(s,{file:l,...t||r})}}function Lg(t){if(t)throw t}var rh,Og;function Aw(){if(Og)return rh;Og=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 rh=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},rh}var Tw=Aw();const sh=s_(Tw);function Dh(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 Rw(){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?Dw(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 Dw(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 oi={basename:Mw,dirname:Lw,extname:Ow,join:Bw,sep:"/"};function Mw(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');sl(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 Lw(t){if(sl(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 Ow(t){sl(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 Bw(...t){let r=-1,s;for(;++r<t.length;)sl(t[r]),t[r]&&(s=s===void 0?t[r]:s+"/"+t[r]);return s===void 0?".":jw(s)}function jw(t){sl(t);const r=t.codePointAt(0)===47;let s=Nw(t,!r);return s.length===0&&!r&&(s="."),s.length>0&&t.codePointAt(t.length-1)===47&&(s+="/"),r?"/"+s:s}function Nw(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 sl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Hw={cwd:zw};function zw(){return"/"}function Mh(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Iw(t){if(typeof t=="string")t=new URL(t);else if(!Mh(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 Uw(t)}function Uw(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 ah=["history","path","basename","stem","extname","dirname"];class Q_{constructor(r){let s;r?Mh(r)?s={path:r}:typeof r=="string"||Pw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Hw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<ah.length;){const p=ah[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)ah.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?oi.basename(this.path):void 0}set basename(r){oh(r,"basename"),lh(r,"basename"),this.path=oi.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?oi.dirname(this.path):void 0}set dirname(r){Bg(this.basename,"dirname"),this.path=oi.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?oi.extname(this.path):void 0}set extname(r){if(lh(r,"extname"),Bg(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=oi.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Mh(r)&&(r=Iw(r)),oh(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?oi.basename(this.path,this.extname):void 0}set stem(r){oh(r,"stem"),lh(r,"stem"),this.path=oi.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 Jt(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 lh(t,r){if(t&&t.includes(oi.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+oi.sep+"`")}function oh(t,r){if(!t)throw new Error("`"+r+"` cannot be empty")}function Bg(t,r){if(!t)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Pw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Fw=(function(t){const l=this.constructor.prototype,d=l[t],p=function(){return d.apply(p,arguments)};return Object.setPrototypeOf(p,l),p}),qw={}.hasOwnProperty;class Jh extends Fw{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=Rw()}copy(){const r=new Jh;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(sh(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(hh("data",this.frozen),this.namespace[r]=s,this):qw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(hh("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=yo(r),l=this.parser||this.Parser;return ch("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),ch("process",this.parser||this.Parser),uh("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(p,f){const o=yo(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);Vw(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(),ch("processSync",this.parser||this.Parser),uh("processSync",this.compiler||this.Compiler),this.process(r,d),Ng("processSync","process",s),l;function d(p,f){s=!0,Lg(p),l=f}}run(r,s,l){jg(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=yo(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),Ng("runSync","run",l),d;function p(f,o){Lg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=yo(s),d=this.compiler||this.Compiler;return uh("stringify",d),jg(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(hh("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=sh(!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];Dh(E)&&Dh(w)&&(w=sh(!0,E,w)),l[y]=[h,w,...T]}}}}const $w=new Jh().freeze();function ch(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function uh(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function hh(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 jg(t){if(!Dh(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Ng(t,r,s){if(!s)throw new Error("`"+t+"` finished async. Use `"+r+"` instead")}function yo(t){return Gw(t)?t:new Q_(t)}function Gw(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Vw(t){return typeof t=="string"||Ww(t)}function Ww(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Kw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Hg=[],zg={allowDangerousHtml:!0},Yw=/^(https?|ircs?|mailto|xmpp)$/i,Xw=[{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 J_(t){const r=Qw(t),s=Jw(t);return Zw(r.runSync(r.parse(s),s),t)}function Qw(t){const r=t.rehypePlugins||Hg,s=t.remarkPlugins||Hg,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...zg}:zg;return $w().use(MC).use(s).use(kw,l).use(r)}function Jw(t){const r=t.children||"",s=new Q_;return typeof r=="string"&&(s.value=r),s}function Zw(t,r){const s=r.allowedElements,l=r.allowElement,d=r.components,p=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||ex;for(const m of Xw)Object.hasOwn(r,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Kw+m.id,void 0);return Qh(t,h),pS(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 th)if(Object.hasOwn(th,w)&&Object.hasOwn(m.properties,w)){const T=m.properties[w],E=th[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 ex(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||Yw.test(t.slice(0,r))?t:""}function Ig(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 tx(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function nx(t,r,s){const d=Io((s||{}).ignore||[]),p=ix(r);let f=-1;for(;++f<p.length;)X_(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 ix(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([rx(d[0]),sx(d[1])])}return r}function rx(t){return typeof t=="string"?new RegExp(tx(t),"g"):t}function sx(t){return typeof t=="function"?t:function(){return t}}const fh="phrasing",dh=["autolink","link","image","label"];function ax(){return{transforms:[dx],enter:{literalAutolink:ox,literalAutolinkEmail:ph,literalAutolinkHttp:ph,literalAutolinkWww:ph},exit:{literalAutolink:fx,literalAutolinkEmail:hx,literalAutolinkHttp:cx,literalAutolinkWww:ux}}}function lx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fh,notInConstruct:dh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fh,notInConstruct:dh},{character:":",before:"[ps]",after:"\\/",inConstruct:fh,notInConstruct:dh}]}}function ox(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function ph(t){this.config.enter.autolinkProtocol.call(this,t)}function cx(t){this.config.exit.autolinkProtocol.call(this,t)}function ux(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 hx(t){this.config.exit.autolinkEmail.call(this,t)}function fx(t){this.exit(t)}function dx(t){nx(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,px],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),mx]],{ignore:["link","linkReference"]})}function px(t,r,s,l,d){let p="";if(!Z_(d)||(/^w/i.test(r)&&(s=r+s,r="",p="http://"),!gx(s)))return!1;const f=_x(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 mx(t,r,s,l){return!Z_(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function gx(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 _x(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=Ig(t,"(");let p=Ig(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 Z_(t,r){const s=t.input.charCodeAt(t.index-1);return(t.index===0||Qr(s)||No(s))&&(!r||s!==47)}ev.peek=kx;function vx(){this.buffer()}function yx(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Sx(){this.buffer()}function bx(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Cx(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 wx(t){this.exit(t)}function xx(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 Ex(t){this.exit(t)}function kx(){return"["}function ev(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 Ax(){return{enter:{gfmFootnoteCallString:vx,gfmFootnoteCall:yx,gfmFootnoteDefinitionLabelString:Sx,gfmFootnoteDefinition:bx},exit:{gfmFootnoteCallString:Cx,gfmFootnoteCall:wx,gfmFootnoteDefinitionLabelString:xx,gfmFootnoteDefinition:Ex}}}function Tx(t){let r=!1;return t&&t.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:ev},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?tv:Rx))),h(),c}}function Rx(t,r,s){return r===0?t:tv(t,r,s)}function tv(t,r,s){return(s?"":" ")+t}const Dx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];nv.peek=jx;function Mx(){return{canContainEols:["delete"],enter:{strikethrough:Ox},exit:{strikethrough:Bx}}}function Lx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Dx}],handlers:{delete:nv}}}function Ox(t){this.enter({type:"delete",children:[]},t)}function Bx(t){this.exit(t)}function nv(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 jx(){return"~"}function Nx(t){return t.length}function Hx(t,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||Nx,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 _=zx(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]=Ug(l[u]);else{const E=Ug(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 zx(t){return t==null?"":String(t)}function Ug(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 Ix(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()),Ux);return d(),f}function Ux(t,r,s){return">"+(s?"":" ")+t}function Px(t,r){return Pg(t,r.inConstruct,!0)&&!Pg(t,r.notInConstruct,!1)}function Pg(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 Fg(t,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
78
- `&&Px(s.stack,s.unsafe[d]))return/[ \t]/.test(l.before)?"":" ";return`\\
79
- `}function Fx(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 qx(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 $x(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 Gx(t,r,s,l){const d=$x(s),p=t.value||"",f=d==="`"?"GraveAccent":"Tilde";if(qx(t,s)){const u=s.enter("codeIndented"),y=s.indentLines(p,Vx);return u(),y}const o=s.createTracker(l),c=d.repeat(Math.max(Fx(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:`
74
+ `}),s}function Mg(t){let r=0,s=t.charCodeAt(r);for(;s===9||s===32;)r++,s=t.charCodeAt(r);return t.slice(r)}function Lg(t,r){const s=yw(t,r),l=s.one(t,void 0),d=cw(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 xw(t,r){return t&&"run"in t?async function(s,l){const d=Lg(s,{file:l,...r});await t.run(d,l)}:function(s,l){return Lg(s,{file:l,...t||r})}}function Og(t){if(t)throw t}var sh,Bg;function Ew(){if(Bg)return sh;Bg=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 sh=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},sh}var kw=Ew();const ah=a_(kw);function Mh(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 Aw(){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?Tw(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 Tw(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 ci={basename:Rw,dirname:Dw,extname:Mw,join:Lw,sep:"/"};function Rw(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');ol(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 Dw(t){if(ol(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 Mw(t){ol(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 Lw(...t){let r=-1,s;for(;++r<t.length;)ol(t[r]),t[r]&&(s=s===void 0?t[r]:s+"/"+t[r]);return s===void 0?".":Ow(s)}function Ow(t){ol(t);const r=t.codePointAt(0)===47;let s=Bw(t,!r);return s.length===0&&!r&&(s="."),s.length>0&&t.codePointAt(t.length-1)===47&&(s+="/"),r?"/"+s:s}function Bw(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 ol(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const jw={cwd:Nw};function Nw(){return"/"}function Lh(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Hw(t){if(typeof t=="string")t=new URL(t);else if(!Lh(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 zw(t)}function zw(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 lh=["history","path","basename","stem","extname","dirname"];class J_{constructor(r){let s;r?Lh(r)?s={path:r}:typeof r=="string"||Iw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":jw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<lh.length;){const p=lh[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)lh.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?ci.basename(this.path):void 0}set basename(r){ch(r,"basename"),oh(r,"basename"),this.path=ci.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?ci.dirname(this.path):void 0}set dirname(r){jg(this.basename,"dirname"),this.path=ci.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?ci.extname(this.path):void 0}set extname(r){if(oh(r,"extname"),jg(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=ci.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Lh(r)&&(r=Hw(r)),ch(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?ci.basename(this.path,this.extname):void 0}set stem(r){ch(r,"stem"),oh(r,"stem"),this.path=ci.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 Qt(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 oh(t,r){if(t&&t.includes(ci.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+ci.sep+"`")}function ch(t,r){if(!t)throw new Error("`"+r+"` cannot be empty")}function jg(t,r){if(!t)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Iw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Uw=(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 Zh extends Uw{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=Aw()}copy(){const r=new Zh;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(ah(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(fh("data",this.frozen),this.namespace[r]=s,this):Pw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(fh("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=So(r),l=this.parser||this.Parser;return uh("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),uh("process",this.parser||this.Parser),hh("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(p,f){const o=So(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);$w(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(),uh("processSync",this.parser||this.Parser),hh("processSync",this.compiler||this.Compiler),this.process(r,d),Hg("processSync","process",s),l;function d(p,f){s=!0,Og(p),l=f}}run(r,s,l){Ng(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=So(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),Hg("runSync","run",l),d;function p(f,o){Og(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=So(s),d=this.compiler||this.Compiler;return hh("stringify",d),Ng(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(fh("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=ah(!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];Mh(E)&&Mh(w)&&(w=ah(!0,E,w)),l[y]=[h,w,...T]}}}}const Fw=new Zh().freeze();function uh(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function hh(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function fh(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 Ng(t){if(!Mh(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Hg(t,r,s){if(!s)throw new Error("`"+t+"` finished async. Use `"+r+"` instead")}function So(t){return qw(t)?t:new J_(t)}function qw(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function $w(t){return typeof t=="string"||Gw(t)}function Gw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Vw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",zg=[],Ig={allowDangerousHtml:!0},Ww=/^(https?|ircs?|mailto|xmpp)$/i,Kw=[{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 Z_(t){const r=Yw(t),s=Xw(t);return Qw(r.runSync(r.parse(s),s),t)}function Yw(t){const r=t.rehypePlugins||zg,s=t.remarkPlugins||zg,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Ig}:Ig;return Fw().use(RC).use(s).use(xw,l).use(r)}function Xw(t){const r=t.children||"",s=new J_;return typeof r=="string"&&(s.value=r),s}function Qw(t,r){const s=r.allowedElements,l=r.allowElement,d=r.components,p=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||Jw;for(const m of Kw)Object.hasOwn(r,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+Vw+m.id,void 0);return Jh(t,h),fS(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 nh)if(Object.hasOwn(nh,w)&&Object.hasOwn(m.properties,w)){const T=m.properties[w],E=nh[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 Jw(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||Ww.test(t.slice(0,r))?t:""}function Ug(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 Zw(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ex(t,r,s){const d=Io((s||{}).ignore||[]),p=tx(r);let f=-1;for(;++f<p.length;)Q_(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 tx(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([nx(d[0]),ix(d[1])])}return r}function nx(t){return typeof t=="string"?new RegExp(Zw(t),"g"):t}function ix(t){return typeof t=="function"?t:function(){return t}}const dh="phrasing",ph=["autolink","link","image","label"];function rx(){return{transforms:[hx],enter:{literalAutolink:ax,literalAutolinkEmail:mh,literalAutolinkHttp:mh,literalAutolinkWww:mh},exit:{literalAutolink:ux,literalAutolinkEmail:cx,literalAutolinkHttp:lx,literalAutolinkWww:ox}}}function sx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:dh,notInConstruct:ph},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:dh,notInConstruct:ph},{character:":",before:"[ps]",after:"\\/",inConstruct:dh,notInConstruct:ph}]}}function ax(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function mh(t){this.config.enter.autolinkProtocol.call(this,t)}function lx(t){this.config.exit.autolinkProtocol.call(this,t)}function ox(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 cx(t){this.config.exit.autolinkEmail.call(this,t)}function ux(t){this.exit(t)}function hx(t){ex(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),dx]],{ignore:["link","linkReference"]})}function fx(t,r,s,l,d){let p="";if(!ev(d)||(/^w/i.test(r)&&(s=r+s,r="",p="http://"),!px(s)))return!1;const f=mx(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 dx(t,r,s,l){return!ev(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function px(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 mx(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=Ug(t,"(");let p=Ug(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 ev(t,r){const s=t.input.charCodeAt(t.index-1);return(t.index===0||Xr(s)||No(s))&&(!r||s!==47)}tv.peek=xx;function gx(){this.buffer()}function _x(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function vx(){this.buffer()}function yx(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Sx(t){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Yn(this.sliceSerialize(t)).toLowerCase(),s.label=r}function bx(t){this.exit(t)}function Cx(t){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=Yn(this.sliceSerialize(t)).toLowerCase(),s.label=r}function wx(t){this.exit(t)}function xx(){return"["}function tv(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 Ex(){return{enter:{gfmFootnoteCallString:gx,gfmFootnoteCall:_x,gfmFootnoteDefinitionLabelString:vx,gfmFootnoteDefinition:yx},exit:{gfmFootnoteCallString:Sx,gfmFootnoteCall:bx,gfmFootnoteDefinitionLabelString:Cx,gfmFootnoteDefinition:wx}}}function kx(t){let r=!1;return t&&t.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:tv},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?nv:Ax))),h(),c}}function Ax(t,r,s){return r===0?t:nv(t,r,s)}function nv(t,r,s){return(s?"":" ")+t}const Tx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];iv.peek=Ox;function Rx(){return{canContainEols:["delete"],enter:{strikethrough:Mx},exit:{strikethrough:Lx}}}function Dx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Tx}],handlers:{delete:iv}}}function Mx(t){this.enter({type:"delete",children:[]},t)}function Lx(t){this.exit(t)}function iv(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 Ox(){return"~"}function Bx(t){return t.length}function jx(t,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||Bx,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 _=Nx(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]=Pg(l[u]);else{const E=Pg(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 Nx(t){return t==null?"":String(t)}function Pg(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 Hx(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()),zx);return d(),f}function zx(t,r,s){return">"+(s?"":" ")+t}function Ix(t,r){return Fg(t,r.inConstruct,!0)&&!Fg(t,r.notInConstruct,!1)}function Fg(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 qg(t,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
78
+ `&&Ix(s.stack,s.unsafe[d]))return/[ \t]/.test(l.before)?"":" ";return`\\
79
+ `}function Ux(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 Fx(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 qx(t,r,s,l){const d=Fx(s),p=t.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Px(t,s)){const u=s.enter("codeIndented"),y=s.indentLines(p,$x);return u(),y}const o=s.createTracker(l),c=d.repeat(Math.max(Ux(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
80
  `,encode:["`"],...o.current()})),u()}return m+=o.move(`
81
81
  `),p&&(m+=o.move(p+`
82
- `)),m+=o.move(c),h(),m}function Vx(t,r,s){return(s?"":" ")+t}function Zh(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 Wx(t,r,s,l){const d=Zh(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 Kx(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 tl(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Do(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}}iv.peek=Yx;function iv(t,r,s,l){const d=Kx(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=Do(l.before.charCodeAt(l.before.length-1),h,d);m.inside&&(c=tl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=Do(l.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+tl(u));const w=f.move(d);return p(),s.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},o+c+w}function Yx(t,r,s){return s.options.emphasis||"*"}function Xx(t,r){let s=!1;return Qh(t,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,Th}),!!((!t.depth||t.depth<3)&&$h(t)&&(r.options.setext||s))}function Qx(t,r,s,l){const d=Math.max(Math.min(6,t.depth||1),1),p=s.createTracker(l);if(Xx(t,s)){const m=s.enter("headingSetext"),u=s.enter("phrasing"),y=s.containerPhrasing(t,{...p.current(),before:`
82
+ `)),m+=o.move(c),h(),m}function $x(t,r,s){return(s?"":" ")+t}function ef(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 Gx(t,r,s,l){const d=ef(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 Vx(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 rl(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Do(t,r,s){const l=Ps(t),d=Ps(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}}rv.peek=Wx;function rv(t,r,s,l){const d=Vx(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=Do(l.before.charCodeAt(l.before.length-1),h,d);m.inside&&(c=rl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=Do(l.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+rl(u));const w=f.move(d);return p(),s.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},o+c+w}function Wx(t,r,s){return s.options.emphasis||"*"}function Kx(t,r){let s=!1;return Jh(t,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,Rh}),!!((!t.depth||t.depth<3)&&Gh(t)&&(r.options.setext||s))}function Yx(t,r,s,l){const d=Math.max(Math.min(6,t.depth||1),1),p=s.createTracker(l);if(Kx(t,s)){const m=s.enter("headingSetext"),u=s.enter("phrasing"),y=s.containerPhrasing(t,{...p.current(),before:`
84
84
  `,after:`
85
85
  `});return u(),m(),y+`
86
86
  `+(d===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
87
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=tl(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),o(),h}rv.peek=Jx;function rv(t){return t.value||""}function Jx(){return"<"}sv.peek=Zx;function sv(t,r,s,l){const d=Zh(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 Zx(){return"!"}av.peek=eE;function av(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 eE(){return"!"}lv.peek=tE;function lv(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 tE(){return"`"}function ov(t,r){const s=$h(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))}cv.peek=nE;function cv(t,r,s,l){const d=Zh(s),p=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(ov(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 nE(t,r,s){return ov(t,s)?"<":"["}uv.peek=iE;function uv(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 iE(){return"["}function ef(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 rE(t){const r=ef(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 sE(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 hv(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 aE(t,r,s,l){const d=s.enter("list"),p=s.bulletCurrent;let f=t.ordered?sE(s):ef(s);const o=t.ordered?f==="."?")":".":rE(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),hv(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 lE(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 oE(t,r,s,l){const d=lE(s);let p=s.bulletCurrent||ef(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 cE(t,r,s,l){const d=s.enter("paragraph"),p=s.enter("phrasing"),f=s.containerPhrasing(t,l);return p(),d(),f}const uE=Io(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function hE(t,r,s,l){return(t.children.some(function(f){return uE(f)})?s.containerPhrasing:s.containerFlow).call(s,t,l)}function fE(t){const r=t.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}fv.peek=dE;function fv(t,r,s,l){const d=fE(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=Do(l.before.charCodeAt(l.before.length-1),h,d);m.inside&&(c=tl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=Do(l.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+tl(u));const w=f.move(d+d);return p(),s.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},o+c+w}function dE(t,r,s){return s.options.strong||"*"}function pE(t,r,s,l){return s.safe(t.value,l)}function mE(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 gE(t,r,s){const l=(hv(s)+(s.options.ruleSpaces?" ":"")).repeat(mE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const dv={blockquote:Ix,break:Fg,code:Gx,definition:Wx,emphasis:iv,hardBreak:Fg,heading:Qx,html:rv,image:sv,imageReference:av,inlineCode:lv,link:cv,linkReference:uv,list:aE,listItem:oE,paragraph:cE,root:hE,strong:fv,text:pE,thematicBreak:gE};function _E(){return{enter:{table:vE,tableData:qg,tableHeader:qg,tableRow:SE},exit:{codeText:bE,table:yE,tableData:mh,tableHeader:mh,tableRow:mh}}}function vE(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 yE(t){this.exit(t),this.data.inTable=void 0}function SE(t){this.enter({type:"tableRow",children:[]},t)}function mh(t){this.exit(t)}function qg(t){this.enter({type:"tableCell",children:[]},t)}function bE(t){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,CE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(t)}function CE(t,r){return r==="|"?r:t}function wE(t){const r=t||{},s=r.tableCellPadding,l=r.tablePipeAlign,d=r.stringLength,p=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
88
+ `,...p.current()});return/^[\t ]/.test(h)&&(h=rl(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),o(),h}sv.peek=Xx;function sv(t){return t.value||""}function Xx(){return"<"}av.peek=Qx;function av(t,r,s,l){const d=ef(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 Qx(){return"!"}lv.peek=Jx;function lv(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 Jx(){return"!"}ov.peek=Zx;function ov(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 Zx(){return"`"}function cv(t,r){const s=Gh(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))}uv.peek=eE;function uv(t,r,s,l){const d=ef(s),p=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(cv(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 eE(t,r,s){return cv(t,s)?"<":"["}hv.peek=tE;function hv(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 tE(){return"["}function tf(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 nE(t){const r=tf(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 iE(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 fv(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 rE(t,r,s,l){const d=s.enter("list"),p=s.bulletCurrent;let f=t.ordered?iE(s):tf(s);const o=t.ordered?f==="."?")":".":nE(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),fv(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 sE(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 aE(t,r,s,l){const d=sE(s);let p=s.bulletCurrent||tf(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 lE(t,r,s,l){const d=s.enter("paragraph"),p=s.enter("phrasing"),f=s.containerPhrasing(t,l);return p(),d(),f}const oE=Io(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function cE(t,r,s,l){return(t.children.some(function(f){return oE(f)})?s.containerPhrasing:s.containerFlow).call(s,t,l)}function uE(t){const r=t.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}dv.peek=hE;function dv(t,r,s,l){const d=uE(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=Do(l.before.charCodeAt(l.before.length-1),h,d);m.inside&&(c=rl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=Do(l.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+rl(u));const w=f.move(d+d);return p(),s.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},o+c+w}function hE(t,r,s){return s.options.strong||"*"}function fE(t,r,s,l){return s.safe(t.value,l)}function dE(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 pE(t,r,s){const l=(fv(s)+(s.options.ruleSpaces?" ":"")).repeat(dE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const pv={blockquote:Hx,break:qg,code:qx,definition:Gx,emphasis:rv,hardBreak:qg,heading:Yx,html:sv,image:av,imageReference:lv,inlineCode:ov,link:uv,linkReference:hv,list:rE,listItem:aE,paragraph:lE,root:cE,strong:dv,text:fE,thematicBreak:pE};function mE(){return{enter:{table:gE,tableData:$g,tableHeader:$g,tableRow:vE},exit:{codeText:yE,table:_E,tableData:gh,tableHeader:gh,tableRow:gh}}}function gE(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 _E(t){this.exit(t),this.data.inTable=void 0}function vE(t){this.enter({type:"tableRow",children:[]},t)}function gh(t){this.exit(t)}function $g(t){this.enter({type:"tableCell",children:[]},t)}function yE(t){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,SE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(t)}function SE(t,r){return r==="|"?r:t}function bE(t){const r=t||{},s=r.tableCellPadding,l=r.tablePipeAlign,d=r.stringLength,p=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
89
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 Hx(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=dv.inlineCode(w,T,E);return E.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function xE(){return{exit:{taskListCheckValueChecked:$g,taskListCheckValueUnchecked:$g,paragraph:kE}}}function EE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:AE}}}function $g(t){const r=this.stack[this.stack.length-2];r.type,r.checked=t.type==="taskListCheckValueChecked"}function kE(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 AE(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=dv.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 TE(){return[ax(),Ax(),Mx(),_E(),xE()]}function RE(t){return{extensions:[lx(),Tx(t),Lx(),wE(t),EE()]}}const DE={tokenize:NE,partial:!0},pv={tokenize:HE,partial:!0},mv={tokenize:zE,partial:!0},gv={tokenize:IE,partial:!0},ME={tokenize:UE,partial:!0},_v={name:"wwwAutolink",tokenize:BE,previous:yv},vv={name:"protocolAutolink",tokenize:jE,previous:Sv},Ni={name:"emailAutolink",tokenize:OE,previous:bv},ci={};function LE(){return{text:ci}}let Kr=48;for(;Kr<123;)ci[Kr]=Ni,Kr++,Kr===58?Kr=65:Kr===91&&(Kr=97);ci[43]=Ni;ci[45]=Ni;ci[46]=Ni;ci[95]=Ni;ci[72]=[Ni,vv];ci[104]=[Ni,vv];ci[87]=[Ni,_v];ci[119]=[Ni,_v];function OE(t,r,s){const l=this;let d,p;return f;function f(u){return!Lh(u)||!bv.call(l,l.previous)||tf(l.events)?s(u):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(u))}function o(u){return Lh(u)?(t.consume(u),o):u===64?(t.consume(u),c):s(u)}function c(u){return u===46?t.check(ME,m,h)(u):u===45||u===95||Qt(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&&nn(l.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),r(u)):s(u)}}function BE(t,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!yv.call(l,l.previous)||tf(l.events)?s(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(DE,t.attempt(pv,t.attempt(mv,p),s),s)(f))}function p(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),r(f)}}function jE(t,r,s){const l=this;let d="",p=!1;return f;function f(u){return(u===72||u===104)&&Sv.call(l,l.previous)&&!tf(l.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),t.consume(u),o):s(u)}function o(u){if(nn(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||Ao(u)||ot(u)||Qr(u)||No(u)?s(u):t.attempt(pv,t.attempt(mv,m),s)(u)}function m(u){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),r(u)}}function NE(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 HE(t,r,s){let l,d,p;return f;function f(h){return h===46||h===95?t.check(gv,c,o)(h):h===null||ot(h)||Qr(h)||h!==45&&No(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 zE(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(gv,r,p)(f):f===null||ot(f)||Qr(f)?r(f):(t.consume(f),d)}function p(f){return f===41&&l++,t.consume(f),d}}function IE(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||ot(o)||Qr(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ot(o)||Qr(o)?r(o):l(o)}function p(o){return nn(o)?f(o):s(o)}function f(o){return o===59?(t.consume(o),l):nn(o)?(t.consume(o),f):s(o)}}function UE(t,r,s){return l;function l(p){return t.consume(p),d}function d(p){return Qt(p)?s(p):r(p)}}function yv(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ot(t)}function Sv(t){return!nn(t)}function bv(t){return!(t===47||Lh(t))}function Lh(t){return t===43||t===45||t===46||t===95||Qt(t)}function tf(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 PE={tokenize:YE,partial:!0};function FE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:VE,continuation:{tokenize:WE},exit:KE}},text:{91:{name:"gfmFootnoteCall",tokenize:GE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:qE,resolveTo:$E}}}}function qE(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 $E(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 GE(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||ot(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 ot(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 VE(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||ot(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 ot(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),Xe(t,w,"gfmFootnoteDefinitionWhitespace")):s(T)}function w(T){return r(T)}}function WE(t,r,s){return t.check(rl,r,t.attempt(PE,r,s))}function KE(t){t.exit("gfmFootnoteDefinition")}function YE(t,r,s){const l=this;return Xe(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 XE(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&&Tn(y,y.length,0,Ho(w,f.slice(h+1,c),o)),Tn(y,y.length,0,[["exit",u,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",m,o]]),Tn(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 QE{constructor(){this.map=[]}add(r,s,l){JE(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 JE(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 ZE(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 e2(){return{flow:{null:{name:"table",tokenize:t2,resolveAll:n2}}}}function t2(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 W=l.events[H][1].type;if(W==="lineEnding"||W==="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):Ve(B)?Xe(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||ot(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,Ve(B)?Xe(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 Ve(B)?Xe(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 Ve(B)?Xe(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)):Ve(B)?Xe(t,D,"whitespace")(B):(t.enter("data"),k(B))}function k(B){return B===null||B===124||ot(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 n2(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 QE;for(;++s<t.length;){const w=t[s],T=w[1];w[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(Gg(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=So(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=So(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=So(y,r,p,d,s,u)):f[1]!==0&&(u=So(y,r,f,d,s,u)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Gg(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=ZE(r.events,s))}return t}function So(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 Gg(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 i2={name:"tasklistCheck",tokenize:s2};function r2(){return{text:{91:i2}}}function s2(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 ot(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):Ve(c)?t.check({tokenize:a2},r,s)(c):s(c)}}function a2(t,r,s){return Xe(t,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function l2(t){return M_([LE(),FE(),XE(t),e2(),r2()])}const o2={};function Cv(t){const r=this,s=t||o2,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),p=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(l2(s)),p.push(TE()),f.push(RE(s))}const wv=1e3,Hs=new Map;let Qa;function c2(t,r,s){const l=Symbol(t),d=Math.max(wv,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}),u2(),xv(),()=>{const f=Hs.get(t);(f==null?void 0:f.token)===l&&(Hs.delete(t),Hs.size===0&&Qa!==void 0&&(window.clearInterval(Qa),Qa=void 0))}}function u2(){Qa!==void 0||typeof window>"u"||(Qa=window.setInterval(()=>{xv()},wv))}async function xv(){const t=Date.now();for(const r of Hs.values())r.inFlight||r.nextRunAt>t||h2(r)}async function h2(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 nl(t,r,s){const l=ee.useRef(r);ee.useEffect(()=>{l.current=r},[r]),ee.useEffect(()=>{if(!(!t||s.enabled===!1))return c2(t,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[t,s.enabled,s.intervalMs,s.runImmediately])}const Mo=`
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 jx(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=pv.inlineCode(w,T,E);return E.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function CE(){return{exit:{taskListCheckValueChecked:Gg,taskListCheckValueUnchecked:Gg,paragraph:xE}}}function wE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:EE}}}function Gg(t){const r=this.stack[this.stack.length-2];r.type,r.checked=t.type==="taskListCheckValueChecked"}function xE(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 EE(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=pv.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 kE(){return[rx(),Ex(),Rx(),mE(),CE()]}function AE(t){return{extensions:[sx(),kx(t),Dx(),bE(t),wE()]}}const TE={tokenize:BE,partial:!0},mv={tokenize:jE,partial:!0},gv={tokenize:NE,partial:!0},_v={tokenize:HE,partial:!0},RE={tokenize:zE,partial:!0},vv={name:"wwwAutolink",tokenize:LE,previous:Sv},yv={name:"protocolAutolink",tokenize:OE,previous:bv},Hi={name:"emailAutolink",tokenize:ME,previous:Cv},ui={};function DE(){return{text:ui}}let Wr=48;for(;Wr<123;)ui[Wr]=Hi,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);ui[43]=Hi;ui[45]=Hi;ui[46]=Hi;ui[95]=Hi;ui[72]=[Hi,yv];ui[104]=[Hi,yv];ui[87]=[Hi,vv];ui[119]=[Hi,vv];function ME(t,r,s){const l=this;let d,p;return f;function f(u){return!Oh(u)||!Cv.call(l,l.previous)||nf(l.events)?s(u):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(u))}function o(u){return Oh(u)?(t.consume(u),o):u===64?(t.consume(u),c):s(u)}function c(u){return u===46?t.check(RE,m,h)(u):u===45||u===95||Xt(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&&nn(l.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),r(u)):s(u)}}function LE(t,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!Sv.call(l,l.previous)||nf(l.events)?s(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(TE,t.attempt(mv,t.attempt(gv,p),s),s)(f))}function p(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),r(f)}}function OE(t,r,s){const l=this;let d="",p=!1;return f;function f(u){return(u===72||u===104)&&bv.call(l,l.previous)&&!nf(l.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),t.consume(u),o):s(u)}function o(u){if(nn(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||Ao(u)||ot(u)||Xr(u)||No(u)?s(u):t.attempt(mv,t.attempt(gv,m),s)(u)}function m(u){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),r(u)}}function BE(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 jE(t,r,s){let l,d,p;return f;function f(h){return h===46||h===95?t.check(_v,c,o)(h):h===null||ot(h)||Xr(h)||h!==45&&No(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 NE(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(_v,r,p)(f):f===null||ot(f)||Xr(f)?r(f):(t.consume(f),d)}function p(f){return f===41&&l++,t.consume(f),d}}function HE(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||ot(o)||Xr(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ot(o)||Xr(o)?r(o):l(o)}function p(o){return nn(o)?f(o):s(o)}function f(o){return o===59?(t.consume(o),l):nn(o)?(t.consume(o),f):s(o)}}function zE(t,r,s){return l;function l(p){return t.consume(p),d}function d(p){return Xt(p)?s(p):r(p)}}function Sv(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ot(t)}function bv(t){return!nn(t)}function Cv(t){return!(t===47||Oh(t))}function Oh(t){return t===43||t===45||t===46||t===95||Xt(t)}function nf(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 IE={tokenize:WE,partial:!0};function UE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:$E,continuation:{tokenize:GE},exit:VE}},text:{91:{name:"gfmFootnoteCall",tokenize:qE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:PE,resolveTo:FE}}}}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=Yn(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 FE(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 qE(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||ot(u))return s(u);if(u===93){t.exit("chunkString");const y=t.exit("gfmFootnoteCallString");return d.includes(Yn(l.sliceSerialize(y)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),r):s(u)}return ot(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 $E(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||ot(T))return s(T);if(T===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return p=Yn(l.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),y}return ot(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),Xe(t,w,"gfmFootnoteDefinitionWhitespace")):s(T)}function w(T){return r(T)}}function GE(t,r,s){return t.check(ll,r,t.attempt(IE,r,s))}function VE(t){t.exit("gfmFootnoteDefinition")}function WE(t,r,s){const l=this;return Xe(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 KE(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,Ho(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=Ps(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=Ps(T);return b._open=!v||v===2&&!!E,b._close=!E||E===2&&!!v,o(T)}}}class YE{constructor(){this.map=[]}add(r,s,l){XE(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 XE(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 QE(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 JE(){return{flow:{null:{name:"table",tokenize:ZE,resolveAll:e2}}}}function ZE(t,r,s){const l=this;let d=0,p=0,f;return o;function o(O){let H=l.events.length-1;for(;H>-1;){const W=l.events[H][1].type;if(W==="lineEnding"||W==="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(O):P(O)}function c(O){return t.enter("tableHead"),t.enter("tableRow"),h(O)}function h(O){return O===124||(f=!0,p+=1),m(O)}function m(O){return O===null?s(O):Le(O)?p>1?(p=0,l.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),w):s(O):Ve(O)?Xe(t,m,"whitespace")(O):(p+=1,f&&(f=!1,d+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),f=!0,m):(t.enter("data"),u(O)))}function u(O){return O===null||O===124||ot(O)?(t.exit("data"),m(O)):(t.consume(O),O===92?y:u)}function y(O){return O===92||O===124?(t.consume(O),u):u(O)}function w(O){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(O):(t.enter("tableDelimiterRow"),f=!1,Ve(O)?Xe(t,T,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):T(O))}function T(O){return O===45||O===58?b(O):O===124?(f=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),E):L(O)}function E(O){return Ve(O)?Xe(t,b,"whitespace")(O):b(O)}function b(O){return O===58?(p+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),v):O===45?(p+=1,v(O)):O===null||Le(O)?A(O):L(O)}function v(O){return O===45?(t.enter("tableDelimiterFiller"),_(O)):L(O)}function _(O){return O===45?(t.consume(O),_):O===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),S):(t.exit("tableDelimiterFiller"),S(O))}function S(O){return Ve(O)?Xe(t,A,"whitespace")(O):A(O)}function A(O){return O===124?T(O):O===null||Le(O)?!f||d!==p?L(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),r(O)):L(O)}function L(O){return s(O)}function M(O){return t.enter("tableRow"),D(O)}function D(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),D):O===null||Le(O)?(t.exit("tableRow"),r(O)):Ve(O)?Xe(t,D,"whitespace")(O):(t.enter("data"),k(O))}function k(O){return O===null||O===124||ot(O)?(t.exit("data"),D(O)):(t.consume(O),O===92?R:k)}function R(O){return O===92||O===124?(t.consume(O),k):k(O)}}function e2(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 YE;for(;++s<t.length;){const w=t[s],T=w[1];w[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(Vg(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=bo(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=bo(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=bo(y,r,p,d,s,u)):f[1]!==0&&(u=bo(y,r,f,d,s,u)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Vg(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=QE(r.events,s))}return t}function bo(t,r,s,l,d,p){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(p.end=Object.assign({},zs(r.events,s[0])),t.add(s[0],0,[["exit",p,r]]));const c=zs(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=zs(r.events,s[2]),m=zs(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({},zs(r.events,d)),t.add(d,0,[["exit",p,r]]),p=void 0),p}function Vg(t,r,s,l,d){const p=[],f=zs(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 zs(t,r){const s=t[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const t2={name:"tasklistCheck",tokenize:i2};function n2(){return{text:{91:t2}}}function i2(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 ot(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 Le(c)?r(c):Ve(c)?t.check({tokenize:r2},r,s)(c):s(c)}}function r2(t,r,s){return Xe(t,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function s2(t){return L_([DE(),UE(),KE(t),JE(),n2()])}const a2={};function wv(t){const r=this,s=t||a2,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),p=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(s2(s)),p.push(kE()),f.push(AE(s))}const xv=1e3,Is=new Map;let Za;function l2(t,r,s){const l=Symbol(t),d=Math.max(xv,s.intervalMs),p=Date.now();return Is.set(t,{id:t,intervalMs:d,nextRunAt:s.runImmediately===!1?p+d:p,inFlight:!1,run:r,token:l}),o2(),Ev(),()=>{const f=Is.get(t);(f==null?void 0:f.token)===l&&(Is.delete(t),Is.size===0&&Za!==void 0&&(window.clearInterval(Za),Za=void 0))}}function o2(){Za!==void 0||typeof window>"u"||(Za=window.setInterval(()=>{Ev()},xv))}async function Ev(){const t=Date.now();for(const r of Is.values())r.inFlight||r.nextRunAt>t||c2(r)}async function c2(t){t.inFlight=!0;try{await t.run()}catch{}finally{const r=Is.get(t.id);(r==null?void 0:r.token)===t.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function sl(t,r,s){const l=ee.useRef(r);ee.useEffect(()=>{l.current=r},[r]),ee.useEffect(()=>{if(!(!t||s.enabled===!1))return l2(t,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[t,s.enabled,s.intervalMs,s.runImmediately])}const Mo=`
91
91
 
92
92
  --- Translation ---
93
- `;function f2({active:t=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:p,panelState:f,onClearSession:o,onEntry:c,onFailures:h}){const[m,u]=ee.useState(""),[y,w]=ee.useState(""),[T,E]=ee.useState(!1),[b,v]=ee.useState(Date.now()),[_,S]=ee.useState(!1),[,A]=ji(""),L=ee.useRef(null),M=f.entries,D=f.failures,k=f.status;ee.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=S2(M);ee.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 Se.translateUserInput(l,d,{text:$,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});I.sent?(u(""),E(!1)):(u(kv($,I.englishPreview)),E(!0))}catch(I){A(lt("Translate composer input",I))}finally{S(!1)}}async function H(){const N=y.trim();if(N){S(!0),A("");try{const $=await Se.translateManualOutput(l,d,{text:N});c(p,d,$),w("")}catch($){A(lt("Translate pasted English output",$))}finally{S(!1)}}}async function U(){S(!0),A("");try{const N=await Se.translateLatestReply(l,d);c(p,d,N)}catch(N){A(lt("Translate final reply",N))}finally{S(!1)}}async function P(){const N=T?Wg(m):m;if(N.trim()){S(!0),A("");try{await Se.sendTranslatedInput(l,d,{englishText:N}),u(""),E(!1)}catch($){A(lt("Send translated English input to role",$))}finally{S(!1)}}}function W(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!_&&m.trim()&&(T?P():B(r)))}async function K(){o(p,d),await Se.clearTranslationSession(p).catch(N=>A(lt("Clear conversation translation panel",N)))}async function G(){S(!0),A("");try{const N=await Se.ignoreTranslationFailures(p);h(p,d,N.failures)}catch(N){A(lt("Ignore failed conversation translations",N))}finally{S(!1)}}async function Y(N){S(!0),A("");try{const $=await Se.retryTranslation(p,N.translationId);c(p,d,$)}catch($){A(lt("Retry latest failed conversation translation",$))}finally{S(!1)}}const Z=b2(M,k,b),z=D.length,j=p2(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 ",d2(s)," · ",Z]})})]}),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(v2,{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&&!x2(N.target.value))&&E(!1)},onKeyDown:W,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!T||!Wg(m).trim(),onClick:()=>void P(),children:"Send English"})})]})})]})}function d2(t){var r;return((r=u_.find(s=>s.value===t))==null?void 0:r.label)??t}function p2(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 m2({open:t,taskSlug:r,targetLanguage:s,onClose:l}){const[d,p]=ee.useState(!1),[,f]=ji(""),[o,c]=ee.useState(null),[h,m]=ee.useState(""),[u,y]=ee.useState(""),[w,T]=ee.useState(""),[E,b]=ee.useState(!1),[v,_]=ee.useState(null),[S,A]=ee.useState(""),[L,M]=ee.useState(""),[D,k]=ee.useState(""),[R,B]=ee.useState(!1);nl(t?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(G=!1){try{const Y=await Se.getTranslationState();c(Y);const Z=h?Y.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!Z)&&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 Se.readFileTranslation(h);y(z.output),T(z.report)}}catch(Y){f(lt("Load file translation list",Y))}}async function U(G){m(G),y(""),T("");try{const Y=await Se.readFileTranslation(G);y(Y.output),T(Y.report)}catch(Y){f(lt(`Read translated file ${G}`,Y))}}async function P(){b(!0),await W(S,L)}async function W(G="",Y=""){B(!0),f("");try{const Z=await Se.browseTranslationSourceFiles({path:G,query:Y,limit:250});_(Z),A(Z.currentPath),M(Y)}catch(Z){f(lt("Browse translation source files",Z))}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 Z=await Se.createFileTranslation({taskSlug:r,sourcePath:Y,targetLanguage:s});b(!1),await H(),await U(Z.id)}catch(Z){f(lt(`Create file translation for ${Y}`,Z))}finally{p(!1)}}}return t?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(_2,{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(g2,{busy:d||R,state:v,currentPath:S,query:L,selectedPath:D,onBrowse:(G,Y)=>void W(G,Y),onClose:()=>b(!1),onQueryChange:M,onSelectPath:k,onTranslate:()=>void K()}):null]}):null}function g2({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(Vg,{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(Vg,{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 Vg({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 _2({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(J_,{remarkPlugins:[Cv],children:l||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function v2({entry:t}){if(t.sourceKind==="conversation-boundary")return x.jsx(y2,{entry:t});const r=w2(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(J_,{remarkPlugins:[Cv],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 y2({entry:t}){const r=t.boundaryKind==="end"?"结束":"开始",s=t.conversationTurn??0,l=k2(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 S2(t){const r=t.find(Ev);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function b2(t,r,s){const l=t.find(Ev);if(l)return`translating ${E2(Math.max(0,s-C2(l)))}`;const d=t.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function Ev(t){return t.status==="queued"||t.status==="translating"}function C2(t){const r=Date.parse(t.translationStartedAt??t.createdAt);return Number.isFinite(r)?r:Date.now()}function w2(t){return t.status==="queued"||t.status==="translating"?t.sourceText:t.status==="translated"?t.direction==="user-input-to-english"?kv(t.sourceText,t.translatedText):t.translatedText:t.translatedText||t.sourceText}function kv(t,r){return`${t.trimEnd()}${Mo}${r.trimStart()}`}function x2(t){return t.includes(Mo)}function Wg(t){const r=t.indexOf(Mo);return r===-1?t:t.slice(r+Mo.length)}function E2(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 k2(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleTimeString()}const A2=8;function T2(){const[t,r]=ee.useState([]);return ee.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,A2)})},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(_h,s),window.addEventListener(vh,l),window.addEventListener(yh,d),()=>{window.removeEventListener(_h,s),window.removeEventListener(vh,l),window.removeEventListener(yh,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:[R2(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 R2(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function D2(t,r){return t.find(s=>s.taskSlug===r)??t[0]??null}function M2(t){if(!(t.mode!=="auto"||t.status!=="running")&&!(!t.activeRole||t.activeRole===t.lastFollowedRole))return t.activeRole}function L2(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 O2(t){const r=t.flowPause;if((r==null?void 0:r.reason)==="awaiting-user")return`awaiting-user:${r.since??t.taskSlug}`;const s=t.roundId??t.startedAt??t.taskSlug,l=t.stoppedAt??t.lastTurnEndedAt??"stopped";return`${s}:${l}`}const B2=3,j2=3e4,xo=new Map;function Av(t,r){const s=lt(t,r);if(!N2(r))return xo.set(t,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=xo.get(t),d=((l==null?void 0:l.consecutiveFailures)??0)+1,p=Date.now(),f=d>=B2&&(!l||l.lastMessage!==s||p-l.lastReportedAt>=j2);return xo.set(t,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?p:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Lo(t){xo.delete(t),p1([t])}function N2(t){const r=Bo(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 H2=["architecture-plan","validation-adequacy","code-diff"];function z2({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 I2({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,_]=ee.useState(!1),[S,A]=ee.useState("bypassPermissions"),[L,M]=ee.useState("default"),[D,k]=ee.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(W=>x.jsxs("li",{children:[x.jsx("span",{children:W.path}),x.jsx(Yn,{status:W.action})]},`${W.path}:${W.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?U2(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(W=>x.jsx("li",{children:W},W))}):null,r!=null&&r.warnings.length?x.jsx("ul",{className:"warnings",children:r.warnings.map(W=>x.jsx("li",{children:W},W))}):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:W=>A(W.target.value),children:d_.map(W=>x.jsx("option",{value:W.value,children:W.label},W.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:L,disabled:f||B||H,onChange:W=>M(W.target.value),children:p_.map(W=>x.jsx("option",{value:W.value,children:W.label},W.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:D,disabled:f||B||H,onChange:W=>k(W.target.value),children:m_.map(W=>x.jsx("option",{value:W.value,children:W.label},W.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(jo,{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 U2(t){return t.replaceAll("_"," ")}function nf(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($2).map((d,p)=>({message:d,sequence:p+1}));return[...r===null?s:s.slice(-r)].sort((d,p)=>p.sequence-d.sequence)}function F2({messages:t,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:p=!0,onModeChange:f,onMarkAllDone:o}){const[c,h]=ee.useState(null),m=nf(t),u=(r==null?void 0:r.mode)??"auto",y=P2(t,l);async function w(T){await G2(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:Oo(T),children:q2(Oo(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 q2(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 Oo(t){return t.acceptedAt??t.deliveredAt??t.dispatchingAt??t.createdAt}function $2(t,r){const s=Oo(t).localeCompare(Oo(r));if(s!==0)return s;const l=t.createdAt.localeCompare(r.createdAt);return l!==0?l:t.id.localeCompare(r.id)}async function G2(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 V2({defaultPath:t="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,p]=ee.useState(t);ee.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 W2({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 K2({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:W,onStartHarnessBootstrap:K,onRestartHarnessBootstrap:G,onStopHarnessBootstrap:Y,onRunHarnessBootstrap:Z,onOpenHarnessStudio:z,onOpenRepositoryDiff:j,onAutoTaskHarnessReviewChange:N,onAutoMemoryChange:$,onRefreshGateway:I,onGatewayEnabledChange:ie,onGatewaySettingsChange:ve,onGatewayTranslationChange:_e,onGatewayConnectionChange:Q,onStartGatewayQrLogin:q,onStartGatewayLarkRegistration:ue,onResetGatewayBinding:ae,onGateReviewGateEnabledChange:de,onTranslationEnabledChange:re,onTranslationAutoSendChange:xe,onTranslationTargetLanguageChange:me,onTranslationOutputModeChange:Me,onOpenFileTranslation:De,onOpenTranslatorSession:ke,onCreateTranslationBootstrap:Tt,onUpdateTranslationMemory:xt,onCreateTask:Nt,onCloseTask:rn,onSelectTask:Rn,themeMode:gt,onAutoOrchestrationChange:ut,onThemeModeChange:Bt,pauseAlertSound:fe,onPauseAlertSoundChange:Ce,roleRetryEnabled:Te,onRoleRetryEnabledChange:je,permissionRequestMode:Ne,onPermissionRequestModeChange:pt,launchTemplate:Fe,canSaveLaunchTemplate:_t,canOneClickStart:vt,onSaveLaunchTemplate:St,onOneClickStart:Ze,onMarkAllMessagesDone:mn,onDeleteMessageHistory:Zt}){const[Ar,ui]=ee.useState(""),[hi,fi]=ee.useState(!1),[gn,_n]=ee.useState(!1),[yt,di]=ee.useState(()=>l?null:"repository"),Hi=nf(d),en=Ar.trim(),qn=J2(t,l,E),Qn=s.filter(ze=>ze.cleanupStatus!=="cleaned"),$n=Qn.find(ze=>ze.taskSlug===l)??null;ee.useEffect(()=>{di(ze=>!l&&ze===null?t?"task":"repository":ze)},[l,t]);function Dn(ze,pi){di(pi?ze:null)}async function sn(ze){ze.preventDefault(),await Nt({taskSlug:en}),ui("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(Yr,{title:"Repository",open:yt==="repository",onOpenChange:ze=>{Dn("repository",ze),ze&&t&&H()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(V2,{defaultPath:(t==null?void 0:t.repoRoot)??"",recentPaths:r,busy:R,onConnect:B}),t?x.jsx(nk,{busy:R,project:t,onPull:U}):null]})}),x.jsx(Yr,{title:"Settings",open:yt==="settings",onOpenChange:ze=>Dn("settings",ze),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Yg(gt)}`,className:"settings-toggle theme-mode-toggle",disabled:R,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>Bt(lk(gt)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Yg(gt)})]}),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:ut}),x.jsx(Fn,{checked:fe,className:"sidebar-switch",disabled:R,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:ze=>Ce(ze)}),x.jsx(Fn,{checked:Te,className:"sidebar-switch",disabled:R,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:ze=>je(ze)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Ne,disabled:R,onChange:ze=>pt(ze.target.value),children:[x.jsx("option",{value:"off",children:"off"}),x.jsx("option",{value:"allowAll",children:"allow all"})]})]}),x.jsxs("button",{className:"settings-toggle",disabled:R||!_t,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:St,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:_t?"ready":"open task"})]}),vt?x.jsxs("button",{className:"settings-toggle is-active",disabled:R,title:Y2(Fe),type:"button",onClick:Ze,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:Tv(Fe)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>fi(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Hi.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(Yr,{title:"Translation",open:yt==="translation",onOpenChange:ze=>Dn("translation",ze),children:x.jsx(X2,{busy:R,enabled:h,autoSendEnabled:m,targetLanguage:u,outputMode:y,memoryInitialized:w,baseUnavailableReason:qn,translatorSession:T,onAutoSendChange:xe,onCreateBootstrap:Tt,onEnabledChange:re,onUpdateMemory:xt,onTargetLanguageChange:me,onOutputModeChange:Me,onOpenFileTranslation:De,onOpenTranslatorSession:ke})}),t&&l?x.jsx(Yr,{title:"Gate Review Gates",open:yt==="gate-review-gates",onOpenChange:ze=>Dn("gate-review-gates",ze),children:x.jsx(Z2,{busy:R,state:c,onGateEnabledChange:de})}):null,x.jsx(Yr,{title:"Gateway",open:yt==="gateway",onOpenChange:ze=>{Dn("gateway",ze),ze&&I()},children:x.jsx(tk,{busy:R,qrCheck:M,qrLogin:L,larkRegistration:D,larkRegistrationCheck:k,status:A,onEnabledChange:ie,onSettingsChange:ve,onResetBinding:ae,onStartLarkRegistration:ue,onStartQrLogin:q,onTranslationChange:_e,onConnectionChange:Q})}),t?x.jsx(Yr,{title:"VCM Harness",open:yt==="vcm-harness",onOpenChange:ze=>Dn("vcm-harness",ze),children:x.jsx(I2,{status:E,bootstrapStatus:b,applyResult:v,hasActiveTask:!!$n,autoTaskHarnessReviewEnabled:_,autoMemoryEnabled:S,busy:R,onRefresh:P,onApply:W,onOpenStudio:z,onOpenRepositoryDiff:j,onAutoTaskHarnessReviewChange:N,onAutoMemoryChange:$,onStartBootstrap:K,onRestartBootstrap:G,onStopBootstrap:Y,onRunBootstrap:Z})}):null,t?x.jsx(Yr,{title:"Task",open:yt==="task",onOpenChange:ze=>Dn("task",ze),children:Qn.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(W2,{tasks:Qn,activeTaskSlug:l,onSelect:Rn}),$n?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:R,type:"button",onClick:rn,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:sn,children:[x.jsx("input",{value:Ar,onChange:ze=>ui(ze.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",en?`feature/${en}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",en?`.claude/worktrees/${en}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:R||!en,children:"Create"})]})})}):null,t&&$n?x.jsx(sk,{task:$n,roundState:o}):null,hi?x.jsx(ck,{busy:R,messages:d,orchestration:p,onClose:()=>fi(!1),onMarkAllDone:()=>{l&&mn(l)},onDeleteMessageHistory:()=>{l&&Zt(l)}}):null,gn?x.jsx(ok,{events:f,onClose:()=>_n(!1)}):null]})}function Tv(t){return[t.autoOrchestration?"auto":"manual"].join(" + ")}function Y2(t){const r=Object.entries(t.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${Tv(t)}; ${r}`}function X2({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:u_.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:r1.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:Q2(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 Q2(t){return t?t.status==="running"?t.activityStatus??"idle":t.status:"not started"}function J2(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 Z2({busy:t,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:H2.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:ek(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function ek(t){switch(t){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"code-diff":return"Code diff"}return t}function tk({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 nk({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:ik(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:rk(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 ${Oh(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 ik(t){return t.branch||"unknown"}function rk(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 sk({roundState:t,task:r}){var m;const[s,l]=ee.useState(()=>Date.now()),d=!!(t!=null&&t.startedAt),p=Rv(r.createdAt,s),f=Kg(t,(t==null?void 0:t.totalCcActiveMs)??0,s),o=d&&t?Kg(t,t.currentRoundCcActiveMs,s):0,c=d&&t?ak(t,s):0,h=((m=r.title)==null?void 0:m.trim())||r.taskSlug;return ee.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:Oh(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:bo(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:bo(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:Oh(t.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:bo(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:bo(o)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:t.turnCount})]})]})]}):null]})}function Kg(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 ak(t,r){const s=t.status==="running"?r:Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return Rv(t.startedAt??"",Number.isFinite(s)?s:r)}function Rv(t,r){const s=Date.parse(t);return Number.isFinite(s)?Math.max(0,r-s):0}function Oh(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 bo(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 lk(t){return t==="system"?"light":t==="light"?"dark":"system"}function Yg(t){return t==="system"?"System":t==="light"?"Light":"Dark"}function ok({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(z2,{events:t,maxEvents:null,showHeader:!1})]})})}function ck({busy:t,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:p}){const f=nf(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(`
93
+ `;function u2({active:t=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:p,panelState:f,onClearSession:o,onEntry:c,onFailures:h}){const[m,u]=ee.useState(""),[y,w]=ee.useState(""),[T,E]=ee.useState(!1),[b,v]=ee.useState(Date.now()),[_,S]=ee.useState(!1),[,A]=Ni(""),L=ee.useRef(null),M=f.entries,D=f.failures,k=f.status;ee.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=v2(M);ee.useEffect(()=>{if(!R)return;v(Date.now());const N=window.setInterval(()=>v(Date.now()),250);return()=>window.clearInterval(N)},[R]);async function O(N=!1){const $=m;S(!0),A(""),E(!1);try{const I=await Se.translateUserInput(l,d,{text:$,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});I.sent?(u(""),E(!1)):(u(Av($,I.englishPreview)),E(!0))}catch(I){A(lt("Translate composer input",I))}finally{S(!1)}}async function H(){const N=y.trim();if(N){S(!0),A("");try{const $=await Se.translateManualOutput(l,d,{text:N});c(p,d,$),w("")}catch($){A(lt("Translate pasted English output",$))}finally{S(!1)}}}async function U(){S(!0),A("");try{const N=await Se.translateLatestReply(l,d);c(p,d,N)}catch(N){A(lt("Translate final reply",N))}finally{S(!1)}}async function P(){const N=T?Kg(m):m;if(N.trim()){S(!0),A("");try{await Se.sendTranslatedInput(l,d,{englishText:N}),u(""),E(!1)}catch($){A(lt("Send translated English input to role",$))}finally{S(!1)}}}function W(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!_&&m.trim()&&(T?P():O(r)))}async function K(){o(p,d),await Se.clearTranslationSession(p).catch(N=>A(lt("Clear conversation translation panel",N)))}async function G(){S(!0),A("");try{const N=await Se.ignoreTranslationFailures(p);h(p,d,N.failures)}catch(N){A(lt("Ignore failed conversation translations",N))}finally{S(!1)}}async function Y(N){S(!0),A("");try{const $=await Se.retryTranslation(p,N.translationId);c(p,d,$)}catch($){A(lt("Retry latest failed conversation translation",$))}finally{S(!1)}}const Z=y2(M,k,b),z=D.length,j=f2(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 ",h2(s)," · ",Z]})})]}),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(g2,{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&&!C2(N.target.value))&&E(!1)},onKeyDown:W,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:_||!T||!Kg(m).trim(),onClick:()=>void P(),children:"Send English"})})]})})]})}function h2(t){var r;return((r=h_.find(s=>s.value===t))==null?void 0:r.label)??t}function f2(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 d2({open:t,taskSlug:r,targetLanguage:s,onClose:l}){const[d,p]=ee.useState(!1),[,f]=Ni(""),[o,c]=ee.useState(null),[h,m]=ee.useState(""),[u,y]=ee.useState(""),[w,T]=ee.useState(""),[E,b]=ee.useState(!1),[v,_]=ee.useState(null),[S,A]=ee.useState(""),[L,M]=ee.useState(""),[D,k]=ee.useState(""),[R,O]=ee.useState(!1);sl(t?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(G=!1){try{const Y=await Se.getTranslationState();c(Y);const Z=h?Y.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!Z)&&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 Se.readFileTranslation(h);y(z.output),T(z.report)}}catch(Y){f(lt("Load file translation list",Y))}}async function U(G){m(G),y(""),T("");try{const Y=await Se.readFileTranslation(G);y(Y.output),T(Y.report)}catch(Y){f(lt(`Read translated file ${G}`,Y))}}async function P(){b(!0),await W(S,L)}async function W(G="",Y=""){O(!0),f("");try{const Z=await Se.browseTranslationSourceFiles({path:G,query:Y,limit:250});_(Z),A(Z.currentPath),M(Y)}catch(Z){f(lt("Browse translation source files",Z))}finally{O(!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 Z=await Se.createFileTranslation({taskSlug:r,sourcePath:Y,targetLanguage:s});b(!1),await H(),await U(Z.id)}catch(Z){f(lt(`Create file translation for ${Y}`,Z))}finally{p(!1)}}}return t?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(m2,{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(p2,{busy:d||R,state:v,currentPath:S,query:L,selectedPath:D,onBrowse:(G,Y)=>void W(G,Y),onClose:()=>b(!1),onQueryChange:M,onSelectPath:k,onTranslate:()=>void K()}):null]}):null}function p2({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(Wg,{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(Wg,{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 Wg({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 m2({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(Z_,{remarkPlugins:[wv],children:l||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function g2({entry:t}){if(t.sourceKind==="conversation-boundary")return x.jsx(_2,{entry:t});const r=b2(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(Z_,{remarkPlugins:[wv],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 _2({entry:t}){const r=t.boundaryKind==="end"?"结束":"开始",s=t.conversationTurn??0,l=x2(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 v2(t){const r=t.find(kv);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function y2(t,r,s){const l=t.find(kv);if(l)return`translating ${w2(Math.max(0,s-S2(l)))}`;const d=t.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function kv(t){return t.status==="queued"||t.status==="translating"}function S2(t){const r=Date.parse(t.translationStartedAt??t.createdAt);return Number.isFinite(r)?r:Date.now()}function b2(t){return t.status==="queued"||t.status==="translating"?t.sourceText:t.status==="translated"?t.direction==="user-input-to-english"?Av(t.sourceText,t.translatedText):t.translatedText:t.translatedText||t.sourceText}function Av(t,r){return`${t.trimEnd()}${Mo}${r.trimStart()}`}function C2(t){return t.includes(Mo)}function Kg(t){const r=t.indexOf(Mo);return r===-1?t:t.slice(r+Mo.length)}function w2(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 x2(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleTimeString()}const E2=8;function k2(){const[t,r]=ee.useState([]);return ee.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,E2)})},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(vh,s),window.addEventListener(yh,l),window.addEventListener(Sh,d),()=>{window.removeEventListener(vh,s),window.removeEventListener(yh,l),window.removeEventListener(Sh,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:[A2(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 A2(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function T2(t,r){return t.find(s=>s.taskSlug===r)??t[0]??null}function R2(t){if(!(t.mode!=="auto"||t.status!=="running")&&!(!t.activeRole||t.activeRole===t.lastFollowedRole))return t.activeRole}function D2(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 M2(t){const r=t.flowPause;if((r==null?void 0:r.reason)==="awaiting-user")return`awaiting-user:${r.since??t.taskSlug}`;const s=t.roundId??t.startedAt??t.taskSlug,l=t.stoppedAt??t.lastTurnEndedAt??"stopped";return`${s}:${l}`}const L2=3,O2=3e4,Eo=new Map;function Tv(t,r){const s=lt(t,r);if(!B2(r))return Eo.set(t,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=Eo.get(t),d=((l==null?void 0:l.consecutiveFailures)??0)+1,p=Date.now(),f=d>=L2&&(!l||l.lastMessage!==s||p-l.lastReportedAt>=O2);return Eo.set(t,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?p:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Lo(t){Eo.delete(t),h1([t])}function B2(t){const r=Bo(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 j2=["architecture-plan","validation-adequacy","code-diff"];function N2({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 H2({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,_]=ee.useState(!1),[S,A]=ee.useState("bypassPermissions"),[L,M]=ee.useState("default"),[D,k]=ee.useState("default"),R=r==null?void 0:r.session,O=(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(W=>x.jsxs("li",{children:[x.jsx("span",{children:W.path}),x.jsx(Kn,{status:W.action})]},`${W.path}:${W.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?z2(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(W=>x.jsx("li",{children:W},W))}):null,r!=null&&r.warnings.length?x.jsx("ul",{className:"warnings",children:r.warnings.map(W=>x.jsx("li",{children:W},W))}):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(Kn,{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||O||H,onChange:W=>A(W.target.value),children:p_.map(W=>x.jsx("option",{value:W.value,children:W.label},W.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:L,disabled:f||O||H,onChange:W=>M(W.target.value),children:m_.map(W=>x.jsx("option",{value:W.value,children:W.label},W.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:D,disabled:f||O||H,onChange:W=>k(W.target.value),children:g_.map(W=>x.jsx("option",{value:W.value,children:W.label},W.value))})]}),x.jsxs("div",{className:"harness-bootstrap-control-actions",children:[x.jsx("button",{type:"button",disabled:f||O||!(r!=null&&r.canStart),onClick:()=>void w(P),children:"Start"}),x.jsx("button",{type:"button",disabled:f||O||!(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||O||!H,onClick:()=>void b(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:H?x.jsx(jo,{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 z2(t){return t.replaceAll("_"," ")}function rf(t){return{total:t.length,accepted:t.filter(r=>r.acceptedAt).length,delivered:t.filter(r=>r.deliveredAt).length}}function I2(t,r=6){const s=[...t].sort(F2).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]=ee.useState(null),m=rf(t),u=(r==null?void 0:r.mode)??"auto",y=I2(t,l);async function w(T){await q2(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:Oo(T),children:P2(Oo(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 P2(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 Oo(t){return t.acceptedAt??t.deliveredAt??t.dispatchingAt??t.createdAt}function F2(t,r){const s=Oo(t).localeCompare(Oo(r));if(s!==0)return s;const l=t.createdAt.localeCompare(r.createdAt);return l!==0?l:t.id.localeCompare(r.id)}async function q2(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 $2({defaultPath:t="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,p]=ee.useState(t);ee.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 G2({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(Kn,{status:l.status})]},l.taskSlug))})}function V2({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:O,onRefreshConnectedRepository:H,onPullConnectedRepository:U,onRefreshHarness:P,onApplyHarness:W,onStartHarnessBootstrap:K,onRestartHarnessBootstrap:G,onStopHarnessBootstrap:Y,onRunHarnessBootstrap:Z,onOpenHarnessStudio:z,onOpenRepositoryDiff:j,onAutoTaskHarnessReviewChange:N,onAutoMemoryChange:$,onRefreshGateway:I,onGatewayEnabledChange:ie,onGatewaySettingsChange:_e,onGatewayTranslationChange:ge,onGatewayConnectionChange:Q,onStartGatewayQrLogin:q,onStartGatewayLarkRegistration:ue,onResetGatewayBinding:le,onGateReviewGateEnabledChange:he,onTranslationEnabledChange:re,onTranslationAutoSendChange:Ee,onTranslationTargetLanguageChange:Be,onTranslationOutputModeChange:ve,onOpenFileTranslation:Te,onOpenTranslatorSession:xe,onCreateTranslationBootstrap:Tt,onUpdateTranslationMemory:xt,onCreateTask:Nt,onCloseTask:rn,onSelectTask:Dn,themeMode:gt,onAutoOrchestrationChange:ut,onThemeModeChange:Bt,pauseAlertSound:fe,onPauseAlertSoundChange:Ce,roleRetryEnabled:Ae,onRoleRetryEnabledChange:je,permissionRequestMode:Ne,onPermissionRequestModeChange:dt,launchTemplate:qe,canSaveLaunchTemplate:_t,canOneClickStart:vt,onSaveLaunchTemplate:St,onOneClickStart:Ze,onMarkAllMessagesDone:gn,onDeleteMessageHistory:Jt}){const[kr,hi]=ee.useState(""),[fi,di]=ee.useState(!1),[_n,vn]=ee.useState(!1),[yt,pi]=ee.useState(()=>l?null:"repository"),zi=rf(d),Zt=kr.trim(),qn=X2(t,l,E),Xn=s.filter(ze=>ze.cleanupStatus!=="cleaned"),$n=Xn.find(ze=>ze.taskSlug===l)??null;ee.useEffect(()=>{pi(ze=>!l&&ze===null?t?"task":"repository":ze)},[l,t]);function Mn(ze,mi){pi(mi?ze:null)}async function sn(ze){ze.preventDefault(),await Nt({taskSlug:Zt}),hi("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(Kr,{title:"Repository",open:yt==="repository",onOpenChange:ze=>{Mn("repository",ze),ze&&t&&H()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx($2,{defaultPath:(t==null?void 0:t.repoRoot)??"",recentPaths:r,busy:R,onConnect:O}),t?x.jsx(ek,{busy:R,project:t,onPull:U}):null]})}),x.jsx(Kr,{title:"Settings",open:yt==="settings",onOpenChange:ze=>Mn("settings",ze),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Xg(gt)}`,className:"settings-toggle theme-mode-toggle",disabled:R,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>Bt(sk(gt)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Xg(gt)})]}),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:ut}),x.jsx(Fn,{checked:fe,className:"sidebar-switch",disabled:R,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:ze=>Ce(ze)}),x.jsx(Fn,{checked:Ae,className:"sidebar-switch",disabled:R,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:ze=>je(ze)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Ne,disabled:R,onChange:ze=>dt(ze.target.value),children:[x.jsx("option",{value:"off",children:"off"}),x.jsx("option",{value:"allowAll",children:"allow all"})]})]}),x.jsxs("button",{className:"settings-toggle",disabled:R||!_t,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:St,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:_t?"ready":"open task"})]}),vt?x.jsxs("button",{className:"settings-toggle is-active",disabled:R,title:W2(qe),type:"button",onClick:Ze,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:Rv(qe)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>di(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[zi.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>vn(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx(Kr,{title:"Translation",open:yt==="translation",onOpenChange:ze=>Mn("translation",ze),children:x.jsx(K2,{busy:R,enabled:h,autoSendEnabled:m,targetLanguage:u,outputMode:y,memoryInitialized:w,baseUnavailableReason:qn,translatorSession:T,onAutoSendChange:Ee,onCreateBootstrap:Tt,onEnabledChange:re,onUpdateMemory:xt,onTargetLanguageChange:Be,onOutputModeChange:ve,onOpenFileTranslation:Te,onOpenTranslatorSession:xe})}),t&&l?x.jsx(Kr,{title:"Gate Review Gates",open:yt==="gate-review-gates",onOpenChange:ze=>Mn("gate-review-gates",ze),children:x.jsx(Q2,{busy:R,state:c,onGateEnabledChange:he})}):null,x.jsx(Kr,{title:"Gateway",open:yt==="gateway",onOpenChange:ze=>{Mn("gateway",ze),ze&&I()},children:x.jsx(Z2,{busy:R,qrCheck:M,qrLogin:L,larkRegistration:D,larkRegistrationCheck:k,status:A,onEnabledChange:ie,onSettingsChange:_e,onResetBinding:le,onStartLarkRegistration:ue,onStartQrLogin:q,onTranslationChange:ge,onConnectionChange:Q})}),t?x.jsx(Kr,{title:"VCM Harness",open:yt==="vcm-harness",onOpenChange:ze=>Mn("vcm-harness",ze),children:x.jsx(H2,{status:E,bootstrapStatus:b,applyResult:v,hasActiveTask:!!$n,autoTaskHarnessReviewEnabled:_,autoMemoryEnabled:S,busy:R,onRefresh:P,onApply:W,onOpenStudio:z,onOpenRepositoryDiff:j,onAutoTaskHarnessReviewChange:N,onAutoMemoryChange:$,onStartBootstrap:K,onRestartBootstrap:G,onStopBootstrap:Y,onRunBootstrap:Z})}):null,t?x.jsx(Kr,{title:"Task",open:yt==="task",onOpenChange:ze=>Mn("task",ze),children:Xn.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(G2,{tasks:Xn,activeTaskSlug:l,onSelect:Dn}),$n?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:R,type:"button",onClick:rn,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:sn,children:[x.jsx("input",{value:kr,onChange:ze=>hi(ze.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",Zt?`feature/${Zt}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",Zt?`.claude/worktrees/${Zt}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:R||!Zt,children:"Create"})]})})}):null,t&&$n?x.jsx(ik,{task:$n,roundState:o}):null,fi?x.jsx(lk,{busy:R,messages:d,orchestration:p,onClose:()=>di(!1),onMarkAllDone:()=>{l&&gn(l)},onDeleteMessageHistory:()=>{l&&Jt(l)}}):null,_n?x.jsx(ak,{events:f,onClose:()=>vn(!1)}):null]})}function Rv(t){return[t.autoOrchestration?"auto":"manual"].join(" + ")}function W2(t){const r=Object.entries(t.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${Rv(t)}; ${r}`}function K2({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:h_.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:r1.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:Y2(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 Y2(t){return t?t.status==="running"?t.activityStatus??"idle":t.status:"not started"}function X2(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 Q2({busy:t,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:j2.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:J2(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function J2(t){switch(t){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"code-diff":return"Code diff"}return t}function Z2({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 ek({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:tk(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:nk(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 ${Bh(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 tk(t){return t.branch||"unknown"}function nk(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 ik({roundState:t,task:r}){var m;const[s,l]=ee.useState(()=>Date.now()),d=!!(t!=null&&t.startedAt),p=Dv(r.createdAt,s),f=Yg(t,(t==null?void 0:t.totalCcActiveMs)??0,s),o=d&&t?Yg(t,t.currentRoundCcActiveMs,s):0,c=d&&t?rk(t,s):0,h=((m=r.title)==null?void 0:m.trim())||r.taskSlug;return ee.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:Bh(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:Co(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:Co(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:Bh(t.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:Co(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:Co(o)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:t.turnCount})]})]})]}):null]})}function Yg(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 rk(t,r){const s=t.status==="running"?r:Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return Dv(t.startedAt??"",Number.isFinite(s)?s:r)}function Dv(t,r){const s=Date.parse(t);return Number.isFinite(s)?Math.max(0,r-s):0}function Bh(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 Co(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 sk(t){return t==="system"?"light":t==="light"?"dark":"system"}function Xg(t){return t==="system"?"System":t==="light"?"Light":"Dark"}function ak({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(N2,{events:t,maxEvents:null,showHeader:!1})]})})}function lk({busy:t,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:p}){const f=rf(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
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(F2,{busy:t,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Yr({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 Dv(t,r){return t.find(s=>s.role===r)}function uk({activeRole:t,roles:r=Nh,sessions:s,onSelect:l}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const p=Dv(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 hk({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=t1(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(Hh,{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(jo,{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(f2,{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 gh=500;function Bh(t){return{taskSlug:t,cursor:1,sessions:{}}}function fk(t,r,s){return t.sessions[r]??Us(s)}function dk(t,r){const l={..._k(t,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...Us(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const p=l[d.sessionId]??Us(d.role);if(d.event.type==="status")l[d.sessionId]={...p,role:d.role,status:d.event.status};else if(d.event.type==="failures")l[d.sessionId]={...p,role:d.role,failures:d.event.failures};else if(d.event.type==="entry"){const f=Lv(Mv(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 pk(t,r,s){return{...t,sessions:{...t.sessions,[r]:Us(s)}}}function mk(t,r,s,l){const d=t.sessions[r]??Us(s),p=Lv(Mv(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 gk(t,r,s,l){const d=t.sessions[r]??Us(s);return{...t,sessions:{...t.sessions,[r]:{...d,role:s,failures:l}}}}function _k(t,r){return t.taskSlug===r?t:Bh(r)}function Us(t){return{role:t,status:"ready",entries:[],failures:[]}}function Mv(t,r){return t.findIndex(l=>l.id===r.id)===-1?[...t,r]:t.map(l=>l.id===r.id?r:l)}function Lv(t){if(t.length<=gh)return{entries:t,removedIds:new Set};const r=t.slice(0,t.length-gh);return{entries:t.slice(-gh),removedIds:new Set(r.map(s=>s.id))}}const vk={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",tester:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},yk={"project-manager":"default",architect:"default",coder:"default",tester:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},Sk={"project-manager":"default",architect:"default",coder:"default",tester:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function bk({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]=ee.useState(null),[v,_]=ee.useState(()=>Qg(f)),[S,A]=ee.useState(()=>Jg(f)),[L,M]=ee.useState(()=>Zg(f)),[D,k]=ee.useState(!1),[,R]=ji(""),[B,H]=ee.useState([]),[U,P]=ee.useState(null),[W,K]=ee.useState(()=>Bh(t.taskSlug)),G=ee.useRef(""),Y=ee.useRef(1),Z=ee.useMemo(()=>JSON.stringify(f),[f]),z=!!(E!=null&&E.sessions.some(de=>de.role==="gate-reviewer")),j=s||z,N=[...Za,...j?[l_]:[]],$=ee.useCallback((de,re)=>{P(re),m==null||m(de),u==null||u(re)},[m,u]),I=ee.useCallback((de,re,xe,me)=>{b(de),$(re,xe),y==null||y(me)},[$,y]),ie=ee.useCallback(async()=>{const de=await Se.getTaskWorkspaceState(t.taskSlug);I(de.taskStatus,de.messages,de.orchestration,de.roundState),Lo("Poll task workspace state"),R(re=>Eo(re,["Load task workspace state","Poll task workspace state"]))},[I,t.taskSlug]),ve=ee.useCallback((de,re)=>{const xe=Av(de,re);xe&&R(xe)},[]);nl(`task-workspace:${t.taskSlug}:${o}`,()=>ie().catch(de=>{ve("Poll task workspace state",de)}),{intervalMs:3e3,runImmediately:!0}),nl(l?`task-translation-feed:${t.taskSlug}`:null,async()=>{try{const de=await Se.pollTranslationTaskFeed(t.taskSlug,Y.current);Y.current=de.nextCursor,K(re=>dk(re,de)),Lo("Poll task translation feed"),R(re=>Eo(re,["Poll task translation feed"]))}catch(de){ve("Poll task translation feed",de)}},{intervalMs:1e3,runImmediately:!0}),ee.useEffect(()=>{H([]),w==null||w([])},[w,t.taskSlug]),ee.useEffect(()=>{Y.current=1,K(Bh(t.taskSlug))},[t.taskSlug]),ee.useEffect(()=>{_(Qg(f)),A(Jg(f)),M(Zg(f))},[Z,t.taskSlug]),ee.useEffect(()=>{E&&!j&&r==="gate-reviewer"&&h("project-manager"),E&&r==="translator"&&h("project-manager")},[r,j,h,E]),ee.useEffect(()=>{const de=E==null?void 0:E.task;if(!de||de.taskSlug!==t.taskSlug)return;const re=Xg(de);if(re===Xg(t)){G.current="";return}G.current!==re&&(G.current=re,c().catch(xe=>{G.current="",R(lt("Refresh task list after task status changed",xe))}))},[c,E==null?void 0:E.task,t]),ee.useEffect(()=>{const de=(E==null?void 0:E.sessions)??[],re=de.filter(De=>Ck(De.role)),xe=new Set(re.map(De=>De.role)),me=de.some(De=>De.role==="gate-reviewer"),Me={};for(const De of Ps)Me[De.name]={permissionMode:v[De.name],model:S[De.name],effort:L[De.name]};T==null||T({taskSlug:t.taskSlug,roles:Me,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!E,sessionCount:re.length,hasAnySession:re.length>0,hasGateReviewerSession:me,allRolesHaveSession:Za.every(De=>xe.has(De.name))})},[S,L,T,U==null?void 0:U.mode,v,E,t.taskSlug]);async function _e(de,re="Run role session action"){k(!0),R("");try{await de(),await ie(),await c()}catch(xe){R(lt(re,xe))}finally{k(!1)}}function Q(de){H(re=>{const xe=[...re,`${new Date().toLocaleTimeString()} ${de}`];return w==null||w(xe),xe})}function q(de,re){_(xe=>({...xe,[de]:re}))}function ue(de,re){A(xe=>({...xe,[de]:re}))}function ae(de,re){M(xe=>({...xe,[de]:re}))}return x.jsxs("div",{className:"task-workspace",children:[x.jsxs("header",{className:"workspace-header",children:[x.jsx("div",{className:"workspace-title-line",children:x.jsx("h1",{children:t.title||t.taskSlug})}),x.jsx(uk,{activeRole:r,roles:N,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:N.map(de=>{const re=de.name,xe=re===r,me=(E==null?void 0:E.sessions)??[],Me=Dv(me,re),De=Me?fk(W,Me.id,re):void 0;return x.jsx("div",{className:xe?"role-console-panel is-active":"role-console-panel","aria-hidden":!xe,children:x.jsx(hk,{role:re,session:Me,permissionMode:v[re],model:S[re],effort:L[re],active:xe,busy:D,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:p,translationPanelState:De,onClearTranslationSession:(ke,Tt)=>{K(xt=>pk(xt,ke,Tt))},onTranslationEntry:(ke,Tt,xt)=>{K(Nt=>mk(Nt,ke,Tt,xt))},onTranslationFailures:(ke,Tt,xt)=>{K(Nt=>gk(Nt,ke,Tt,xt))},onPermissionModeChange:ke=>q(re,ke),onModelChange:ke=>ue(re,ke),onEffortChange:ke=>ae(re,ke),onStart:()=>void _e(async()=>{await Se.startRoleSession(t.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:L[re]}),Q(`started ${re} with ${v[re]} / ${S[re]} / ${L[re]}`)},`Start ${re} session`),onResume:()=>void _e(async()=>{await Se.resumeRoleSession(t.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:L[re]}),Q(`resumed ${re} with ${v[re]} / ${S[re]} / ${L[re]}`)},`Resume ${re} session`),onStop:()=>void _e(async()=>{await Se.stopRoleSession(t.taskSlug,re),Q(`stopped ${re}`)},`Stop ${re} session`),onRestart:()=>void _e(async()=>{await Se.restartRoleSession(t.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:L[re]}),Q(`restarted ${re} with ${v[re]} / ${S[re]} / ${L[re]}`)},`Restart ${re} session`),onNotifyHarnessUpdated:()=>void _e(async()=>{await Se.notifyRoleHarnessUpdated(t.taskSlug,re),Q(`notified ${re} to reload latest harness`)},`Notify ${re} to reload harness`),onTerminalEvent:ke=>Q(`${de.label}: ${ke}`)})},re)})})})})]})}function Ck(t){return Za.some(r=>r.name===t)}function Xg(t){return[t.status,t.updatedAt,t.cleanupStatus??"",t.cleanedAt??""].join(":")}function Qg(t){var s;const r={...vk};for(const l of Ps)r[l.name]=((s=t.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function Jg(t){var s;const r={...yk};for(const l of Ps)r[l.name]=((s=t.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function Zg(t){var s;const r={...Sk};for(const l of Ps)r[l.name]=((s=t.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const wk=120*1e3,e_=1400,xk=3;function Ek(t){return!!(t!=null&&t.initialized)}function kk(){const[t,r]=ee.useState(null),[s,l]=ee.useState([]),[d,p]=ee.useState(null),[f,o]=ee.useState(null),[c,h]=ee.useState(null),[m,u]=ee.useState(null),[y,w]=ee.useState(null),[T,E]=ee.useState(null),[b,v]=ee.useState(null),[_,S]=ee.useState(null),[A,L]=ee.useState(null),[M,D]=ee.useState(null),[k,R]=ee.useState(null),[B,H]=ee.useState(!1),[U,P]=ee.useState(null),[W,K]=ee.useState(null),[G,Y]=ee.useState(!1),[Z,z]=ee.useState([]),[j,N]=ee.useState(null),[$,I]=ee.useState(null),[ie,ve]=ee.useState(null),[_e,Q]=ee.useState(null),[q,ue]=ee.useState(null),[ae,de]=ee.useState(null),[re,xe]=ee.useState("project-manager"),[me,Me]=ee.useState("system"),[De,ke]=ee.useState(!0),[Tt,xt]=ee.useState(!0),[Nt,rn]=ee.useState("off"),[Rn,gt]=ee.useState(!1),[ut,Bt]=ee.useState(!1),[fe,Ce]=ee.useState(!1),[Te,je]=ee.useState(!1),[Ne,pt]=ee.useState(n1),[Fe,_t]=ee.useState(i1),[vt,St]=ee.useState(!1),[Ze,mn]=ee.useState(!1),[Zt,Ar]=ee.useState(!1),[ui,hi]=ee.useState(!1),[fi,gn]=ee.useState(!1),[_n,yt]=ee.useState(null),[di,Hi]=ee.useState("bypassPermissions"),[en,qn]=ee.useState("default"),[Qn,$n]=ee.useState("medium"),[Dn,sn]=ee.useState(null),[ze,pi]=ee.useState("bypassPermissions"),[Tr,es]=ee.useState("default"),[vn,Et]=ee.useState("medium"),[It,zi]=ee.useState(()=>s1()),[Mn,Po]=ee.useState(null),[Fo,$s]=ee.useState(0),[Ii,Ui]=ee.useState(null),[Pi,Fi]=ee.useState(null),[qi,$i]=ee.useState(!1),[ht,Gs]=ee.useState(!1),[,Jn]=ji(""),Zn=ee.useRef({}),ei=ee.useRef({}),al=ee.useRef({}),Vs=ee.useRef({}),Ws=ee.useRef({}),ti=ee.useRef(null),Gi=ee.useRef(""),te=ee.useMemo(()=>D2(Z,j),[Z,j]),bt=(Mn==null?void 0:Mn.taskSlug)===(te==null?void 0:te.taskSlug)?Mn:null,Vt=c===(te==null?void 0:te.taskSlug)?d:null,Ks=m===(te==null?void 0:te.taskSlug)?f:null,qo=_===(te==null?void 0:te.taskSlug)?b:null,Ys=!!(t&&te&&Ek(Vt)),ll=(_n==null?void 0:_n.status)==="running",mi=!!(A!=null&&A.enabled),ol=!!(fe&&Ys&&ll),an=!!(bt!=null&&bt.statusLoaded),Xs=!!(te&&(bt!=null&&bt.statusLoaded)&&!bt.hasAnySession),Ut=ee.useCallback(V=>{Me(V.themeMode),ke(V.flowPauseAlerts),xt(V.roleRetryEnabled),rn(V.permissionRequestMode),gt(V.autoTaskHarnessReviewEnabled),Bt(V.autoMemoryEnabled),Ce(V.translationEnabled),je(V.translationAutoSendEnabled),pt(V.translationTargetLanguage),_t(V.translationOutputMode),zi(V.launchTemplate)},[]);ee.useEffect(()=>{if(!De)return;let V=!1;const he=()=>{V||(V=!0,t_(),window.removeEventListener("pointerdown",he),window.removeEventListener("keydown",he))};return window.addEventListener("pointerdown",he),window.addEventListener("keydown",he),()=>{window.removeEventListener("pointerdown",he),window.removeEventListener("keydown",he)}},[De]);const Ht=ee.useCallback(()=>{ti.current!==null&&(window.clearInterval(ti.current),ti.current=null)},[]),gi=ee.useCallback(()=>{Ht(),Co(),ti.current=window.setInterval(()=>{Co()},e_)},[Ht]),Qs=ee.useCallback(()=>{Ht();let V=1;Co(),ti.current=window.setInterval(()=>{V+=1,Co(),V>=xk&&ti.current!==null&&(window.clearInterval(ti.current),ti.current=null)},e_)},[Ht]),Js=ee.useCallback((V,he=`manual-${Date.now()}`,qe={})=>{Ui({id:he,text:V}),qe.sound==="strong"?gi():qe.sound==="weak"?Qs():Ht()},[Qs,gi,Ht]),Vi=ee.useCallback(()=>{Ht(),Ui(null)},[Ht]);ee.useEffect(()=>{te!=null&&te.taskSlug&&(Ws.current[te.taskSlug]=Date.now())},[te==null?void 0:te.taskSlug]);const $o=ee.useCallback(V=>{te!=null&&te.taskSlug&&I({taskSlug:te.taskSlug,messages:V})},[te==null?void 0:te.taskSlug]),cl=ee.useCallback(V=>{al.current[V.taskSlug]=V.mode,te!=null&&te.taskSlug&&ve({taskSlug:te.taskSlug,orchestration:V})},[te==null?void 0:te.taskSlug]),ul=ee.useCallback(V=>{te!=null&&te.taskSlug&&Q({taskSlug:te.taskSlug,events:V})},[te==null?void 0:te.taskSlug]),Zs=ee.useCallback(V=>{if(!(te!=null&&te.taskSlug)||V.taskSlug!==te.taskSlug)return;ue({taskSlug:V.taskSlug,roundState:V});const he=M2({mode:al.current[V.taskSlug],status:V.status,activeRole:V.activeRole,lastFollowedRole:Vs.current[V.taskSlug]});he&&(Vs.current[V.taskSlug]=he,xe(he));const qe=L2(V,Ok);if(qe===null){ei.current[V.taskSlug]={status:V.status};return}const Pt=O2(V),Lr=Zn.current[V.taskSlug],Wo=ei.current[V.taskSlug];if(ei.current[V.taskSlug]={status:V.status},Lr===Pt||(Zn.current[V.taskSlug]=Pt,!Dk(V,Wo,Ws.current[V.taskSlug])))return;if(mi){Ht(),Ui(null);return}const Ko=De?Rk(V)>=wk?"strong":"weak":"none";Js(qe,Pt,{sound:Ko})},[te==null?void 0:te.taskSlug,mi,De,Js,Ht]),Go=ee.useCallback(V=>{Po(he=>(he==null?void 0:he.taskSlug)===V.taskSlug&&he.statusLoaded===V.statusLoaded&&he.sessionCount===V.sessionCount&&he.hasAnySession===V.hasAnySession&&he.hasGateReviewerSession===V.hasGateReviewerSession&&he.allRolesHaveSession===V.allRolesHaveSession&&he.autoOrchestration===V.autoOrchestration&&JSON.stringify(he.roles)===JSON.stringify(V.roles)?he:V)},[]);async function Wi(){const V=await Se.listTasks();return z(V),N(he=>{var qe;return he&&V.some(Pt=>Pt.taskSlug===he)?he:((qe=V[0])==null?void 0:qe.taskSlug)??null}),V}async function Ki(V=te==null?void 0:te.taskSlug){if(!V)return p(null),h(null),null;const he=await Se.getHarnessStatus(V);return p(he),h(V),he}async function yn(V=te==null?void 0:te.taskSlug){if(!V)return o(null),u(null),null;const he=await Se.getHarnessBootstrapStatus(V);return o(he),u(V),he}async function ni(){const V=await Se.getGatewayStatus();return L(V),V}async function ea(){const V=await Se.getRecentRepositoryPaths();return l(V),V}async function _i(){if(!t)return St(!1),!1;const V=await Se.getTranslationState();return St(V.memoryInitialized),V.memoryInitialized}async function ii(V){const[he,qe]=await Promise.all([Se.listMessages(V),Se.getOrchestrationState(V)]);I({taskSlug:V,messages:he}),ve({taskSlug:V,orchestration:qe})}async function ta(V){const he=await Se.getGateReviewState(V);return de({taskSlug:V,state:he}),Lo("Poll Gate Review state"),Jn(qe=>Eo(qe,["Refresh Gate Review state","Poll Gate Review state"])),he}function ts(V,he){const qe=Av(V,he);qe&&Jn(qe)}function vi(V){V&&(Hi(V.permissionMode),V.model&&qn(V.model),V.effort&&$n(V.effort))}async function Yi(V={}){const he=await Se.getTranslatorSession();return yt(he),V.syncLaunchOptions&&vi(he),he}function Wt(V){V&&(pi(V.permissionMode),V.model&&es(V.model),V.effort&&Et(V.effort))}async function Ln(V={}){const he=await Se.getHarnessEngineerSession();return sn(he),V.syncLaunchOptions&&Wt(he),he}function Rr(V,he,qe={}){var Pt;yt(V.translatorSession),St(!!((Pt=V.translationState)!=null&&Pt.memoryInitialized)),sn(V.harnessEngineerSession),E(V.harnessFeedbackState),v(V.autoMemoryState),S(he&&V.autoMemoryState?he:null),L(V.gatewayStatus),he&&V.harnessStatus?(p(V.harnessStatus),h(he)):(p(null),h(null)),he&&V.harnessBootstrapStatus?(o(V.harnessBootstrapStatus),u(he)):(o(null),u(null)),qe.syncLaunchOptions&&(vi(V.translatorSession),Wt(V.harnessEngineerSession))}async function Gn(V={}){if(!t)return yt(null),St(!1),sn(null),p(null),o(null),h(null),u(null),E(null),v(null),S(null),null;const he=(te==null?void 0:te.taskSlug)??null,qe=await Se.getProjectRuntimeState(he);return Rr(qe,he,V),qe}function na(){const V=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const he of V)Lo(he);Jn(he=>Eo(he,V))}ee.useEffect(()=>{Promise.all([Se.getCurrentProject(),Se.getRecentRepositoryPaths(),Se.getAppPreferences(),Se.getGatewayStatus()]).then(async([V,he,qe,Pt])=>{r(V),l(he),L(Pt),Ut(qe),V&&await Wi()}).catch(V=>Jn(lt("Load initial app data",V)))},[Ut]),ee.useEffect(()=>{const V=window.matchMedia("(prefers-color-scheme: dark)"),he=()=>$i(V.matches);return he(),V.addEventListener("change",he),()=>V.removeEventListener("change",he)},[]),ee.useEffect(()=>()=>Ht(),[Ht]),ee.useEffect(()=>{mi&&(Ht(),Ui(null))},[mi,Ht]),ee.useEffect(()=>{const V=me==="system"?qi?"dark":"light":me;document.documentElement.dataset.theme=V,document.documentElement.dataset.themeMode=me},[qi,me]),ee.useEffect(()=>{if(!(te!=null&&te.taskSlug)){de(null);return}ta(te.taskSlug).catch(V=>Jn(lt("Refresh Gate Review state",V)))},[te==null?void 0:te.taskSlug]),ee.useEffect(()=>{Gi.current="",yt(null),Hi("bypassPermissions"),qn("default"),$n("medium"),St(!1),sn(null),pi("bypassPermissions"),es("default"),Et("medium"),p(null),o(null),h(null),u(null),E(null)},[t==null?void 0:t.repoRoot]),nl(t?`project-runtime:${t.repoRoot}:${(te==null?void 0:te.taskSlug)??"no-task"}`:null,async()=>{try{const V=(t==null?void 0:t.repoRoot)??"",he=!!(t&&Gi.current!==V);await Gn({syncLaunchOptions:he}),he&&(Gi.current=V),na()}catch(V){ts("Poll project runtime state",V)}},{intervalMs:3e3,runImmediately:!0});const Kt=(te==null?void 0:te.taskSlug)??null,ns=Kt&&(ae==null?void 0:ae.taskSlug)===Kt?ae.state:null,Xi=Kt&&(q==null?void 0:q.taskSlug)===Kt?q.roundState:null,Qi=Kt&&(Mn==null?void 0:Mn.taskSlug)===Kt?Mn:null,hl=!!(Kt&&(ns!=null&&ns.activeGate||(Xi==null?void 0:Xi.activeRole)==="gate-reviewer"||Qi!=null&&Qi.hasGateReviewerSession));nl(hl&&Kt?`gate-review:${Kt}`:null,async()=>{if(Kt)try{await ta(Kt)}catch(V){ts("Poll Gate Review state",V)}},{intervalMs:3e3,runImmediately:!1});async function Ee(V,he="Run UI action"){Gs(!0),Jn("");try{await V()}catch(qe){Jn(lt(he,qe))}finally{Gs(!1)}}async function yi(){var Pt;if(!te)throw new Error("Create or select a task before closing it.");const V=[`Close task "${te.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- moves project-scoped Translator and Harness Engineer sessions to the base repository cwd",`- deletes the task worktree: ${te.worktreePath}`,`- deletes the Git branch: ${te.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(V))return;const qe=await Se.cleanupTask(te.taskSlug);N(null),I(null),ve(null),Q(null),ue(null),de(null),$s(Lr=>Lr+1),await Wi(),(Pt=qe.warnings)!=null&&Pt.length&&window.alert([`Task "${qe.taskSlug}" closed with cleanup warnings:`,"",...qe.warnings.map(Lr=>`- ${Lr}`)].join(`
97
- `))}const is=$&&$.taskSlug===(te==null?void 0:te.taskSlug)?$.messages:[],Dr=ie&&ie.taskSlug===(te==null?void 0:te.taskSlug)?ie.orchestration:null,Vo=_e&&_e.taskSlug===(te==null?void 0:te.taskSlug)?_e.events:[],ln=q&&q.taskSlug===(te==null?void 0:te.taskSlug)?q.roundState:null,Mr=te!=null&&te.taskSlug&&(ln!=null&&ln.roleRecovery)?Mk(te.taskSlug,ln.roleRecovery):null,Ji=ln!=null&&ln.roleRecovery&&ln.roleRecovery.status!=="failed"&&Mr!==Pi?Lk(ln.roleRecovery):null,Zi=ae&&ae.taskSlug===(te==null?void 0:te.taskSlug)?ae.state:null,fl=!!(Zi&&Object.values(Zi.gates).some(V=>V.required));return x.jsxs(a1,{sidebar:x.jsx(K2,{project:t,recentRepositoryPaths:s,tasks:Z,activeTaskSlug:(te==null?void 0:te.taskSlug)??null,messages:is,orchestration:Dr,events:Vo,roundState:ln,gateReview:Zi,translationEnabled:ol,translationAutoSendEnabled:Te,translationTargetLanguage:Ne,translationOutputMode:Fe,translationMemoryInitialized:vt,translatorSession:_n,harnessStatus:Vt,harnessBootstrapStatus:Ks,harnessApplyResult:y,autoTaskHarnessReviewEnabled:Rn,autoMemoryEnabled:ut,gatewayStatus:A,gatewayQrLogin:M,gatewayQrCheck:k,gatewayLarkRegistration:U,gatewayLarkRegistrationCheck:W,busy:ht,onConnect:V=>Ee(async()=>{const he=await Se.connectProject({repoPath:V});r(he),w(null),await Promise.all([Wi(),ea()])},"Connect repository"),onRefreshConnectedRepository:()=>Ee(async()=>{const V=await Se.getCurrentProject();r(V)},"Refresh connected repository"),onPullConnectedRepository:()=>Ee(async()=>{const V=await Se.pullCurrentProject();r(V)},"Pull connected repository"),onRefreshHarness:()=>Ee(async()=>{if(!te)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([Ki(te.taskSlug),yn(te.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>Ee(async()=>{if(!te)throw new Error("Create or select a task before applying VCM Harness.");const V=await Se.applyHarness({taskSlug:te.taskSlug});w(V),await Promise.all([Ki(te.taskSlug),yn(te.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:V=>Ee(async()=>{if(!te)throw new Error("Create or select a task before starting Harness Bootstrap.");const he=await Se.startHarnessBootstrap({taskSlug:te.taskSlug,cols:120,rows:32,...V});o(he.status),u(te.taskSlug),await Ln({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:V=>Ee(async()=>{if(!te)throw new Error("Create or select a task before restarting Harness Bootstrap.");const he=await Se.restartHarnessBootstrap({taskSlug:te.taskSlug,cols:120,rows:32,...V});o(he.status),u(te.taskSlug),await Ln({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>Ee(async()=>{const V=await Se.stopHarnessBootstrap();o(V),u((te==null?void 0:te.taskSlug)??null),await Ln()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>Ee(async()=>{if(!te)throw new Error("Create or select a task before running Harness Bootstrap.");const V=await Se.runHarnessBootstrap({taskSlug:te.taskSlug});o(V.status),u(te.taskSlug),await Ln()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>hi(!0),onOpenRepositoryDiff:()=>gn(!0),onAutoTaskHarnessReviewChange:V=>{gt(V),Ee(async()=>{const he=await Se.updateAppPreferences({autoTaskHarnessReviewEnabled:V});Ut(he)},"Update auto task harness review setting")},onAutoMemoryChange:V=>{Bt(V),Ee(async()=>{const he=await Se.updateAppPreferences({autoMemoryEnabled:V});Ut(he),await Gn()},"Update auto memory setting")},onRefreshGateway:()=>Ee(async()=>{await ni()},"Refresh Gateway status"),onGatewayEnabledChange:V=>{Ee(async()=>{const he=await Se.updateGatewaySettings({enabled:V,...V&&t?{currentProjectId:t.repoRoot,currentTaskSlug:(te==null?void 0:te.taskSlug)??null}:{}});L(he),V&&Ut(await Se.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:V=>Ee(async()=>{const he=await Se.updateGatewaySettings(V);L(he)},"Update Gateway settings"),onGatewayTranslationChange:V=>{Ee(async()=>{const he=await Se.updateGatewaySettings({translationEnabled:V});L(he)},"Update Gateway translation setting")},onGatewayConnectionChange:V=>{Ee(async()=>{const he=await Se.setGatewayConnection(V);L(he)},"Update Gateway connection setting")},onStartGatewayQrLogin:()=>{Ee(async()=>{const V=await Se.startGatewayQrLogin();D(V),R(null),H(!0),await ni()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{Ee(async()=>{const V=await Se.startGatewayLarkRegistration();P(V),K(null),Y(!0),await ni()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{Ee(async()=>{const V=await Se.resetGatewayBinding();L(V),D(null),R(null),H(!1),P(null),K(null),Y(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(V,he)=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before changing Gate Review Gates.");const qe=await Se.updateGateReviewSettings(te.taskSlug,{gates:{[V]:he}});de({taskSlug:te.taskSlug,state:qe})},`Update ${V} Gate Review setting`)},onTranslationEnabledChange:V=>{Ce(V),Ee(async()=>{const he=await Se.updateAppPreferences({translationEnabled:V});Ut(he)},"Update conversation translation setting")},onTranslationAutoSendChange:V=>{je(V),Ee(async()=>{const he=await Se.updateAppPreferences({translationAutoSendEnabled:V});Ut(he)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:V=>{pt(V),Ee(async()=>{const he=await Se.updateAppPreferences({translationTargetLanguage:V});Ut(he)},"Update translation target language")},onTranslationOutputModeChange:V=>{_t(V),Ee(async()=>{const he=await Se.updateAppPreferences({translationOutputMode:V});Ut(he)},"Update translation output mode")},onOpenFileTranslation:()=>mn(!0),onOpenTranslatorSession:()=>Ar(!0),onCreateTranslationBootstrap:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before running Translation Bootstrap.");await Se.createTranslationBootstrap({taskSlug:te.taskSlug,targetLanguage:Ne}),await _i(),await Yi()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before updating translation memory.");await Se.createTranslationMemoryUpdate({taskSlug:te.taskSlug,targetLanguage:Ne}),await _i(),await Yi()},"Create translation memory update task")},onCreateTask:V=>Ee(async()=>{const he=await Se.createTask(V);await Wi(),N(he.taskSlug)},"Create task"),onCloseTask:()=>{Ee(yi,"Close task")},onSelectTask:N,themeMode:me,onAutoOrchestrationChange:V=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before changing auto orchestration.");const he=await Se.updateOrchestrationState(te.taskSlug,{mode:V?"auto":"manual"});ve({taskSlug:te.taskSlug,orchestration:he})},"Update auto orchestration mode")},onThemeModeChange:V=>{Me(V),Ee(async()=>{const he=await Se.updateAppPreferences({themeMode:V});Ut(he)},"Update theme setting")},pauseAlertSound:De,onPauseAlertSoundChange:V=>{ke(V),V&&t_(),Ee(async()=>{const he=await Se.updateAppPreferences({flowPauseAlerts:V});Ut(he)},"Update pause alert sound setting")},roleRetryEnabled:Tt,onRoleRetryEnabledChange:V=>{xt(V),Ee(async()=>{const he=await Se.updateAppPreferences({roleRetryEnabled:V});Ut(he)},"Update CC retry setting")},permissionRequestMode:Nt,onPermissionRequestModeChange:V=>{rn(V),Ee(async()=>{const he=await Se.updateAppPreferences({permissionRequestMode:V});Ut(he)},"Update permission request setting")},launchTemplate:It,canSaveLaunchTemplate:an,canOneClickStart:Xs,onSaveLaunchTemplate:()=>{Ee(async()=>{if(!(bt!=null&&bt.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const V=await Se.updateAppPreferences({launchTemplate:{version:1,roles:bt.roles,autoOrchestration:bt.autoOrchestration}});Ut(V)},"Save launch template")},onOneClickStart:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before one-click start.");const V=await Se.oneClickStart(te.taskSlug);ve({taskSlug:te.taskSlug,orchestration:V.orchestration}),xe("project-manager"),await ii(te.taskSlug),await Wi(),$s(he=>he+1)},"One-click start role sessions")},onMarkAllMessagesDone:V=>{Ee(async()=>{const he=await Se.markAllMessagesDone(V);I({taskSlug:V,messages:he.messages}),await ii(V)},"Mark all role messages done")},onDeleteMessageHistory:V=>{Ee(async()=>{const he=await Se.deleteMessageHistory(V);I({taskSlug:V,messages:he.messages}),await ii(V)},"Delete role message history")}}),children:[x.jsx(T2,{}),Ii?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:Ii.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:Vi,children:"Confirm"})]})}):null,Ji&&Mr?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Ji}),x.jsx("button",{type:"button",onClick:()=>Fi(Mr),children:"Close"})]}):null,B&&M?x.jsx(Ak,{busy:ht,qrCheck:k,qrLogin:M,onCheck:()=>{Ee(async()=>{const V=await Se.checkGatewayQrLogin();R(V),(V.status==="confirmed"||V.status==="binded_redirect")&&H(!1),await ni()})},onClose:()=>H(!1)}):null,G&&U?x.jsx(Tk,{busy:ht,registration:U,registrationCheck:W,onCheck:()=>{Ee(async()=>{const V=await Se.checkGatewayLarkRegistration();K(V),V.gatewayStatus&&L(V.gatewayStatus),V.status==="confirmed"&&(Y(!1),await ni())},"Check Lark Gateway QR setup")},onManualBind:(V,he)=>{Ee(async()=>{const qe=await Se.bindGatewayLarkApp({appId:V,appSecret:he,larkDomain:"lark"});K(qe),qe.gatewayStatus&&L(qe.gatewayStatus),qe.status==="confirmed"&&(Y(!1),await ni())},"Bind Lark Gateway app")},onClose:()=>Y(!1)}):null,t&&te?x.jsx(bk,{task:te,activeRole:re,gateReviewerEnabled:fl,translationEnabled:ol,translationAutoSendEnabled:Te,translationTargetLanguage:Ne,launchTemplate:It,refreshNonce:Fo,onTaskChanged:async()=>{await Wi()},onActiveRoleChange:xe,onMessagesChanged:$o,onOrchestrationChanged:cl,onRoundStateChanged:Zs,onEventsChanged:ul,onLaunchStateChanged:Go}):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(m2,{open:Ze,taskSlug:(te==null?void 0:te.taskSlug)??null,targetLanguage:Ne,onClose:()=>mn(!1)}),x.jsx(T1,{open:ui,busy:ht,status:Vt,memoryState:qo,bootstrapStatus:Ks,engineerSession:Dn,permissionMode:ze,model:Tr,effort:vn,taskSlug:(te==null?void 0:te.taskSlug)??null,onClose:()=>hi(!1),onRefresh:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Ki(te.taskSlug),yn(te.taskSlug),Ln(),Se.getAutoMemoryState(te.taskSlug).then(V=>{v(V),S(te.taskSlug)})])},"Refresh Harness Studio")},onPermissionModeChange:pi,onModelChange:es,onEffortChange:Et,onEngineerStart:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before starting Harness Engineer.");const V=await Se.startHarnessEngineerSession({taskSlug:te.taskSlug,cols:120,rows:32,permissionMode:ze,model:Tr,effort:vn});sn(V),Wt(V)},"Start Harness Engineer")},onEngineerResume:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before resuming Harness Engineer.");const V=await Se.resumeHarnessEngineerSession({taskSlug:te.taskSlug,cols:120,rows:32,permissionMode:ze,model:Tr,effort:vn});sn(V),Wt(V)},"Resume Harness Engineer")},onEngineerRestart:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before restarting Harness Engineer.");const V=await Se.restartHarnessEngineerSession({taskSlug:te.taskSlug,cols:120,rows:32,permissionMode:ze,model:Tr,effort:vn});sn(V),Wt(V)},"Restart Harness Engineer")},onEngineerStop:()=>{Ee(async()=>{const V=await Se.stopHarnessEngineerSession();sn(V)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{Ee(async()=>{const V=await Se.notifyHarnessEngineerHarnessUpdated();sn(V),Wt(V)},"Notify Harness Engineer to reload harness")},onOpenRepositoryDiff:()=>gn(!0),onReviewTaskHarness:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before reviewing task harness.");const V=await Se.startTaskHarnessRetrospective({taskSlug:te.taskSlug,trigger:"manual"});E(V),await Ln({syncLaunchOptions:!0})},"Review task harness")},onMemoryStateChange:V=>{v(V),S((te==null?void 0:te.taskSlug)??null)}}),x.jsx(O1,{open:fi,taskSlug:(te==null?void 0:te.taskSlug)??null,onClose:()=>gn(!1)}),x.jsx(z1,{open:Zt,busy:ht,session:_n,permissionMode:di,model:en,effort:Qn,onClose:()=>Ar(!1),onPermissionModeChange:Hi,onModelChange:qn,onEffortChange:$n,onStart:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before starting Translator.");const V=await Se.startTranslatorSession({taskSlug:te.taskSlug,cols:100,rows:28,permissionMode:di,model:en,effort:Qn});yt(V),vi(V)},"Start Translator session")},onResume:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before resuming Translator.");const V=await Se.resumeTranslatorSession({taskSlug:te.taskSlug,cols:100,rows:28,permissionMode:di,model:en,effort:Qn});yt(V),vi(V)},"Resume Translator session")},onRestart:()=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before restarting Translator.");const V=await Se.restartTranslatorSession({taskSlug:te.taskSlug,cols:100,rows:28,permissionMode:di,model:en,effort:Qn});yt(V),vi(V)},"Restart Translator session")},onStop:()=>{Ee(async()=>{const V=await Se.stopTranslatorSession();yt(V)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{Ee(async()=>{const V=await Se.notifyTranslatorHarnessUpdated();yt(V),vi(V)},"Notify Translator to reload harness")}}),x.jsx(l1,{busy:ht,state:T,onCancel:V=>{Ee(async()=>{const he=await Se.decideHarnessFeedback({action:"cancel",taskSlug:te==null?void 0:te.taskSlug,comment:V});E(he)},"Cancel Harness feedback")},onApprove:V=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before approving Harness feedback.");const he=await Se.decideHarnessFeedback({action:"approve",taskSlug:te.taskSlug,comment:V});E(he),await Ln()},"Approve Harness feedback")},onComment:V=>{Ee(async()=>{if(!te)throw new Error("Create or select a task before sending Harness feedback comments.");const he=await Se.decideHarnessFeedback({action:"comment",taskSlug:te.taskSlug,comment:V});E(he),await Ln()},"Send Harness feedback comment")},onReject:V=>{Ee(async()=>{const he=await Se.decideHarnessFeedback({action:"reject",taskSlug:te==null?void 0:te.taskSlug,comment:V});E(he)},"Reject Harness feedback")}})]})}function Ak({busy:t,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[p,f]=ee.useState(""),[o,c]=ji("");return ee.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const m=Jr(0,"M");m.addData(d.qrcodeUrl),m.make(),h||f(m.createDataURL(8,2))}catch(m){h||c(lt("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:Ov(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 Tk({busy:t,onCheck:r,onClose:s,onManualBind:l,registration:d,registrationCheck:p}){const[f,o]=ee.useState(""),[c,h]=ji(""),[m,u]=ee.useState(""),[y,w]=ee.useState(""),[T,E]=ji("");return ee.useEffect(()=>{let b=!1;h(""),o("");try{const v=Jr(0,"M");v.addData(d.qrUrl),v.make(),b||o(v.createDataURL(8,2))}catch(v){b||h(lt("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:Ov(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 Ov(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 Xr=null;function Rk(t){const r=Date.parse(t.startedAt??""),s=Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return!Number.isFinite(r)||!Number.isFinite(s)?0:Math.max(0,s-r)}function Dk(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 Mk(t,r){return`${t}:${r.role}:${r.lastFailureAt}`}function Lk(t){const r=jk(t.role),s=Bv(t);return t.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次 · ${Nk(t.nextRetryAt)}`}function Ok(t,r){const s=Bv(t);return t.retryable===!1?`CC stopped for ${r}: ${Bk(t)} cannot be fixed by retrying.`:`CC retry failed after ${t.maxAttempts} attempts for ${r}${s}.`}function Bv(t){return!t.error||t.error==="unknown"?"":` · ${t.error}`}function Bk(t){return t.error&&t.error!=="unknown"?t.error:"this error"}function jk(t){return t.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function Nk(t){if(!t)return"即将重试";const r=Date.parse(t)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function t_(){const t=jv();return t?Nv(t):!1}async function Co(){const t=jv();if(!t||!await Nv(t))return!1;try{const s=t.createGain(),l=t.currentTime+.025;return s.gain.setValueAtTime(.85,t.currentTime),s.connect(t.destination),r_(t,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),r_(t,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function jv(){const t=window.AudioContext??window.webkitAudioContext;if(!t)return null;try{return(!Xr||Xr.state==="closed")&&(Xr=new t),Xr}catch{return null}}function n_(t){Xr=null,t&&t.state!=="closed"&&t.close().catch(()=>{})}async function Nv(t){if(i_(t))return!0;try{await t.resume();const r=i_(t);return!r&&t===Xr&&n_(t),r}catch{return t===Xr&&n_(t),!1}}function i_(t){return t.state==="running"}function r_(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 Hv=document.getElementById("root");if(!Hv)throw new Error("Missing #root element.");$0.createRoot(Hv).render(x.jsx(ee.StrictMode,{children:x.jsx(kk,{})}));
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 Kr({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 Mv(t,r){return t.find(s=>s.role===r)}function ok({activeRole:t,roles:r=Hh,sessions:s,onSelect:l}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const p=Mv(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(Kn,{status:f})]},d.name)})})}function ck({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=t1(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(zh,{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(jo,{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(u2,{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 _h=500;function jh(t){return{taskSlug:t,cursor:1,sessions:{}}}function uk(t,r,s){return t.sessions[r]??Fs(s)}function hk(t,r){const l={...mk(t,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...Fs(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const p=l[d.sessionId]??Fs(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=Ov(Lv(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 fk(t,r,s){return{...t,sessions:{...t.sessions,[r]:Fs(s)}}}function dk(t,r,s,l){const d=t.sessions[r]??Fs(s),p=Ov(Lv(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 pk(t,r,s,l){const d=t.sessions[r]??Fs(s);return{...t,sessions:{...t.sessions,[r]:{...d,role:s,failures:l}}}}function mk(t,r){return t.taskSlug===r?t:jh(r)}function Fs(t){return{role:t,status:"ready",entries:[],failures:[]}}function Lv(t,r){return t.findIndex(l=>l.id===r.id)===-1?[...t,r]:t.map(l=>l.id===r.id?r:l)}function Ov(t){if(t.length<=_h)return{entries:t,removedIds:new Set};const r=t.slice(0,t.length-_h);return{entries:t.slice(-_h),removedIds:new Set(r.map(s=>s.id))}}const gk={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",tester:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},_k={"project-manager":"default",architect:"default",coder:"default",tester:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},vk={"project-manager":"default",architect:"default",coder:"default",tester:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function yk({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]=ee.useState(null),[v,_]=ee.useState(()=>Jg(f)),[S,A]=ee.useState(()=>Zg(f)),[L,M]=ee.useState(()=>e_(f)),[D,k]=ee.useState(!1),[,R]=Ni(""),[O,H]=ee.useState([]),[U,P]=ee.useState(null),[W,K]=ee.useState(()=>jh(t.taskSlug)),G=ee.useRef(""),Y=ee.useRef(1),Z=ee.useMemo(()=>JSON.stringify(f),[f]),z=!!(E!=null&&E.sessions.some(he=>he.role==="gate-reviewer")),j=s||z,N=[...tl,...j?[o_]:[]],$=ee.useCallback((he,re)=>{P(re),m==null||m(he),u==null||u(re)},[m,u]),I=ee.useCallback((he,re,Ee,Be)=>{b(he),$(re,Ee),y==null||y(Be)},[$,y]),ie=ee.useCallback(async()=>{const he=await Se.getTaskWorkspaceState(t.taskSlug);I(he.taskStatus,he.messages,he.orchestration,he.roundState),Lo("Poll task workspace state"),R(re=>ko(re,["Load task workspace state","Poll task workspace state"]))},[I,t.taskSlug]),_e=ee.useCallback((he,re)=>{const Ee=Tv(he,re);Ee&&R(Ee)},[]);sl(`task-workspace:${t.taskSlug}:${o}`,()=>ie().catch(he=>{_e("Poll task workspace state",he)}),{intervalMs:3e3,runImmediately:!0}),sl(l?`task-translation-feed:${t.taskSlug}`:null,async()=>{try{const he=await Se.pollTranslationTaskFeed(t.taskSlug,Y.current);Y.current=he.nextCursor,K(re=>hk(re,he)),Lo("Poll task translation feed"),R(re=>ko(re,["Poll task translation feed"]))}catch(he){_e("Poll task translation feed",he)}},{intervalMs:1e3,runImmediately:!0}),ee.useEffect(()=>{H([]),w==null||w([])},[w,t.taskSlug]),ee.useEffect(()=>{Y.current=1,K(jh(t.taskSlug))},[t.taskSlug]),ee.useEffect(()=>{_(Jg(f)),A(Zg(f)),M(e_(f))},[Z,t.taskSlug]),ee.useEffect(()=>{E&&!j&&r==="gate-reviewer"&&h("project-manager"),E&&r==="translator"&&h("project-manager")},[r,j,h,E]),ee.useEffect(()=>{const he=E==null?void 0:E.task;if(!he||he.taskSlug!==t.taskSlug)return;const re=Qg(he);if(re===Qg(t)){G.current="";return}G.current!==re&&(G.current=re,c().catch(Ee=>{G.current="",R(lt("Refresh task list after task status changed",Ee))}))},[c,E==null?void 0:E.task,t]),ee.useEffect(()=>{const he=(E==null?void 0:E.sessions)??[],re=he.filter(Te=>Sk(Te.role)),Ee=new Set(re.map(Te=>Te.role)),Be=he.some(Te=>Te.role==="gate-reviewer"),ve={};for(const Te of qs)ve[Te.name]={permissionMode:v[Te.name],model:S[Te.name],effort:L[Te.name]};T==null||T({taskSlug:t.taskSlug,roles:ve,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!E,sessionCount:re.length,hasAnySession:re.length>0,hasGateReviewerSession:Be,allRolesHaveSession:tl.every(Te=>Ee.has(Te.name))})},[S,L,T,U==null?void 0:U.mode,v,E,t.taskSlug]);async function ge(he,re="Run role session action"){k(!0),R("");try{await he(),await ie(),await c()}catch(Ee){R(lt(re,Ee))}finally{k(!1)}}function Q(he){H(re=>{const Ee=[...re,`${new Date().toLocaleTimeString()} ${he}`];return w==null||w(Ee),Ee})}function q(he,re){_(Ee=>({...Ee,[he]:re}))}function ue(he,re){A(Ee=>({...Ee,[he]:re}))}function le(he,re){M(Ee=>({...Ee,[he]:re}))}return x.jsxs("div",{className:"task-workspace",children:[x.jsxs("header",{className:"workspace-header",children:[x.jsx("div",{className:"workspace-title-line",children:x.jsx("h1",{children:t.title||t.taskSlug})}),x.jsx(ok,{activeRole:r,roles:N,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:N.map(he=>{const re=he.name,Ee=re===r,Be=(E==null?void 0:E.sessions)??[],ve=Mv(Be,re),Te=ve?uk(W,ve.id,re):void 0;return x.jsx("div",{className:Ee?"role-console-panel is-active":"role-console-panel","aria-hidden":!Ee,children:x.jsx(ck,{role:re,session:ve,permissionMode:v[re],model:S[re],effort:L[re],active:Ee,busy:D,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:p,translationPanelState:Te,onClearTranslationSession:(xe,Tt)=>{K(xt=>fk(xt,xe,Tt))},onTranslationEntry:(xe,Tt,xt)=>{K(Nt=>dk(Nt,xe,Tt,xt))},onTranslationFailures:(xe,Tt,xt)=>{K(Nt=>pk(Nt,xe,Tt,xt))},onPermissionModeChange:xe=>q(re,xe),onModelChange:xe=>ue(re,xe),onEffortChange:xe=>le(re,xe),onStart:()=>void ge(async()=>{await Se.startRoleSession(t.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:L[re]}),Q(`started ${re} with ${v[re]} / ${S[re]} / ${L[re]}`)},`Start ${re} session`),onResume:()=>void ge(async()=>{await Se.resumeRoleSession(t.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:L[re]}),Q(`resumed ${re} with ${v[re]} / ${S[re]} / ${L[re]}`)},`Resume ${re} session`),onStop:()=>void ge(async()=>{await Se.stopRoleSession(t.taskSlug,re),Q(`stopped ${re}`)},`Stop ${re} session`),onRestart:()=>void ge(async()=>{await Se.restartRoleSession(t.taskSlug,re,{cols:100,rows:28,permissionMode:v[re],model:S[re],effort:L[re]}),Q(`restarted ${re} with ${v[re]} / ${S[re]} / ${L[re]}`)},`Restart ${re} session`),onNotifyHarnessUpdated:()=>void ge(async()=>{await Se.notifyRoleHarnessUpdated(t.taskSlug,re),Q(`notified ${re} to reload latest harness`)},`Notify ${re} to reload harness`),onTerminalEvent:xe=>Q(`${he.label}: ${xe}`)})},re)})})})})]})}function Sk(t){return tl.some(r=>r.name===t)}function Qg(t){return[t.status,t.updatedAt,t.cleanupStatus??"",t.cleanedAt??""].join(":")}function Jg(t){var s;const r={...gk};for(const l of qs)r[l.name]=((s=t.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function Zg(t){var s;const r={..._k};for(const l of qs)r[l.name]=((s=t.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function e_(t){var s;const r={...vk};for(const l of qs)r[l.name]=((s=t.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const bk=120*1e3,t_=1400,Ck=3;function wk(t){return!!(t!=null&&t.initialized)}function xk(){const[t,r]=ee.useState(null),[s,l]=ee.useState([]),[d,p]=ee.useState(null),[f,o]=ee.useState(null),[c,h]=ee.useState(null),[m,u]=ee.useState(null),[y,w]=ee.useState(null),[T,E]=ee.useState(null),[b,v]=ee.useState(null),[_,S]=ee.useState(null),[A,L]=ee.useState(null),[M,D]=ee.useState(null),[k,R]=ee.useState(null),[O,H]=ee.useState(!1),[U,P]=ee.useState(null),[W,K]=ee.useState(null),[G,Y]=ee.useState(!1),[Z,z]=ee.useState([]),[j,N]=ee.useState(null),[$,I]=ee.useState(null),[ie,_e]=ee.useState(null),[ge,Q]=ee.useState(null),[q,ue]=ee.useState(null),[le,he]=ee.useState(null),[re,Ee]=ee.useState("project-manager"),[Be,ve]=ee.useState("system"),[Te,xe]=ee.useState(!0),[Tt,xt]=ee.useState(!0),[Nt,rn]=ee.useState("off"),[Dn,gt]=ee.useState(!1),[ut,Bt]=ee.useState(!1),[fe,Ce]=ee.useState(!1),[Ae,je]=ee.useState(!1),[Ne,dt]=ee.useState(n1),[qe,_t]=ee.useState(i1),[vt,St]=ee.useState(!1),[Ze,gn]=ee.useState(!1),[Jt,kr]=ee.useState(!1),[hi,fi]=ee.useState(!1),[di,_n]=ee.useState(!1),[vn,yt]=ee.useState(null),[pi,zi]=ee.useState("bypassPermissions"),[Zt,qn]=ee.useState("default"),[Xn,$n]=ee.useState("medium"),[Mn,sn]=ee.useState(null),[ze,mi]=ee.useState("bypassPermissions"),[Ar,Zr]=ee.useState("default"),[yn,Et]=ee.useState("medium"),[It,Ii]=ee.useState(()=>s1()),[Ln,Po]=ee.useState(null),[Fo,Vs]=ee.useState(0),[Ui,Pi]=ee.useState(null),[Fi,qi]=ee.useState(null),[$i,Gi]=ee.useState(!1),[pt,Ws]=ee.useState(!1),[,Qn]=Ni(""),Jn=ee.useRef({}),Zn=ee.useRef({}),cl=ee.useRef({}),Ks=ee.useRef({}),Ys=ee.useRef({}),ei=ee.useRef(null),Vi=ee.useRef(""),ne=ee.useMemo(()=>T2(Z,j),[Z,j]),bt=(Ln==null?void 0:Ln.taskSlug)===(ne==null?void 0:ne.taskSlug)?Ln:null,Gt=c===(ne==null?void 0:ne.taskSlug)?d:null,Xs=m===(ne==null?void 0:ne.taskSlug)?f:null,qo=_===(ne==null?void 0:ne.taskSlug)?b:null,Qs=!!(t&&ne&&wk(Gt)),ul=(vn==null?void 0:vn.status)==="running",gi=!!(A!=null&&A.enabled),hl=!!(fe&&Qs&&ul),an=!!(bt!=null&&bt.statusLoaded),Js=!!(ne&&(bt!=null&&bt.statusLoaded)&&!bt.hasAnySession),Ut=ee.useCallback(V=>{ve(V.themeMode),xe(V.flowPauseAlerts),xt(V.roleRetryEnabled),rn(V.permissionRequestMode),gt(V.autoTaskHarnessReviewEnabled),Bt(V.autoMemoryEnabled),Ce(V.translationEnabled),je(V.translationAutoSendEnabled),dt(V.translationTargetLanguage),_t(V.translationOutputMode),Ii(V.launchTemplate)},[]);ee.useEffect(()=>{if(!Te)return;let V=!1;const de=()=>{V||(V=!0,n_(),window.removeEventListener("pointerdown",de),window.removeEventListener("keydown",de))};return window.addEventListener("pointerdown",de),window.addEventListener("keydown",de),()=>{window.removeEventListener("pointerdown",de),window.removeEventListener("keydown",de)}},[Te]);const Ht=ee.useCallback(()=>{ei.current!==null&&(window.clearInterval(ei.current),ei.current=null)},[]),_i=ee.useCallback(()=>{Ht(),wo(),ei.current=window.setInterval(()=>{wo()},t_)},[Ht]),Zs=ee.useCallback(()=>{Ht();let V=1;wo(),ei.current=window.setInterval(()=>{V+=1,wo(),V>=Ck&&ei.current!==null&&(window.clearInterval(ei.current),ei.current=null)},t_)},[Ht]),ea=ee.useCallback((V,de=`manual-${Date.now()}`,Fe={})=>{Pi({id:de,text:V}),Fe.sound==="strong"?_i():Fe.sound==="weak"?Zs():Ht()},[Zs,_i,Ht]),Wi=ee.useCallback(()=>{Ht(),Pi(null)},[Ht]);ee.useEffect(()=>{ne!=null&&ne.taskSlug&&(Ys.current[ne.taskSlug]=Date.now())},[ne==null?void 0:ne.taskSlug]);const $o=ee.useCallback(V=>{ne!=null&&ne.taskSlug&&I({taskSlug:ne.taskSlug,messages:V})},[ne==null?void 0:ne.taskSlug]),fl=ee.useCallback(V=>{cl.current[V.taskSlug]=V.mode,ne!=null&&ne.taskSlug&&_e({taskSlug:ne.taskSlug,orchestration:V})},[ne==null?void 0:ne.taskSlug]),dl=ee.useCallback(V=>{ne!=null&&ne.taskSlug&&Q({taskSlug:ne.taskSlug,events:V})},[ne==null?void 0:ne.taskSlug]),ta=ee.useCallback(V=>{if(!(ne!=null&&ne.taskSlug)||V.taskSlug!==ne.taskSlug)return;ue({taskSlug:V.taskSlug,roundState:V});const de=R2({mode:cl.current[V.taskSlug],status:V.status,activeRole:V.activeRole,lastFollowedRole:Ks.current[V.taskSlug]});de&&(Ks.current[V.taskSlug]=de,Ee(de));const Fe=D2(V,Mk);if(Fe===null){Zn.current[V.taskSlug]={status:V.status};return}const en=M2(V),Mr=Jn.current[V.taskSlug],Ko=Zn.current[V.taskSlug];if(Zn.current[V.taskSlug]={status:V.status},Mr===en||(Jn.current[V.taskSlug]=en,!Tk(V,Ko,Ys.current[V.taskSlug])))return;if(gi){Ht(),Pi(null);return}const Yo=Te?Ak(V)>=bk?"strong":"weak":"none";ea(Fe,en,{sound:Yo})},[ne==null?void 0:ne.taskSlug,gi,Te,ea,Ht]),Go=ee.useCallback(V=>{Po(de=>(de==null?void 0:de.taskSlug)===V.taskSlug&&de.statusLoaded===V.statusLoaded&&de.sessionCount===V.sessionCount&&de.hasAnySession===V.hasAnySession&&de.hasGateReviewerSession===V.hasGateReviewerSession&&de.allRolesHaveSession===V.allRolesHaveSession&&de.autoOrchestration===V.autoOrchestration&&JSON.stringify(de.roles)===JSON.stringify(V.roles)?de:V)},[]);async function Ki(){const V=await Se.listTasks();return z(V),N(de=>{var Fe;return de&&V.some(en=>en.taskSlug===de)?de:((Fe=V[0])==null?void 0:Fe.taskSlug)??null}),V}async function Yi(V=ne==null?void 0:ne.taskSlug){if(!V)return p(null),h(null),null;const de=await Se.getHarnessStatus(V);return p(de),h(V),de}async function Sn(V=ne==null?void 0:ne.taskSlug){if(!V)return o(null),u(null),null;const de=await Se.getHarnessBootstrapStatus(V);return o(de),u(V),de}async function ti(){const V=await Se.getGatewayStatus();return L(V),V}async function na(){const V=await Se.getRecentRepositoryPaths();return l(V),V}async function vi(){if(!t)return St(!1),!1;const V=await Se.getTranslationState();return St(V.memoryInitialized),V.memoryInitialized}async function ni(V){const[de,Fe]=await Promise.all([Se.listMessages(V),Se.getOrchestrationState(V)]);I({taskSlug:V,messages:de}),_e({taskSlug:V,orchestration:Fe})}async function ia(V){const de=await Se.getGateReviewState(V);return he({taskSlug:V,state:de}),Lo("Poll Gate Review state"),Qn(Fe=>ko(Fe,["Refresh Gate Review state","Poll Gate Review state"])),de}function es(V,de){const Fe=Tv(V,de);Fe&&Qn(Fe)}function yi(V){V&&(zi(V.permissionMode),V.model&&qn(V.model),V.effort&&$n(V.effort))}async function Xi(V={}){const de=await Se.getTranslatorSession();return yt(de),V.syncLaunchOptions&&yi(de),de}function Vt(V){V&&(mi(V.permissionMode),V.model&&Zr(V.model),V.effort&&Et(V.effort))}async function ii(V={}){const de=await Se.getHarnessEngineerSession();return sn(de),V.syncLaunchOptions&&Vt(de),de}async function Tr(V=ne==null?void 0:ne.taskSlug){if(!t)return E(null),null;const de=await Se.getHarnessFeedbackState(V);return E(de),de}function ri(V,de,Fe={}){var en;yt(V.translatorSession),St(!!((en=V.translationState)!=null&&en.memoryInitialized)),sn(V.harnessEngineerSession),E(V.harnessFeedbackState),v(V.autoMemoryState),S(de&&V.autoMemoryState?de:null),L(V.gatewayStatus),de&&V.harnessStatus?(p(V.harnessStatus),h(de)):(p(null),h(null)),de&&V.harnessBootstrapStatus?(o(V.harnessBootstrapStatus),u(de)):(o(null),u(null)),Fe.syncLaunchOptions&&(yi(V.translatorSession),Vt(V.harnessEngineerSession))}async function ts(V={}){if(!t)return yt(null),St(!1),sn(null),p(null),o(null),h(null),u(null),E(null),v(null),S(null),null;const de=(ne==null?void 0:ne.taskSlug)??null,Fe=await Se.getProjectRuntimeState(de);return ri(Fe,de,V),Fe}function ns(){const V=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const de of V)Lo(de);Qn(de=>ko(de,V))}ee.useEffect(()=>{Promise.all([Se.getCurrentProject(),Se.getRecentRepositoryPaths(),Se.getAppPreferences(),Se.getGatewayStatus()]).then(async([V,de,Fe,en])=>{r(V),l(de),L(en),Ut(Fe),V&&await Ki()}).catch(V=>Qn(lt("Load initial app data",V)))},[Ut]),ee.useEffect(()=>{const V=window.matchMedia("(prefers-color-scheme: dark)"),de=()=>Gi(V.matches);return de(),V.addEventListener("change",de),()=>V.removeEventListener("change",de)},[]),ee.useEffect(()=>()=>Ht(),[Ht]),ee.useEffect(()=>{gi&&(Ht(),Pi(null))},[gi,Ht]),ee.useEffect(()=>{const V=Be==="system"?$i?"dark":"light":Be;document.documentElement.dataset.theme=V,document.documentElement.dataset.themeMode=Be},[$i,Be]),ee.useEffect(()=>{if(!(ne!=null&&ne.taskSlug)){he(null);return}ia(ne.taskSlug).catch(V=>Qn(lt("Refresh Gate Review state",V)))},[ne==null?void 0:ne.taskSlug]),ee.useEffect(()=>{Vi.current="",yt(null),zi("bypassPermissions"),qn("default"),$n("medium"),St(!1),sn(null),mi("bypassPermissions"),Zr("default"),Et("medium"),p(null),o(null),h(null),u(null),E(null)},[t==null?void 0:t.repoRoot]),sl(t?`project-runtime:${t.repoRoot}:${(ne==null?void 0:ne.taskSlug)??"no-task"}`:null,async()=>{try{const V=(t==null?void 0:t.repoRoot)??"",de=!!(t&&Vi.current!==V);await ts({syncLaunchOptions:de}),de&&(Vi.current=V),ns()}catch(V){es("Poll project runtime state",V)}},{intervalMs:3e3,runImmediately:!0});const ln=(ne==null?void 0:ne.taskSlug)??null,Qi=ln&&(le==null?void 0:le.taskSlug)===ln?le.state:null,Ji=ln&&(q==null?void 0:q.taskSlug)===ln?q.roundState:null,is=ln&&(Ln==null?void 0:Ln.taskSlug)===ln?Ln:null,Wt=!!(ln&&(Qi!=null&&Qi.activeGate||(Ji==null?void 0:Ji.activeRole)==="gate-reviewer"||is!=null&&is.hasGateReviewerSession));sl(Wt&&ln?`gate-review:${ln}`:null,async()=>{if(ln)try{await ia(ln)}catch(V){es("Poll Gate Review state",V)}},{intervalMs:3e3,runImmediately:!1});async function De(V,de="Run UI action"){Ws(!0),Qn("");try{await V()}catch(Fe){Qn(lt(de,Fe))}finally{Ws(!1)}}async function rs(){var en;if(!ne)throw new Error("Create or select a task before closing it.");const V=[`Close task "${ne.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- moves project-scoped Translator and Harness Engineer sessions to the base repository cwd",`- deletes the task worktree: ${ne.worktreePath}`,`- deletes the Git branch: ${ne.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(V))return;const Fe=await Se.cleanupTask(ne.taskSlug);N(null),I(null),_e(null),Q(null),ue(null),he(null),Vs(Mr=>Mr+1),await Ki(),(en=Fe.warnings)!=null&&en.length&&window.alert([`Task "${Fe.taskSlug}" closed with cleanup warnings:`,"",...Fe.warnings.map(Mr=>`- ${Mr}`)].join(`
97
+ `))}const Rr=$&&$.taskSlug===(ne==null?void 0:ne.taskSlug)?$.messages:[],Vo=ie&&ie.taskSlug===(ne==null?void 0:ne.taskSlug)?ie.orchestration:null,ra=ge&&ge.taskSlug===(ne==null?void 0:ne.taskSlug)?ge.events:[],on=q&&q.taskSlug===(ne==null?void 0:ne.taskSlug)?q.roundState:null,Si=ne!=null&&ne.taskSlug&&(on!=null&&on.roleRecovery)?Rk(ne.taskSlug,on.roleRecovery):null,Dr=on!=null&&on.roleRecovery&&on.roleRecovery.status!=="failed"&&Si!==Fi?Dk(on.roleRecovery):null,ss=le&&le.taskSlug===(ne==null?void 0:ne.taskSlug)?le.state:null,Wo=!!(ss&&Object.values(ss.gates).some(V=>V.required));return x.jsxs(a1,{sidebar:x.jsx(V2,{project:t,recentRepositoryPaths:s,tasks:Z,activeTaskSlug:(ne==null?void 0:ne.taskSlug)??null,messages:Rr,orchestration:Vo,events:ra,roundState:on,gateReview:ss,translationEnabled:hl,translationAutoSendEnabled:Ae,translationTargetLanguage:Ne,translationOutputMode:qe,translationMemoryInitialized:vt,translatorSession:vn,harnessStatus:Gt,harnessBootstrapStatus:Xs,harnessApplyResult:y,autoTaskHarnessReviewEnabled:Dn,autoMemoryEnabled:ut,gatewayStatus:A,gatewayQrLogin:M,gatewayQrCheck:k,gatewayLarkRegistration:U,gatewayLarkRegistrationCheck:W,busy:pt,onConnect:V=>De(async()=>{const de=await Se.connectProject({repoPath:V});r(de),w(null),await Promise.all([Ki(),na()])},"Connect repository"),onRefreshConnectedRepository:()=>De(async()=>{const V=await Se.getCurrentProject();r(V)},"Refresh connected repository"),onPullConnectedRepository:()=>De(async()=>{const V=await Se.pullCurrentProject();r(V)},"Pull connected repository"),onRefreshHarness:()=>De(async()=>{if(!ne)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([Yi(ne.taskSlug),Sn(ne.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>De(async()=>{if(!ne)throw new Error("Create or select a task before applying VCM Harness.");const V=await Se.applyHarness({taskSlug:ne.taskSlug});w(V),await Promise.all([Yi(ne.taskSlug),Sn(ne.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:V=>De(async()=>{if(!ne)throw new Error("Create or select a task before starting Harness Bootstrap.");const de=await Se.startHarnessBootstrap({taskSlug:ne.taskSlug,cols:120,rows:32,...V});o(de.status),u(ne.taskSlug),await ii({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:V=>De(async()=>{if(!ne)throw new Error("Create or select a task before restarting Harness Bootstrap.");const de=await Se.restartHarnessBootstrap({taskSlug:ne.taskSlug,cols:120,rows:32,...V});o(de.status),u(ne.taskSlug),await ii({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>De(async()=>{const V=await Se.stopHarnessBootstrap();o(V),u((ne==null?void 0:ne.taskSlug)??null),await ii()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>De(async()=>{if(!ne)throw new Error("Create or select a task before running Harness Bootstrap.");const V=await Se.runHarnessBootstrap({taskSlug:ne.taskSlug});o(V.status),u(ne.taskSlug),await ii()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>fi(!0),onOpenRepositoryDiff:()=>_n(!0),onAutoTaskHarnessReviewChange:V=>{gt(V),De(async()=>{const de=await Se.updateAppPreferences({autoTaskHarnessReviewEnabled:V});Ut(de)},"Update auto task harness review setting")},onAutoMemoryChange:V=>{Bt(V),De(async()=>{const de=await Se.updateAppPreferences({autoMemoryEnabled:V});Ut(de),await ts()},"Update auto memory setting")},onRefreshGateway:()=>De(async()=>{await ti()},"Refresh Gateway status"),onGatewayEnabledChange:V=>{De(async()=>{const de=await Se.updateGatewaySettings({enabled:V,...V&&t?{currentProjectId:t.repoRoot,currentTaskSlug:(ne==null?void 0:ne.taskSlug)??null}:{}});L(de),V&&Ut(await Se.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:V=>De(async()=>{const de=await Se.updateGatewaySettings(V);L(de)},"Update Gateway settings"),onGatewayTranslationChange:V=>{De(async()=>{const de=await Se.updateGatewaySettings({translationEnabled:V});L(de)},"Update Gateway translation setting")},onGatewayConnectionChange:V=>{De(async()=>{const de=await Se.setGatewayConnection(V);L(de)},"Update Gateway connection setting")},onStartGatewayQrLogin:()=>{De(async()=>{const V=await Se.startGatewayQrLogin();D(V),R(null),H(!0),await ti()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{De(async()=>{const V=await Se.startGatewayLarkRegistration();P(V),K(null),Y(!0),await ti()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{De(async()=>{const V=await Se.resetGatewayBinding();L(V),D(null),R(null),H(!1),P(null),K(null),Y(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(V,de)=>{De(async()=>{if(!ne)throw new Error("Create or select a task before changing Gate Review Gates.");const Fe=await Se.updateGateReviewSettings(ne.taskSlug,{gates:{[V]:de}});he({taskSlug:ne.taskSlug,state:Fe})},`Update ${V} Gate Review setting`)},onTranslationEnabledChange:V=>{Ce(V),De(async()=>{const de=await Se.updateAppPreferences({translationEnabled:V});Ut(de)},"Update conversation translation setting")},onTranslationAutoSendChange:V=>{je(V),De(async()=>{const de=await Se.updateAppPreferences({translationAutoSendEnabled:V});Ut(de)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:V=>{dt(V),De(async()=>{const de=await Se.updateAppPreferences({translationTargetLanguage:V});Ut(de)},"Update translation target language")},onTranslationOutputModeChange:V=>{_t(V),De(async()=>{const de=await Se.updateAppPreferences({translationOutputMode:V});Ut(de)},"Update translation output mode")},onOpenFileTranslation:()=>gn(!0),onOpenTranslatorSession:()=>kr(!0),onCreateTranslationBootstrap:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before running Translation Bootstrap.");await Se.createTranslationBootstrap({taskSlug:ne.taskSlug,targetLanguage:Ne}),await vi(),await Xi()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before updating translation memory.");await Se.createTranslationMemoryUpdate({taskSlug:ne.taskSlug,targetLanguage:Ne}),await vi(),await Xi()},"Create translation memory update task")},onCreateTask:V=>De(async()=>{const de=await Se.createTask(V);await Ki(),N(de.taskSlug)},"Create task"),onCloseTask:()=>{De(rs,"Close task")},onSelectTask:N,themeMode:Be,onAutoOrchestrationChange:V=>{De(async()=>{if(!ne)throw new Error("Create or select a task before changing auto orchestration.");const de=await Se.updateOrchestrationState(ne.taskSlug,{mode:V?"auto":"manual"});_e({taskSlug:ne.taskSlug,orchestration:de})},"Update auto orchestration mode")},onThemeModeChange:V=>{ve(V),De(async()=>{const de=await Se.updateAppPreferences({themeMode:V});Ut(de)},"Update theme setting")},pauseAlertSound:Te,onPauseAlertSoundChange:V=>{xe(V),V&&n_(),De(async()=>{const de=await Se.updateAppPreferences({flowPauseAlerts:V});Ut(de)},"Update pause alert sound setting")},roleRetryEnabled:Tt,onRoleRetryEnabledChange:V=>{xt(V),De(async()=>{const de=await Se.updateAppPreferences({roleRetryEnabled:V});Ut(de)},"Update CC retry setting")},permissionRequestMode:Nt,onPermissionRequestModeChange:V=>{rn(V),De(async()=>{const de=await Se.updateAppPreferences({permissionRequestMode:V});Ut(de)},"Update permission request setting")},launchTemplate:It,canSaveLaunchTemplate:an,canOneClickStart:Js,onSaveLaunchTemplate:()=>{De(async()=>{if(!(bt!=null&&bt.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const V=await Se.updateAppPreferences({launchTemplate:{version:1,roles:bt.roles,autoOrchestration:bt.autoOrchestration}});Ut(V)},"Save launch template")},onOneClickStart:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before one-click start.");const V=await Se.oneClickStart(ne.taskSlug);_e({taskSlug:ne.taskSlug,orchestration:V.orchestration}),Ee("project-manager"),await ni(ne.taskSlug),await Ki(),Vs(de=>de+1)},"One-click start role sessions")},onMarkAllMessagesDone:V=>{De(async()=>{const de=await Se.markAllMessagesDone(V);I({taskSlug:V,messages:de.messages}),await ni(V)},"Mark all role messages done")},onDeleteMessageHistory:V=>{De(async()=>{const de=await Se.deleteMessageHistory(V);I({taskSlug:V,messages:de.messages}),await ni(V)},"Delete role message history")}}),children:[x.jsx(k2,{}),Ui?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:Ui.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:Wi,children:"Confirm"})]})}):null,Dr&&Si?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Dr}),x.jsx("button",{type:"button",onClick:()=>qi(Si),children:"Close"})]}):null,O&&M?x.jsx(Ek,{busy:pt,qrCheck:k,qrLogin:M,onCheck:()=>{De(async()=>{const V=await Se.checkGatewayQrLogin();R(V),(V.status==="confirmed"||V.status==="binded_redirect")&&H(!1),await ti()})},onClose:()=>H(!1)}):null,G&&U?x.jsx(kk,{busy:pt,registration:U,registrationCheck:W,onCheck:()=>{De(async()=>{const V=await Se.checkGatewayLarkRegistration();K(V),V.gatewayStatus&&L(V.gatewayStatus),V.status==="confirmed"&&(Y(!1),await ti())},"Check Lark Gateway QR setup")},onManualBind:(V,de)=>{De(async()=>{const Fe=await Se.bindGatewayLarkApp({appId:V,appSecret:de,larkDomain:"lark"});K(Fe),Fe.gatewayStatus&&L(Fe.gatewayStatus),Fe.status==="confirmed"&&(Y(!1),await ti())},"Bind Lark Gateway app")},onClose:()=>Y(!1)}):null,t&&ne?x.jsx(yk,{task:ne,activeRole:re,gateReviewerEnabled:Wo,translationEnabled:hl,translationAutoSendEnabled:Ae,translationTargetLanguage:Ne,launchTemplate:It,refreshNonce:Fo,onTaskChanged:async()=>{await Ki()},onActiveRoleChange:Ee,onMessagesChanged:$o,onOrchestrationChanged:fl,onRoundStateChanged:ta,onEventsChanged:dl,onLaunchStateChanged:Go}):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(d2,{open:Ze,taskSlug:(ne==null?void 0:ne.taskSlug)??null,targetLanguage:Ne,onClose:()=>gn(!1)}),x.jsx(E1,{open:hi,busy:pt,status:Gt,feedbackState:T,memoryState:qo,bootstrapStatus:Xs,engineerSession:Mn,permissionMode:ze,model:Ar,effort:yn,taskSlug:(ne==null?void 0:ne.taskSlug)??null,onClose:()=>fi(!1),onRefresh:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Yi(ne.taskSlug),Sn(ne.taskSlug),ii(),Tr(ne.taskSlug),Se.getAutoMemoryState(ne.taskSlug).then(V=>{v(V),S(ne.taskSlug)})])},"Refresh Harness Studio")},onPermissionModeChange:mi,onModelChange:Zr,onEffortChange:Et,onEngineerStart:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before starting Harness Engineer.");const V=await Se.startHarnessEngineerSession({taskSlug:ne.taskSlug,cols:120,rows:32,permissionMode:ze,model:Ar,effort:yn});sn(V),Vt(V)},"Start Harness Engineer")},onEngineerResume:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before resuming Harness Engineer.");const V=await Se.resumeHarnessEngineerSession({taskSlug:ne.taskSlug,cols:120,rows:32,permissionMode:ze,model:Ar,effort:yn});sn(V),Vt(V)},"Resume Harness Engineer")},onEngineerRestart:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before restarting Harness Engineer.");const V=await Se.restartHarnessEngineerSession({taskSlug:ne.taskSlug,cols:120,rows:32,permissionMode:ze,model:Ar,effort:yn});sn(V),Vt(V)},"Restart Harness Engineer")},onEngineerStop:()=>{De(async()=>{const V=await Se.stopHarnessEngineerSession();sn(V)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{De(async()=>{const V=await Se.notifyHarnessEngineerHarnessUpdated();sn(V),Vt(V)},"Notify Harness Engineer to reload harness")},onOpenRepositoryDiff:()=>_n(!0),onReviewTaskHarness:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before reviewing task harness.");const V=await Se.startTaskHarnessRetrospective({taskSlug:ne.taskSlug,trigger:"manual"});E(V),await ii({syncLaunchOptions:!0})},"Review task harness")},onMemoryStateChange:V=>{v(V),S((ne==null?void 0:ne.taskSlug)??null)}}),x.jsx(M1,{open:di,taskSlug:(ne==null?void 0:ne.taskSlug)??null,onClose:()=>_n(!1)}),x.jsx(N1,{open:Jt,busy:pt,session:vn,permissionMode:pi,model:Zt,effort:Xn,onClose:()=>kr(!1),onPermissionModeChange:zi,onModelChange:qn,onEffortChange:$n,onStart:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before starting Translator.");const V=await Se.startTranslatorSession({taskSlug:ne.taskSlug,cols:100,rows:28,permissionMode:pi,model:Zt,effort:Xn});yt(V),yi(V)},"Start Translator session")},onResume:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before resuming Translator.");const V=await Se.resumeTranslatorSession({taskSlug:ne.taskSlug,cols:100,rows:28,permissionMode:pi,model:Zt,effort:Xn});yt(V),yi(V)},"Resume Translator session")},onRestart:()=>{De(async()=>{if(!ne)throw new Error("Create or select a task before restarting Translator.");const V=await Se.restartTranslatorSession({taskSlug:ne.taskSlug,cols:100,rows:28,permissionMode:pi,model:Zt,effort:Xn});yt(V),yi(V)},"Restart Translator session")},onStop:()=>{De(async()=>{const V=await Se.stopTranslatorSession();yt(V)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{De(async()=>{const V=await Se.notifyTranslatorHarnessUpdated();yt(V),yi(V)},"Notify Translator to reload harness")}})]})}function Ek({busy:t,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[p,f]=ee.useState(""),[o,c]=Ni("");return ee.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const m=Qr(0,"M");m.addData(d.qrcodeUrl),m.make(),h||f(m.createDataURL(8,2))}catch(m){h||c(lt("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:Bv(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]=ee.useState(""),[c,h]=Ni(""),[m,u]=ee.useState(""),[y,w]=ee.useState(""),[T,E]=Ni("");return ee.useEffect(()=>{let b=!1;h(""),o("");try{const v=Qr(0,"M");v.addData(d.qrUrl),v.make(),b||o(v.createDataURL(8,2))}catch(v){b||h(lt("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:Bv(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 Bv(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 Yr=null;function Ak(t){const r=Date.parse(t.startedAt??""),s=Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return!Number.isFinite(r)||!Number.isFinite(s)?0:Math.max(0,s-r)}function Tk(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 Rk(t,r){return`${t}:${r.role}:${r.lastFailureAt}`}function Dk(t){const r=Ok(t.role),s=jv(t);return t.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次 · ${Bk(t.nextRetryAt)}`}function Mk(t,r){const s=jv(t);return t.retryable===!1?`CC stopped for ${r}: ${Lk(t)} cannot be fixed by retrying.`:`CC retry failed after ${t.maxAttempts} attempts for ${r}${s}.`}function jv(t){return!t.error||t.error==="unknown"?"":` · ${t.error}`}function Lk(t){return t.error&&t.error!=="unknown"?t.error:"this error"}function Ok(t){return t.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function Bk(t){if(!t)return"即将重试";const r=Date.parse(t)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function n_(){const t=Nv();return t?Hv(t):!1}async function wo(){const t=Nv();if(!t||!await Hv(t))return!1;try{const s=t.createGain(),l=t.currentTime+.025;return s.gain.setValueAtTime(.85,t.currentTime),s.connect(t.destination),s_(t,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),s_(t,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Nv(){const t=window.AudioContext??window.webkitAudioContext;if(!t)return null;try{return(!Yr||Yr.state==="closed")&&(Yr=new t),Yr}catch{return null}}function i_(t){Yr=null,t&&t.state!=="closed"&&t.close().catch(()=>{})}async function Hv(t){if(r_(t))return!0;try{await t.resume();const r=r_(t);return!r&&t===Yr&&i_(t),r}catch{return t===Yr&&i_(t),!1}}function r_(t){return t.state==="running"}function s_(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 zv=document.getElementById("root");if(!zv)throw new Error("Missing #root element.");$0.createRoot(zv).render(x.jsx(ee.StrictMode,{children:x.jsx(xk,{})}));