vibe-coding-master 0.7.11 → 0.7.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/dist/backend/adapters/ccr-gateway-adapter.js +149 -0
- package/dist/backend/adapters/claude-adapter.js +4 -1
- package/dist/backend/adapters/filesystem.js +3 -0
- package/dist/backend/api/app-settings-routes.js +9 -0
- package/dist/backend/api/session-routes.js +1 -0
- package/dist/backend/api/translation-worker-routes.js +1 -0
- package/dist/backend/server.js +13 -1
- package/dist/backend/services/app-settings-service.js +31 -1
- package/dist/backend/services/ccr-integration-service.js +194 -0
- package/dist/backend/services/session-service.js +33 -6
- package/dist/shared/types/session.js +31 -4
- package/dist-frontend/assets/index-BAE_pjXJ.js +97 -0
- package/dist-frontend/assets/index-CiEUp9Si.css +32 -0
- package/dist-frontend/index.html +2 -2
- package/package.json +1 -1
- package/dist-frontend/assets/index-42EpETgd.js +0 -97
- package/dist-frontend/assets/index-D65x2x0F.css +0 -32
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var L0=Object.defineProperty;var O0=(t,r,s)=>r in t?L0(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s;var Lm=(t,r,s)=>O0(t,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))l(d);new MutationObserver(d=>{for(const v of d)if(v.type==="childList")for(const f of v.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const v={};return d.integrity&&(v.integrity=d.integrity),d.referrerPolicy&&(v.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?v.credentials="include":d.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function l(d){if(d.ep)return;d.ep=!0;const v=s(d);fetch(d.href,v)}})();function a_(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gu={exports:{}},Fa={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Om;function B0(){if(Om)return Fa;Om=1;var t=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(l,d,v){var f=null;if(v!==void 0&&(f=""+v),d.key!==void 0&&(f=""+d.key),"key"in d){v={};for(var o in d)o!=="key"&&(v[o]=d[o])}else v=d;return d=v.ref,{$$typeof:t,type:l,key:f,ref:d!==void 0?d:null,props:v}}return Fa.Fragment=r,Fa.jsx=s,Fa.jsxs=s,Fa}var Bm;function j0(){return Bm||(Bm=1,Gu.exports=B0()),Gu.exports}var x=j0(),Vu={exports:{}},Pe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var jm;function N0(){if(jm)return Pe;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"),v=Symbol.for("react.consumer"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),S=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=S&&N[S]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,y={};function _(N,q,I){this.props=N,this.context=q,this.refs=y,this.updater=I||T}_.prototype.isReactComponent={},_.prototype.setState=function(N,q){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,q,"setState")},_.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function g(){}g.prototype=_.prototype;function b(N,q,I){this.props=N,this.context=q,this.refs=y,this.updater=I||T}var E=b.prototype=new g;E.constructor=b,k(E,_.prototype),E.isPureReactComponent=!0;var L=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function M(N,q,I){var ie=I.ref;return{$$typeof:t,type:N,key:q,ref:ie!==void 0?ie:null,props:I}}function O(N,q){return M(N.type,q,N.props)}function H(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function U(N){var q={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(I){return q[I]})}var P=/\/+/g;function K(N,q){return typeof N=="object"&&N!==null&&N.key!=null?U(""+N.key):q.toString(36)}function G(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(R,R):(N.status="pending",N.then(function(q){N.status==="pending"&&(N.status="fulfilled",N.value=q)},function(q){N.status==="pending"&&(N.status="rejected",N.reason=q)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function V(N,q,I,ie,de){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 p:return Q=N._init,V(Q(N._payload),q,I,ie,de)}}if(Q)return de=de(N),Q=ie===""?"."+K(N,0):ie,L(de)?(I="",Q!=null&&(I=Q.replace(P,"$&/")+"/"),V(de,q,I,"",function(se){return se})):de!=null&&(H(de)&&(de=O(de,I+(de.key==null||N&&N.key===de.key?"":(""+de.key).replace(P,"$&/")+"/")+Q)),q.push(de)),1;Q=0;var $=ie===""?".":ie+":";if(L(N))for(var ce=0;ce<N.length;ce++)ie=N[ce],_e=$+K(ie,ce),Q+=V(ie,q,I,_e,de);else if(ce=w(N),typeof ce=="function")for(N=ce.call(N),ce=0;!(ie=N.next()).done;)ie=ie.value,_e=$+K(ie,ce++),Q+=V(ie,q,I,_e,de);else if(_e==="object"){if(typeof N.then=="function")return V(G(N),q,I,ie,de);throw q=String(N),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Q}function Y(N,q,I){if(N==null)return N;var ie=[],de=0;return V(N,ie,"","",function(_e){return q.call(I,_e,de++)}),ie}function te(N){if(N._status===-1){var q=N._result;q=q(),q.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=q)}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 q=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(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},j={map:Y,forEach:function(N,q,I){Y(N,function(){q.apply(this,arguments)},I)},count:function(N){var q=0;return Y(N,function(){q++}),q},toArray:function(N){return Y(N,function(q){return q})||[]},only:function(N){if(!H(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Pe.Activity=h,Pe.Children=j,Pe.Component=_,Pe.Fragment=s,Pe.Profiler=d,Pe.PureComponent=b,Pe.StrictMode=l,Pe.Suspense=c,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return D.H.useMemoCache(N)}},Pe.cache=function(N){return function(){return N.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(N,q,I){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ie=k({},N.props),de=N.key;if(q!=null)for(_e in q.key!==void 0&&(de=""+q.key),q)!A.call(q,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&q.ref===void 0||(ie[_e]=q[_e]);var _e=arguments.length-2;if(_e===1)ie.children=I;else if(1<_e){for(var Q=Array(_e),$=0;$<_e;$++)Q[$]=arguments[$+2];ie.children=Q}return M(N.type,de,ie)},Pe.createContext=function(N){return N={$$typeof:f,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:v,_context:N},N},Pe.createElement=function(N,q,I){var ie,de={},_e=null;if(q!=null)for(ie in q.key!==void 0&&(_e=""+q.key),q)A.call(q,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(de[ie]=q[ie]);var Q=arguments.length-2;if(Q===1)de.children=I;else if(1<Q){for(var $=Array(Q),ce=0;ce<Q;ce++)$[ce]=arguments[ce+2];de.children=$}if(N&&N.defaultProps)for(ie in Q=N.defaultProps,Q)de[ie]===void 0&&(de[ie]=Q[ie]);return M(N,_e,de)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(N){return{$$typeof:o,render:N}},Pe.isValidElement=H,Pe.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:te}},Pe.memo=function(N,q){return{$$typeof:u,type:N,compare:q===void 0?null:q}},Pe.startTransition=function(N){var q=D.T,I={};D.T=I;try{var ie=N(),de=D.S;de!==null&&de(I,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(R,z)}catch(_e){z(_e)}finally{q!==null&&I.types!==null&&(q.types=I.types),D.T=q}},Pe.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Pe.use=function(N){return D.H.use(N)},Pe.useActionState=function(N,q,I){return D.H.useActionState(N,q,I)},Pe.useCallback=function(N,q){return D.H.useCallback(N,q)},Pe.useContext=function(N){return D.H.useContext(N)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(N,q){return D.H.useDeferredValue(N,q)},Pe.useEffect=function(N,q){return D.H.useEffect(N,q)},Pe.useEffectEvent=function(N){return D.H.useEffectEvent(N)},Pe.useId=function(){return D.H.useId()},Pe.useImperativeHandle=function(N,q,I){return D.H.useImperativeHandle(N,q,I)},Pe.useInsertionEffect=function(N,q){return D.H.useInsertionEffect(N,q)},Pe.useLayoutEffect=function(N,q){return D.H.useLayoutEffect(N,q)},Pe.useMemo=function(N,q){return D.H.useMemo(N,q)},Pe.useOptimistic=function(N,q){return D.H.useOptimistic(N,q)},Pe.useReducer=function(N,q,I){return D.H.useReducer(N,q,I)},Pe.useRef=function(N){return D.H.useRef(N)},Pe.useState=function(N){return D.H.useState(N)},Pe.useSyncExternalStore=function(N,q,I){return D.H.useSyncExternalStore(N,q,I)},Pe.useTransition=function(){return D.H.useTransition()},Pe.version="19.2.6",Pe}var Nm;function Nh(){return Nm||(Nm=1,Vu.exports=N0()),Vu.exports}var ee=Nh(),Wu={exports:{}},qa={},Ku={exports:{}},Yu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Hm;function H0(){return Hm||(Hm=1,(function(t){function r(V,Y){var te=V.length;V.push(Y);e:for(;0<te;){var z=te-1>>>1,j=V[z];if(0<d(j,Y))V[z]=Y,V[te]=j,te=z;else break e}}function s(V){return V.length===0?null:V[0]}function l(V){if(V.length===0)return null;var Y=V[0],te=V.pop();if(te!==Y){V[0]=te;e:for(var z=0,j=V.length,N=j>>>1;z<N;){var q=2*(z+1)-1,I=V[q],ie=q+1,de=V[ie];if(0>d(I,te))ie<j&&0>d(de,I)?(V[z]=de,V[ie]=te,z=ie):(V[z]=I,V[q]=te,z=q);else if(ie<j&&0>d(de,te))V[z]=de,V[ie]=te,z=ie;else break e}}return Y}function d(V,Y){var te=V.sortIndex-Y.sortIndex;return te!==0?te:V.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;t.unstable_now=function(){return v.now()}}else{var f=Date,o=f.now();t.unstable_now=function(){return f.now()-o}}var c=[],u=[],p=1,h=null,S=3,w=!1,T=!1,k=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var Y=s(u);Y!==null;){if(Y.callback===null)l(u);else if(Y.startTime<=V)l(u),Y.sortIndex=Y.expirationTime,r(c,Y);else break;Y=s(u)}}function L(V){if(k=!1,E(V),!T)if(s(c)!==null)T=!0,R||(R=!0,U());else{var Y=s(u);Y!==null&&G(L,Y.startTime-V)}}var R=!1,D=-1,A=5,M=-1;function O(){return y?!0:!(t.unstable_now()-M<A)}function H(){if(y=!1,R){var V=t.unstable_now();M=V;var Y=!0;try{e:{T=!1,k&&(k=!1,g(D),D=-1),w=!0;var te=S;try{t:{for(E(V),h=s(c);h!==null&&!(h.expirationTime>V&&O());){var z=h.callback;if(typeof z=="function"){h.callback=null,S=h.priorityLevel;var j=z(h.expirationTime<=V);if(V=t.unstable_now(),typeof j=="function"){h.callback=j,E(V),Y=!0;break t}h===s(c)&&l(c),E(V)}else l(c);h=s(c)}if(h!==null)Y=!0;else{var N=s(u);N!==null&&G(L,N.startTime-V),Y=!1}}break e}finally{h=null,S=te,w=!1}Y=void 0}}finally{Y?U():R=!1}}}var U;if(typeof b=="function")U=function(){b(H)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,K=P.port2;P.port1.onmessage=H,U=function(){K.postMessage(null)}}else U=function(){_(H,0)};function G(V,Y){D=_(function(){V(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(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_next=function(V){switch(S){case 1:case 2:case 3:var Y=3;break;default:Y=S}var te=S;S=Y;try{return V()}finally{S=te}},t.unstable_requestPaint=function(){y=!0},t.unstable_runWithPriority=function(V,Y){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var te=S;S=V;try{return Y()}finally{S=te}},t.unstable_scheduleCallback=function(V,Y,te){var z=t.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?z+te:z):te=z,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=te+j,V={id:p++,callback:Y,priorityLevel:V,startTime:te,expirationTime:j,sortIndex:-1},te>z?(V.sortIndex=te,r(u,V),s(c)===null&&V===s(u)&&(k?(g(D),D=-1):k=!0,G(L,te-z))):(V.sortIndex=j,r(c,V),T||w||(T=!0,R||(R=!0,U()))),V},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(V){var Y=S;return function(){var te=S;S=Y;try{return V.apply(this,arguments)}finally{S=te}}}})(Yu)),Yu}var zm;function z0(){return zm||(zm=1,Ku.exports=H0()),Ku.exports}var Xu={exports:{}},Jt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Im;function I0(){if(Im)return Jt;Im=1;var t=Nh();function r(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)u+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+u+" 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 v(c,u,p){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:h==null?null:""+h,children:c,containerInfo:u,implementation:p}}var f=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Jt.createPortal=function(c,u){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(r(299));return v(c,u,null,p)},Jt.flushSync=function(c){var u=f.T,p=l.p;try{if(f.T=null,l.p=2,c)return c()}finally{f.T=u,l.p=p,l.d.f()}},Jt.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,l.d.C(c,u))},Jt.prefetchDNS=function(c){typeof c=="string"&&l.d.D(c)},Jt.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var p=u.as,h=o(p,u.crossOrigin),S=typeof u.integrity=="string"?u.integrity:void 0,w=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;p==="style"?l.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:h,integrity:S,fetchPriority:w}):p==="script"&&l.d.X(c,{crossOrigin:h,integrity:S,fetchPriority:w,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Jt.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var p=o(u.as,u.crossOrigin);l.d.M(c,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&l.d.M(c)},Jt.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var p=u.as,h=o(p,u.crossOrigin);l.d.L(c,p,{crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Jt.preloadModule=function(c,u){if(typeof c=="string")if(u){var p=o(u.as,u.crossOrigin);l.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else l.d.m(c)},Jt.requestFormReset=function(c){l.d.r(c)},Jt.unstable_batchedUpdates=function(c,u){return c(u)},Jt.useFormState=function(c,u,p){return f.H.useFormState(c,u,p)},Jt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Jt.version="19.2.6",Jt}var Pm;function P0(){if(Pm)return Xu.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(),Xu.exports=I0(),Xu.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Um;function U0(){if(Um)return qa;Um=1;var t=z0(),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 v(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(v(e)!==e)throw Error(l(188))}function u(e){var n=e.alternate;if(!n){if(n=v(e),n===null)throw Error(l(188));return n!==e?null:e}for(var i=e,a=n;;){var m=i.return;if(m===null)break;var C=m.alternate;if(C===null){if(a=m.return,a!==null){i=a;continue}break}if(m.child===C.child){for(C=m.child;C;){if(C===i)return c(m),e;if(C===a)return c(m),n;C=C.sibling}throw Error(l(188))}if(i.return!==a.return)i=m,a=C;else{for(var B=!1,F=m.child;F;){if(F===i){B=!0,i=m,a=C;break}if(F===a){B=!0,a=m,i=C;break}F=F.sibling}if(!B){for(F=C.child;F;){if(F===i){B=!0,i=C,a=m;break}if(F===a){B=!0,a=C,i=m;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 p(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=p(e),n!==null)return n;e=e.sibling}return null}var h=Object.assign,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),b=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),M=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 K(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 k:return"Fragment";case _:return"Profiler";case y:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case b:return e.displayName||"Context";case g:return(e._context.displayName||"Context")+".Consumer";case E: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:K(e.type)||"Memo";case A:n=e._payload,e=e._init;try{return K(e(n))}catch{}}return null}var G=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},z=[],j=-1;function N(e){return{current:e}}function q(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),de=N(null),_e=N(null),Q=N(null);function $(e,n){switch(I(_e,n),I(de,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}}q(ie),I(ie,e)}function ce(){q(ie),q(de),q(_e)}function se(e){e.memoizedState!==null&&I(Q,e);var n=ie.current,i=nm(n,e.type);n!==i&&(I(de,e),I(ie,i))}function xe(e){de.current===e&&(q(ie),q(de)),Q.current===e&&(q(Q),za._currentValue=te)}var be,je;function Ee(e){if(be===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);be=n&&n[1]||"",je=-1<i.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+be+e+je}var me=!1;function Me(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 ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(oe){var le=oe}Reflect.construct(e,[],ve)}else{try{ve.call()}catch(oe){le=oe}e.call(ve.prototype)}}else{try{throw Error()}catch(oe){le=oe}(ve=e())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(oe){if(oe&&le&&typeof oe.stack=="string")return[oe.stack,le.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");m&&m.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(m=a=0;a<X.length&&!X[a].includes("DetermineComponentFrameRoot");)a++;for(;m<ae.length&&!ae[m].includes("DetermineComponentFrameRoot");)m++;if(a===X.length||m===ae.length)for(a=X.length-1,m=ae.length-1;1<=a&&0<=m&&X[a]!==ae[m];)m--;for(;1<=a&&0<=m;a--,m--)if(X[a]!==ae[m]){if(a!==1||m!==1)do if(a--,m--,0>m||X[a]!==ae[m]){var fe=`
|
|
46
|
+
`+X[a].replace(" at new "," at ");return e.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",e.displayName)),fe}while(1<=a&&0<=m);break}}}finally{me=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ee(i):""}function Ae(e,n){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee("Lazy");case 13:return e.child!==n&&n!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Me(e.type,!1);case 11:return Me(e.type.render,!1);case 1:return Me(e.type,!0);case 31:return Ee("Activity");default:return""}}function rt(e){try{var n="",i=null;do n+=Ae(e,i),i=e,e=e.return;while(e);return n}catch(a){return`
|
|
47
|
+
Error generating stack: `+a.message+`
|
|
48
|
+
`+a.stack}}var ge=Object.prototype.hasOwnProperty,ze=t.unstable_scheduleCallback,Ke=t.unstable_cancelCallback,zt=t.unstable_shouldYield,pt=t.unstable_requestPaint,mt=t.unstable_now,Ot=t.unstable_getCurrentPriorityLevel,he=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,He=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,vt=t.log,Fe=t.unstable_setDisableYieldValue,Ct=null,St=null;function Bt(e){if(typeof vt=="function"&&Fe(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(Ct,e)}catch{}}var et=Math.clz32?Math.clz32:Kr,Ut=Math.log,nn=Math.LN2;function Kr(e){return e>>>=0,e===0?32:31-(Ut(e)/nn|0)|0}var Hi=256,fi=262144,zi=4194304;function Cn(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 di(e,n,i){var a=e.pendingLanes;if(a===0)return 0;var m=0,C=e.suspendedLanes,B=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~C,a!==0?m=Cn(a):(B&=F,B!==0?m=Cn(B):i||(i=F&~e,i!==0&&(m=Cn(i))))):(F=a&~C,F!==0?m=Cn(F):B!==0?m=Cn(B):i||(i=a&~e,i!==0&&(m=Cn(i)))),m===0?0:n!==0&&n!==m&&(n&C)===0&&(C=m&-m,i=n&-n,C>=i||C===32&&(i&4194048)!==0)?n:m}function Wn(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function ni(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 un(){var e=zi;return zi<<=1,(zi&62914560)===0&&(zi=4194304),e}function Kn(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function Ft(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pi(e,n,i,a,m,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 fe=31-et(i),ve=1<<fe;F[fe]=0,X[fe]=-1;var le=ae[fe];if(le!==null)for(ae[fe]=null,fe=0;fe<le.length;fe++){var oe=le[fe];oe!==null&&(oe.lane&=-536870913)}i&=~ve}a!==0&&Ii(e,a,0),C!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=C&~(B&~n))}function Ii(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var a=31-et(n);e.entangledLanes|=n,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function hn(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var a=31-et(i),m=1<<a;m&n|e[a]&n&&(e[a]|=n),i&=~m}}function Pi(e,n){var i=n&-n;return i=(i&42)!==0?1:mi(i),(i&(e.suspendedLanes|n))!==0?0:i}function mi(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 jt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function rn(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Em(e.type))}function Ui(e,n){var i=Y.p;try{return Y.p=e,n()}finally{Y.p=i}}var Ne=Math.random().toString(36).slice(2),bt="__reactFiber$"+Ne,Nt="__reactProps$"+Ne,ii="__reactContainer$"+Ne,Yr="__reactEvents$"+Ne,qo="__reactListeners$"+Ne,ri="__reactHandles$"+Ne,cl="__reactResources$"+Ne,yr="__reactMarker$"+Ne;function Xr(e){delete e[bt],delete e[Nt],delete e[Yr],delete e[qo],delete e[ri]}function wn(e){var n=e[bt];if(n)return n;for(var i=e.parentNode;i;){if(n=i[ii]||i[bt]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=cm(e);e!==null;){if(i=e[bt])return i;e=cm(e)}return n}e=i,i=e.parentNode}return null}function gi(e){if(e=e[bt]||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 Sr(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function Fi(e){var n=e[cl];return n||(n=e[cl]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Et(e){e[yr]=!0}var ul=new Set,qi={};function si(e,n){fn(e,n),fn(e+"Capture",n)}function fn(e,n){for(qi[e]=n,e=0;e<n.length;e++)ul.add(n[e])}var hl=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]*$"),Qr={},Ks={};function fl(e){return ge.call(Ks,e)?!0:ge.call(Qr,e)?!1:hl.test(e)?Ks[e]=!0:(Qr[e]=!0,!1)}function br(e,n,i){if(fl(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 _i(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 Nn(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 Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function dn(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 m=a.get,C=a.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return m.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 Cr(e){if(!e._valueTracker){var n=Z(e)?"checked":"value";e._valueTracker=dn(e,n,""+e[n])}}function Ys(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),a="";return e&&(a=Z(e)?e.checked?"true":"false":e.value),e=a,e!==i?(n.setValue(e),!0):!1}function Jr(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 $o=/[\n"\\]/g;function pn(e){return e.replace($o,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Zr(e,n,i,a,m,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=""+Kt(n)):e.value!==""+Kt(n)&&(e.value=""+Kt(n)):B!=="submit"&&B!=="reset"||e.removeAttribute("value"),n!=null?Xs(e,B,Kt(n)):i!=null?Xs(e,B,Kt(i)):a!=null&&e.removeAttribute("value"),m==null&&C!=null&&(e.defaultChecked=!!C),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?e.name=""+Kt(F):e.removeAttribute("name")}function dl(e,n,i,a,m,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)){Cr(e);return}i=i!=null?""+Kt(i):"",n=n!=null?""+Kt(n):i,F||n===e.value||(e.value=n),e.defaultValue=n}a=a??m,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),Cr(e)}function Xs(e,n,i){n==="number"&&Jr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Yn(e,n,i,a){if(e=e.options,n){n={};for(var m=0;m<i.length;m++)n["$"+i[m]]=!0;for(i=0;i<e.length;i++)m=n.hasOwnProperty("$"+e[i].value),e[i].selected!==m&&(e[i].selected=m),m&&a&&(e[i].defaultSelected=!0)}else{for(i=""+Kt(i),n=null,m=0;m<e.length;m++){if(e[m].value===i){e[m].selected=!0,a&&(e[m].defaultSelected=!0);return}n!==null||e[m].disabled||(n=e[m])}n!==null&&(n.selected=!0)}}function qt(e,n,i){if(n!=null&&(n=""+Kt(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+Kt(i):""}function Hn(e,n,i,a){if(n==null){if(a!=null){if(i!=null)throw Error(l(92));if(G(a)){if(1<a.length)throw Error(l(93));a=a[0]}i=a}i==null&&(i=""),n=i}i=Kt(n),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Cr(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 pl=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 es(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||pl.has(n)?n==="float"?e.cssFloat=i:e[n]=(""+i).trim():e[n]=i+"px"}function ml(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 m in n)a=n[m],n.hasOwnProperty(m)&&i[m]!==a&&es(e,m,a)}else for(var C in n)n.hasOwnProperty(C)&&es(e,C,n[C])}function Qs(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var 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"]]),Vo=/^[\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 ts(e){return Vo.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Yt(){}var wr=null;function xr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xn=null,$i=null;function Js(e){var n=gi(e);if(n&&(e=n.stateNode)){var i=e[Nt]||null;e:switch(e=n.stateNode,n.type){case"input":if(Zr(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="'+pn(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var a=i[n];if(a!==e&&a.form===e.form){var m=a[Nt]||null;if(!m)throw Error(l(90));Zr(a,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<i.length;n++)a=i[n],a.form===e.form&&Ys(a)}break e;case"textarea":qt(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&Yn(e,!!i.multiple,n,!1)}}}var Er=!1;function Zs(e,n,i){if(Er)return e(n,i);Er=!0;try{var a=e(n);return a}finally{if(Er=!1,(xn!==null||$i!==null)&&(Jl(),xn&&(n=xn,e=$i,$i=xn=null,Js(n),e)))for(n=0;n<e.length;n++)Js(e[n])}}function Gi(e,n){var i=e.stateNode;if(i===null)return null;var a=i[Nt]||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 Xt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ns=!1;if(Xt)try{var En={};Object.defineProperty(En,"passive",{get:function(){ns=!0}}),window.addEventListener("test",En,En),window.removeEventListener("test",En,En)}catch{ns=!1}var sn=null,ea=null,is=null;function ta(){if(is)return is;var e,n=ea,i=n.length,a,m="value"in sn?sn.value:sn.textContent,C=m.length;for(e=0;e<i&&n[e]===m[e];e++);var B=i-e;for(a=1;a<=B&&n[i-a]===m[C-a];a++);return is=m.slice(e,1<a?1-a:void 0)}function rs(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 Qt(){return!0}function ss(){return!1}function It(e){function n(i,a,m,C,B){this._reactName=i,this._targetInst=m,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)?Qt:ss,this.isPropagationStopped=ss,this}return h(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=Qt)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Qt)},persist:function(){},isPersistent:Qt}),n}var Xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},as=It(Xn),Re=h({},Xn,{view:0,detail:0}),Wo=It(Re),na,ia,kr,an=h({},Re,{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!==kr&&(kr&&e.type==="mousemove"?(na=e.screenX-kr.screenX,ia=e.screenY-kr.screenY):ia=na=0,kr=e),na)},movementY:function(e){return"movementY"in e?e.movementY:ia}}),ls=It(an),gl=h({},an,{dataTransfer:0}),ra=It(gl),Ko=h({},Re,{relatedTarget:0}),W=It(Ko),ue=h({},Xn,{animationName:0,elapsedTime:0,pseudoElement:0}),Je=It(ue),ln=h({},Xn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yi=It(ln),Yo=h({},Xn,{data:0}),sf=It(Yo),Iv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Uv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fv(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Uv[e])?!!n[e]:!1}function Xo(){return Fv}var qv=h({},Re,{key:function(e){if(e.key){var n=Iv[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=rs(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"?rs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$v=It(qv),Gv=h({},an,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),af=It(Gv),Vv=h({},Re,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xo}),Wv=It(Vv),Kv=h({},Xn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yv=It(Kv),Xv=h({},an,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Qv=It(Xv),Jv=h({},Xn,{newState:0,oldState:0}),Zv=It(Jv),ey=[9,13,27,32],Qo=Xt&&"CompositionEvent"in window,sa=null;Xt&&"documentMode"in document&&(sa=document.documentMode);var ty=Xt&&"TextEvent"in window&&!sa,lf=Xt&&(!Qo||sa&&8<sa&&11>=sa),of=" ",cf=!1;function uf(e,n){switch(e){case"keyup":return ey.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var os=!1;function ny(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 iy(e,n){if(os)return e==="compositionend"||!Qo&&uf(e,n)?(e=ta(),is=ea=sn=null,os=!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 ry={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ff(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ry[e.type]:n==="textarea"}function df(e,n,i,a){xn?$i?$i.push(a):$i=[a]:xn=a,n=so(n,"onChange"),0<n.length&&(i=new as("onChange","change",null,i,a),e.push({event:i,listeners:n}))}var aa=null,la=null;function sy(e){Yp(e,0)}function _l(e){var n=Sr(e);if(Ys(n))return e}function pf(e,n){if(e==="change")return n}var mf=!1;if(Xt){var Jo;if(Xt){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"&&_l(la)){var n=[];df(n,la,e,xr(e)),Zs(sy,n)}}function ay(e,n,i){e==="focusin"?(_f(),aa=n,la=i,aa.attachEvent("onpropertychange",vf)):e==="focusout"&&_f()}function ly(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return _l(la)}function oy(e,n){if(e==="click")return _l(n)}function cy(e,n){if(e==="input"||e==="change")return _l(n)}function uy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var kn=typeof Object.is=="function"?Object.is:uy;function oa(e,n){if(kn(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 m=i[a];if(!ge.call(n,m)||!kn(e[m],n[m]))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=Jr(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=Jr(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 hy=Xt&&"documentMode"in document&&11>=document.documentMode,cs=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||cs==null||cs!==Jr(a)||(a=cs,"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=so(tc,"onSelect"),0<a.length&&(n=new as("onSelect","select",null,n,i),e.push({event:n,listeners:a}),n.target=cs)))}function Ar(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var us={animationend:Ar("Animation","AnimationEnd"),animationiteration:Ar("Animation","AnimationIteration"),animationstart:Ar("Animation","AnimationStart"),transitionrun:Ar("Transition","TransitionRun"),transitionstart:Ar("Transition","TransitionStart"),transitioncancel:Ar("Transition","TransitionCancel"),transitionend:Ar("Transition","TransitionEnd")},ic={},xf={};Xt&&(xf=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function Tr(e){if(ic[e])return ic[e];if(!us[e])return e;var n=us[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in xf)return ic[e]=n[i];return e}var Ef=Tr("animationend"),kf=Tr("animationiteration"),Af=Tr("animationstart"),fy=Tr("transitionrun"),dy=Tr("transitionstart"),py=Tr("transitioncancel"),Tf=Tr("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 Qn(e,n){Rf.set(e,n),si(n,[e])}var vl=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)},zn=[],hs=0,sc=0;function yl(){for(var e=hs,n=sc=hs=0;n<e;){var i=zn[n];zn[n++]=null;var a=zn[n];zn[n++]=null;var m=zn[n];zn[n++]=null;var C=zn[n];if(zn[n++]=null,a!==null&&m!==null){var B=a.pending;B===null?m.next=m:(m.next=B.next,B.next=m),a.pending=m}C!==0&&Df(i,m,C)}}function Sl(e,n,i,a){zn[hs++]=e,zn[hs++]=n,zn[hs++]=i,zn[hs++]=a,sc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function ac(e,n,i,a){return Sl(e,n,i,a),bl(e)}function Rr(e,n){return Sl(e,null,null,n),bl(e)}function Df(e,n,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var m=!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||(m=!0)),e=C,C=C.return;return e.tag===3?(C=e.stateNode,m&&n!==null&&(m=31-et(i),e=C.hiddenUpdates,a=e[m],a===null?e[m]=[n]:a.push(n),n.lane=i|536870912),C):null}function bl(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 fs={};function my(e,n,i,a){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function An(e,n,i,a){return new my(e,n,i,a)}function lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Si(e,n){var i=e.alternate;return i===null?(i=An(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 Cl(e,n,i,a,m,C){var B=0;if(a=e,typeof e=="function")lc(e)&&(B=1);else if(typeof e=="string")B=S0(e,i,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=An(31,i,n,m),e.elementType=M,e.lanes=C,e;case k:return Dr(i.children,m,C,n);case y:B=8,m|=24;break;case _:return e=An(12,i,n,m|2),e.elementType=_,e.lanes=C,e;case L:return e=An(13,i,n,m),e.elementType=L,e.lanes=C,e;case R:return e=An(19,i,n,m),e.elementType=R,e.lanes=C,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case b:B=10;break e;case g:B=9;break e;case E:B=11;break e;case D:B=14;break e;case A:B=16,a=null;break e}B=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return n=An(B,i,n,m),n.elementType=e,n.type=a,n.lanes=C,n}function Dr(e,n,i,a){return e=An(7,e,a,n),e.lanes=i,e}function oc(e,n,i){return e=An(6,e,null,n),e.lanes=i,e}function Lf(e){var n=An(18,null,null,0);return n.stateNode=e,n}function cc(e,n,i){return n=An(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 In(e,n){if(typeof e=="object"&&e!==null){var i=Of.get(e);return i!==void 0?i:(n={value:e,source:n,stack:rt(n)},Of.set(e,n),n)}return{value:e,source:n,stack:rt(n)}}var ds=[],ps=0,wl=null,ua=0,Pn=[],Un=0,Vi=null,ai=1,li="";function bi(e,n){ds[ps++]=ua,ds[ps++]=wl,wl=e,ua=n}function Bf(e,n,i){Pn[Un++]=ai,Pn[Un++]=li,Pn[Un++]=Vi,Vi=e;var a=ai;e=li;var m=32-et(a)-1;a&=~(1<<m),i+=1;var C=32-et(n)+m;if(30<C){var B=m-m%5;C=(a&(1<<B)-1).toString(32),a>>=B,m-=B,ai=1<<32-et(n)+m|i<<m|a,li=C+e}else ai=1<<C|i<<m|a,li=e}function uc(e){e.return!==null&&(bi(e,1),Bf(e,1,0))}function hc(e){for(;e===wl;)wl=ds[--ps],ds[ps]=null,ua=ds[--ps],ds[ps]=null;for(;e===Vi;)Vi=Pn[--Un],Pn[Un]=null,li=Pn[--Un],Pn[Un]=null,ai=Pn[--Un],Pn[Un]=null}function jf(e,n){Pn[Un++]=ai,Pn[Un++]=li,Pn[Un++]=Vi,ai=n.id,li=n.overflow,Vi=e}var $t=null,gt=null,Qe=!1,Wi=null,Fn=!1,fc=Error(l(519));function Ki(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ha(In(n,e)),fc}function Nf(e){var n=e.stateNode,i=e.type,a=e.memoizedProps;switch(n[bt]=e,n[Nt]=a,i){case"dialog":Ve("cancel",n),Ve("close",n);break;case"iframe":case"object":case"embed":Ve("load",n);break;case"video":case"audio":for(i=0;i<Oa.length;i++)Ve(Oa[i],n);break;case"source":Ve("error",n);break;case"img":case"image":case"link":Ve("error",n),Ve("load",n);break;case"details":Ve("toggle",n);break;case"input":Ve("invalid",n),dl(n,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ve("invalid",n);break;case"textarea":Ve("invalid",n),Hn(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&&(Ve("beforetoggle",n),Ve("toggle",n)),a.onScroll!=null&&Ve("scroll",n),a.onScrollEnd!=null&&Ve("scrollend",n),a.onClick!=null&&(n.onclick=Yt),n=!0):n=!1,n||Ki(e,!0)}function Hf(e){for($t=e.return;$t;)switch($t.tag){case 5:case 31:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:$t=$t.return}}function ms(e){if(e!==$t)return!1;if(!Qe)return Hf(e),Qe=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Du(e.type,e.memoizedProps)),i=!i),i&>&&Ki(e),Hf(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));gt=om(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));gt=om(e)}else n===27?(n=gt,or(e.type)?(e=ju,ju=null,gt=e):gt=n):gt=$t?$n(e.stateNode.nextSibling):null;return!0}function Mr(){gt=$t=null,Qe=!1}function dc(){var e=Wi;return e!==null&&(vn===null?vn=e:vn.push.apply(vn,e),Wi=null),e}function ha(e){Wi===null?Wi=[e]:Wi.push(e)}var pc=N(null),Lr=null,Ci=null;function Yi(e,n,i){I(pc,n._currentValue),n._currentValue=i}function wi(e){e._currentValue=pc.current,q(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 m=e.child;for(m!==null&&(m.return=e);m!==null;){var C=m.dependencies;if(C!==null){var B=m.child;C=C.firstContext;e:for(;C!==null;){var F=C;C=m;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(m.tag===18){if(B=m.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=m.child;if(B!==null)B.return=m;else for(B=m;B!==null;){if(B===e){B=null;break}if(m=B.sibling,m!==null){m.return=B.return,B=m;break}B=B.return}m=B}}function gs(e,n,i,a){e=null;for(var m=n,C=!1;m!==null;){if(!C){if((m.flags&524288)!==0)C=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var B=m.alternate;if(B===null)throw Error(l(387));if(B=B.memoizedProps,B!==null){var F=m.type;kn(m.pendingProps.value,B.value)||(e!==null?e.push(F):e=[F])}}else if(m===Q.current){if(B=m.alternate,B===null)throw Error(l(387));B.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(za):e=[za])}m=m.return}e!==null&&gc(n,e,i,a),n.flags|=262144}function xl(e){for(e=e.firstContext;e!==null;){if(!kn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Or(e){Lr=e,Ci=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return zf(Lr,e)}function El(e,n){return Lr===null&&Or(e),zf(e,n)}function zf(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 gy=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(i,a){e.push(a)}};this.abort=function(){n.aborted=!0,e.forEach(function(i){return i()})}},_y=t.unstable_scheduleCallback,vy=t.unstable_NormalPriority,Tt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _c(){return{controller:new gy,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&_y(vy,function(){e.controller.abort()})}var da=null,vc=0,_s=0,vs=null;function yy(e,n){if(da===null){var i=da=[];vc=0,_s=bu(),vs={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){vs!==null&&(vs.status="fulfilled");var e=da;da=null,_s=0,vs=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Sy(e,n){var i=[],a={status:"pending",value:null,reason:null,then:function(m){i.push(m)}};return e.then(function(){a.status="fulfilled",a.value=n;for(var m=0;m<i.length;m++)(0,i[m])(n)},function(m){for(a.status="rejected",a.reason=m,m=0;m<i.length;m++)(0,i[m])(void 0)}),a}var Pf=V.S;V.S=function(e,n){wp=mt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&yy(e,n),Pf!==null&&Pf(e,n)};var Br=N(null);function yc(){var e=Br.current;return e!==null?e:ut.pooledCache}function kl(e,n){n===null?I(Br,Br.current):I(Br,n.pool)}function Uf(){var e=yc();return e===null?null:{parent:Tt._currentValue,pool:e}}var ys=Error(l(460)),Sc=Error(l(474)),Al=Error(l(542)),Tl={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(Yt,Yt),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(Yt,Yt);else{if(e=ut,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=n,e.status="pending",e.then(function(a){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=a}},function(a){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=a}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Gf(e),e}throw Nr=n,ys}}function jr(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Nr=i,ys):i}}var Nr=null;function $f(){if(Nr===null)throw Error(l(459));var e=Nr;return Nr=null,e}function Gf(e){if(e===ys||e===Al)throw Error(l(483))}var Ss=null,pa=0;function Rl(e){var n=pa;return pa+=1,Ss===null&&(Ss=[]),qf(Ss,e,n)}function ma(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Dl(e,n){throw n.$$typeof===S?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(ne,J){if(e){var re=ne.deletions;re===null?(ne.deletions=[J],ne.flags|=16):re.push(J)}}function i(ne,J){if(!e)return null;for(;J!==null;)n(ne,J),J=J.sibling;return null}function a(ne){for(var J=new Map;ne!==null;)ne.key!==null?J.set(ne.key,ne):J.set(ne.index,ne),ne=ne.sibling;return J}function m(ne,J){return ne=Si(ne,J),ne.index=0,ne.sibling=null,ne}function C(ne,J,re){return ne.index=re,e?(re=ne.alternate,re!==null?(re=re.index,re<J?(ne.flags|=67108866,J):re):(ne.flags|=67108866,J)):(ne.flags|=1048576,J)}function B(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function F(ne,J,re,pe){return J===null||J.tag!==6?(J=oc(re,ne.mode,pe),J.return=ne,J):(J=m(J,re),J.return=ne,J)}function X(ne,J,re,pe){var Le=re.type;return Le===k?fe(ne,J,re.props.children,pe,re.key):J!==null&&(J.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===A&&jr(Le)===J.type)?(J=m(J,re.props),ma(J,re),J.return=ne,J):(J=Cl(re.type,re.key,re.props,null,ne.mode,pe),ma(J,re),J.return=ne,J)}function ae(ne,J,re,pe){return J===null||J.tag!==4||J.stateNode.containerInfo!==re.containerInfo||J.stateNode.implementation!==re.implementation?(J=cc(re,ne.mode,pe),J.return=ne,J):(J=m(J,re.children||[]),J.return=ne,J)}function fe(ne,J,re,pe,Le){return J===null||J.tag!==7?(J=Dr(re,ne.mode,pe,Le),J.return=ne,J):(J=m(J,re),J.return=ne,J)}function ve(ne,J,re){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=oc(""+J,ne.mode,re),J.return=ne,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case w:return re=Cl(J.type,J.key,J.props,null,ne.mode,re),ma(re,J),re.return=ne,re;case T:return J=cc(J,ne.mode,re),J.return=ne,J;case A:return J=jr(J),ve(ne,J,re)}if(G(J)||U(J))return J=Dr(J,ne.mode,re,null),J.return=ne,J;if(typeof J.then=="function")return ve(ne,Rl(J),re);if(J.$$typeof===b)return ve(ne,El(ne,J),re);Dl(ne,J)}return null}function le(ne,J,re,pe){var Le=J!==null?J.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Le!==null?null:F(ne,J,""+re,pe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return re.key===Le?X(ne,J,re,pe):null;case T:return re.key===Le?ae(ne,J,re,pe):null;case A:return re=jr(re),le(ne,J,re,pe)}if(G(re)||U(re))return Le!==null?null:fe(ne,J,re,pe,null);if(typeof re.then=="function")return le(ne,J,Rl(re),pe);if(re.$$typeof===b)return le(ne,J,El(ne,re),pe);Dl(ne,re)}return null}function oe(ne,J,re,pe,Le){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ne=ne.get(re)||null,F(J,ne,""+pe,Le);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case w:return ne=ne.get(pe.key===null?re:pe.key)||null,X(J,ne,pe,Le);case T:return ne=ne.get(pe.key===null?re:pe.key)||null,ae(J,ne,pe,Le);case A:return pe=jr(pe),oe(ne,J,re,pe,Le)}if(G(pe)||U(pe))return ne=ne.get(re)||null,fe(J,ne,pe,Le,null);if(typeof pe.then=="function")return oe(ne,J,re,Rl(pe),Le);if(pe.$$typeof===b)return oe(ne,J,re,El(J,pe),Le);Dl(J,pe)}return null}function ke(ne,J,re,pe){for(var Le=null,tt=null,De=J,qe=J=0,Xe=null;De!==null&&qe<re.length;qe++){De.index>qe?(Xe=De,De=null):Xe=De.sibling;var nt=le(ne,De,re[qe],pe);if(nt===null){De===null&&(De=Xe);break}e&&De&&nt.alternate===null&&n(ne,De),J=C(nt,J,qe),tt===null?Le=nt:tt.sibling=nt,tt=nt,De=Xe}if(qe===re.length)return i(ne,De),Qe&&bi(ne,qe),Le;if(De===null){for(;qe<re.length;qe++)De=ve(ne,re[qe],pe),De!==null&&(J=C(De,J,qe),tt===null?Le=De:tt.sibling=De,tt=De);return Qe&&bi(ne,qe),Le}for(De=a(De);qe<re.length;qe++)Xe=oe(De,ne,qe,re[qe],pe),Xe!==null&&(e&&Xe.alternate!==null&&De.delete(Xe.key===null?qe:Xe.key),J=C(Xe,J,qe),tt===null?Le=Xe:tt.sibling=Xe,tt=Xe);return e&&De.forEach(function(dr){return n(ne,dr)}),Qe&&bi(ne,qe),Le}function Be(ne,J,re,pe){if(re==null)throw Error(l(151));for(var Le=null,tt=null,De=J,qe=J=0,Xe=null,nt=re.next();De!==null&&!nt.done;qe++,nt=re.next()){De.index>qe?(Xe=De,De=null):Xe=De.sibling;var dr=le(ne,De,nt.value,pe);if(dr===null){De===null&&(De=Xe);break}e&&De&&dr.alternate===null&&n(ne,De),J=C(dr,J,qe),tt===null?Le=dr:tt.sibling=dr,tt=dr,De=Xe}if(nt.done)return i(ne,De),Qe&&bi(ne,qe),Le;if(De===null){for(;!nt.done;qe++,nt=re.next())nt=ve(ne,nt.value,pe),nt!==null&&(J=C(nt,J,qe),tt===null?Le=nt:tt.sibling=nt,tt=nt);return Qe&&bi(ne,qe),Le}for(De=a(De);!nt.done;qe++,nt=re.next())nt=oe(De,ne,qe,nt.value,pe),nt!==null&&(e&&nt.alternate!==null&&De.delete(nt.key===null?qe:nt.key),J=C(nt,J,qe),tt===null?Le=nt:tt.sibling=nt,tt=nt);return e&&De.forEach(function(M0){return n(ne,M0)}),Qe&&bi(ne,qe),Le}function ct(ne,J,re,pe){if(typeof re=="object"&&re!==null&&re.type===k&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case w:e:{for(var Le=re.key;J!==null;){if(J.key===Le){if(Le=re.type,Le===k){if(J.tag===7){i(ne,J.sibling),pe=m(J,re.props.children),pe.return=ne,ne=pe;break e}}else if(J.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===A&&jr(Le)===J.type){i(ne,J.sibling),pe=m(J,re.props),ma(pe,re),pe.return=ne,ne=pe;break e}i(ne,J);break}else n(ne,J);J=J.sibling}re.type===k?(pe=Dr(re.props.children,ne.mode,pe,re.key),pe.return=ne,ne=pe):(pe=Cl(re.type,re.key,re.props,null,ne.mode,pe),ma(pe,re),pe.return=ne,ne=pe)}return B(ne);case T:e:{for(Le=re.key;J!==null;){if(J.key===Le)if(J.tag===4&&J.stateNode.containerInfo===re.containerInfo&&J.stateNode.implementation===re.implementation){i(ne,J.sibling),pe=m(J,re.children||[]),pe.return=ne,ne=pe;break e}else{i(ne,J);break}else n(ne,J);J=J.sibling}pe=cc(re,ne.mode,pe),pe.return=ne,ne=pe}return B(ne);case A:return re=jr(re),ct(ne,J,re,pe)}if(G(re))return ke(ne,J,re,pe);if(U(re)){if(Le=U(re),typeof Le!="function")throw Error(l(150));return re=Le.call(re),Be(ne,J,re,pe)}if(typeof re.then=="function")return ct(ne,J,Rl(re),pe);if(re.$$typeof===b)return ct(ne,J,El(ne,re),pe);Dl(ne,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,J!==null&&J.tag===6?(i(ne,J.sibling),pe=m(J,re),pe.return=ne,ne=pe):(i(ne,J),pe=oc(re,ne.mode,pe),pe.return=ne,ne=pe),B(ne)):i(ne,J)}return function(ne,J,re,pe){try{pa=0;var Le=ct(ne,J,re,pe);return Ss=null,Le}catch(De){if(De===ys||De===Al)throw De;var tt=An(29,De,null,ne.mode);return tt.lanes=pe,tt.return=ne,tt}finally{}}}var Hr=Vf(!0),Wf=Vf(!1),Xi=!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 Qi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ji(e,n,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(it&2)!==0){var m=a.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),a.pending=n,n=bl(e),Df(e,null,i),n}return Sl(e,a,n,i),bl(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,hn(e,i)}}function wc(e,n){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var m=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?m=C=B:C=C.next=B,i=i.next}while(i!==null);C===null?m=C=n:C=C.next=n}else m=C=n;i={baseState:a.baseState,firstBaseUpdate:m,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=vs;if(e!==null)throw e}}function va(e,n,i,a){xc=!1;var m=e.updateQueue;Xi=!1;var C=m.firstBaseUpdate,B=m.lastBaseUpdate,F=m.shared.pending;if(F!==null){m.shared.pending=null;var X=F,ae=X.next;X.next=null,B===null?C=ae:B.next=ae,B=X;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,F=fe.lastBaseUpdate,F!==B&&(F===null?fe.firstBaseUpdate=ae:F.next=ae,fe.lastBaseUpdate=X))}if(C!==null){var ve=m.baseState;B=0,fe=ae=X=null,F=C;do{var le=F.lane&-536870913,oe=le!==F.lane;if(oe?(Ye&le)===le:(a&le)===le){le!==0&&le===_s&&(xc=!0),fe!==null&&(fe=fe.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var ke=e,Be=F;le=n;var ct=i;switch(Be.tag){case 1:if(ke=Be.payload,typeof ke=="function"){ve=ke.call(ct,ve,le);break e}ve=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Be.payload,le=typeof ke=="function"?ke.call(ct,ve,le):ke,le==null)break e;ve=h({},ve,le);break e;case 2:Xi=!0}}le=F.callback,le!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=m.callbacks,oe===null?m.callbacks=[le]:oe.push(le))}else oe={lane:le,tag:F.tag,payload:F.payload,callback:F.callback,next:null},fe===null?(ae=fe=oe,X=ve):fe=fe.next=oe,B|=le;if(F=F.next,F===null){if(F=m.shared.pending,F===null)break;oe=F,F=oe.next,oe.next=null,m.lastBaseUpdate=oe,m.shared.pending=null}}while(!0);fe===null&&(X=ve),m.baseState=X,m.firstBaseUpdate=ae,m.lastBaseUpdate=fe,C===null&&(m.shared.lanes=0),ir|=B,e.lanes=B,e.memoizedState=ve}}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 bs=N(null),Ml=N(0);function Xf(e,n){e=Li,I(Ml,e),I(bs,n),Li=e|n.baseLanes}function Ec(){I(Ml,Li),I(bs,bs.current)}function kc(){Li=Ml.current,q(bs),q(Ml)}var Tn=N(null),qn=null;function Zi(e){var n=e.alternate;I(kt,kt.current&1),I(Tn,e),qn===null&&(n===null||bs.current!==null||n.memoizedState!==null)&&(qn=e)}function Ac(e){I(kt,kt.current),I(Tn,e),qn===null&&(qn=e)}function Qf(e){e.tag===22?(I(kt,kt.current),I(Tn,e),qn===null&&(qn=e)):er()}function er(){I(kt,kt.current),I(Tn,Tn.current)}function Rn(e){q(Tn),qn===e&&(qn=null),q(kt)}var kt=N(0);function Ll(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 xi=0,Ue=null,lt=null,Rt=null,Ol=!1,Cs=!1,zr=!1,Bl=0,ya=0,ws=null,by=0;function wt(){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(!kn(e[i],n[i]))return!1;return!0}function Rc(e,n,i,a,m,C){return xi=C,Ue=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=e===null||e.memoizedState===null?Bd:$c,zr=!1,C=i(a,m),zr=!1,Cs&&(C=Zf(n,i,a,m)),Jf(e),C}function Jf(e){V.H=Ca;var n=lt!==null&<.next!==null;if(xi=0,Rt=lt=Ue=null,Ol=!1,ya=0,ws=null,n)throw Error(l(300));e===null||Dt||(e=e.dependencies,e!==null&&xl(e)&&(Dt=!0))}function Zf(e,n,i,a){Ue=e;var m=0;do{if(Cs&&(ws=null),ya=0,Cs=!1,25<=m)throw Error(l(301));if(m+=1,Rt=lt=null,e.updateQueue!=null){var C=e.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}V.H=jd,C=n(i,a)}while(Cs);return C}function Cy(){var e=V.H,n=e.useState()[0];return n=typeof n.then=="function"?Sa(n):n,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(Ue.flags|=1024),n}function Dc(){var e=Bl!==0;return Bl=0,e}function Mc(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function Lc(e){if(Ol){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Ol=!1}xi=0,Rt=lt=Ue=null,Cs=!1,ya=Bl=0,ws=null}function on(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Ue.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function At(){if(lt===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var n=Rt===null?Ue.memoizedState:Rt.next;if(n!==null)Rt=n,lt=e;else{if(e===null)throw Ue.alternate===null?Error(l(467)):Error(l(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Rt===null?Ue.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function jl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sa(e){var n=ya;return ya+=1,ws===null&&(ws=[]),e=qf(ws,e,n),n=Ue,(Rt===null?n.memoizedState:Rt.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?Bd:$c),e}function Nl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sa(e);if(e.$$typeof===b)return Gt(e)}throw Error(l(438,String(e)))}function Oc(e){var n=null,i=Ue.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var a=Ue.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(n={data:a.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=jl(),Ue.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 Ei(e,n){return typeof n=="function"?n(e):n}function Hl(e){var n=At();return Bc(n,lt,e)}function Bc(e,n,i){var a=e.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=i;var m=e.baseQueue,C=a.pending;if(C!==null){if(m!==null){var B=m.next;m.next=C.next,C.next=B}n.baseQueue=m=C,a.pending=null}if(C=e.baseState,m===null)e.memoizedState=C;else{n=m.next;var F=B=null,X=null,ae=n,fe=!1;do{var ve=ae.lane&-536870913;if(ve!==ae.lane?(Ye&ve)===ve:(xi&ve)===ve){var le=ae.revertLane;if(le===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),ve===_s&&(fe=!0);else if((xi&le)===le){ae=ae.next,le===_s&&(fe=!0);continue}else ve={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},X===null?(F=X=ve,B=C):X=X.next=ve,Ue.lanes|=le,ir|=le;ve=ae.action,zr&&i(C,ve),C=ae.hasEagerState?ae.eagerState:i(C,ve)}else le={lane:ve,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},X===null?(F=X=le,B=C):X=X.next=le,Ue.lanes|=ve,ir|=ve;ae=ae.next}while(ae!==null&&ae!==n);if(X===null?B=C:X.next=F,!kn(C,e.memoizedState)&&(Dt=!0,fe&&(i=vs,i!==null)))throw i;e.memoizedState=C,e.baseState=B,e.baseQueue=X,a.lastRenderedState=C}return m===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,m=i.pending,C=n.memoizedState;if(m!==null){i.pending=null;var B=m=m.next;do C=e(C,B.action),B=B.next;while(B!==m);kn(C,n.memoizedState)||(Dt=!0),n.memoizedState=C,n.baseQueue===null&&(n.baseState=C),i.lastRenderedState=C}return[C,a]}function ed(e,n,i){var a=Ue,m=At(),C=Qe;if(C){if(i===void 0)throw Error(l(407));i=i()}else i=n();var B=!kn((lt||m).memoizedState,i);if(B&&(m.memoizedState=i,Dt=!0),m=m.queue,zc(id.bind(null,a,m,e),[e]),m.getSnapshot!==n||B||Rt!==null&&Rt.memoizedState.tag&1){if(a.flags|=2048,xs(9,{destroy:void 0},nd.bind(null,a,m,i,n),null),ut===null)throw Error(l(349));C||(xi&127)!==0||td(a,n,i)}return i}function td(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Ue.updateQueue,n===null?(n=jl(),Ue.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!kn(e,i)}catch{return!0}}function sd(e){var n=Rr(e,2);n!==null&&yn(n,e,2)}function Nc(e){var n=on();if(typeof e=="function"){var i=e;if(e=i(),zr){Bt(!0);try{i()}finally{Bt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:e},n}function ad(e,n,i,a){return e.baseState=i,Bc(e,lt,typeof a=="function"?a:Ei)}function wy(e,n,i,a,m){if(Pl(e))throw Error(l(485));if(e=n.action,e!==null){var C={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){C.listeners.push(B)}};V.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,m=e.state;if(n.isTransition){var C=V.T,B={};V.T=B;try{var F=i(m,a),X=V.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),V.T=C}}else try{C=i(m,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(Qe){var i=ut.formState;if(i!==null){e:{var a=Ue;if(Qe){if(gt){t:{for(var m=gt,C=Fn;m.nodeType!==8;){if(!C){m=null;break t}if(m=$n(m.nextSibling),m===null){m=null;break t}}C=m.data,m=C==="F!"||C==="F"?m:null}if(m){gt=$n(m.nextSibling),a=m.data==="F!";break e}}Ki(a)}a=!1}a&&(n=i[0])}}return i=on(),i.memoizedState=i.baseState=n,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hd,lastRenderedState:n},i.queue=a,i=Md.bind(null,Ue,a),a.dispatch=i,a=Nc(!1),C=qc.bind(null,Ue,!1,a.queue),a=on(),m={state:n,dispatch:null,action:e,pending:null},a.queue=m,i=wy.bind(null,Ue,m,C,i),m.dispatch=i,a.memoizedState=e,[n,i,!1]}function dd(e){var n=At();return pd(n,lt,e)}function pd(e,n,i){if(n=Bc(e,n,hd)[0],e=Hl(Ei)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var a=Sa(n)}catch(B){throw B===ys?Al:B}else a=n;n=At();var m=n.queue,C=m.dispatch;return i!==n.memoizedState&&(Ue.flags|=2048,xs(9,{destroy:void 0},xy.bind(null,m,i),null)),[a,C,e]}function xy(e,n){e.action=n}function md(e){var n=At(),i=lt;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 xs(e,n,i,a){return e={tag:e,create:i,deps:a,inst:n,next:null},n=Ue.updateQueue,n===null&&(n=jl(),Ue.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 zl(e,n,i,a){var m=on();Ue.flags|=e,m.memoizedState=xs(1|n,{destroy:void 0},i,a===void 0?null:a)}function Il(e,n,i,a){var m=At();a=a===void 0?null:a;var C=m.memoizedState.inst;lt!==null&&a!==null&&Tc(a,lt.memoizedState.deps)?m.memoizedState=xs(n,C,i,a):(Ue.flags|=e,m.memoizedState=xs(1|n,C,i,a))}function _d(e,n){zl(8390656,8,e,n)}function zc(e,n){Il(2048,8,e,n)}function Ey(e){Ue.flags|=4;var n=Ue.updateQueue;if(n===null)n=jl(),Ue.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 Ey({ref:n,nextImpl:e}),function(){if((it&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function yd(e,n){return Il(4,2,e,n)}function Sd(e,n){return Il(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,Il(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(),zr){Bt(!0);try{e()}finally{Bt(!1)}}return i.memoizedState=[a,n],a}function Pc(e,n,i){return i===void 0||(xi&1073741824)!==0&&(Ye&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=Ep(),Ue.lanes|=e,ir|=e,i)}function Ed(e,n,i,a){return kn(i,n)?i:bs.current!==null?(e=Pc(e,i,a),kn(e,n)||(Dt=!0),e):(xi&42)===0||(xi&1073741824)!==0&&(Ye&261930)===0?(Dt=!0,e.memoizedState=i):(e=Ep(),Ue.lanes|=e,ir|=e,n)}function kd(e,n,i,a,m){var C=Y.p;Y.p=C!==0&&8>C?C:8;var B=V.T,F={};V.T=F,qc(e,!1,n,i);try{var X=m(),ae=V.S;if(ae!==null&&ae(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var fe=Sy(X,a);ba(e,n,fe,Ln(e))}else ba(e,n,a,Ln(e))}catch(ve){ba(e,n,{then:function(){},status:"rejected",reason:ve},Ln())}finally{Y.p=C,B!==null&&F.types!==null&&(B.types=F.types),V.T=B}}function ky(){}function Uc(e,n,i,a){if(e.tag!==5)throw Error(l(476));var m=Ad(e).queue;kd(e,m,n,te,i===null?ky:function(){return Td(e),i(a)})}function Ad(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:te},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 Td(e){var n=Ad(e);n.next===null&&(n=e.alternate.memoizedState),ba(e,n.next.queue,{},Ln())}function Fc(){return Gt(za)}function Rd(){return At().memoizedState}function Dd(){return At().memoizedState}function Ay(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=Ln();e=Qi(i);var a=Ji(n,e,i);a!==null&&(yn(a,n,i),ga(a,n,i)),n={cache:_c()},e.payload=n;return}n=n.return}}function Ty(e,n,i){var a=Ln();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Pl(e)?Ld(n,i):(i=ac(e,n,i,a),i!==null&&(yn(i,e,a),Od(i,n,a)))}function Md(e,n,i){var a=Ln();ba(e,n,i,a)}function ba(e,n,i,a){var m={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Pl(e))Ld(n,m);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(m.hasEagerState=!0,m.eagerState=F,kn(F,B))return Sl(e,n,m,0),ut===null&&yl(),!1}catch{}finally{}if(i=ac(e,n,m,a),i!==null)return yn(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},Pl(e)){if(n)throw Error(l(479))}else n=ac(e,i,a,2),n!==null&&yn(n,e,2)}function Pl(e){var n=e.alternate;return e===Ue||n!==null&&n===Ue}function Ld(e,n){Cs=Ol=!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,hn(e,i)}}var Ca={readContext:Gt,use:Nl,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt};Ca.useEffectEvent=wt;var Bd={readContext:Gt,use:Nl,useCallback:function(e,n){return on().memoizedState=[e,n===void 0?null:n],e},useContext:Gt,useEffect:_d,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,zl(4194308,4,bd.bind(null,n,e),i)},useLayoutEffect:function(e,n){return zl(4194308,4,e,n)},useInsertionEffect:function(e,n){zl(4,2,e,n)},useMemo:function(e,n){var i=on();n=n===void 0?null:n;var a=e();if(zr){Bt(!0);try{e()}finally{Bt(!1)}}return i.memoizedState=[a,n],a},useReducer:function(e,n,i){var a=on();if(i!==void 0){var m=i(n);if(zr){Bt(!0);try{i(n)}finally{Bt(!1)}}}else m=n;return a.memoizedState=a.baseState=m,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:m},a.queue=e,e=e.dispatch=Ty.bind(null,Ue,e),[a.memoizedState,e]},useRef:function(e){var n=on();return e={current:e},n.memoizedState=e},useState:function(e){e=Nc(e);var n=e.queue,i=Md.bind(null,Ue,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:Ic,useDeferredValue:function(e,n){var i=on();return Pc(i,e,n)},useTransition:function(){var e=Nc(!1);return e=kd.bind(null,Ue,e.queue,!0,!1),on().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var a=Ue,m=on();if(Qe){if(i===void 0)throw Error(l(407));i=i()}else{if(i=n(),ut===null)throw Error(l(349));(Ye&127)!==0||td(a,n,i)}m.memoizedState=i;var C={value:i,getSnapshot:n};return m.queue=C,_d(id.bind(null,a,C,e),[e]),a.flags|=2048,xs(9,{destroy:void 0},nd.bind(null,a,C,i,n),null),i},useId:function(){var e=on(),n=ut.identifierPrefix;if(Qe){var i=li,a=ai;i=(a&~(1<<32-et(a)-1)).toString(32)+i,n="_"+n+"R_"+i,i=Bl++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=by++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Fc,useFormState:fd,useActionState:fd,useOptimistic:function(e){var n=on();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,Ue,!0,i),i.dispatch=n,[e,n]},useMemoCache:Oc,useCacheRefresh:function(){return on().memoizedState=Ay.bind(null,Ue)},useEffectEvent:function(e){var n=on(),i={impl:e};return n.memoizedState=i,function(){if((it&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},$c={readContext:Gt,use:Nl,useCallback:wd,useContext:Gt,useEffect:zc,useImperativeHandle:Cd,useInsertionEffect:yd,useLayoutEffect:Sd,useMemo:xd,useReducer:Hl,useRef:gd,useState:function(){return Hl(Ei)},useDebugValue:Ic,useDeferredValue:function(e,n){var i=At();return Ed(i,lt.memoizedState,e,n)},useTransition:function(){var e=Hl(Ei)[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,lt,e,n)},useMemoCache:Oc,useCacheRefresh:Dd};$c.useEffectEvent=vd;var jd={readContext:Gt,use:Nl,useCallback:wd,useContext:Gt,useEffect:zc,useImperativeHandle:Cd,useInsertionEffect:yd,useLayoutEffect:Sd,useMemo:xd,useReducer:jc,useRef:gd,useState:function(){return jc(Ei)},useDebugValue:Ic,useDeferredValue:function(e,n){var i=At();return lt===null?Pc(i,e,n):Ed(i,lt.memoizedState,e,n)},useTransition:function(){var e=jc(Ei)[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 lt!==null?ad(i,lt,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:h({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Vc={enqueueSetState:function(e,n,i){e=e._reactInternals;var a=Ln(),m=Qi(a);m.payload=n,i!=null&&(m.callback=i),n=Ji(e,m,a),n!==null&&(yn(n,e,a),ga(n,e,a))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var a=Ln(),m=Qi(a);m.tag=1,m.payload=n,i!=null&&(m.callback=i),n=Ji(e,m,a),n!==null&&(yn(n,e,a),ga(n,e,a))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Ln(),a=Qi(i);a.tag=2,n!=null&&(a.callback=n),n=Ji(e,a,i),n!==null&&(yn(n,e,i),ga(n,e,i))}};function Nd(e,n,i,a,m,C,B){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,C,B):n.prototype&&n.prototype.isPureReactComponent?!oa(i,a)||!oa(m,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 Ir(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=h({},i));for(var m in e)i[m]===void 0&&(i[m]=e[m])}return i}function zd(e){vl(e)}function Id(e){console.error(e)}function Pd(e){vl(e)}function Ul(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(m){setTimeout(function(){throw m})}}function Wc(e,n,i){return i=Qi(i),i.tag=3,i.payload={element:null},i.callback=function(){Ul(e,n)},i}function Fd(e){return e=Qi(e),e.tag=3,e}function qd(e,n,i,a){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var C=a.value;e.payload=function(){return m(C)},e.callback=function(){Ud(n,i,a)}}var B=i.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(e.callback=function(){Ud(n,i,a),typeof m!="function"&&(rr===null?rr=new Set([this]):rr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function Ry(e,n,i,a,m){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(n=i.alternate,n!==null&&gs(n,i,m,!0),i=Tn.current,i!==null){switch(i.tag){case 31:case 13:return qn===null?Zl():i.alternate===null&&xt===0&&(xt=3),i.flags&=-257,i.flags|=65536,i.lanes=m,a===Tl?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([a]):n.add(a),vu(e,a,m)),!1;case 22:return i.flags|=65536,a===Tl?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,m)),!1}throw Error(l(435,i.tag))}return vu(e,a,m),Zl(),!1}if(Qe)return n=Tn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,a!==fc&&(e=Error(l(422),{cause:a}),ha(In(e,i)))):(a!==fc&&(n=Error(l(423),{cause:a}),ha(In(n,i))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,a=In(a,i),m=Wc(e.stateNode,a,m),wc(e,m),xt!==4&&(xt=2)),!1;var C=Error(l(520),{cause:a});if(C=In(C,i),Da===null?Da=[C]:Da.push(C),xt!==4&&(xt=2),n===null)return!0;a=In(a,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,e=m&-m,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"&&(rr===null||!rr.has(C))))return i.flags|=65536,m&=-m,i.lanes|=m,m=Fd(m),qd(m,e,i,a),wc(i,m),!1}i=i.return}while(i!==null);return!1}var Kc=Error(l(461)),Dt=!1;function Vt(e,n,i,a){n.child=e===null?Wf(n,null,i,a):Hr(n,e.child,i,a)}function $d(e,n,i,a,m){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 Or(n),a=Rc(e,n,i,B,C,m),F=Dc(),e!==null&&!Dt?(Mc(e,n,m),ki(e,n,m)):(Qe&&F&&uc(n),n.flags|=1,Vt(e,n,a,m),n.child)}function Gd(e,n,i,a,m){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,m)):(e=Cl(i.type,null,a,n,n.mode,m),e.ref=n.ref,e.return=n,n.child=e)}if(C=e.child,!nu(e,m)){var B=C.memoizedProps;if(i=i.compare,i=i!==null?i:oa,i(B,a)&&e.ref===n.ref)return ki(e,n,m)}return n.flags|=1,e=Si(C,a),e.ref=n.ref,e.return=n,n.child=e}function Vd(e,n,i,a,m){if(e!==null){var C=e.memoizedProps;if(oa(C,a)&&e.ref===n.ref)if(Dt=!1,n.pendingProps=a=C,nu(e,m))(e.flags&131072)!==0&&(Dt=!0);else return n.lanes=e.lanes,ki(e,n,m)}return Yc(e,n,i,a,m)}function Wd(e,n,i,a){var m=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,m=0;a!==null;)m=m|a.lanes|a.childLanes,a=a.sibling;a=m&~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&&kl(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?(kl(n,C.cachePool),Xf(n,C),er(),n.memoizedState=null):(e!==null&&kl(n,null),Ec(),er());return Vt(e,n,m,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,m){var C=yc();return C=C===null?null:{parent:Tt._currentValue,pool:C},n.memoizedState={baseLanes:i,cachePool:C},e!==null&&kl(n,null),Ec(),Qf(n),e!==null&&gs(e,n,a,!0),n.childLanes=m,null}function Fl(e,n){return n=$l({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 Hr(n,e.child,null,i),e=Fl(n,n.pendingProps),e.flags|=2,Rn(n),n.memoizedState=null,e}function Dy(e,n,i){var a=n.pendingProps,m=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Qe){if(a.mode==="hidden")return e=Fl(n,a),n.lanes=536870912,wa(null,e);if(Ac(n),(e=gt)?(e=lm(e,Fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Vi!==null?{id:ai,overflow:li}:null,retryLane:536870912,hydrationErrors:null},i=Lf(e),i.return=n,n.child=i,$t=n,gt=null)):e=null,e===null)throw Ki(n);return n.lanes=536870912,null}return Fl(n,a)}var C=e.memoizedState;if(C!==null){var B=C.dehydrated;if(Ac(n),m)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(Dt||gs(e,n,i,!1),m=(i&e.childLanes)!==0,Dt||m){if(a=ut,a!==null&&(B=Pi(a,i),B!==0&&B!==C.retryLane))throw C.retryLane=B,Rr(e,B),yn(a,e,B),Kc;Zl(),n=Yd(e,n,i)}else e=C.treeContext,gt=$n(B.nextSibling),$t=n,Qe=!0,Wi=null,Fn=!1,e!==null&&jf(n,e),n=Fl(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 ql(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,m){return Or(n),i=Rc(e,n,i,a,void 0,m),a=Dc(),e!==null&&!Dt?(Mc(e,n,m),ki(e,n,m)):(Qe&&a&&uc(n),n.flags|=1,Vt(e,n,i,m),n.child)}function Xd(e,n,i,a,m,C){return Or(n),n.updateQueue=null,i=Zf(n,a,i,m),Jf(e),a=Dc(),e!==null&&!Dt?(Mc(e,n,C),ki(e,n,C)):(Qe&&a&&uc(n),n.flags|=1,Vt(e,n,i,C),n.child)}function Qd(e,n,i,a,m){if(Or(n),n.stateNode===null){var C=fs,B=i.contextType;typeof B=="object"&&B!==null&&(C=Gt(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?Gt(B):fs,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,m),_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=Ir(i,F);C.props=X;var ae=C.context,fe=i.contextType;B=fs,typeof fe=="object"&&fe!==null&&(B=Gt(fe));var ve=i.getDerivedStateFromProps;fe=typeof ve=="function"||typeof C.getSnapshotBeforeUpdate=="function",F=n.pendingProps!==F,fe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F||ae!==B)&&Hd(n,C,a,B),Xi=!1;var le=n.memoizedState;C.state=le,va(n,a,C,m),_a(),ae=n.memoizedState,F||le!==ae||Xi?(typeof ve=="function"&&(Gc(n,i,ve,a),ae=n.memoizedState),(X=Xi||Nd(n,i,X,a,le,ae,B))?(fe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(n.flags|=4194308)):(typeof C.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=a,n.memoizedState=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,fe=Ir(i,B),C.props=fe,ve=n.pendingProps,le=C.context,ae=i.contextType,X=fs,typeof ae=="object"&&ae!==null&&(X=Gt(ae)),F=i.getDerivedStateFromProps,(ae=typeof F=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(B!==ve||le!==X)&&Hd(n,C,a,X),Xi=!1,le=n.memoizedState,C.state=le,va(n,a,C,m),_a();var oe=n.memoizedState;B!==ve||le!==oe||Xi||e!==null&&e.dependencies!==null&&xl(e.dependencies)?(typeof F=="function"&&(Gc(n,i,F,a),oe=n.memoizedState),(fe=Xi||Nd(n,i,fe,a,le,oe,X)||e!==null&&e.dependencies!==null&&xl(e.dependencies))?(ae||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(a,oe,X),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(a,oe,X)),typeof C.componentDidUpdate=="function"&&(n.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof C.componentDidUpdate!="function"||B===e.memoizedProps&&le===e.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&le===e.memoizedState||(n.flags|=1024),n.memoizedProps=a,n.memoizedState=oe),C.props=a,C.state=oe,C.context=X,a=fe):(typeof C.componentDidUpdate!="function"||B===e.memoizedProps&&le===e.memoizedState||(n.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&le===e.memoizedState||(n.flags|=1024),a=!1)}return C=a,ql(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=Hr(n,e.child,null,m),n.child=Hr(n,null,i,m)):Vt(e,n,i,m),n.memoizedState=C.state,e=n.child):e=ki(e,n,m),e}function Jd(e,n,i,a){return Mr(),n.flags|=256,Vt(e,n,i,a),n.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Uf()}}function Jc(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=Mn),e}function Zd(e,n,i){var a=n.pendingProps,m=!1,C=(n.flags&128)!==0,B;if((B=C)||(B=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),B&&(m=!0,n.flags&=-129),B=(n.flags&32)!==0,n.flags&=-33,e===null){if(Qe){if(m?Zi(n):er(),(e=gt)?(e=lm(e,Fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Vi!==null?{id:ai,overflow:li}:null,retryLane:536870912,hydrationErrors:null},i=Lf(e),i.return=n,n.child=i,$t=n,gt=null)):e=null,e===null)throw Ki(n);return Bu(e)?n.lanes=32:n.lanes=536870912,null}var F=a.children;return a=a.fallback,m?(er(),m=n.mode,F=$l({mode:"hidden",children:F},m),a=Dr(a,m,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)):(Zi(n),Zc(n,F))}var X=e.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(C)n.flags&256?(Zi(n),n.flags&=-257,n=eu(e,n,i)):n.memoizedState!==null?(er(),n.child=e.child,n.flags|=128,n=null):(er(),F=a.fallback,m=n.mode,a=$l({mode:"visible",children:a.children},m),F=Dr(F,m,i,null),F.flags|=2,a.return=n,F.return=n,a.sibling=F,n.child=a,Hr(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(Zi(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(Dt||gs(e,n,i,!1),B=(i&e.childLanes)!==0,Dt||B){if(B=ut,B!==null&&(a=Pi(B,i),a!==0&&a!==X.retryLane))throw X.retryLane=a,Rr(e,a),yn(B,e,a),Kc;Ou(F)||Zl(),n=eu(e,n,i)}else Ou(F)?(n.flags|=192,n.child=e.child,n=null):(e=X.treeContext,gt=$n(F.nextSibling),$t=n,Qe=!0,Wi=null,Fn=!1,e!==null&&jf(n,e),n=Zc(n,a.children),n.flags|=4096);return n}return m?(er(),F=a.fallback,m=n.mode,X=e.child,ae=X.sibling,a=Si(X,{mode:"hidden",children:a.children}),a.subtreeFlags=X.subtreeFlags&65011712,ae!==null?F=Si(ae,F):(F=Dr(F,m,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):(m=F.cachePool,m!==null?(X=Tt._currentValue,m=m.parent!==X?{parent:X,pool:X}:m):m=Uf(),F={baseLanes:F.baseLanes|i,cachePool:m}),a.memoizedState=F,a.childLanes=Jc(e,B,i),n.memoizedState=Xc,wa(e.child,a)):(Zi(n),i=e.child,e=i.sibling,i=Si(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=$l({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function $l(e,n){return e=An(22,e,null,n),e.lanes=0,e}function eu(e,n,i){return Hr(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,m,C){var B=e.memoizedState;B===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:m,treeForkCount:C}:(B.isBackwards=n,B.rendering=null,B.renderingStartTime=0,B.last=a,B.tail=i,B.tailMode=m,B.treeForkCount=C)}function tp(e,n,i){var a=n.pendingProps,m=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),Vt(e,n,a,i),a=Qe?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(m){case"forwards":for(i=n.child,m=null;i!==null;)e=i.alternate,e!==null&&Ll(e)===null&&(m=i),i=i.sibling;i=m,i===null?(m=n.child,n.child=null):(m=i.sibling,i.sibling=null),tu(n,!1,m,i,C,a);break;case"backwards":case"unstable_legacy-backwards":for(i=null,m=n.child,n.child=null;m!==null;){if(e=m.alternate,e!==null&&Ll(e)===null){n.child=m;break}e=m.sibling,m.sibling=i,i=m,m=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 ki(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),ir|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(gs(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 nu(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&xl(e)))}function My(e,n,i){switch(n.tag){case 3:$(n,n.stateNode.containerInfo),Yi(n,Tt,e.memoizedState.cache),Mr();break;case 27:case 5:se(n);break;case 4:$(n,n.stateNode.containerInfo);break;case 10:Yi(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?(Zi(n),n.flags|=128,null):(i&n.child.childLanes)!==0?Zd(e,n,i):(Zi(n),e=ki(e,n,i),e!==null?e.sibling:null);Zi(n);break;case 19:var m=(e.flags&128)!==0;if(a=(i&n.childLanes)!==0,a||(gs(e,n,i,!1),a=(i&n.childLanes)!==0),m){if(a)return tp(e,n,i);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),I(kt,kt.current),a)break;return null;case 22:return n.lanes=0,Wd(e,n,i,n.pendingProps);case 24:Yi(n,Tt,e.memoizedState.cache)}return ki(e,n,i)}function np(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)Dt=!0;else{if(!nu(e,i)&&(n.flags&128)===0)return Dt=!1,My(e,n,i);Dt=(e.flags&131072)!==0}else Dt=!1,Qe&&(n.flags&1048576)!==0&&Bf(n,ua,n.index);switch(n.lanes=0,n.tag){case 16:e:{var a=n.pendingProps;if(e=jr(n.elementType),n.type=e,typeof e=="function")lc(e)?(a=Ir(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 m=e.$$typeof;if(m===E){n.tag=11,n=$d(null,n,e,a,i);break e}else if(m===D){n.tag=14,n=Gd(null,n,e,a,i);break e}}throw n=K(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,m=Ir(a,n.pendingProps),Qd(e,n,a,m,i);case 3:e:{if($(n,n.stateNode.containerInfo),e===null)throw Error(l(387));a=n.pendingProps;var C=n.memoizedState;m=C.element,Cc(e,n),va(n,a,null,i);var B=n.memoizedState;if(a=B.cache,Yi(n,Tt,a),a!==C.cache&&gc(n,[Tt],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!==m){m=In(Error(l(424)),n),ha(m),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(gt=$n(e.firstChild),$t=n,Qe=!0,Wi=null,Fn=!0,i=Wf(n,null,a,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Mr(),a===m){n=ki(e,n,i);break e}Vt(e,n,a,i)}n=n.child}return n;case 26:return ql(e,n),e===null?(i=dm(n.type,null,n.pendingProps,null))?n.memoizedState=i:Qe||(i=n.type,e=n.pendingProps,a=ao(_e.current).createElement(i),a[bt]=n,a[Nt]=e,Wt(a,i,e),Et(a),n.stateNode=a):n.memoizedState=dm(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return se(n),e===null&&Qe&&(a=n.stateNode=um(n.type,n.pendingProps,_e.current),$t=n,Fn=!0,m=gt,or(n.type)?(ju=m,gt=$n(a.firstChild)):gt=m),Vt(e,n,n.pendingProps.children,i),ql(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Qe&&((m=a=gt)&&(a=l0(a,n.type,n.pendingProps,Fn),a!==null?(n.stateNode=a,$t=n,gt=$n(a.firstChild),Fn=!1,m=!0):m=!1),m||Ki(n)),se(n),m=n.type,C=n.pendingProps,B=e!==null?e.memoizedProps:null,a=C.children,Du(m,C)?a=null:B!==null&&Du(m,B)&&(n.flags|=32),n.memoizedState!==null&&(m=Rc(e,n,Cy,null,null,i),za._currentValue=m),ql(e,n),Vt(e,n,a,i),n.child;case 6:return e===null&&Qe&&((e=i=gt)&&(i=o0(i,n.pendingProps,Fn),i!==null?(n.stateNode=i,$t=n,gt=null,e=!0):e=!1),e||Ki(n)),null;case 13:return Zd(e,n,i);case 4:return $(n,n.stateNode.containerInfo),a=n.pendingProps,e===null?n.child=Hr(n,null,a,i):Vt(e,n,a,i),n.child;case 11:return $d(e,n,n.type,n.pendingProps,i);case 7:return Vt(e,n,n.pendingProps,i),n.child;case 8:return Vt(e,n,n.pendingProps.children,i),n.child;case 12:return Vt(e,n,n.pendingProps.children,i),n.child;case 10:return a=n.pendingProps,Yi(n,n.type,a.value),Vt(e,n,a.children,i),n.child;case 9:return m=n.type._context,a=n.pendingProps.children,Or(n),m=Gt(m),a=a(m),n.flags|=1,Vt(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 Dy(e,n,i);case 22:return Wd(e,n,i,n.pendingProps);case 24:return Or(n),a=Gt(Tt),e===null?(m=yc(),m===null&&(m=ut,C=_c(),m.pooledCache=C,C.refCount++,C!==null&&(m.pooledCacheLanes|=i),m=C),n.memoizedState={parent:a,cache:m},bc(n),Yi(n,Tt,m)):((e.lanes&i)!==0&&(Cc(e,n),va(n,null,null,i),_a()),m=e.memoizedState,C=n.memoizedState,m.parent!==a?(m={parent:a,cache:a},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),Yi(n,Tt,a)):(a=C.cache,Yi(n,Tt,a),a!==m.cache&&gc(n,[Tt],i,!0))),Vt(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 iu(e,n,i,a,m){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(m&335544128)===m)if(e.stateNode.complete)e.flags|=8192;else if(Rp())e.flags|=8192;else throw Nr=Tl,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 Nr=Tl,Sc}function Gl(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?un():536870912,e.lanes|=n,Ts|=n)}function xa(e,n){if(!Qe)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function _t(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,a=0;if(n)for(var m=e.child;m!==null;)i|=m.lanes|m.childLanes,a|=m.subtreeFlags&65011712,a|=m.flags&65011712,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)i|=m.lanes|m.childLanes,a|=m.subtreeFlags,a|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=a,e.childLanes=i,n}function Ly(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 _t(n),null;case 1:return _t(n),null;case 3:return i=n.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),wi(Tt),ce(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ms(n)?Ai(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,dc())),_t(n),null;case 26:var m=n.type,C=n.memoizedState;return e===null?(Ai(n),C!==null?(_t(n),ip(n,C)):(_t(n),iu(n,m,null,a,i))):C?C!==e.memoizedState?(Ai(n),_t(n),ip(n,C)):(_t(n),n.flags&=-16777217):(e=e.memoizedProps,e!==a&&Ai(n),_t(n),iu(n,m,e,a,i)),null;case 27:if(xe(n),i=_e.current,m=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&Ai(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return _t(n),null}e=ie.current,ms(n)?Nf(n):(e=um(m,a,i),n.stateNode=e,Ai(n))}return _t(n),null;case 5:if(xe(n),m=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&Ai(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return _t(n),null}if(C=ie.current,ms(n))Nf(n);else{var B=ao(_e.current);switch(C){case 1:C=B.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:C=B.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":C=B.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":C=B.createElementNS("http://www.w3.org/1998/Math/MathML",m);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(m,{is:a.is}):B.createElement(m)}}C[bt]=n,C[Nt]=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(Wt(C,m,a),m){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 _t(n),iu(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,ms(n)){if(e=n.stateNode,i=n.memoizedProps,a=null,m=$t,m!==null)switch(m.tag){case 27:case 5:a=m.memoizedProps}e[bt]=n,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Zp(e.nodeValue,i)),e||Ki(n,!0)}else e=ao(e).createTextNode(a),e[bt]=n,n.stateNode=e}return _t(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(a=ms(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[bt]=n}else Mr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;_t(n),e=!1}else i=dc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return n.flags&256?(Rn(n),n):(Rn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return _t(n),null;case 13:if(a=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=ms(n),a!==null&&a.dehydrated!==null){if(e===null){if(!m)throw Error(l(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[bt]=n}else Mr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;_t(n),m=!1}else m=dc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(Rn(n),n):(Rn(n),null)}return Rn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=a!==null,e=e!==null&&e.memoizedState!==null,i&&(a=n.child,m=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(m=a.alternate.memoizedState.cachePool.pool),C=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(C=a.memoizedState.cachePool.pool),C!==m&&(a.flags|=2048)),i!==e&&i&&(n.child.flags|=8192),Gl(n,n.updateQueue),_t(n),null);case 4:return ce(),e===null&&Eu(n.stateNode.containerInfo),_t(n),null;case 10:return wi(n.type),_t(n),null;case 19:if(q(kt),a=n.memoizedState,a===null)return _t(n),null;if(m=(n.flags&128)!==0,C=a.rendering,C===null)if(m)xa(a,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(C=Ll(e),C!==null){for(n.flags|=128,xa(a,!1),e=C.updateQueue,n.updateQueue=e,Gl(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),Qe&&bi(n,a.treeForkCount),n.child}e=e.sibling}a.tail!==null&&mt()>Xl&&(n.flags|=128,m=!0,xa(a,!1),n.lanes=4194304)}else{if(!m)if(e=Ll(C),e!==null){if(n.flags|=128,m=!0,e=e.updateQueue,n.updateQueue=e,Gl(n,e),xa(a,!0),a.tail===null&&a.tailMode==="hidden"&&!C.alternate&&!Qe)return _t(n),null}else 2*mt()-a.renderingStartTime>Xl&&i!==536870912&&(n.flags|=128,m=!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=mt(),e.sibling=null,i=kt.current,I(kt,m?i&1|2:i&1),Qe&&bi(n,a.treeForkCount),e):(_t(n),null);case 22:case 23:return Rn(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&&(_t(n),n.subtreeFlags&6&&(n.flags|=8192)):_t(n),i=n.updateQueue,i!==null&&Gl(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&&q(Br),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),wi(Tt),_t(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function Oy(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 wi(Tt),ce(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return xe(n),null;case 31:if(n.memoizedState!==null){if(Rn(n),n.alternate===null)throw Error(l(340));Mr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Rn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));Mr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return q(kt),null;case 4:return ce(),null;case 10:return wi(n.type),null;case 22:case 23:return Rn(n),kc(),e!==null&&q(Br),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return wi(Tt),null;case 25:return null;default:return null}}function rp(e,n){switch(hc(n),n.tag){case 3:wi(Tt),ce();break;case 26:case 27:case 5:xe(n);break;case 4:ce();break;case 31:n.memoizedState!==null&&Rn(n);break;case 13:Rn(n);break;case 19:q(kt);break;case 10:wi(n.type);break;case 22:case 23:Rn(n),kc(),e!==null&&q(Br);break;case 24:wi(Tt)}}function Ea(e,n){try{var i=n.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var m=a.next;i=m;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!==m)}}catch(F){at(n,n.return,F)}}function tr(e,n,i){try{var a=n.updateQueue,m=a!==null?a.lastEffect:null;if(m!==null){var C=m.next;a=C;do{if((a.tag&e)===e){var B=a.inst,F=B.destroy;if(F!==void 0){B.destroy=void 0,m=n;var X=i,ae=F;try{ae()}catch(fe){at(m,X,fe)}}}a=a.next}while(a!==C)}}catch(fe){at(n,n.return,fe)}}function sp(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{Yf(n,i)}catch(a){at(e,e.return,a)}}}function ap(e,n,i){i.props=Ir(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){at(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(m){at(e,n,m)}}function oi(e,n){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(m){at(e,n,m)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(m){at(e,n,m)}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(m){at(e,e.return,m)}}function ru(e,n,i){try{var a=e.stateNode;t0(a,e.type,i,n),a[Nt]=n}catch(m){at(e,e.return,m)}}function op(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&or(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&&or(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=Yt));else if(a!==4&&(a===27&&or(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 Vl(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&&or(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Vl(e,n,i),e=e.sibling;e!==null;)Vl(e,n,i),e=e.sibling}function cp(e){var n=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);Wt(n,a,i),n[bt]=e,n[Nt]=i}catch(C){at(e,e.return,C)}}var Ti=!1,Mt=!1,lu=!1,up=typeof WeakSet=="function"?WeakSet:Set,Pt=null;function By(e,n){if(e=e.containerInfo,Tu=po,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 m=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,fe=0,ve=e,le=null;t:for(;;){for(var oe;ve!==i||m!==0&&ve.nodeType!==3||(F=B+m),ve!==C||a!==0&&ve.nodeType!==3||(X=B+a),ve.nodeType===3&&(B+=ve.nodeValue.length),(oe=ve.firstChild)!==null;)le=ve,ve=oe;for(;;){if(ve===e)break t;if(le===i&&++ae===m&&(F=B),le===C&&++fe===a&&(X=B),(oe=ve.nextSibling)!==null)break;ve=le,le=ve.parentNode}ve=oe}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},po=!1,Pt=n;Pt!==null;)if(n=Pt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Pt=e;else for(;Pt!==null;){switch(n=Pt,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++)m=e[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&C!==null){e=void 0,i=n,m=C.memoizedProps,C=C.memoizedState,a=i.stateNode;try{var ke=Ir(i.type,m);e=a.getSnapshotBeforeUpdate(ke,C),a.__reactInternalSnapshotBeforeUpdate=e}catch(Be){at(i,i.return,Be)}}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,Pt=e;break}Pt=n.return}}function hp(e,n,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Di(e,i),a&4&&Ea(5,i);break;case 1:if(Di(e,i),a&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(B){at(i,i.return,B)}else{var m=Ir(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(m,n,e.__reactInternalSnapshotBeforeUpdate)}catch(B){at(i,i.return,B)}}a&64&&sp(i),a&512&&ka(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{Yf(e,n)}catch(B){at(i,i.return,B)}}break;case 27:n===null&&a&4&&cp(i);case 26:case 5:Di(e,i),n===null&&a&4&&lp(i),a&512&&ka(i,i.return);break;case 12:Di(e,i);break;case 31:Di(e,i),a&4&&pp(e,i);break;case 13:Di(e,i),a&4&&mp(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=qy.bind(null,i),c0(e,i))));break;case 22:if(a=i.memoizedState!==null||Ti,!a){n=n!==null&&n.memoizedState!==null||Mt,m=Ti;var C=Mt;Ti=a,(Mt=n)&&!C?Mi(e,i,(i.subtreeFlags&8772)!==0):Di(e,i),Ti=m,Mt=C}break;case 30:break;default:Di(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&&Xr(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var yt=null,mn=!1;function Ri(e,n,i){for(i=i.child;i!==null;)dp(e,n,i),i=i.sibling}function dp(e,n,i){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Ct,i)}catch{}switch(i.tag){case 26:Mt||oi(i,n),Ri(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Mt||oi(i,n);var a=yt,m=mn;or(i.type)&&(yt=i.stateNode,mn=!1),Ri(e,n,i),ja(i.stateNode),yt=a,mn=m;break;case 5:Mt||oi(i,n);case 6:if(a=yt,m=mn,yt=null,Ri(e,n,i),yt=a,mn=m,yt!==null)if(mn)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(i.stateNode)}catch(C){at(i,n,C)}else try{yt.removeChild(i.stateNode)}catch(C){at(i,n,C)}break;case 18:yt!==null&&(mn?(e=yt,sm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ns(e)):sm(yt,i.stateNode));break;case 4:a=yt,m=mn,yt=i.stateNode.containerInfo,mn=!0,Ri(e,n,i),yt=a,mn=m;break;case 0:case 11:case 14:case 15:tr(2,i,n),Mt||tr(4,i,n),Ri(e,n,i);break;case 1:Mt||(oi(i,n),a=i.stateNode,typeof a.componentWillUnmount=="function"&&ap(i,n,a)),Ri(e,n,i);break;case 21:Ri(e,n,i);break;case 22:Mt=(a=Mt)||i.memoizedState!==null,Ri(e,n,i),Mt=a;break;default:Ri(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{Ns(e)}catch(i){at(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{Ns(e)}catch(i){at(n,n.return,i)}}function jy(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new 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 Wl(e,n){var i=jy(e);n.forEach(function(a){if(!i.has(a)){i.add(a);var m=$y.bind(null,e,a);a.then(m,m)}})}function gn(e,n){var i=n.deletions;if(i!==null)for(var a=0;a<i.length;a++){var m=i[a],C=e,B=n,F=B;e:for(;F!==null;){switch(F.tag){case 27:if(or(F.type)){yt=F.stateNode,mn=!1;break e}break;case 5:yt=F.stateNode,mn=!1;break e;case 3:case 4:yt=F.stateNode.containerInfo,mn=!0;break e}F=F.return}if(yt===null)throw Error(l(160));dp(C,B,m),yt=null,mn=!1,C=m.alternate,C!==null&&(C.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)gp(n,e),n=n.sibling}var Jn=null;function gp(e,n){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gn(n,e),_n(e),a&4&&(tr(3,e,e.return),Ea(3,e),tr(5,e,e.return));break;case 1:gn(n,e),_n(e),a&512&&(Mt||i===null||oi(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 m=Jn;if(gn(n,e),_n(e),a&512&&(Mt||i===null||oi(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,m=m.ownerDocument||m;t:switch(a){case"title":C=m.getElementsByTagName("title")[0],(!C||C[yr]||C[bt]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=m.createElement(a),m.head.insertBefore(C,m.querySelector("head > title"))),Wt(C,a,i),C[bt]=e,Et(C),a=C;break e;case"link":var B=gm("link","href",m).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=m.createElement(a),Wt(C,a,i),m.head.appendChild(C);break;case"meta":if(B=gm("meta","content",m).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=m.createElement(a),Wt(C,a,i),m.head.appendChild(C);break;default:throw Error(l(468,a))}C[bt]=e,Et(C),a=C}e.stateNode=a}else _m(m,e.type,e.stateNode);else e.stateNode=mm(m,a,e.memoizedProps);else C!==a?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,a===null?_m(m,e.type,e.stateNode):mm(m,a,e.memoizedProps)):a===null&&e.stateNode!==null&&ru(e,e.memoizedProps,i.memoizedProps)}break;case 27:gn(n,e),_n(e),a&512&&(Mt||i===null||oi(i,i.return)),i!==null&&a&4&&ru(e,e.memoizedProps,i.memoizedProps);break;case 5:if(gn(n,e),_n(e),a&512&&(Mt||i===null||oi(i,i.return)),e.flags&32){m=e.stateNode;try{vi(m,"")}catch(ke){at(e,e.return,ke)}}a&4&&e.stateNode!=null&&(m=e.memoizedProps,ru(e,m,i!==null?i.memoizedProps:m)),a&1024&&(lu=!0);break;case 6:if(gn(n,e),_n(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(ke){at(e,e.return,ke)}}break;case 3:if(co=null,m=Jn,Jn=lo(n.containerInfo),gn(n,e),Jn=m,_n(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Ns(n.containerInfo)}catch(ke){at(e,e.return,ke)}lu&&(lu=!1,_p(e));break;case 4:a=Jn,Jn=lo(e.stateNode.containerInfo),gn(n,e),_n(e),Jn=a;break;case 12:gn(n,e),_n(e);break;case 31:gn(n,e),_n(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Wl(e,a)));break;case 13:gn(n,e),_n(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Yl=mt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Wl(e,a)));break;case 22:m=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,ae=Ti,fe=Mt;if(Ti=ae||m,Mt=fe||X,gn(n,e),Mt=fe,Ti=ae,_n(e),a&8192)e:for(n=e.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,m&&(i===null||X||Ti||Mt||Pr(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){X=i=n;try{if(C=X.stateNode,m)B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{F=X.stateNode;var ve=X.memoizedProps.style,le=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;F.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(ke){at(X,X.return,ke)}}}else if(n.tag===6){if(i===null){X=n;try{X.stateNode.nodeValue=m?"":X.memoizedProps}catch(ke){at(X,X.return,ke)}}}else if(n.tag===18){if(i===null){X=n;try{var oe=X.stateNode;m?am(oe,!0):am(X.stateNode,!1)}catch(ke){at(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,Wl(e,i))));break;case 19:gn(n,e),_n(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Wl(e,a)));break;case 30:break;case 21:break;default:gn(n,e),_n(e)}}function _n(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 m=i.stateNode,C=su(e);Vl(e,C,m);break;case 5:var B=i.stateNode;i.flags&32&&(vi(B,""),i.flags&=-33);var F=su(e);Vl(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(fe){at(e,e.return,fe)}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 Di(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)hp(e,n.alternate,n),n=n.sibling}function Pr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:tr(4,n,n.return),Pr(n);break;case 1:oi(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&ap(n,n.return,i),Pr(n);break;case 27:ja(n.stateNode);case 26:case 5:oi(n,n.return),Pr(n);break;case 22:n.memoizedState===null&&Pr(n);break;case 30:Pr(n);break;default:Pr(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,m=e,C=n,B=C.flags;switch(C.tag){case 0:case 11:case 15:Mi(m,C,i),Ea(4,C);break;case 1:if(Mi(m,C,i),a=C,m=a.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ae){at(a,a.return,ae)}if(a=C,m=a.updateQueue,m!==null){var F=a.stateNode;try{var X=m.shared.hiddenCallbacks;if(X!==null)for(m.shared.hiddenCallbacks=null,m=0;m<X.length;m++)Kf(X[m],F)}catch(ae){at(a,a.return,ae)}}i&&B&64&&sp(C),ka(C,C.return);break;case 27:cp(C);case 26:case 5:Mi(m,C,i),i&&a===null&&B&4&&lp(C),ka(C,C.return);break;case 12:Mi(m,C,i);break;case 31:Mi(m,C,i),i&&B&4&&pp(m,C);break;case 13:Mi(m,C,i),i&&B&4&&mp(m,C);break;case 22:C.memoizedState===null&&Mi(m,C,i),ka(C,C.return);break;case 30:break;default:Mi(m,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 Zn(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 m=n.flags;switch(n.tag){case 0:case 11:case 15:Zn(e,n,i,a),m&2048&&Ea(9,n);break;case 1:Zn(e,n,i,a);break;case 3:Zn(e,n,i,a),m&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(m&2048){Zn(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){at(n,n.return,X)}}else Zn(e,n,i,a);break;case 31:Zn(e,n,i,a);break;case 13:Zn(e,n,i,a);break;case 23:break;case 22:C=n.stateNode,B=n.alternate,n.memoizedState!==null?C._visibility&2?Zn(e,n,i,a):Aa(e,n):C._visibility&2?Zn(e,n,i,a):(C._visibility|=2,Es(e,n,i,a,(n.subtreeFlags&10256)!==0||!1)),m&2048&&ou(B,n);break;case 24:Zn(e,n,i,a),m&2048&&cu(n.alternate,n);break;default:Zn(e,n,i,a)}}function Es(e,n,i,a,m){for(m=m&&((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:Es(C,B,F,X,m),Ea(8,B);break;case 23:break;case 22:var fe=B.stateNode;B.memoizedState!==null?fe._visibility&2?Es(C,B,F,X,m):Aa(C,B):(fe._visibility|=2,Es(C,B,F,X,m)),m&&ae&2048&&ou(B.alternate,B);break;case 24:Es(C,B,F,X,m),m&&ae&2048&&cu(B.alternate,B);break;default:Es(C,B,F,X,m)}n=n.sibling}}function Aa(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=e,a=n,m=a.flags;switch(a.tag){case 22:Aa(i,a),m&2048&&ou(a.alternate,a);break;case 24:Aa(i,a),m&2048&&cu(a.alternate,a);break;default:Aa(i,a)}n=n.sibling}}var Ta=8192;function ks(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:ks(e,n,i),e.flags&Ta&&e.memoizedState!==null&&b0(i,Jn,e.memoizedState,e.memoizedProps);break;case 5:ks(e,n,i);break;case 3:case 4:var a=Jn;Jn=lo(e.stateNode.containerInfo),ks(e,n,i),Jn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Ta,Ta=16777216,ks(e,n,i),Ta=a):ks(e,n,i));break;default:ks(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];Pt=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&&tr(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,Kl(e)):Ra(e);break;default:Ra(e)}}function Kl(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];Pt=a,Cp(a,e)}Sp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:tr(8,n,n.return),Kl(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,Kl(n));break;default:Kl(n)}e=e.sibling}}function Cp(e,n){for(;Pt!==null;){var i=Pt;switch(i.tag){case 0:case 11:case 15:tr(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,Pt=a;else e:for(i=e;Pt!==null;){a=Pt;var m=a.sibling,C=a.return;if(fp(a),a===i){Pt=null;break e}if(m!==null){m.return=C,Pt=m;break e}Pt=C}}}var Ny={getCacheForType:function(e){var n=Gt(Tt),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return Gt(Tt).controller.signal}},Hy=typeof WeakMap=="function"?WeakMap:Map,it=0,ut=null,Ge=null,Ye=0,st=0,Dn=null,nr=!1,As=!1,uu=!1,Li=0,xt=0,ir=0,Ur=0,hu=0,Mn=0,Ts=0,Da=null,vn=null,fu=!1,Yl=0,wp=0,Xl=1/0,Ql=null,rr=null,Ht=0,sr=null,Rs=null,Oi=0,du=0,pu=null,xp=null,Ma=0,mu=null;function Ln(){return(it&2)!==0&&Ye!==0?Ye&-Ye:V.T!==null?bu():rn()}function Ep(){if(Mn===0)if((Ye&536870912)===0||Qe){var e=fi;fi<<=1,(fi&3932160)===0&&(fi=262144),Mn=e}else Mn=536870912;return e=Tn.current,e!==null&&(e.flags|=32),Mn}function yn(e,n,i){(e===ut&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(Ds(e,0),ar(e,Ye,Mn,!1)),Ft(e,i),((it&2)===0||e!==ut)&&(e===ut&&((it&2)===0&&(Ur|=i),xt===4&&ar(e,Ye,Mn,!1)),ci(e))}function kp(e,n,i){if((it&6)!==0)throw Error(l(327));var a=!i&&(n&127)===0&&(n&e.expiredLanes)===0||Wn(e,n),m=a?Py(e,n):_u(e,n,!0),C=a;do{if(m===0){As&&!a&&ar(e,n,0,!1);break}else{if(i=e.current.alternate,C&&!zy(i)){m=_u(e,n,!1),C=!1;continue}if(m===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;m=Da;var X=F.current.memoizedState.isDehydrated;if(X&&(Ds(F,B).flags|=256),B=_u(F,B,!1),B!==2){if(uu&&!X){F.errorRecoveryDisabledLanes|=C,Ur|=C,m=4;break e}C=vn,vn=m,C!==null&&(vn===null?vn=C:vn.push.apply(vn,C))}m=B}if(C=!1,m!==2)continue}}if(m===1){Ds(e,0),ar(e,n,0,!0);break}e:{switch(a=e,C=m,C){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:ar(a,n,Mn,!nr);break e;case 2:vn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(m=Yl+300-mt(),10<m)){if(ar(a,n,Mn,!nr),di(a,0,!0)!==0)break e;Oi=n,a.timeoutHandle=im(Ap.bind(null,a,i,vn,Ql,fu,n,Mn,Ur,Ts,nr,C,"Throttled",-0,0),m);break e}Ap(a,i,vn,Ql,fu,n,Mn,Ur,Ts,nr,C,null,-0,0)}}break}while(!0);ci(e)}function Ap(e,n,i,a,m,C,B,F,X,ae,fe,ve,le,oe){if(e.timeoutHandle=-1,ve=n.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yt},yp(n,C,ve);var ke=(C&62914560)===C?Yl-mt():(C&4194048)===C?wp-mt():0;if(ke=C0(ve,ke),ke!==null){Oi=C,e.cancelPendingCommit=ke(jp.bind(null,e,n,C,i,a,m,B,F,X,fe,ve,null,le,oe)),ar(e,C,B,!ae);return}}jp(e,n,C,i,a,m,B,F,X)}function zy(e){for(var n=e;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var a=0;a<i.length;a++){var m=i[a],C=m.getSnapshot;m=m.value;try{if(!kn(C(),m))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 ar(e,n,i,a){n&=~hu,n&=~Ur,e.suspendedLanes|=n,e.pingedLanes&=~n,a&&(e.warmLanes|=n),a=e.expirationTimes;for(var m=n;0<m;){var C=31-et(m),B=1<<C;a[C]=-1,m&=~B}i!==0&&Ii(e,i,n)}function Jl(){return(it&6)===0?(La(0),!1):!0}function gu(){if(Ge!==null){if(st===0)var e=Ge.return;else e=Ge,Ci=Lr=null,Lc(e),Ss=null,pa=0,e=Ge;for(;e!==null;)rp(e.alternate,e),e=e.return;Ge=null}}function Ds(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,r0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Oi=0,gu(),ut=e,Ge=i=Si(e.current,null),Ye=n,st=0,Dn=null,nr=!1,As=Wn(e,n),uu=!1,Ts=Mn=hu=Ur=ir=xt=0,vn=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 m=31-et(a),C=1<<m;n|=e[m],a&=~C}return Li=n,yl(),i}function Tp(e,n){Ue=null,V.H=Ca,n===ys||n===Al?(n=$f(),st=3):n===Sc?(n=$f(),st=4):st=n===Kc?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Dn=n,Ge===null&&(xt=1,Ul(e,In(n,e.current)))}function Rp(){var e=Tn.current;return e===null?!0:(Ye&4194048)===Ye?qn===null:(Ye&62914560)===Ye||(Ye&536870912)!==0?e===qn:!1}function Dp(){var e=V.H;return V.H=Ca,e===null?Ca:e}function Mp(){var e=V.A;return V.A=Ny,e}function Zl(){xt=4,nr||(Ye&4194048)!==Ye&&Tn.current!==null||(As=!0),(ir&134217727)===0&&(Ur&134217727)===0||ut===null||ar(ut,Ye,Mn,!1)}function _u(e,n,i){var a=it;it|=2;var m=Dp(),C=Mp();(ut!==e||Ye!==n)&&(Ql=null,Ds(e,n)),n=!1;var B=xt;e:do try{if(st!==0&&Ge!==null){var F=Ge,X=Dn;switch(st){case 8:gu(),B=6;break e;case 3:case 2:case 9:case 6:Tn.current===null&&(n=!0);var ae=st;if(st=0,Dn=null,Ms(e,F,X,ae),i&&As){B=0;break e}break;default:ae=st,st=0,Dn=null,Ms(e,F,X,ae)}}Iy(),B=xt;break}catch(fe){Tp(e,fe)}while(!0);return n&&e.shellSuspendCounter++,Ci=Lr=null,it=a,V.H=m,V.A=C,Ge===null&&(ut=null,Ye=0,yl()),B}function Iy(){for(;Ge!==null;)Lp(Ge)}function Py(e,n){var i=it;it|=2;var a=Dp(),m=Mp();ut!==e||Ye!==n?(Ql=null,Xl=mt()+500,Ds(e,n)):As=Wn(e,n);e:do try{if(st!==0&&Ge!==null){n=Ge;var C=Dn;t:switch(st){case 1:st=0,Dn=null,Ms(e,n,C,1);break;case 2:case 9:if(Ff(C)){st=0,Dn=null,Op(n);break}n=function(){st!==2&&st!==9||ut!==e||(st=7),ci(e)},C.then(n,n);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:Ff(C)?(st=0,Dn=null,Op(n)):(st=0,Dn=null,Ms(e,n,C,7));break;case 5:var B=null;switch(Ge.tag){case 26:B=Ge.memoizedState;case 5:case 27:var F=Ge;if(B?vm(B):F.stateNode.complete){st=0,Dn=null;var X=F.sibling;if(X!==null)Ge=X;else{var ae=F.return;ae!==null?(Ge=ae,eo(ae)):Ge=null}break t}}st=0,Dn=null,Ms(e,n,C,5);break;case 6:st=0,Dn=null,Ms(e,n,C,6);break;case 8:gu(),xt=6;break e;default:throw Error(l(462))}}Uy();break}catch(fe){Tp(e,fe)}while(!0);return Ci=Lr=null,V.H=a,V.A=m,it=i,Ge!==null?0:(ut=null,Ye=0,yl(),xt)}function Uy(){for(;Ge!==null&&!zt();)Lp(Ge)}function Lp(e){var n=np(e.alternate,e,Li);e.memoizedProps=e.pendingProps,n===null?eo(e):Ge=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,Ye);break;case 11:n=Xd(i,n,n.pendingProps,n.type.render,n.ref,Ye);break;case 5:Lc(n);default:rp(i,n),n=Ge=Mf(n,Li),n=np(i,n,Li)}e.memoizedProps=e.pendingProps,n===null?eo(e):Ge=n}function Ms(e,n,i,a){Ci=Lr=null,Lc(n),Ss=null,pa=0;var m=n.return;try{if(Ry(e,m,n,i,Ye)){xt=1,Ul(e,In(i,e.current)),Ge=null;return}}catch(C){if(m!==null)throw Ge=m,C;xt=1,Ul(e,In(i,e.current)),Ge=null;return}n.flags&32768?(Qe||a===1?e=!0:As||(Ye&536870912)!==0?e=!1:(nr=e=!0,(a===2||a===9||a===3||a===6)&&(a=Tn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Bp(n,e)):eo(n)}function eo(e){var n=e;do{if((n.flags&32768)!==0){Bp(n,nr);return}e=n.return;var i=Ly(n.alternate,n,Li);if(i!==null){Ge=i;return}if(n=n.sibling,n!==null){Ge=n;return}Ge=n=e}while(n!==null);xt===0&&(xt=5)}function Bp(e,n){do{var i=Oy(e.alternate,e);if(i!==null){i.flags&=32767,Ge=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=i}while(e!==null);xt=6,Ge=null}function jp(e,n,i,a,m,C,B,F,X){e.cancelPendingCommit=null;do to();while(Ht!==0);if((it&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(C=n.lanes|n.childLanes,C|=sc,pi(e,i,C,B,F,X),e===ut&&(Ge=ut=null,Ye=0),Rs=n,sr=e,Oi=i,du=C,pu=m,xp=a,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Gy(Te,function(){return Pp(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||a){a=V.T,V.T=null,m=Y.p,Y.p=2,B=it,it|=4;try{By(e,n,i)}finally{it=B,Y.p=m,V.T=a}}Ht=1,Np(),Hp(),zp()}}function Np(){if(Ht===1){Ht=0;var e=sr,n=Rs,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var a=Y.p;Y.p=2;var m=it;it|=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,fe=X.end;if(fe===void 0&&(fe=ae),"selectionStart"in F)F.selectionStart=ae,F.selectionEnd=Math.min(fe,F.value.length);else{var ve=F.ownerDocument||document,le=ve&&ve.defaultView||window;if(le.getSelection){var oe=le.getSelection(),ke=F.textContent.length,Be=Math.min(X.start,ke),ct=X.end===void 0?Be:Math.min(X.end,ke);!oe.extend&&Be>ct&&(B=ct,ct=Be,Be=B);var ne=Sf(F,Be),J=Sf(F,ct);if(ne&&J&&(oe.rangeCount!==1||oe.anchorNode!==ne.node||oe.anchorOffset!==ne.offset||oe.focusNode!==J.node||oe.focusOffset!==J.offset)){var re=ve.createRange();re.setStart(ne.node,ne.offset),oe.removeAllRanges(),Be>ct?(oe.addRange(re),oe.extend(J.node,J.offset)):(re.setEnd(J.node,J.offset),oe.addRange(re))}}}}for(ve=[],oe=F;oe=oe.parentNode;)oe.nodeType===1&&ve.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<ve.length;F++){var pe=ve[F];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}po=!!Tu,Ru=Tu=null}finally{it=m,Y.p=a,V.T=i}}e.current=n,Ht=2}}function Hp(){if(Ht===2){Ht=0;var e=sr,n=Rs,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var a=Y.p;Y.p=2;var m=it;it|=4;try{hp(e,n.alternate,n)}finally{it=m,Y.p=a,V.T=i}}Ht=3}}function zp(){if(Ht===4||Ht===3){Ht=0,pt();var e=sr,n=Rs,i=Oi,a=xp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ht=5:(Ht=0,Rs=sr=null,Ip(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(rr=null),jt(i),n=n.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Ct,n,void 0,(n.current.flags&128)===128)}catch{}if(a!==null){n=V.T,m=Y.p,Y.p=2,V.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{V.T=n,Y.p=m}}(Oi&3)!==0&&to(),ci(e),m=e.pendingLanes,(i&261930)!==0&&(m&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 to(){return Np(),Hp(),zp(),Pp()}function Pp(){if(Ht!==5)return!1;var e=sr,n=du;du=0;var i=jt(Oi),a=V.T,m=Y.p;try{Y.p=32>i?32:i,V.T=null,i=pu,pu=null;var C=sr,B=Oi;if(Ht=0,Rs=sr=null,Oi=0,(it&6)!==0)throw Error(l(331));var F=it;if(it|=4,bp(C.current),vp(C,C.current,B,i),it=F,La(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Ct,C)}catch{}return!0}finally{Y.p=m,V.T=a,Ip(e,n)}}function Up(e,n,i){n=In(i,n),n=Wc(e.stateNode,n,2),e=Ji(e,n,2),e!==null&&(Ft(e,2),ci(e))}function at(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"&&(rr===null||!rr.has(a))){e=In(i,e),i=Fd(2),a=Ji(n,i,2),a!==null&&(qd(i,a,n,e),Ft(a,2),ci(a));break}}n=n.return}}function vu(e,n,i){var a=e.pingCache;if(a===null){a=e.pingCache=new Hy;var m=new Set;a.set(n,m)}else m=a.get(n),m===void 0&&(m=new Set,a.set(n,m));m.has(i)||(uu=!0,m.add(i),e=Fy.bind(null,e,n,i),n.then(e,e))}function Fy(e,n,i){var a=e.pingCache;a!==null&&a.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ut===e&&(Ye&i)===i&&(xt===4||xt===3&&(Ye&62914560)===Ye&&300>mt()-Yl?(it&2)===0&&Ds(e,0):hu|=i,Ts===Ye&&(Ts=0)),ci(e)}function Fp(e,n){n===0&&(n=un()),e=Rr(e,n),e!==null&&(Ft(e,n),ci(e))}function qy(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Fp(e,i)}function $y(e,n){var i=0;switch(e.tag){case 31:case 13:var a=e.stateNode,m=e.memoizedState;m!==null&&(i=m.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 Gy(e,n){return ze(e,n)}var no=null,Ls=null,yu=!1,io=!1,Su=!1,lr=0;function ci(e){e!==Ls&&e.next===null&&(Ls===null?no=Ls=e:Ls=Ls.next=e),io=!0,yu||(yu=!0,Wy())}function La(e,n){if(!Su&&io){Su=!0;do for(var i=!1,a=no;a!==null;){if(e!==0){var m=a.pendingLanes;if(m===0)var C=0;else{var B=a.suspendedLanes,F=a.pingedLanes;C=(1<<31-et(42|e)+1)-1,C&=m&~(B&~F),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,Vp(a,C))}else C=Ye,C=di(a,a===ut?C:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(C&3)===0||Wn(a,C)||(i=!0,Vp(a,C));a=a.next}while(i);Su=!1}}function Vy(){qp()}function qp(){io=yu=!1;var e=0;lr!==0&&i0()&&(e=lr);for(var n=mt(),i=null,a=no;a!==null;){var m=a.next,C=$p(a,n);C===0?(a.next=null,i===null?no=m:i.next=m,m===null&&(Ls=i)):(i=a,(e!==0||(C&3)!==0)&&(io=!0)),a=m}Ht!==0&&Ht!==5||La(e),lr!==0&&(lr=0)}function $p(e,n){for(var i=e.suspendedLanes,a=e.pingedLanes,m=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var B=31-et(C),F=1<<B,X=m[B];X===-1?((F&i)===0||(F&a)!==0)&&(m[B]=ni(F,n)):X<=n&&(e.expiredLanes|=F),C&=~F}if(n=ut,i=Ye,i=di(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===n&&(st===2||st===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Ke(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Wn(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(a!==null&&Ke(a),jt(i)){case 2:case 8:i=Ce;break;case 32:i=Te;break;case 268435456:i=Ie;break;default:i=Te}return a=Gp.bind(null,e),i=ze(i,a),e.callbackPriority=n,e.callbackNode=i,n}return a!==null&&a!==null&&Ke(a),e.callbackPriority=2,e.callbackNode=null,2}function Gp(e,n){if(Ht!==0&&Ht!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(to()&&e.callbackNode!==i)return null;var a=Ye;return a=di(e,e===ut?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(kp(e,a,n),$p(e,mt()),e.callbackNode!=null&&e.callbackNode===i?Gp.bind(null,e):null)}function Vp(e,n){if(to())return null;kp(e,n,!0)}function Wy(){s0(function(){(it&6)!==0?ze(he,Vy):qp()})}function bu(){if(lr===0){var e=_s;e===0&&(e=Hi,Hi<<=1,(Hi&261888)===0&&(Hi=256)),lr=e}return lr}function Wp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ts(""+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 Ky(e,n,i,a,m){if(n==="submit"&&i&&i.stateNode===m){var C=Wp((m[Nt]||null).action),B=a.submitter;B&&(n=(n=B[Nt]||null)?Wp(n.formAction):B.getAttribute("formAction"),n!==null&&(C=n,B=null));var F=new as("action","action",null,a,m);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(lr!==0){var X=B?Kp(m,B):new FormData(m);Uc(i,{pending:!0,data:X,method:m.method,action:C},null,X)}}else typeof C=="function"&&(F.preventDefault(),X=B?Kp(m,B):new FormData(m),Uc(i,{pending:!0,data:X,method:m.method,action:C},C,X))},currentTarget:m}]})}}for(var Cu=0;Cu<rc.length;Cu++){var wu=rc[Cu],Yy=wu.toLowerCase(),Xy=wu[0].toUpperCase()+wu.slice(1);Qn(Yy,"on"+Xy)}Qn(Ef,"onAnimationEnd"),Qn(kf,"onAnimationIteration"),Qn(Af,"onAnimationStart"),Qn("dblclick","onDoubleClick"),Qn("focusin","onFocus"),Qn("focusout","onBlur"),Qn(fy,"onTransitionRun"),Qn(dy,"onTransitionStart"),Qn(py,"onTransitionCancel"),Qn(Tf,"onTransitionEnd"),fn("onMouseEnter",["mouseout","mouseover"]),fn("onMouseLeave",["mouseout","mouseover"]),fn("onPointerEnter",["pointerout","pointerover"]),fn("onPointerLeave",["pointerout","pointerover"]),si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),si("onBeforeInput",["compositionend","keypress","textInput","paste"]),si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),si("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(" "),Qy=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],m=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&&m.isPropagationStopped())break e;C=F,m.currentTarget=ae;try{C(m)}catch(fe){vl(fe)}m.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&&m.isPropagationStopped())break e;C=F,m.currentTarget=ae;try{C(m)}catch(fe){vl(fe)}m.currentTarget=null,C=X}}}}function Ve(e,n){var i=n[Yr];i===void 0&&(i=n[Yr]=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 ro="_reactListening"+Math.random().toString(36).slice(2);function Eu(e){if(!e[ro]){e[ro]=!0,ul.forEach(function(i){i!=="selectionchange"&&(Qy.has(i)||xu(i,!1,e),xu(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[ro]||(n[ro]=!0,xu("selectionchange",!1,n))}}function Xp(e,n,i,a){switch(Em(n)){case 2:var m=E0;break;case 8:m=k0;break;default:m=Pu}i=m.bind(null,n,i,e),m=void 0,!ns||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),a?m!==void 0?e.addEventListener(n,i,{capture:!0,passive:m}):e.addEventListener(n,i,!0):m!==void 0?e.addEventListener(n,i,{passive:m}):e.addEventListener(n,i,!1)}function ku(e,n,i,a,m){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===m)break;if(B===4)for(B=a.return;B!==null;){var X=B.tag;if((X===3||X===4)&&B.stateNode.containerInfo===m)return;B=B.return}for(;F!==null;){if(B=wn(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}Zs(function(){var ae=C,fe=xr(i),ve=[];e:{var le=Rf.get(e);if(le!==void 0){var oe=as,ke=e;switch(e){case"keypress":if(rs(i)===0)break e;case"keydown":case"keyup":oe=$v;break;case"focusin":ke="focus",oe=W;break;case"focusout":ke="blur",oe=W;break;case"beforeblur":case"afterblur":oe=W;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=ls;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=ra;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Wv;break;case Ef:case kf:case Af:oe=Je;break;case Tf:oe=Yv;break;case"scroll":case"scrollend":oe=Wo;break;case"wheel":oe=Qv;break;case"copy":case"cut":case"paste":oe=yi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=af;break;case"toggle":case"beforetoggle":oe=Zv}var Be=(n&4)!==0,ct=!Be&&(e==="scroll"||e==="scrollend"),ne=Be?le!==null?le+"Capture":null:le;Be=[];for(var J=ae,re;J!==null;){var pe=J;if(re=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||re===null||ne===null||(pe=Gi(J,ne),pe!=null&&Be.push(Ba(J,pe,re))),ct)break;J=J.return}0<Be.length&&(le=new oe(le,ke,null,i,fe),ve.push({event:le,listeners:Be}))}}if((n&7)===0){e:{if(le=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",le&&i!==wr&&(ke=i.relatedTarget||i.fromElement)&&(wn(ke)||ke[ii]))break e;if((oe||le)&&(le=fe.window===fe?fe:(le=fe.ownerDocument)?le.defaultView||le.parentWindow:window,oe?(ke=i.relatedTarget||i.toElement,oe=ae,ke=ke?wn(ke):null,ke!==null&&(ct=v(ke),Be=ke.tag,ke!==ct||Be!==5&&Be!==27&&Be!==6)&&(ke=null)):(oe=null,ke=ae),oe!==ke)){if(Be=ls,pe="onMouseLeave",ne="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Be=af,pe="onPointerLeave",ne="onPointerEnter",J="pointer"),ct=oe==null?le:Sr(oe),re=ke==null?le:Sr(ke),le=new Be(pe,J+"leave",oe,i,fe),le.target=ct,le.relatedTarget=re,pe=null,wn(fe)===ae&&(Be=new Be(ne,J+"enter",ke,i,fe),Be.target=re,Be.relatedTarget=ct,pe=Be),ct=pe,oe&&ke)t:{for(Be=Jy,ne=oe,J=ke,re=0,pe=ne;pe;pe=Be(pe))re++;pe=0;for(var Le=J;Le;Le=Be(Le))pe++;for(;0<re-pe;)ne=Be(ne),re--;for(;0<pe-re;)J=Be(J),pe--;for(;re--;){if(ne===J||J!==null&&ne===J.alternate){Be=ne;break t}ne=Be(ne),J=Be(J)}Be=null}else Be=null;oe!==null&&Qp(ve,le,oe,Be,!1),ke!==null&&ct!==null&&Qp(ve,ct,ke,Be,!0)}}e:{if(le=ae?Sr(ae):window,oe=le.nodeName&&le.nodeName.toLowerCase(),oe==="select"||oe==="input"&&le.type==="file")var tt=pf;else if(ff(le))if(mf)tt=cy;else{tt=ly;var De=ay}else oe=le.nodeName,!oe||oe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ae&&Qs(ae.elementType)&&(tt=pf):tt=oy;if(tt&&(tt=tt(e,ae))){df(ve,tt,i,fe);break e}De&&De(e,le,ae),e==="focusout"&&ae&&le.type==="number"&&ae.memoizedProps.value!=null&&Xs(le,"number",le.value)}switch(De=ae?Sr(ae):window,e){case"focusin":(ff(De)||De.contentEditable==="true")&&(cs=De,tc=ae,ca=null);break;case"focusout":ca=tc=cs=null;break;case"mousedown":nc=!0;break;case"contextmenu":case"mouseup":case"dragend":nc=!1,wf(ve,i,fe);break;case"selectionchange":if(hy)break;case"keydown":case"keyup":wf(ve,i,fe)}var qe;if(Qo)e:{switch(e){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else os?uf(e,i)&&(Xe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Xe="onCompositionStart");Xe&&(lf&&i.locale!=="ko"&&(os||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&os&&(qe=ta()):(sn=fe,ea="value"in sn?sn.value:sn.textContent,os=!0)),De=so(ae,Xe),0<De.length&&(Xe=new sf(Xe,e,null,i,fe),ve.push({event:Xe,listeners:De}),qe?Xe.data=qe:(qe=hf(i),qe!==null&&(Xe.data=qe)))),(qe=ty?ny(e,i):iy(e,i))&&(Xe=so(ae,"onBeforeInput"),0<Xe.length&&(De=new sf("onBeforeInput","beforeinput",null,i,fe),ve.push({event:De,listeners:Xe}),De.data=qe)),Ky(ve,e,ae,i,fe)}Yp(ve,n)})}function Ba(e,n,i){return{instance:e,listener:n,currentTarget:i}}function so(e,n){for(var i=n+"Capture",a=[];e!==null;){var m=e,C=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||C===null||(m=Gi(e,i),m!=null&&a.unshift(Ba(e,m,C)),m=Gi(e,n),m!=null&&a.push(Ba(e,m,C))),e.tag===3)return a;e=e.return}return[]}function Jy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qp(e,n,i,a,m){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,m?(ae=Gi(i,C),ae!=null&&B.unshift(Ba(i,ae,X))):m||(ae=Gi(i,C),ae!=null&&B.push(Ba(i,ae,X)))),i=i.return}B.length!==0&&e.push({event:n,listeners:B})}var Zy=/\r\n?/g,e0=/\u0000|\uFFFD/g;function Jp(e){return(typeof e=="string"?e:""+e).replace(Zy,`
|
|
49
|
+
`).replace(e0,"")}function Zp(e,n){return n=Jp(n),Jp(e)===n}function ot(e,n,i,a,m,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":_i(e,"class",a);break;case"tabIndex":_i(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":_i(e,i,a);break;case"style":ml(e,a,C);break;case"data":if(n!=="object"){_i(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=ts(""+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"&&ot(e,n,"name",m.name,m,null),ot(e,n,"formEncType",m.formEncType,m,null),ot(e,n,"formMethod",m.formMethod,m,null),ot(e,n,"formTarget",m.formTarget,m,null)):(ot(e,n,"encType",m.encType,m,null),ot(e,n,"method",m.method,m,null),ot(e,n,"target",m.target,m,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=ts(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Yt);break;case"onScroll":a!=null&&Ve("scroll",e);break;case"onScrollEnd":a!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(m.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=ts(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""+a):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":a===!0?e.setAttribute(i,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,a):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(i,a):e.removeAttribute(i);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(i):e.setAttribute(i,a);break;case"popover":Ve("beforetoggle",e),Ve("toggle",e),br(e,"popover",a);break;case"xlinkActuate":Nn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Nn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Nn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Nn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Nn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Nn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Nn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Nn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Nn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":br(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Go.get(i)||i,br(e,i,a))}}function Au(e,n,i,a,m,C){switch(i){case"style":ml(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(m.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&&Ve("scroll",e);break;case"onScrollEnd":a!=null&&Ve("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Yt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qi.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),n=i.slice(2,m?i.length-7:void 0),C=e[Nt]||null,C=C!=null?C[i]:null,typeof C=="function"&&e.removeEventListener(n,C,m),typeof a=="function")){typeof C!="function"&&C!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,a,m);break e}i in e?e[i]=a:a===!0?e.setAttribute(i,""):br(e,i,a)}}}function Wt(e,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var a=!1,m=!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":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:ot(e,n,C,B,i,null)}}m&&ot(e,n,"srcSet",i.srcSet,i,null),a&&ot(e,n,"src",i.src,i,null);return;case"input":Ve("invalid",e);var F=C=B=m=null,X=null,ae=null;for(a in i)if(i.hasOwnProperty(a)){var fe=i[a];if(fe!=null)switch(a){case"name":m=fe;break;case"type":B=fe;break;case"checked":X=fe;break;case"defaultChecked":ae=fe;break;case"value":C=fe;break;case"defaultValue":F=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(l(137,n));break;default:ot(e,n,a,fe,i,null)}}dl(e,C,F,X,ae,B,m,!1);return;case"select":Ve("invalid",e),a=B=C=null;for(m in i)if(i.hasOwnProperty(m)&&(F=i[m],F!=null))switch(m){case"value":C=F;break;case"defaultValue":B=F;break;case"multiple":a=F;default:ot(e,n,m,F,i,null)}n=C,i=B,e.multiple=!!a,n!=null?Yn(e,!!a,n,!1):i!=null&&Yn(e,!!a,i,!0);return;case"textarea":Ve("invalid",e),C=m=a=null;for(B in i)if(i.hasOwnProperty(B)&&(F=i[B],F!=null))switch(B){case"value":a=F;break;case"defaultValue":m=F;break;case"children":C=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(91));break;default:ot(e,n,B,F,i,null)}Hn(e,a,m,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:ot(e,n,X,a,i,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(a=0;a<Oa.length;a++)Ve(Oa[a],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in i)if(i.hasOwnProperty(ae)&&(a=i[ae],a!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:ot(e,n,ae,a,i,null)}return;default:if(Qs(n)){for(fe in i)i.hasOwnProperty(fe)&&(a=i[fe],a!==void 0&&Au(e,n,fe,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&ot(e,n,F,a,i,null))}function t0(e,n,i,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,C=null,B=null,F=null,X=null,ae=null,fe=null;for(oe in i){var ve=i[oe];if(i.hasOwnProperty(oe)&&ve!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":X=ve;default:a.hasOwnProperty(oe)||ot(e,n,oe,null,a,ve)}}for(var le in a){var oe=a[le];if(ve=i[le],a.hasOwnProperty(le)&&(oe!=null||ve!=null))switch(le){case"type":C=oe;break;case"name":m=oe;break;case"checked":ae=oe;break;case"defaultChecked":fe=oe;break;case"value":B=oe;break;case"defaultValue":F=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,n));break;default:oe!==ve&&ot(e,n,le,oe,a,ve)}}Zr(e,B,F,X,ae,fe,C,m);return;case"select":oe=B=F=le=null;for(C in i)if(X=i[C],i.hasOwnProperty(C)&&X!=null)switch(C){case"value":break;case"multiple":oe=X;default:a.hasOwnProperty(C)||ot(e,n,C,null,a,X)}for(m in a)if(C=a[m],X=i[m],a.hasOwnProperty(m)&&(C!=null||X!=null))switch(m){case"value":le=C;break;case"defaultValue":F=C;break;case"multiple":B=C;default:C!==X&&ot(e,n,m,C,a,X)}n=F,i=B,a=oe,le!=null?Yn(e,!!i,le,!1):!!a!=!!i&&(n!=null?Yn(e,!!i,n,!0):Yn(e,!!i,i?[]:"",!1));return;case"textarea":oe=le=null;for(F in i)if(m=i[F],i.hasOwnProperty(F)&&m!=null&&!a.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:ot(e,n,F,null,a,m)}for(B in a)if(m=a[B],C=i[B],a.hasOwnProperty(B)&&(m!=null||C!=null))switch(B){case"value":le=m;break;case"defaultValue":oe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==C&&ot(e,n,B,m,a,C)}qt(e,le,oe);return;case"option":for(var ke in i)if(le=i[ke],i.hasOwnProperty(ke)&&le!=null&&!a.hasOwnProperty(ke))switch(ke){case"selected":e.selected=!1;break;default:ot(e,n,ke,null,a,le)}for(X in a)if(le=a[X],oe=i[X],a.hasOwnProperty(X)&&le!==oe&&(le!=null||oe!=null))switch(X){case"selected":e.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:ot(e,n,X,le,a,oe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Be in i)le=i[Be],i.hasOwnProperty(Be)&&le!=null&&!a.hasOwnProperty(Be)&&ot(e,n,Be,null,a,le);for(ae in a)if(le=a[ae],oe=i[ae],a.hasOwnProperty(ae)&&le!==oe&&(le!=null||oe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(l(137,n));break;default:ot(e,n,ae,le,a,oe)}return;default:if(Qs(n)){for(var ct in i)le=i[ct],i.hasOwnProperty(ct)&&le!==void 0&&!a.hasOwnProperty(ct)&&Au(e,n,ct,void 0,a,le);for(fe in a)le=a[fe],oe=i[fe],!a.hasOwnProperty(fe)||le===oe||le===void 0&&oe===void 0||Au(e,n,fe,le,a,oe);return}}for(var ne in i)le=i[ne],i.hasOwnProperty(ne)&&le!=null&&!a.hasOwnProperty(ne)&&ot(e,n,ne,null,a,le);for(ve in a)le=a[ve],oe=i[ve],!a.hasOwnProperty(ve)||le===oe||le==null&&oe==null||ot(e,n,ve,le,a,oe)}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 n0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,i=performance.getEntriesByType("resource"),a=0;a<i.length;a++){var m=i[a],C=m.transferSize,B=m.initiatorType,F=m.duration;if(C&&F&&em(B)){for(B=0,F=m.responseEnd,a+=1;a<i.length;a++){var X=i[a],ae=X.startTime;if(ae>F)break;var fe=X.transferSize,ve=X.initiatorType;fe&&em(ve)&&(X=X.responseEnd,B+=fe*(X<F?1:(F-ae)/(X-ae)))}if(--a,n+=8*(C+B)/(m.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 ao(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 i0(){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,r0=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,s0=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(e){return rm.resolve(null).then(e).catch(a0)}:im;function a0(e){setTimeout(function(){throw e})}function or(e){return e==="head"}function sm(e,n){var i=n,a=0;do{var m=i.nextSibling;if(e.removeChild(i),m&&m.nodeType===8)if(i=m.data,i==="/$"||i==="/&"){if(a===0){e.removeChild(m),Ns(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[yr]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=B}}else i==="body"&&ja(e.ownerDocument.body);i=m}while(i);Ns(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),Xr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function l0(e,n,i,a){for(;e.nodeType===1;){var m=i;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[yr])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!==m.rel||e.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||e.getAttribute("title")!==(m.title==null?null:m.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(C=e.getAttribute("src"),(C!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&C&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var C=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===C)return e}else return e;if(e=$n(e.nextSibling),e===null)break}return null}function o0(e,n,i){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=$n(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=$n(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 c0(e,n){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||i.readyState!=="loading")n();else{var a=function(){n(),i.removeEventListener("DOMContentLoaded",a)};i.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function $n(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 $n(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=ao(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]);Xr(e)}var Gn=new Map,hm=new Set;function lo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Bi=Y.d;Y.d={f:u0,r:h0,D:f0,C:d0,L:p0,m:m0,X:_0,S:g0,M:v0};function u0(){var e=Bi.f(),n=Jl();return e||n}function h0(e){var n=gi(e);n!==null&&n.tag===5&&n.type==="form"?Td(n):Bi.r(e)}var Os=typeof document>"u"?null:document;function fm(e,n,i){var a=Os;if(a&&typeof n=="string"&&n){var m=pn(n);m='link[rel="'+e+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),hm.has(m)||(hm.add(m),e={rel:e,crossOrigin:i,href:n},a.querySelector(m)===null&&(n=a.createElement("link"),Wt(n,"link",e),Et(n),a.head.appendChild(n)))}}function f0(e){Bi.D(e),fm("dns-prefetch",e,null)}function d0(e,n){Bi.C(e,n),fm("preconnect",e,n)}function p0(e,n,i){Bi.L(e,n,i);var a=Os;if(a&&e&&n){var m='link[rel="preload"][as="'+pn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+pn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+pn(i.imageSizes)+'"]')):m+='[href="'+pn(e)+'"]';var C=m;switch(n){case"style":C=Bs(e);break;case"script":C=js(e)}Gn.has(C)||(e=h({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),Gn.set(C,e),a.querySelector(m)!==null||n==="style"&&a.querySelector(Na(C))||n==="script"&&a.querySelector(Ha(C))||(n=a.createElement("link"),Wt(n,"link",e),Et(n),a.head.appendChild(n)))}}function m0(e,n){Bi.m(e,n);var i=Os;if(i&&e){var a=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+pn(a)+'"][href="'+pn(e)+'"]',C=m;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=js(e)}if(!Gn.has(C)&&(e=h({rel:"modulepreload",href:e},n),Gn.set(C,e),i.querySelector(m)===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"),Wt(a,"link",e),Et(a),i.head.appendChild(a)}}}function g0(e,n,i){Bi.S(e,n,i);var a=Os;if(a&&e){var m=Fi(a).hoistableStyles,C=Bs(e);n=n||"default";var B=m.get(C);if(!B){var F={loading:0,preload:null};if(B=a.querySelector(Na(C)))F.loading=5;else{e=h({rel:"stylesheet",href:e,"data-precedence":n},i),(i=Gn.get(C))&&Nu(e,i);var X=B=a.createElement("link");Et(X),Wt(X,"link",e),X._p=new Promise(function(ae,fe){X.onload=ae,X.onerror=fe}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,oo(B,n,a)}B={type:"stylesheet",instance:B,count:1,state:F},m.set(C,B)}}}function _0(e,n){Bi.X(e,n);var i=Os;if(i&&e){var a=Fi(i).hoistableScripts,m=js(e),C=a.get(m);C||(C=i.querySelector(Ha(m)),C||(e=h({src:e,async:!0},n),(n=Gn.get(m))&&Hu(e,n),C=i.createElement("script"),Et(C),Wt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(m,C))}}function v0(e,n){Bi.M(e,n);var i=Os;if(i&&e){var a=Fi(i).hoistableScripts,m=js(e),C=a.get(m);C||(C=i.querySelector(Ha(m)),C||(e=h({src:e,async:!0,type:"module"},n),(n=Gn.get(m))&&Hu(e,n),C=i.createElement("script"),Et(C),Wt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(m,C))}}function dm(e,n,i,a){var m=(m=_e.current)?lo(m):null;if(!m)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=Bs(i.href),i=Fi(m).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=Bs(i.href);var C=Fi(m).hoistableStyles,B=C.get(e);if(B||(m=m.ownerDocument||m,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(e,B),(C=m.querySelector(Na(e)))&&!C._p&&(B.instance=C,B.state.loading=5),Gn.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},Gn.set(e,i),C||y0(m,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=js(i),i=Fi(m).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 Bs(e){return'href="'+pn(e)+'"'}function Na(e){return'link[rel="stylesheet"]['+e+"]"}function pm(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function y0(e,n,i,a){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?a.loading=1:(n=e.createElement("link"),a.preload=n,n.addEventListener("load",function(){return a.loading|=1}),n.addEventListener("error",function(){return a.loading|=2}),Wt(n,"link",i),Et(n),e.head.appendChild(n))}function js(e){return'[src="'+pn(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~="'+pn(i.href)+'"]');if(a)return n.instance=a,Et(a),a;var m=h({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Et(a),Wt(a,"style",m),oo(a,i.precedence,e),n.instance=a;case"stylesheet":m=Bs(i.href);var C=e.querySelector(Na(m));if(C)return n.state.loading|=4,n.instance=C,Et(C),C;a=pm(i),(m=Gn.get(m))&&Nu(a,m),C=(e.ownerDocument||e).createElement("link"),Et(C);var B=C;return B._p=new Promise(function(F,X){B.onload=F,B.onerror=X}),Wt(C,"link",a),n.state.loading|=4,oo(C,i.precedence,e),n.instance=C;case"script":return C=js(i.src),(m=e.querySelector(Ha(C)))?(n.instance=m,Et(m),m):(a=i,(m=Gn.get(C))&&(a=h({},i),Hu(a,m)),e=e.ownerDocument||e,m=e.createElement("script"),Et(m),Wt(m,"link",a),e.head.appendChild(m),n.instance=m);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,oo(a,i.precedence,e));return n.instance}function oo(e,n,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=a.length?a[a.length-1]:null,C=m,B=0;B<a.length;B++){var F=a[B];if(F.dataset.precedence===n)C=F;else if(C!==m)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 co=null;function gm(e,n,i){if(co===null){var a=new Map,m=co=new Map;m.set(i,a)}else m=co,a=m.get(i),a||(a=new Map,m.set(i,a));if(a.has(e))return a;for(a.set(e,null),i=i.getElementsByTagName(e),m=0;m<i.length;m++){var C=i[m];if(!(C[yr]||C[bt]||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 S0(e,n,i){if(i===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function vm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function b0(e,n,i,a){if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var m=Bs(a.href),C=n.querySelector(Na(m));if(C){n=C._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=uo.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=C,Et(C);return}C=n.ownerDocument||n,a=pm(a),(m=Gn.get(m))&&Nu(a,m),C=C.createElement("link"),Et(C);var B=C;B._p=new Promise(function(F,X){B.onload=F,B.onerror=X}),Wt(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=uo.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var zu=0;function C0(e,n){return e.stylesheets&&e.count===0&&fo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&fo(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+n);0<e.imgBytes&&zu===0&&(zu=62500*n0());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fo(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(m)}}:null}function uo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ho=null;function fo(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ho=new Map,n.forEach(w0,e),ho=null,uo.call(e))}function w0(e,n){if(!(n.state.loading&4)){var i=ho.get(e);if(i)var a=i.get(null);else{i=new Map,ho.set(e,i);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<m.length;C++){var B=m[C];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(i.set(B.dataset.precedence,B),a=B)}a&&i.set(null,a)}m=n.instance,B=m.getAttribute("data-precedence"),C=i.get(B)||a,C===a&&i.set(null,m),i.set(B,m),this.count++,a=uo.bind(this),m.addEventListener("load",a),m.addEventListener("error",a),C?C.parentNode.insertBefore(m,C.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),n.state.loading|=4}}var za={$$typeof:b,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function x0(e,n,i,a,m,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=Kn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kn(0),this.hiddenUpdates=Kn(null),this.identifierPrefix=a,this.onUncaughtError=m,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,m,C,B,F,X,ae,fe,ve){return e=new x0(e,n,i,B,X,ae,fe,ve,F),n=1,C===!0&&(n|=24),C=An(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=fs,e):fs}function bm(e,n,i,a,m,C){m=Sm(m),a.context===null?a.context=m:a.pendingContext=m,a=Qi(n),a.payload={element:i},C=C===void 0?null:C,C!==null&&(a.callback=C),i=Ji(e,a,n),i!==null&&(yn(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=Rr(e,67108864);n!==null&&yn(n,e,67108864),Iu(e,67108864)}}function xm(e){if(e.tag===13||e.tag===31){var n=Ln();n=mi(n);var i=Rr(e,n);i!==null&&yn(i,e,n),Iu(e,n)}}var po=!0;function E0(e,n,i,a){var m=V.T;V.T=null;var C=Y.p;try{Y.p=2,Pu(e,n,i,a)}finally{Y.p=C,V.T=m}}function k0(e,n,i,a){var m=V.T;V.T=null;var C=Y.p;try{Y.p=8,Pu(e,n,i,a)}finally{Y.p=C,V.T=m}}function Pu(e,n,i,a){if(po){var m=Uu(a);if(m===null)ku(e,n,a,mo,i),km(e,a);else if(T0(m,e,n,i,a))a.stopPropagation();else if(km(e,a),n&4&&-1<A0.indexOf(e)){for(;m!==null;){var C=gi(m);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var B=Cn(C.pendingLanes);if(B!==0){var F=C;for(F.pendingLanes|=2,F.entangledLanes|=2;B;){var X=1<<31-et(B);F.entanglements[1]|=X,B&=~X}ci(C),(it&6)===0&&(Xl=mt()+500,La(0))}}break;case 31:case 13:F=Rr(C,2),F!==null&&yn(F,C,2),Jl(),Iu(C,2)}if(C=Uu(a),C===null&&ku(e,n,a,mo,i),C===m)break;m=C}m!==null&&a.stopPropagation()}else ku(e,n,a,null,i)}}function Uu(e){return e=xr(e),Fu(e)}var mo=null;function Fu(e){if(mo=null,e=wn(e),e!==null){var n=v(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 mo=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(Ot()){case he:return 2;case Ce:return 8;case Te:case He:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var qu=!1,cr=null,ur=null,hr=null,Ia=new Map,Pa=new Map,fr=[],A0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function km(e,n){switch(e){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":ur=null;break;case"mouseover":case"mouseout":hr=null;break;case"pointerover":case"pointerout":Ia.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pa.delete(n.pointerId)}}function Ua(e,n,i,a,m,C){return e===null||e.nativeEvent!==C?(e={blockedOn:n,domEventName:i,eventSystemFlags:a,nativeEvent:C,targetContainers:[m]},n!==null&&(n=gi(n),n!==null&&wm(n)),e):(e.eventSystemFlags|=a,n=e.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),e)}function T0(e,n,i,a,m){switch(n){case"focusin":return cr=Ua(cr,e,n,i,a,m),!0;case"dragenter":return ur=Ua(ur,e,n,i,a,m),!0;case"mouseover":return hr=Ua(hr,e,n,i,a,m),!0;case"pointerover":var C=m.pointerId;return Ia.set(C,Ua(Ia.get(C)||null,e,n,i,a,m)),!0;case"gotpointercapture":return C=m.pointerId,Pa.set(C,Ua(Pa.get(C)||null,e,n,i,a,m)),!0}return!1}function Am(e){var n=wn(e.target);if(n!==null){var i=v(n);if(i!==null){if(n=i.tag,n===13){if(n=f(i),n!==null){e.blockedOn=n,Ui(e.priority,function(){xm(i)});return}}else if(n===31){if(n=o(i),n!==null){e.blockedOn=n,Ui(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 go(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);wr=a,i.target.dispatchEvent(a),wr=null}else return n=gi(i),n!==null&&wm(n),e.blockedOn=i,!1;n.shift()}return!0}function Tm(e,n,i){go(e)&&i.delete(n)}function R0(){qu=!1,cr!==null&&go(cr)&&(cr=null),ur!==null&&go(ur)&&(ur=null),hr!==null&&go(hr)&&(hr=null),Ia.forEach(Tm),Pa.forEach(Tm)}function _o(e,n){e.blockedOn===n&&(e.blockedOn=null,qu||(qu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,R0)))}var vo=null;function Rm(e){vo!==e&&(vo=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){vo===e&&(vo=null);for(var n=0;n<e.length;n+=3){var i=e[n],a=e[n+1],m=e[n+2];if(typeof a!="function"){if(Fu(a||i)===null)continue;break}var C=gi(i);C!==null&&(e.splice(n,3),n-=3,Uc(C,{pending:!0,data:m,method:i.method,action:a},a,m))}}))}function Ns(e){function n(X){return _o(X,e)}cr!==null&&_o(cr,e),ur!==null&&_o(ur,e),hr!==null&&_o(hr,e),Ia.forEach(n),Pa.forEach(n);for(var i=0;i<fr.length;i++){var a=fr[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<fr.length&&(i=fr[0],i.blockedOn===null);)Am(i),i.blockedOn===null&&fr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var m=i[a],C=i[a+1],B=m[Nt]||null;if(typeof C=="function")B||Rm(i);else if(B){var F=null;if(C&&C.hasAttribute("formAction")){if(m=C,B=C[Nt]||null)F=B.formAction;else if(Fu(m)!==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 m=B})},focusReset:"manual",scroll:"manual"})}function n(){m!==null&&(m(),m=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,m=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),m!==null&&(m(),m=null)}}}function $u(e){this._internalRoot=e}yo.prototype.render=$u.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var i=n.current,a=Ln();bm(i,a,e,n,null,null)},yo.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),Jl(),n[ii]=null}};function yo(e){this._internalRoot=e}yo.prototype.unstable_scheduleHydration=function(e){if(e){var n=rn();e={blockedOn:null,target:e,priority:n};for(var i=0;i<fr.length&&n!==0&&n<fr[i].priority;i++);fr.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=u(n),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var D0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var So=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!So.isDisabled&&So.supportsFiber)try{Ct=So.inject(D0),St=So}catch{}}return qa.createRoot=function(e,n){if(!d(e))throw Error(l(299));var i=!1,a="",m=zd,C=Id,B=Pd;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=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,m,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,m="",C=zd,B=Id,F=Pd,X=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(m=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,m,X,C,B,F,Dm),n.context=Sm(null),i=n.current,a=Ln(),a=mi(a),m=Qi(a),m.callback=null,Ji(i,m,a),i=a,n.current.lanes=i,Ft(n,i),ci(n),e[ii]=n.current,Eu(e),new yo(n)},qa.version="19.2.6",qa}var Fm;function F0(){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=U0(),Wu.exports}var q0=F0();const Vr=function(t,r){let d=t;const v=Ya[r];let f=null,o=0,c=null;const u=[],p={},h=function(D,A){o=d*4+17,f=(function(M){const O=new Array(M);for(let H=0;H<M;H+=1){O[H]=new Array(M);for(let U=0;U<M;U+=1)O[H][U]=null}return O})(o),S(0,0),S(o-7,0),S(0,o-7),k(),T(),_(D,A),d>=7&&y(D),c==null&&(c=E(d,v,u)),g(c,A)},S=function(D,A){for(let M=-1;M<=7;M+=1)if(!(D+M<=-1||o<=D+M))for(let O=-1;O<=7;O+=1)A+O<=-1||o<=A+O||(0<=M&&M<=6&&(O==0||O==6)||0<=O&&O<=6&&(M==0||M==6)||2<=M&&M<=4&&2<=O&&O<=4?f[D+M][A+O]=!0:f[D+M][A+O]=!1)},w=function(){let D=0,A=0;for(let M=0;M<8;M+=1){h(!0,M);const O=mr.getLostPoint(p);(M==0||D>O)&&(D=O,A=M)}return A},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)},k=function(){const D=mr.getPatternPosition(d);for(let A=0;A<D.length;A+=1)for(let M=0;M<D.length;M+=1){const O=D[A],H=D[M];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}},y=function(D){const A=mr.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const O=!D&&(A>>M&1)==1;f[Math.floor(M/3)][M%3+o-8-3]=O}for(let M=0;M<18;M+=1){const O=!D&&(A>>M&1)==1;f[M%3+o-8-3][Math.floor(M/3)]=O}},_=function(D,A){const M=v<<3|A,O=mr.getBCHTypeInfo(M);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},g=function(D,A){let M=-1,O=o-1,H=7,U=0;const P=mr.getMaskFunction(A);for(let K=o-1;K>0;K-=2)for(K==6&&(K-=1);;){for(let G=0;G<2;G+=1)if(f[O][K-G]==null){let V=!1;U<D.length&&(V=(D[U]>>>H&1)==1),P(O,K-G)&&(V=!V),f[O][K-G]=V,H-=1,H==-1&&(U+=1,H=7)}if(O+=M,O<0||o<=O){O-=M,M=-M;break}}},b=function(D,A){let M=0,O=0,H=0;const U=new Array(A.length),P=new Array(A.length);for(let Y=0;Y<A.length;Y+=1){const te=A[Y].dataCount,z=A[Y].totalCount-te;O=Math.max(O,te),H=Math.max(H,z),U[Y]=new Array(te);for(let I=0;I<U[Y].length;I+=1)U[Y][I]=255&D.getBuffer()[I+M];M+=te;const j=mr.getErrorCorrectPolynomial(z),q=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+q.getLength()-P[Y].length;P[Y][I]=ie>=0?q.getAt(ie):0}}let K=0;for(let Y=0;Y<A.length;Y+=1)K+=A[Y].totalCount;const G=new Array(K);let V=0;for(let Y=0;Y<O;Y+=1)for(let te=0;te<A.length;te+=1)Y<U[te].length&&(G[V]=U[te][Y],V+=1);for(let Y=0;Y<H;Y+=1)for(let te=0;te<A.length;te+=1)Y<P[te].length&&(G[V]=P[te][Y],V+=1);return G},E=function(D,A,M){const O=qm.getRSBlocks(D,A),H=$m();for(let P=0;P<M.length;P+=1){const K=M[P];H.put(K.getMode(),4),H.put(K.getLength(),mr.getLengthInBits(K.getMode(),D)),K.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 b(H,O)};p.addData=function(D,A){A=A||"Byte";let M=null;switch(A){case"Numeric":M=$0(D);break;case"Alphanumeric":M=G0(D);break;case"Byte":M=V0(D);break;case"Kanji":M=W0(D);break;default:throw"mode:"+A}u.push(M),c=null},p.isDark=function(D,A){if(D<0||o<=D||A<0||o<=A)throw D+","+A;return f[D][A]},p.getModuleCount=function(){return o},p.make=function(){if(d<1){let D=1;for(;D<40;D++){const A=qm.getRSBlocks(D,v),M=$m();for(let H=0;H<u.length;H++){const U=u[H];M.put(U.getMode(),4),M.put(U.getLength(),mr.getLengthInBits(U.getMode(),D)),U.write(M)}let O=0;for(let H=0;H<A.length;H++)O+=A[H].dataCount;if(M.getLengthInBits()<=O*8)break}d=D}h(!1,w())},p.createTableTag=function(D,A){D=D||2,A=typeof A>"u"?D*4:A;let M="";M+='<table style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: "+A+"px;",M+='">',M+="<tbody>";for(let O=0;O<p.getModuleCount();O+=1){M+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)M+='<td style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: 0px;",M+=" width: "+D+"px;",M+=" height: "+D+"px;",M+=" background-color: ",M+=p.isDark(O,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},p.createSvgTag=function(D,A,M,O){let H={};typeof arguments[0]=="object"&&(H=arguments[0],D=H.cellSize,A=H.margin,M=H.alt,O=H.title),D=D||2,A=typeof A>"u"?D*4:A,M=typeof M=="string"?{text:M}:M||{},M.text=M.text||null,M.id=M.text?M.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=p.getModuleCount()*D+A*2;let P,K,G,V,Y="",te;for(te="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||M.text?' role="img" aria-labelledby="'+L([O.id,M.id].join(" ").trim())+'"':"",Y+=">",Y+=O.text?'<title id="'+L(O.id)+'">'+L(O.text)+"</title>":"",Y+=M.text?'<description id="'+L(M.id)+'">'+L(M.text)+"</description>":"",Y+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Y+='<path d="',G=0;G<p.getModuleCount();G+=1)for(V=G*D+A,P=0;P<p.getModuleCount();P+=1)p.isDark(G,P)&&(K=P*D+A,Y+="M"+K+","+V+te);return Y+='" stroke="transparent" fill="black"/>',Y+="</svg>",Y},p.createDataURL=function(D,A){D=D||2,A=typeof A>"u"?D*4:A;const M=p.getModuleCount()*D+A*2,O=A,H=M-A;return Q0(M,M,function(U,P){if(O<=U&&U<H&&O<=P&&P<H){const K=Math.floor((U-O)/D),G=Math.floor((P-O)/D);return p.isDark(G,K)?0:1}else return 1})},p.createImgTag=function(D,A,M){D=D||2,A=typeof A>"u"?D*4:A;const O=p.getModuleCount()*D+A*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(D,A),H+='"',H+=' width="',H+=O,H+='"',H+=' height="',H+=O,H+='"',M&&(H+=' alt="',H+=L(M),H+='"'),H+="/>",H};const L=function(D){let A="";for(let M=0;M<D.length;M+=1){const O=D.charAt(M);switch(O){case"<":A+="<";break;case">":A+=">";break;case"&":A+="&";break;case'"':A+=""";break;default:A+=O;break}}return A},R=function(D){D=typeof D>"u"?2:D;const M=p.getModuleCount()*1+D*2,O=D,H=M-D;let U,P,K,G,V;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},te={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<M;U+=2){for(K=Math.floor((U-O)/1),G=Math.floor((U+1-O)/1),P=0;P<M;P+=1)V="█",O<=P&&P<H&&O<=U&&U<H&&p.isDark(K,Math.floor((P-O)/1))&&(V=" "),O<=P&&P<H&&O<=U+1&&U+1<H&&p.isDark(G,Math.floor((P-O)/1))?V+=" ":V+="█",z+=D<1&&U+1>=H?te[V]:Y[V];z+=`
|
|
50
|
+
`}return M%2&&D>0?z.substring(0,z.length-M-1)+Array(M+1).join("▀"):z.substring(0,z.length-1)};return p.createASCII=function(D,A){if(D=D||1,D<2)return R(A);D-=1,A=typeof A>"u"?D*2:A;const M=p.getModuleCount()*D+A*2,O=A,H=M-A;let U,P,K,G;const V=Array(D+1).join("██"),Y=Array(D+1).join(" ");let te="",z="";for(U=0;U<M;U+=1){for(K=Math.floor((U-O)/D),z="",P=0;P<M;P+=1)G=1,O<=P&&P<H&&O<=U&&U<H&&p.isDark(K,Math.floor((P-O)/D))&&(G=0),z+=G?V:Y;for(K=0;K<D;K+=1)te+=z+`
|
|
51
|
+
`}return te.substring(0,te.length-1)},p.renderTo2dContext=function(D,A){A=A||2;const M=p.getModuleCount();for(let O=0;O<M;O++)for(let H=0;H<M;H++)D.fillStyle=p.isDark(O,H)?"black":"white",D.fillRect(H*A,O*A,A,A)},p};Vr.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};Vr.createStringToBytes=function(t,r){const s=(function(){const d=Y0(t),v=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 u=v(),p=v(),h=v(),S=String.fromCharCode(c<<8|u),w=p<<8|h;o[S]=w,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const v=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)v.push(o);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?v.push(c):(v.push(c>>>8),v.push(c&255)):v.push(l)}}return v}};const Zt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ya={L:1,M:0,Q:3,H:2},pr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},mr=(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={},v=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;v(o)-v(r)>=0;)o^=r<<v(o)-v(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;v(o)-v(s)>=0;)o^=s<<v(o)-v(s);return f<<12|o},d.getPatternPosition=function(f){return t[f-1]},d.getMaskFunction=function(f){switch(f){case pr.PATTERN000:return function(o,c){return(o+c)%2==0};case pr.PATTERN001:return function(o,c){return o%2==0};case pr.PATTERN010:return function(o,c){return c%3==0};case pr.PATTERN011:return function(o,c){return(o+c)%3==0};case pr.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case pr.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case pr.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case pr.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,_r.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case Zt.MODE_NUMBER:return 10;case Zt.MODE_ALPHA_NUM:return 9;case Zt.MODE_8BIT_BYTE:return 8;case Zt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case Zt.MODE_NUMBER:return 12;case Zt.MODE_ALPHA_NUM:return 11;case Zt.MODE_8BIT_BYTE:return 16;case Zt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case Zt.MODE_NUMBER:return 14;case Zt.MODE_ALPHA_NUM:return 13;case Zt.MODE_8BIT_BYTE:return 16;case Zt.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 h=0;h<o;h+=1)for(let S=0;S<o;S+=1){let w=0;const T=f.isDark(h,S);for(let k=-1;k<=1;k+=1)if(!(h+k<0||o<=h+k))for(let y=-1;y<=1;y+=1)S+y<0||o<=S+y||k==0&&y==0||T==f.isDark(h+k,S+y)&&(w+=1);w>5&&(c+=3+w-5)}for(let h=0;h<o-1;h+=1)for(let S=0;S<o-1;S+=1){let w=0;f.isDark(h,S)&&(w+=1),f.isDark(h+1,S)&&(w+=1),f.isDark(h,S+1)&&(w+=1),f.isDark(h+1,S+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let h=0;h<o;h+=1)for(let S=0;S<o-6;S+=1)f.isDark(h,S)&&!f.isDark(h,S+1)&&f.isDark(h,S+2)&&f.isDark(h,S+3)&&f.isDark(h,S+4)&&!f.isDark(h,S+5)&&f.isDark(h,S+6)&&(c+=40);for(let h=0;h<o;h+=1)for(let S=0;S<o-6;S+=1)f.isDark(S,h)&&!f.isDark(S+1,h)&&f.isDark(S+2,h)&&f.isDark(S+3,h)&&f.isDark(S+4,h)&&!f.isDark(S+5,h)&&f.isDark(S+6,h)&&(c+=40);let u=0;for(let h=0;h<o;h+=1)for(let S=0;S<o;S+=1)f.isDark(S,h)&&(u+=1);const p=Math.abs(100*u/o/o-50)/5;return c+=p*10,c},d})(),_r=(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 v=new Array(t.length-d+r);for(let f=0;f<t.length-d;f+=1)v[f]=t[f+d];return v})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const v=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)v[f+o]^=_r.gexp(_r.glog(l.getAt(f))+_r.glog(d.getAt(o)));return el(v,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const v=_r.glog(l.getAt(0))-_r.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]^=_r.gexp(_r.glog(d.getAt(o))+v);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,v){const f={};return f.totalCount=d,f.dataCount=v,f},s={},l=function(d,v){switch(v){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,v){const f=l(d,v);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+v;const o=f.length/3,c=[];for(let u=0;u<o;u+=1){const p=f[u*3+0],h=f[u*3+1],S=f[u*3+2];for(let w=0;w<p;w+=1)c.push(r(h,S))}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 v=0;v<d;v+=1)s.putBit((l>>>d-v-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);t.length<=d&&t.push(0),l&&(t[d]|=128>>>r%8),r+=1},s},$0=function(t){const r=Zt.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+v(f.charAt(c));return o},v=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},G0=function(t){const r=Zt.MODE_ALPHA_NUM,s=t,l={};l.getMode=function(){return r},l.getLength=function(v){return s.length},l.write=function(v){const f=s;let o=0;for(;o+1<f.length;)v.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&v.put(d(f.charAt(o)),6)};const d=function(v){if("0"<=v&&v<="9")return v.charCodeAt(0)-48;if("A"<=v&&v<="Z")return v.charCodeAt(0)-65+10;switch(v){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+v}};return l},V0=function(t){const r=Zt.MODE_8BIT_BYTE,s=Vr.stringToBytes(t),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let v=0;v<s.length;v+=1)d.put(s[v],8)},l},W0=function(t){const r=Zt.MODE_KANJI,s=Vr.stringToBytes;(function(v,f){const o=s(v);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(v){return~~(l.length/2)},d.write=function(v){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),v.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 v=0;v<d;v+=1)r.writeByte(s[v+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return t},r.toString=function(){let s="";s+="[";for(let l=0;l<t.length;l+=1)l>0&&(s+=","),s+=t[l];return s+="]",s},r},K0=function(){let t=0,r=0,s=0,l="";const d={},v=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;)v(t>>>r-6),r-=6},d.flush=function(){if(r>0&&(v(t<<6-r),t=0,r=0),s%3!=0){const o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},Y0=function(t){const r=t;let s=0,l=0,d=0;const v={};v.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;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 v},X0=function(t,r){const s=t,l=r,d=new Array(t*r),v={};v.setPixel=function(u,p,h){d[p*s+u]=h},v.write=function(u){u.writeString("GIF87a"),u.writeShort(s),u.writeShort(l),u.writeByte(128),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(255),u.writeByte(255),u.writeByte(255),u.writeString(","),u.writeShort(0),u.writeShort(0),u.writeShort(s),u.writeShort(l),u.writeByte(0);const p=2,h=o(p);u.writeByte(p);let S=0;for(;h.length-S>255;)u.writeByte(255),u.writeBytes(h,S,255),S+=255;u.writeByte(h.length-S),u.writeBytes(h,S,h.length-S),u.writeByte(0),u.writeString(";")};const f=function(u){const p=u;let h=0,S=0;const w={};return w.write=function(T,k){if(T>>>k)throw"length over";for(;h+k>=8;)p.writeByte(255&(T<<h|S)),k-=8-h,T>>>=8-h,S=0,h=0;S=T<<h|S,h=h+k},w.flush=function(){h>0&&p.writeByte(S)},w},o=function(u){const p=1<<u,h=(1<<u)+1;let S=u+1;const w=c();for(let g=0;g<p;g+=1)w.add(String.fromCharCode(g));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(h));const T=l_(),k=f(T);k.write(p,S);let y=0,_=String.fromCharCode(d[y]);for(y+=1;y<d.length;){const g=String.fromCharCode(d[y]);y+=1,w.contains(_+g)?_=_+g:(k.write(w.indexOf(_),S),w.size()<4095&&(w.size()==1<<S&&(S+=1),w.add(_+g)),_=g)}return k.write(w.indexOf(_),S),k.write(h,S),k.flush(),T.toByteArray()},c=function(){const u={};let p=0;const h={};return h.add=function(S){if(h.contains(S))throw"dup key:"+S;u[S]=p,p+=1},h.size=function(){return p},h.indexOf=function(S){return u[S]},h.contains=function(S){return typeof u[S]<"u"},h};return v},Q0=function(t,r,s){const l=X0(t,r);for(let o=0;o<r;o+=1)for(let c=0;c<t;c+=1)l.setPixel(c,o,s(c,o));const d=l_();l.write(d);const v=K0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)v.writeByte(f[o]);return v.flush(),"data:image/gif;base64,"+v};Vr.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},Gs=[...tl,o_],J0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},Z0={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},c_=[J0,Z0],Hh=[...Gs,...c_];tl.map(t=>t.name);const u_=Gs.map(t=>t.name);c_.map(t=>t.name);Hh.map(t=>t.name);Hh.filter(t=>t.dispatchable).map(t=>t.name);function e1(t){return u_.includes(t)}const t1="zh-CN",n1="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"}],i1=[{value:"round-final",label:"Round final reply"},{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function r1(){const t={};for(const r of u_)t[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:t,autoOrchestration:!0}}const f_=[{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"}],s1=[{value:"default",label:"Default",description:"Account default",source:"claude",available:!0},{value:"fable",label:"Fable",description:"Claude Fable",source:"claude",available:!0},{value:"opus",label:"Opus",description:"Latest Opus",source:"claude",available:!0},{value:"sonnet",label:"Sonnet",description:"Latest Sonnet",source:"claude",available:!0}],a1="Codex API/gpt-5.6-sol",l1=`ccr:${a1}`;function d_(t=!1,r="CCR GPT models are unavailable."){return[...s1,{value:l1,label:"GPT-5.6 Sol (CCR)",description:"GPT-5.6 Sol through the host CCR gateway",source:"ccr",available:t,...t?{}:{unavailableReason:r}}]}const o1=[{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"}],p_=[...o1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function c1({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 No(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 ht(t,r,s){return`${t} failed. Reason: ${No(r,s)}`}function To(t,r){return r.some(s=>t.startsWith(`${s} failed.`))?"":t}const ye={getAppPreferences(){return Se("/api/settings/preferences")},updateAppPreferences(t){return Se("/api/settings/preferences",{method:"PUT",body:JSON.stringify(t)})},getCcrIntegrationStatus(){return Se("/api/settings/ccr")},updateCcrIntegration(t){return Se("/api/settings/ccr",{method:"PUT",body:JSON.stringify(t)})},checkCcrIntegration(){return Se("/api/settings/ccr/check",{method:"POST"})},getRuntimeDiagnostics(){return Se("/api/diagnostics/runtime")},getCurrentProject(){return Se("/api/projects/current")},pullCurrentProject(){return Se("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return Se("/api/projects/recent")},connectProject(t){return Se("/api/projects/connect",{method:"POST",body:JSON.stringify(t)})},listTasks(){return Se("/api/tasks")},createTask(t){return Se("/api/tasks",{method:"POST",body:JSON.stringify(t)})},cleanupTask(t){return Se(`/api/tasks/${encodeURIComponent(t)}/cleanup`,{method:"POST"})},getHarnessStatus(t){const r=new URLSearchParams({taskSlug:t});return Se(`/api/projects/harness?${r.toString()}`)},applyHarness(t){return Se("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(t)})},getHarnessFileContent(t,r){const s=new URLSearchParams({path:r,taskSlug:t});return Se(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(t,r,s){const l=new URLSearchParams({path:r,taskSlug:t});return Se(`/api/projects/harness/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(t,r){const s=new URLSearchParams({taskSlug:t});return r&&s.set("commit",r),Se(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return Se(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(t){return Se("/api/projects/harness/repository-diff/merge-to-current-branch",{method:"POST",body:JSON.stringify({taskSlug:t})})},getHarnessBootstrapStatus(t){const r=new URLSearchParams({taskSlug:t});return Se(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(t={}){return Se("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(t)})},restartHarnessBootstrap(t={}){return Se("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessBootstrap(t){return Se("/api/projects/harness/bootstrap/stop",{method:"POST",body:JSON.stringify(t)})},runHarnessBootstrap(t){return Se("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(t)})},getHarnessEngineerSession(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString()?`?${r.toString()}`:"";return Se(`/api/projects/harness/engineer/session${s}`)},ensureHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(t)})},startHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(t)})},resumeHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(t)})},restartHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessEngineerSession(t={}){return Se("/api/projects/harness/engineer/session/stop",{method:"POST",body:JSON.stringify(t)})},notifyHarnessEngineerHarnessUpdated(t={}){return Se("/api/projects/harness/engineer/session/notify-harness",{method:"POST",body:JSON.stringify(t)})},getHarnessFeedbackState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return Se(`/api/projects/harness/feedback${s?`?${s}`:""}`)},sendHarnessFeedback(t){return Se("/api/projects/harness/feedback/send",{method:"POST",body:JSON.stringify(t)})},startTaskHarnessRetrospective(t){return Se("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(t)})},getAutoMemoryState(t){const r=new URLSearchParams({taskSlug:t});return Se(`/api/projects/harness/memory?${r.toString()}`)},getMemoryFileContent(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return Se(`/api/projects/harness/memory/file?${s.toString()}`)},updateMemoryFileContent(t,r,s){const l=new URLSearchParams({taskSlug:t,path:r});return Se(`/api/projects/harness/memory/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},revertMemoryRun(t){return Se("/api/projects/harness/memory/revert",{method:"POST",body:JSON.stringify(t)})},retryMemoryReview(t){return Se("/api/projects/harness/memory/retry",{method:"POST",body:JSON.stringify(t)})},getTaskStatus(t){return Se(`/api/tasks/${encodeURIComponent(t)}/status`)},oneClickStart(t){return Se(`/api/tasks/${encodeURIComponent(t)}/one-click-start`,{method:"POST"})},getTaskWorkspaceState(t){return Se(`/api/tasks/${encodeURIComponent(t)}/workspace-state`)},getProjectRuntimeState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return Se(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(t){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions`)},startRoleSession(t,r,s={}){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(t,r,s={}){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(t,r,s={}){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(t){return Se(`/api/tasks/${encodeURIComponent(t)}/messages`)},markAllMessagesDone(t){return Se(`/api/tasks/${encodeURIComponent(t)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(t){return Se(`/api/tasks/${encodeURIComponent(t)}/messages/history`,{method:"DELETE"})},getOrchestrationState(t){return Se(`/api/tasks/${encodeURIComponent(t)}/orchestration`)},updateOrchestrationState(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(t){return Se(`/api/tasks/${encodeURIComponent(t)}/round`)},getGateReviewState(t){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review`)},updateGateReviewSettings(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/report`)},startTranslationSession(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(t,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),Se(`/api/translation/sessions/${encodeURIComponent(t)}/events?${l.toString()}`)},pollTranslationTaskFeed(t,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),Se(`/api/tasks/${encodeURIComponent(t)}/translation/feed?${l.toString()}`)},translateUserInput(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},translateLatestReply(t,r){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/latest-reply`,{method:"POST"})},sendTranslatedInput(t,r,s){return Se(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(t){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/clear`,{method:"POST"})},stopTranslationSession(t){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(t={}){return Se("/api/projects/translation/session/notify-harness",{method:"POST",body:JSON.stringify(t)})},retryTranslation(t,r){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(t){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(t){return Se(`/api/translation/sessions/${encodeURIComponent(t)}/failures/retry`,{method:"POST"})},getTranslationState(){return Se("/api/translation/state")},getTranslatorSession(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString()?`?${r.toString()}`:"";return Se(`/api/translation/session${s}`)},ensureTranslatorSession(t={}){return Se("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(t)})},startTranslatorSession(t={}){return Se("/api/translation/session/start",{method:"POST",body:JSON.stringify(t)})},resumeTranslatorSession(t={}){return Se("/api/translation/session/resume",{method:"POST",body:JSON.stringify(t)})},restartTranslatorSession(t={}){return Se("/api/translation/session/restart",{method:"POST",body:JSON.stringify(t)})},stopTranslatorSession(t={}){return Se("/api/translation/session/stop",{method:"POST",body:JSON.stringify(t)})},browseTranslationSourceFiles(t={}){const r=new URLSearchParams;t.path&&r.set("path",t.path),t.query&&r.set("query",t.query),t.limit!==void 0&&r.set("limit",String(t.limit));const s=r.toString()?`?${r.toString()}`:"";return Se(`/api/translation/source-files${s}`)},createFileTranslation(t){return Se("/api/translation/files",{method:"POST",body:JSON.stringify(t)})},readFileTranslation(t){return Se(`/api/translation/files/${encodeURIComponent(t)}`)},createTranslationBootstrap(t){return Se("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(t)})},createTranslationMemoryUpdate(t){return Se("/api/translation/memory-update",{method:"POST",body:JSON.stringify(t)})},promoteTranslation(t,r){return Se(`/api/translation/files/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return Se("/api/gateway/status")},updateGatewaySettings(t){return Se("/api/gateway/settings",{method:"PUT",body:JSON.stringify(t)})},startGatewayQrLogin(){return Se("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(t={}){return Se("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(t)})},startGatewayLarkRegistration(){return Se("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return Se("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(t){return Se("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(t)})},resetGatewayBinding(){return Se("/api/gateway/binding/reset",{method:"POST"})},setGatewayConnection(t){return Se("/api/gateway/connection",{method:"PUT",body:JSON.stringify({enabled:t})})}};async function Se(t,r={}){var v,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: ${No(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),u=u1(c),p=d.statusText?`${d.status} ${d.statusText}`:String(d.status),S=((v=u==null?void 0:u.error)!=null&&v.hint?`${u.error.message??"Backend error."} ${u.error.hint}`:(f=u==null?void 0:u.error)==null?void 0:f.message)??h1(c),w=(o=u==null?void 0:u.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 ${p}. ${S}${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 vh="vcm:ui-error-report",yh="vcm:ui-error-clear-actions",Sh="vcm:ui-error-clear-message";function f1(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(vh,{detail:{message:r}}))}function d1(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(Sh,{detail:{message:r}}))}function p1(t){t.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(yh,{detail:{actions:t}}))}function ji(t){const[r,s]=ee.useState(t),l=ee.useRef(t),d=ee.useCallback(v=>{const f=l.current,o=typeof v=="function"?v(f):v;l.current=o,typeof o=="string"&&o.trim()?f1(o):typeof f=="string"&&f.trim()&&d1(f),s(o)},[]);return[r,d]}var Qu={exports:{}},Gm;function m1(){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 v=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(v._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,v=d._renderService.dimensions;if(v.css.cell.width===0||v.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),h=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),S=u-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(S/v.css.cell.width)),rows:Math.max(1,Math.floor(h/v.css.cell.height))}}}})(),s})()))})(Qu)),Qu.exports}var g1=m1(),Ju={exports:{}},Vm;function _1(){return Vm||(Vm=1,(function(t,r){(function(s,l){t.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{function c(p){try{const h=new URL(p),S=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return p.toLocaleLowerCase().startsWith(S.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(p,h,S,w={}){this._terminal=p,this._regex=h,this._handler=S,this._options=w}provideLinks(p,h){const S=u.computeLink(p,this._regex,this._terminal,this._handler);h(this._addCallbacks(S))}_addCallbacks(p){return p.map((h=>(h.leave=this._options.leave,h.hover=(S,w)=>{if(this._options.hover){const{range:T}=h;this._options.hover(S,w,T)}},h)))}};class u{static computeLink(h,S,w,T){const k=new RegExp(S.source,(S.flags||"")+"g"),[y,_]=u._getWindowedLineStrings(h-1,w),g=y.join("");let b;const E=[];for(;b=k.exec(g);){const L=b[0];if(!c(L))continue;const[R,D]=u._mapStrIdx(w,_,0,b.index),[A,M]=u._mapStrIdx(w,R,D,L.length);if(R===-1||D===-1||A===-1||M===-1)continue;const O={start:{x:D+1,y:R+1},end:{x:M,y:A+1}};E.push({range:O,text:L,activate:T})}return E}static _getWindowedLineStrings(h,S){let w,T=h,k=h,y=0,_="";const g=[];if(w=S.buffer.active.getLine(h)){const b=w.translateToString(!0);if(w.isWrapped&&b[0]!==" "){for(y=0;(w=S.buffer.active.getLine(--T))&&y<2048&&(_=w.translateToString(!0),y+=_.length,g.push(_),w.isWrapped&&_.indexOf(" ")===-1););g.reverse()}for(g.push(b),y=0;(w=S.buffer.active.getLine(++k))&&w.isWrapped&&y<2048&&(_=w.translateToString(!0),y+=_.length,g.push(_),_.indexOf(" ")===-1););}return[g,T]}static _mapStrIdx(h,S,w,T){const k=h.buffer.active,y=k.getNullCell();let _=w;for(;T;){const g=k.getLine(S);if(!g)return[-1,-1];for(let b=_;b<g.length;++b){g.getCell(b,y);const E=y.getChars();if(y.getWidth()&&(T-=E.length||1,b===g.length-1&&E==="")){const L=k.getLine(S+1);L&&L.isWrapped&&(L.getCell(0,y),y.getWidth()===2&&(T+=1))}if(T<0)return[S,b]}S++,_=0}return[S,_]}}o.LinkComputer=u}},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 v={};return(()=>{var f=v;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const o=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(p,h){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(p=u,h={}){this._handler=p,this._options=h}activate(p){this._terminal=p;const h=this._options,S=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,S,this._handler,h))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),v})()))})(Ju)),Ju.exports}var v1=_1(),Zu={exports:{}},Wm;function y1(){return Wm||(Wm=1,(function(t,r){(function(s,l){t.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var u=this&&this.__decorate||function(g,b,E,L){var R,D=arguments.length,A=D<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,b,E,L);else for(var M=g.length-1;M>=0;M--)(R=g[M])&&(A=(D<3?R(A):D>3?R(b,E,A):R(b,E))||A);return D>3&&A&&Object.defineProperty(b,E,A),A},p=this&&this.__param||function(g,b){return function(E,L){b(E,L,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const h=c(9042),S=c(9924),w=c(844),T=c(4725),k=c(2585),y=c(3656);let _=o.AccessibilityManager=class extends w.Disposable{constructor(g,b,E,L){super(),this._terminal=g,this._coreBrowserService=E,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 R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
52
|
+
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.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(g){for(let b=0;b<g;b++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
|
|
53
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,b){this._liveRegionDebouncer.refresh(g,b,this._terminal.rows)}_renderRows(g,b){const E=this._terminal.buffer,L=E.lines.length.toString();for(let R=g;R<=b;R++){const D=E.lines.get(E.ydisp+R),A=[],M=(D==null?void 0:D.translateToString(!0,void 0,void 0,A))||"",O=(E.ydisp+R+1).toString(),H=this._rowElements[R];H&&(M.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=M,this._rowColumns.set(H,A)),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(g,b){const E=g.target,L=this._rowElements[b===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==L)return;let R,D;if(b===0?(R=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=E,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:g.anchorNode,offset:g.anchorOffset},E={node:g.focusNode,offset:g.focusOffset};if((b.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===E.node&&b.offset>E.offset)&&([b,E]=[E,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const L=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:L,offset:((M=L.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(E.node))return;const R=({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 K=this._rowColumns.get(U);if(!K)return console.warn("columns is null. Race condition?"),null;let G=H<K.length?K[H]:K.slice(-1)[0]+1;return G>=this._terminal.cols&&(++P,G=0),{row:P,column:G}},D=R(b),A=R(E);if(D&&A){if(D.row>A.row||D.row===A.row&&D.column>=A.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(A.row-D.row)*this._terminal.cols-D.column+A.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_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 g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=_=u([p(1,k.IInstantiationService),p(2,T.ICoreBrowserService),p(3,T.IRenderService)],_)},3614:(f,o)=>{function c(S){return S.replace(/\r?\n/g,"\r")}function u(S,w){return w?"\x1B[200~"+S+"\x1B[201~":S}function p(S,w,T,k){S=u(S=c(S),T.decPrivateModes.bracketedPasteMode&&k.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(S,!0),w.value=""}function h(S,w,T){const k=T.getBoundingClientRect(),y=S.clientX-k.left-10,_=S.clientY-k.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${y}px`,w.style.top=`${_}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=u,o.copyHandler=function(S,w){S.clipboardData&&S.clipboardData.setData("text/plain",w.selectionText),S.preventDefault()},o.handlePasteEvent=function(S,w,T,k){S.stopPropagation(),S.clipboardData&&p(S.clipboardData.getData("text/plain"),w,T,k)},o.paste=p,o.moveTextAreaUnderMouseCursor=h,o.rightClickHandler=function(S,w,T,k,y){h(S,w,T),y&&k.rightClickSelect(S),w.value=k.selectionText,w.select()}},7239:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=c(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(p,h,S){this._css.set(p,h,S)}getCss(p,h){return this._css.get(p,h)}setColor(p,h,S){this._color.set(p,h,S)}getColor(p,h){return this._color.get(p,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,u,p,h){c.addEventListener(u,p,h);let S=!1;return{dispose:()=>{S||(S=!0,c.removeEventListener(u,p,h))}}}},3551:function(f,o,c){var u=this&&this.__decorate||function(_,g,b,E){var L,R=arguments.length,D=R<3?g:E===null?E=Object.getOwnPropertyDescriptor(g,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(_,g,b,E);else for(var A=_.length-1;A>=0;A--)(L=_[A])&&(D=(R<3?L(D):R>3?L(g,b,D):L(g,b))||D);return R>3&&D&&Object.defineProperty(g,b,D),D},p=this&&this.__param||function(_,g){return function(b,E){g(b,E,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const h=c(3656),S=c(8460),w=c(844),T=c(2585),k=c(4725);let y=o.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(_,g,b,E,L){super(),this._element=_,this._mouseService=g,this._renderService=b,this._bufferService=E,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new S.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new S.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const g=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const b=_.composedPath();for(let E=0;E<b.length;E++){const L=b[E];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(_){if(this._activeLine!==_.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(_,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,_)||(this._clearCurrentLink(),this._askForLink(_,!0))}_askForLink(_,g){var E,L;this._activeProviderReplies&&g||((E=this._activeProviderReplies)==null||E.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let b=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())g?(L=this._activeProviderReplies)!=null&&L.get(R)&&(b=this._checkLinkProviderResult(R,_,b)):D.provideLinks(_.y,(A=>{var O,H;if(this._isMouseOut)return;const M=A==null?void 0:A.map((U=>({link:U})));(O=this._activeProviderReplies)==null||O.set(R,M),b=this._checkLinkProviderResult(R,_,b),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,g){const b=new Set;for(let E=0;E<g.size;E++){const L=g.get(E);if(L)for(let R=0;R<L.length;R++){const D=L[R],A=D.link.range.start.y<_?0:D.link.range.start.x,M=D.link.range.end.y>_?this._bufferService.cols:D.link.range.end.x;for(let O=A;O<=M;O++){if(b.has(O)){L.splice(R--,1);break}b.add(O)}}}}_checkLinkProviderResult(_,g,b){var R;if(!this._activeProviderReplies)return b;const E=this._activeProviderReplies.get(_);let L=!1;for(let D=0;D<_;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(L=!0);if(!L&&E){const D=E.find((A=>this._linkAtPosition(A.link,g)));D&&(b=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let D=0;D<this._activeProviderReplies.size;D++){const A=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((M=>this._linkAtPosition(M.link,g)));if(A){b=!0,this._handleNewLink(A);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const g=this._positionFromMouseEvent(_,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,g){this._currentLink&&this._lastMouseEvent&&(!_||!g||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(_.link,g)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>{var b,E;return(E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.pointerCursor},set:b=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>{var b,E;return(E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.underline},set:b=>{var E,L,R;(E=this._currentLink)!=null&&E.state&&((R=(L=this._currentLink)==null?void 0:L.state)==null?void 0:R.decorations.underline)!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const E=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(E,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(_,g,b){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(b,g.text)}_fireUnderlineEvent(_,g){const b=_.range,E=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-E-1,b.end.x,b.end.y-E-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(_,g,b){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(b,g.text)}_linkAtPosition(_,g){const b=_.range.start.y*this._bufferService.cols+_.range.start.x,E=_.range.end.y*this._bufferService.cols+_.range.end.x,L=g.y*this._bufferService.cols+g.x;return b<=L&&L<=E}_positionFromMouseEvent(_,g,b){const E=b.getCoords(_,g,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,g,b,E,L){return{x1:_,y1:g,x2:b,y2:E,cols:this._bufferService.cols,fg:L}}};o.Linkifier=y=u([p(1,k.IMouseService),p(2,k.IRenderService),p(3,T.IBufferService),p(4,k.ILinkProviderService)],y)},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 u=this&&this.__decorate||function(k,y,_,g){var b,E=arguments.length,L=E<3?y:g===null?g=Object.getOwnPropertyDescriptor(y,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(k,y,_,g);else for(var R=k.length-1;R>=0;R--)(b=k[R])&&(L=(E<3?b(L):E>3?b(y,_,L):b(y,_))||L);return E>3&&L&&Object.defineProperty(y,_,L),L},p=this&&this.__param||function(k,y){return function(_,g){y(_,g,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const h=c(511),S=c(2585);let w=o.OscLinkProvider=class{constructor(k,y,_){this._bufferService=k,this._optionsService=y,this._oscLinkService=_}provideLinks(k,y){var M;const _=this._bufferService.buffer.lines.get(k-1);if(!_)return void y(void 0);const g=[],b=this._optionsService.rawOptions.linkHandler,E=new h.CellData,L=_.getTrimmedLength();let R=-1,D=-1,A=!1;for(let O=0;O<L;O++)if(D!==-1||_.hasContent(O)){if(_.loadCell(O,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=O,R=E.extended.urlId;continue}A=E.extended.urlId!==R}else D!==-1&&(A=!0);if(A||D!==-1&&O===L-1){const H=(M=this._oscLinkService.getLinkData(R))==null?void 0:M.uri;if(H){const U={start:{x:D+1,y:k},end:{x:O+(A||O!==L-1?0:1),y:k}};let P=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const K=new URL(H);["http:","https:"].includes(K.protocol)||(P=!0)}catch{P=!0}P||g.push({text:H,range:U,activate:(K,G)=>b?b.activate(K,G,U):T(0,G),hover:(K,G)=>{var V;return(V=b==null?void 0:b.hover)==null?void 0:V.call(b,K,G,U)},leave:(K,G)=>{var V;return(V=b==null?void 0:b.leave)==null?void 0:V.call(b,K,G,U)}})}A=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=O,R=E.extended.urlId):(D=-1,R=-1)}}y(g)}};function T(k,y){if(confirm(`Do you want to navigate to ${y}?
|
|
54
|
+
|
|
55
|
+
WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=w=u([p(0,S.IBufferService),p(1,S.IOptionsService),p(2,S.IOscLinkService)],w)},6193:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,u){this._renderCallback=c,this._coreBrowserService=u,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,u,p){this._rowCount=p,c=c!==void 0?c:0,u=u!==void 0?u: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,u):u,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),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),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 u=c(3614),p=c(3656),h=c(3551),S=c(9042),w=c(3730),T=c(1680),k=c(3107),y=c(5744),_=c(2950),g=c(1296),b=c(428),E=c(4269),L=c(5114),R=c(8934),D=c(3230),A=c(9312),M=c(4725),O=c(6731),H=c(8055),U=c(8969),P=c(8460),K=c(844),G=c(6114),V=c(8437),Y=c(2584),te=c(7399),z=c(5941),j=c(9074),N=c(2585),q=c(5435),I=c(4567),ie=c(779);class de 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=G,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.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(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,ce)=>this.refresh($,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),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(($=>this._afterResize($.cols,$.rows)))),this.register((0,K.toDisposable)((()=>{var $,ce;this._customKeyEventHandler=void 0,(ce=($=this.element)==null?void 0:$.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const $ of Q){let ce,se="";switch($.index){case 256:ce="foreground",se="10";break;case 257:ce="background",se="11";break;case 258:ce="cursor",se="12";break;default:ce="ansi",se="4;"+$.index}switch($.type){case 0:const xe=H.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${se};${(0,z.toRgbString)(xe)}${Y.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((be=>be.ansi[$.index]=H.channels.toColor(...$.color)));else{const be=ce;this._themeService.modifyColors((je=>je[be]=H.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.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,$=this.buffer.lines.get(Q);if(!$)return;const ce=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,xe=$.getWidth(ce),be=this._renderService.dimensions.css.cell.width*xe,je=this.buffer.y*this._renderService.dimensions.css.cell.height,Ee=ce*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ee+"px",this.textarea.style.top=je+"px",this.textarea.style.width=be+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,u.copyHandler)($,this._selectionService)})));const Q=$=>(0,u.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Q)),G.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,u.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,u.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),G.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,u.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){var ce;if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ce=this.element)==null?void 0:ce.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Q.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",S.promptLabel),G.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(L.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(_.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(T.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(k.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,$=this.element;function ce(be){const je=Q._mouseService.getMouseReportCoords(be,Q.screenElement);if(!je)return!1;let Ee,me;switch(be.overrideType||be.type){case"mousemove":me=32,be.buttons===void 0?(Ee=3,be.button!==void 0&&(Ee=be.button<3?be.button:3)):Ee=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":me=0,Ee=be.button<3?be.button:3;break;case"mousedown":me=1,Ee=be.button<3?be.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(be)===!1||Q.viewport.getLinesScrolled(be)===0)return!1;me=be.deltaY<0?0:1,Ee=4;break;default:return!1}return!(me===void 0||Ee===void 0||Ee>4)&&Q.coreMouseService.triggerMouseEvent({col:je.col,row:je.row,x:je.x,y:je.y,button:Ee,action:me,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},xe={mouseup:be=>(ce(be),be.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(be)),wheel:be=>(ce(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&ce(be)},mousemove:be=>{be.buttons||ce(be)}};this.register(this.coreMouseService.onProtocolChange((be=>{be?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(be)),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&be?se.mousemove||($.addEventListener("mousemove",xe.mousemove),se.mousemove=xe.mousemove):($.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&be?se.wheel||($.addEventListener("wheel",xe.wheel,{passive:!1}),se.wheel=xe.wheel):($.removeEventListener("wheel",se.wheel),se.wheel=null),2&be?se.mouseup||(se.mouseup=xe.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&be?se.mousedrag||(se.mousedrag=xe.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)($,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return ce(be),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(be)}))),this.register((0,p.addDisposableDomListener)($,"wheel",(be=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const je=this.viewport.getLinesScrolled(be);if(je===0)return;const Ee=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let me="";for(let Me=0;Me<Math.abs(je);Me++)me+=Ee;return this.coreService.triggerDataEvent(me,!0),this.cancel(be,!0)}return this.viewport.handleWheel(be)?this.cancel(be):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)($,"touchstart",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,p.addDisposableDomListener)($,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(Q,$){var ce;(ce=this._renderService)==null||ce.refreshRows(Q,$)}updateCursorStyle(Q){var $;($=this._selectionService)!=null&&$.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,$,ce=0){var se;ce===1?(super.scrollLines(Q,$,ce),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(Q)}paste(Q){(0,u.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 $=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),$}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,$,ce){this._selectionService.setSelection(Q,$,ce)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Q;(Q=this._selectionService)==null||Q.clearSelection()}selectAll(){var Q;(Q=this._selectionService)==null||Q.selectAll()}selectLines(Q,$){var ce;(ce=this._selectionService)==null||ce.selectLines(Q,$)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!$&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,te.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),ce.type===3||ce.type===2){const se=this.rows-1;return this.scrollLines(ce.type===2?-se:se),this.cancel(Q,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(ce.cancel&&this.cancel(Q,!0),!ce.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==Y.C0.ETX&&ce.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,$){const ce=Q.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||Q.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||Q.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?ce:ce&&(!$.keyCode||$.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)$=Q.charCode;else if(Q.which===null||Q.which===void 0)$=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;$=Q.which}return!(!$||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent($,!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.data;return this.coreService.triggerDataEvent($,!0),this.cancel(Q),!0}return!1}resize(Q,$){Q!==this.cols||$!==this.rows?super.resize(Q,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,$){var ce,se;(ce=this._charSizeService)==null||ce.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var Q;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let $=1;$<this.rows;$++)this.buffer.lines.push(this.buffer.getBlankLine(V.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 $,ce;this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),($=this._selectionService)==null||$.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Q;(Q=this._renderService)==null||Q.clearTextureAtlas()}_reportFocus(){var Q;(Q=this.element)!=null&&Q.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case q.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${ce};${$}t`);break;case q.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),xe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${xe};${se}t`)}}cancel(Q,$){if(this.options.cancelEvents||$)return Q.preventDefault(),Q.stopPropagation(),!1}}o.Terminal=de},9924:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,p){this._rowCount=p,c=c!==void 0?c:0,u=u!==void 0?u: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,u):u;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const S=h-this._lastRefreshMs,w=this._debounceThresholdMS-S;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),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(f,o,c){var u=this&&this.__decorate||function(_,g,b,E){var L,R=arguments.length,D=R<3?g:E===null?E=Object.getOwnPropertyDescriptor(g,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(_,g,b,E);else for(var A=_.length-1;A>=0;A--)(L=_[A])&&(D=(R<3?L(D):R>3?L(g,b,D):L(g,b))||D);return R>3&&D&&Object.defineProperty(g,b,D),D},p=this&&this.__param||function(_,g){return function(b,E){g(b,E,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const h=c(3656),S=c(4725),w=c(8460),T=c(844),k=c(2585);let y=o.Viewport=class extends T.Disposable{constructor(_,g,b,E,L,R,D,A){super(),this._viewportElement=_,this._scrollArea=g,this._bufferService=b,this._optionsService=E,this._charSizeService=L,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(_){this._viewportElement.style.backgroundColor=_.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(_){if(_)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 g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const _=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==_&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=_),this._refreshAnimationFrame=null}syncScrollArea(_=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(_);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(_)}_handleScroll(_){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 g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const _=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(_*(this._smoothScrollState.target-this._smoothScrollState.origin)),_<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(_,g){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&b<this._lastRecordedBufferHeight)||(_.cancelable&&_.preventDefault(),!1)}handleWheel(_){const g=this._getPixelsScrolled(_);return g!==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+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(_,g))}scrollLines(_){if(_!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=_*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!1})}_getPixelsScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let g=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(_,g){var A;let b,E="";const L=[],R=g??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let M=_;M<R;M++){const O=D.get(M);if(!O)continue;const H=(A=D.get(M+1))==null?void 0:A.isWrapped;if(E+=O.translateToString(!H),!H||M===D.length-1){const U=document.createElement("div");U.textContent=E,L.push(U),E.length>0&&(b=U),E=""}}return{bufferElements:L,cursorElement:b}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let g=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(_,g){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&g.altKey||b==="ctrl"&&g.ctrlKey||b==="shift"&&g.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const g=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(_,g))}};o.Viewport=y=u([p(2,k.IBufferService),p(3,k.IOptionsService),p(4,S.ICharSizeService),p(5,S.IRenderService),p(6,S.ICoreBrowserService),p(7,S.IThemeService)],y)},3107:function(f,o,c){var u=this&&this.__decorate||function(k,y,_,g){var b,E=arguments.length,L=E<3?y:g===null?g=Object.getOwnPropertyDescriptor(y,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(k,y,_,g);else for(var R=k.length-1;R>=0;R--)(b=k[R])&&(L=(E<3?b(L):E>3?b(y,_,L):b(y,_))||L);return E>3&&L&&Object.defineProperty(y,_,L),L},p=this&&this.__param||function(k,y){return function(_,g){y(_,g,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const h=c(4725),S=c(844),w=c(2585);let T=o.BufferDecorationRenderer=class extends S.Disposable{constructor(k,y,_,g,b){super(),this._screenElement=k,this._bufferService=y,this._coreBrowserService=_,this._decorationService=g,this._renderService=b,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((E=>this._removeDecoration(E)))),this.register((0,S.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 k of this._decorationService.decorations)this._renderDecoration(k);this._dimensionsChanged=!1}_renderDecoration(k){this._refreshStyle(k),this._dimensionsChanged&&this._refreshXPosition(k)}_createElement(k){var g;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((g=k==null?void 0:k.options)==null?void 0:g.layer)==="top"),y.style.width=`${Math.round((k.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(k.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(k.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=k.options.x??0;return _&&_>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(k,y),y}_refreshStyle(k){const y=k.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)k.element&&(k.element.style.display="none",k.onRenderEmitter.fire(k.element));else{let _=this._decorationElements.get(k);_||(_=this._createElement(k),k.element=_,this._decorationElements.set(k,_),this._container.appendChild(_),k.onDispose((()=>{this._decorationElements.delete(k),_.remove()}))),_.style.top=y*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",k.onRenderEmitter.fire(_)}}_refreshXPosition(k,y=k.element){if(!y)return;const _=k.options.x??0;(k.options.anchor||"left")==="right"?y.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(k){var y;(y=this._decorationElements.get(k))==null||y.remove(),this._decorationElements.delete(k),k.dispose()}};o.BufferDecorationRenderer=T=u([p(1,w.IBufferService),p(2,h.ICoreBrowserService),p(3,w.IDecorationService),p(4,h.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 u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,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,u){return u>=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,p){return u>=c.startBufferLine-this._linePadding[p||"full"]&&u<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(f,o,c){var u=this&&this.__decorate||function(b,E,L,R){var D,A=arguments.length,M=A<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,E,L,R);else for(var O=b.length-1;O>=0;O--)(D=b[O])&&(M=(A<3?D(M):A>3?D(E,L,M):D(E,L))||M);return A>3&&M&&Object.defineProperty(E,L,M),M},p=this&&this.__param||function(b,E){return function(L,R){E(L,R,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const h=c(5871),S=c(4725),w=c(844),T=c(2585),k={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let g=o.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,E,L,R,D,A,M){var H;super(),this._viewportElement=b,this._screenElement=E,this._bufferService=L,this._decorationService=R,this._renderService=D,this._optionsService=A,this._coreBrowserService=M,this._colorZoneStore=new h.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 b=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=b,y.center=E,y.right=b,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=y.left,_.right=y.left+y.center}_refreshDrawHeightConstants(){k.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);k.left=E,k.center=E,k.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.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 E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const E of b)E.position!=="full"&&this._renderColorZone(E);for(const E of b)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(_[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-k[b.position||"full"]/2),y[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+k[b.position||"full"]))}_queueRefresh(b,E){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=g=u([p(2,T.IBufferService),p(3,T.IDecorationService),p(4,S.IRenderService),p(5,T.IOptionsService),p(6,S.ICoreBrowserService)],g)},2950:function(f,o,c){var u=this&&this.__decorate||function(k,y,_,g){var b,E=arguments.length,L=E<3?y:g===null?g=Object.getOwnPropertyDescriptor(y,_):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(k,y,_,g);else for(var R=k.length-1;R>=0;R--)(b=k[R])&&(L=(E<3?b(L):E>3?b(y,_,L):b(y,_))||L);return E>3&&L&&Object.defineProperty(y,_,L),L},p=this&&this.__param||function(k,y){return function(_,g){y(_,g,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const h=c(4725),S=c(2585),w=c(2584);let T=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(k,y,_,g,b,E){this._textarea=k,this._compositionView=y,this._bufferService=_,this._optionsService=g,this._coreService=b,this._renderService=E,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(k){this._compositionView.textContent=k.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(k){if(this._isComposing||this._isSendingComposition){if(k.keyCode===229||k.keyCode===16||k.keyCode===17||k.keyCode===18)return!1;this._finalizeComposition(!1)}return k.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(k){if(this._compositionView.classList.remove("active"),this._isComposing=!1,k){const y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),_.length>0&&this._coreService.triggerDataEvent(_,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const k=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,_=y.replace(k,"");this._dataAlreadySent=_,y.length>k.length?this._coreService.triggerDataEvent(_,!0):y.length<k.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):y.length===k.length&&y!==k&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(k){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),_=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=_+"px",this._compositionView.style.lineHeight=_+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}k||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=T=u([p(2,S.IBufferService),p(3,S.IOptionsService),p(4,S.ICoreService),p(5,h.IRenderService)],T)},9806:(f,o)=>{function c(u,p,h){const S=h.getBoundingClientRect(),w=u.getComputedStyle(h),T=parseInt(w.getPropertyValue("padding-left")),k=parseInt(w.getPropertyValue("padding-top"));return[p.clientX-S.left-T,p.clientY-S.top-k]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(u,p,h,S,w,T,k,y,_){if(!T)return;const g=c(u,p,h);return g?(g[0]=Math.ceil((g[0]+(_?k/2:0))/k),g[1]=Math.ceil(g[1]/y),g[0]=Math.min(Math.max(g[0],1),S+(_?1:0)),g[1]=Math.min(Math.max(g[1],1),w),g):void 0}},9504:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=c(2584);function p(y,_,g,b){const E=y-h(y,g),L=_-h(_,g),R=Math.abs(E-L)-(function(D,A,M){let O=0;const H=D-h(D,M),U=A-h(A,M);for(let P=0;P<Math.abs(H-U);P++){const K=S(D,A)==="A"?-1:1,G=M.buffer.lines.get(H+K*P);G!=null&&G.isWrapped&&O++}return O})(y,_,g);return k(R,T(S(y,_),b))}function h(y,_){let g=0,b=_.buffer.lines.get(y),E=b==null?void 0:b.isWrapped;for(;E&&y>=0&&y<_.rows;)g++,b=_.buffer.lines.get(--y),E=b==null?void 0:b.isWrapped;return g}function S(y,_){return y>_?"A":"B"}function w(y,_,g,b,E,L){let R=y,D=_,A="";for(;R!==g||D!==b;)R+=E?1:-1,E&&R>L.cols-1?(A+=L.buffer.translateBufferLineToString(D,!1,y,R),R=0,y=0,D++):!E&&R<0&&(A+=L.buffer.translateBufferLineToString(D,!1,0,y+1),R=L.cols-1,y=R,D--);return A+L.buffer.translateBufferLineToString(D,!1,y,R)}function T(y,_){const g=_?"O":"[";return u.C0.ESC+g+y}function k(y,_){y=Math.floor(y);let g="";for(let b=0;b<y;b++)g+=_;return g}o.moveToCellSequence=function(y,_,g,b){const E=g.buffer.x,L=g.buffer.y;if(!g.buffer.hasScrollback)return(function(A,M,O,H,U,P){return p(M,H,U,P).length===0?"":k(w(A,M,A,M-h(M,U),!1,U).length,T("D",P))})(E,L,0,_,g,b)+p(L,_,g,b)+(function(A,M,O,H,U,P){let K;K=p(M,H,U,P).length>0?H-h(H,U):M;const G=H,V=(function(Y,te,z,j,N,q){let I;return I=p(z,j,N,q).length>0?j-h(j,N):te,Y<z&&I<=j||Y>=z&&I<j?"C":"D"})(A,M,O,H,U,P);return k(w(A,K,O,G,V==="C",U).length,T(V,P))})(E,L,y,_,g,b);let R;if(L===_)return R=E>y?"D":"C",k(Math.abs(E-y),T(R,b));R=L>_?"D":"C";const D=Math.abs(L-_);return k((function(A,M){return M.cols-A})(L>_?y:E,g)+(D-1)*g.cols+1+((L>_?E:y)-1),T(R,b))}},1296:function(f,o,c){var u=this&&this.__decorate||function(P,K,G,V){var Y,te=arguments.length,z=te<3?K:V===null?V=Object.getOwnPropertyDescriptor(K,G):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,K,G,V);else for(var j=P.length-1;j>=0;j--)(Y=P[j])&&(z=(te<3?Y(z):te>3?Y(K,G,z):Y(K,G))||z);return te>3&&z&&Object.defineProperty(K,G,z),z},p=this&&this.__param||function(P,K){return function(G,V){K(G,V,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const h=c(3787),S=c(2550),w=c(2223),T=c(6171),k=c(6052),y=c(4725),_=c(8055),g=c(8460),b=c(844),E=c(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",A="xterm-bg-",M="xterm-focus",O="xterm-selection";let H=1,U=o.DomRenderer=class extends b.Disposable{constructor(P,K,G,V,Y,te,z,j,N,q,I,ie,de){super(),this._terminal=P,this._document=K,this._element=G,this._screenElement=V,this._viewportElement=Y,this._helperContainer=te,this._linkifier2=z,this._charSizeService=N,this._optionsService=q,this._bufferService=I,this._coreBrowserService=ie,this._themeService=de,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,k.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(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((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(h.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,b.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 S.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 G of this._rowElements)G.style.width=`${this.dimensions.css.canvas.width}px`,G.style.height=`${this.dimensions.css.cell.height}px`,G.style.lineHeight=`${this.dimensions.css.cell.height}px`,G.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${R} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${R} .xterm-dim { color: ${_.color.multiplyOpacity(P.foreground,.5).css};}`,K+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const G=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;K+=`@keyframes ${G} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${V} { 50% { box-shadow: none; }}`,K+=`@keyframes ${Y} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,K+=`${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${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[te,z]of P.ansi.entries())K+=`${this._terminalSelector} .${D}${te} { color: ${z.css}; }${this._terminalSelector} .${D}${te}.xterm-dim { color: ${_.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${A}${te} { background-color: ${z.css}; }`;K+=`${this._terminalSelector} .${D}${w.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(P.background).css}; }${this._terminalSelector} .${D}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${A}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=K}_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,K){for(let G=this._rowElements.length;G<=K;G++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,K){this._refreshRowElements(P,K),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,K,G){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,K,G),this.renderRows(0,this._bufferService.rows-1),!P||!K)return;this._selectionRenderModel.update(this._terminal,P,K,G);const V=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(G){const N=P[0]>K[0];j.appendChild(this._createSelectionElement(te,N?K[0]:P[0],N?P[0]:K[0],z-te+1))}else{const N=V===te?P[0]:0,q=te===Y?K[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(te,N,q));const I=z-te-1;if(j.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,I)),te!==z){const ie=Y===z?K[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,ie))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,K,G,V=1){const Y=this._document.createElement("div"),te=K*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(G-K);return te+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-te),Y.style.height=V*this.dimensions.css.cell.height+"px",Y.style.top=P*this.dimensions.css.cell.height+"px",Y.style.left=`${te}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,K){const G=this._bufferService.buffer,V=G.ybase+G.y,Y=Math.min(G.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=K;N++){const q=N+G.ydisp,I=this._rowElements[N],ie=G.lines.get(q);if(!I||!ie)break;I.replaceChildren(...this._rowFactory.createRow(ie,q,q===V,z,j,Y,te,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,K,G,V,Y,te){G<0&&(P=0),V<0&&(K=0);const z=this._bufferService.rows-1;G=Math.max(Math.min(G,z),0),V=Math.max(Math.min(V,z),0),Y=Math.min(Y,this._bufferService.cols);const j=this._bufferService.buffer,N=j.ybase+j.y,q=Math.min(j.x,Y-1),I=this._optionsService.rawOptions.cursorBlink,ie=this._optionsService.rawOptions.cursorStyle,de=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=G;_e<=V;++_e){const Q=_e+j.ydisp,$=this._rowElements[_e],ce=j.lines.get(Q);if(!$||!ce)break;$.replaceChildren(...this._rowFactory.createRow(ce,Q,Q===N,ie,de,q,I,this.dimensions.css.cell.width,this._widthCache,te?_e===G?P:0:-1,te?(_e===V?K:Y)-1:-1))}}};o.DomRenderer=U=u([p(7,E.IInstantiationService),p(8,y.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,y.ICoreBrowserService),p(12,y.IThemeService)],U)},3787:function(f,o,c){var u=this&&this.__decorate||function(R,D,A,M){var O,H=arguments.length,U=H<3?D:M===null?M=Object.getOwnPropertyDescriptor(D,A):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(R,D,A,M);else for(var P=R.length-1;P>=0;P--)(O=R[P])&&(U=(H<3?O(U):H>3?O(D,A,U):O(D,A))||U);return H>3&&U&&Object.defineProperty(D,A,U),U},p=this&&this.__param||function(R,D){return function(A,M){D(A,M,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const h=c(2223),S=c(643),w=c(511),T=c(2585),k=c(8055),y=c(4725),_=c(4269),g=c(6171),b=c(3734);let E=o.DomRendererRowFactory=class{constructor(R,D,A,M,O,H,U){this._document=R,this._characterJoinerService=D,this._optionsService=A,this._coreBrowserService=M,this._coreService=O,this._decorationService=H,this._themeService=U,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,A){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=A}createRow(R,D,A,M,O,H,U,P,K,G,V){const Y=[],te=this._characterJoinerService.getJoinedCharacters(D),z=this._themeService.colors;let j,N=R.getNoBgTrimmedLength();A&&N<H+1&&(N=H+1);let q=0,I="",ie=0,de=0,_e=0,Q=!1,$=0,ce=!1,se=0;const xe=[],be=G!==-1&&V!==-1;for(let je=0;je<N;je++){R.loadCell(je,this._workCell);let Ee=this._workCell.getWidth();if(Ee===0)continue;let me=!1,Me=je,Ae=this._workCell;if(te.length>0&&je===te[0][0]){me=!0;const Fe=te.shift();Ae=new _.JoinedCellData(this._workCell,R.translateToString(!0,Fe[0],Fe[1]),Fe[1]-Fe[0]),Me=Fe[1]-1,Ee=Ae.getWidth()}const rt=this._isCellInSelection(je,D),ge=A&&je===H,ze=be&&je>=G&&je<=V;let Ke=!1;this._decorationService.forEachDecorationAtCell(je,D,void 0,(Fe=>{Ke=!0}));let zt=Ae.getChars()||S.WHITESPACE_CELL_CHAR;if(zt===" "&&(Ae.isUnderline()||Ae.isOverline())&&(zt=" "),se=Ee*P-K.get(zt,Ae.isBold(),Ae.isItalic()),j){if(q&&(rt&&ce||!rt&&!ce&&Ae.bg===ie)&&(rt&&ce&&z.selectionForeground||Ae.fg===de)&&Ae.extended.ext===_e&&ze===Q&&se===$&&!ge&&!me&&!Ke){Ae.isInvisible()?I+=S.WHITESPACE_CELL_CHAR:I+=zt,q++;continue}q&&(j.textContent=I),j=this._document.createElement("span"),q=0,I=""}else j=this._document.createElement("span");if(ie=Ae.bg,de=Ae.fg,_e=Ae.extended.ext,Q=ze,$=se,ce=rt,me&&H>=je&&H<=Me&&(H=je),!this._coreService.isCursorHidden&&ge&&this._coreService.isCursorInitialized){if(xe.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&xe.push("xterm-cursor-blink"),xe.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":xe.push("xterm-cursor-outline");break;case"block":xe.push("xterm-cursor-block");break;case"bar":xe.push("xterm-cursor-bar");break;case"underline":xe.push("xterm-cursor-underline")}}if(Ae.isBold()&&xe.push("xterm-bold"),Ae.isItalic()&&xe.push("xterm-italic"),Ae.isDim()&&xe.push("xterm-dim"),I=Ae.isInvisible()?S.WHITESPACE_CELL_CHAR:Ae.getChars()||S.WHITESPACE_CELL_CHAR,Ae.isUnderline()&&(xe.push(`xterm-underline-${Ae.extended.underlineStyle}`),I===" "&&(I=" "),!Ae.isUnderlineColorDefault()))if(Ae.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(Ae.getUnderlineColor()).join(",")})`;else{let Fe=Ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ae.isBold()&&Fe<8&&(Fe+=8),j.style.textDecorationColor=z.ansi[Fe].css}Ae.isOverline()&&(xe.push("xterm-overline"),I===" "&&(I=" ")),Ae.isStrikethrough()&&xe.push("xterm-strikethrough"),ze&&(j.style.textDecoration="underline");let pt=Ae.getFgColor(),mt=Ae.getFgColorMode(),Ot=Ae.getBgColor(),he=Ae.getBgColorMode();const Ce=!!Ae.isInverse();if(Ce){const Fe=pt;pt=Ot,Ot=Fe;const Ct=mt;mt=he,he=Ct}let Te,He,Ie,vt=!1;switch(this._decorationService.forEachDecorationAtCell(je,D,void 0,(Fe=>{Fe.options.layer!=="top"&&vt||(Fe.backgroundColorRGB&&(he=50331648,Ot=Fe.backgroundColorRGB.rgba>>8&16777215,Te=Fe.backgroundColorRGB),Fe.foregroundColorRGB&&(mt=50331648,pt=Fe.foregroundColorRGB.rgba>>8&16777215,He=Fe.foregroundColorRGB),vt=Fe.options.layer==="top")})),!vt&&rt&&(Te=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Ot=Te.rgba>>8&16777215,he=50331648,vt=!0,z.selectionForeground&&(mt=50331648,pt=z.selectionForeground.rgba>>8&16777215,He=z.selectionForeground)),vt&&xe.push("xterm-decoration-top"),he){case 16777216:case 33554432:Ie=z.ansi[Ot],xe.push(`xterm-bg-${Ot}`);break;case 50331648:Ie=k.channels.toColor(Ot>>16,Ot>>8&255,255&Ot),this._addStyle(j,`background-color:#${L((Ot>>>0).toString(16),"0",6)}`);break;default:Ce?(Ie=z.foreground,xe.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ie=z.background}switch(Te||Ae.isDim()&&(Te=k.color.multiplyOpacity(Ie,.5)),mt){case 16777216:case 33554432:Ae.isBold()&&pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(pt+=8),this._applyMinimumContrast(j,Ie,z.ansi[pt],Ae,Te,void 0)||xe.push(`xterm-fg-${pt}`);break;case 50331648:const Fe=k.channels.toColor(pt>>16&255,pt>>8&255,255&pt);this._applyMinimumContrast(j,Ie,Fe,Ae,Te,He)||this._addStyle(j,`color:#${L(pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Ie,z.foreground,Ae,Te,He)||Ce&&xe.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}xe.length&&(j.className=xe.join(" "),xe.length=0),ge||me||Ke?j.textContent=I:q++,se!==this.defaultSpacing&&(j.style.letterSpacing=`${se}px`),Y.push(j),je=Me}return j&&q&&(j.textContent=I),Y}_applyMinimumContrast(R,D,A,M,O,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const U=this._getContrastCache(M);let P;if(O||H||(P=U.getColor(D.rgba,A.rgba)),P===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);P=k.color.ensureContrastRatio(O||D,H||A,K),U.setColor((O||D).rgba,(H||A).rgba,P??null)}return!!P&&(this._addStyle(R,`color:${P.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const A=this._selectionStart,M=this._selectionEnd;return!(!A||!M)&&(this._columnSelectMode?A[0]<=M[0]?R>=A[0]&&D>=A[1]&&R<M[0]&&D<=M[1]:R<A[0]&&D>=A[1]&&R>=M[0]&&D<=M[1]:D>A[1]&&D<M[1]||A[1]===M[1]&&D===A[1]&&R>=A[0]&&R<M[0]||A[1]<M[1]&&D===M[1]&&R<M[0]||A[1]<M[1]&&D===A[1]&&R>=A[0])}};function L(R,D,A){for(;R.length<A;)R=D+R;return R}o.DomRendererRowFactory=E=u([p(1,y.ICharacterJoinerService),p(2,T.IOptionsService),p(3,y.ICoreBrowserService),p(4,T.ICoreService),p(5,T.IDecorationService),p(6,y.IThemeService)],E)},2550:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.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=[p,h,S,w],this._container.appendChild(p),this._container.appendChild(h),this._container.appendChild(S),this._container.appendChild(w),u.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,u,p,h){c===this._font&&u===this._fontSize&&p===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=u,this._weight=p,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,u,p){let h=0;if(!u&&!p&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const T=this._measure(c,0);return T>0&&(this._flat[h]=T),T}let S=c;u&&(S+="B"),p&&(S+="I");let w=this._holey.get(S);if(w===void 0){let T=0;u&&(T|=1),p&&(T|=2),w=this._measure(c,T),w>0&&this._holey.set(S,w)}return w}_measure(c,u){const p=this._measureElements[u];return p.textContent=c.repeat(32),p.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 u=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(f,o)=>{function c(p){return 57508<=p&&p<=57558}function u(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(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(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=u,o.allowRescaling=function(p,h,S,w){return h===1&&S>Math.ceil(1.5*w)&&p!==void 0&&p>255&&!u(p)&&!c(p)&&!(function(T){return 57344<=T&&T<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(h){return 9472<=h&&h<=9631})(p)},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(p,h,S=0){return(p-(2*Math.round(h)-S))%(2*Math.round(h))}},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(p,h,S,w=!1){if(this.selectionStart=h,this.selectionEnd=S,!h||!S||h[0]===S[0]&&h[1]===S[1])return void this.clear();const T=p.buffers.active.ydisp,k=h[1]-T,y=S[1]-T,_=Math.max(k,0),g=Math.min(y,p.rows-1);_>=p.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=k,this.viewportEndRow=y,this.viewportCappedStartRow=_,this.viewportCappedEndRow=g,this.startCol=h[0],this.endCol=S[0])}isCellSelected(p,h,S){return!!this.hasSelection&&(S-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&S>=this.viewportCappedStartRow&&h<this.endCol&&S<=this.viewportCappedEndRow:h<this.startCol&&S>=this.viewportCappedStartRow&&h>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&h>=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,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[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 u=this&&this.__decorate||function(g,b,E,L){var R,D=arguments.length,A=D<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,b,E,L);else for(var M=g.length-1;M>=0;M--)(R=g[M])&&(A=(D<3?R(A):D>3?R(b,E,A):R(b,E))||A);return D>3&&A&&Object.defineProperty(b,E,A),A},p=this&&this.__param||function(g,b){return function(E,L){b(E,L,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const h=c(2585),S=c(8460),w=c(844);let T=o.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,b,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new S.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new y(g,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};o.CharSizeService=T=u([p(2,h.IOptionsService)],T);class k extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,E){b!==void 0&&b>0&&E!==void 0&&E>0&&(this._result.width=b,this._result.height=E)}}class y extends k{constructor(b,E,L){super(),this._document=b,this._parentElement=E,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 _ extends k{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(f,o,c){var u=this&&this.__decorate||function(_,g,b,E){var L,R=arguments.length,D=R<3?g:E===null?E=Object.getOwnPropertyDescriptor(g,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(_,g,b,E);else for(var A=_.length-1;A>=0;A--)(L=_[A])&&(D=(R<3?L(D):R>3?L(g,b,D):L(g,b))||D);return R>3&&D&&Object.defineProperty(g,b,D),D},p=this&&this.__param||function(_,g){return function(b,E){g(b,E,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const h=c(3734),S=c(643),w=c(511),T=c(2585);class k extends h.AttributeData{constructor(g,b,E){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=b,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=k;let y=o.CharacterJoinerService=class m_{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(g){const b={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(b),b.id}deregister(g){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===g)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(g);if(!b||b.length===0)return[];const E=[],L=b.translateToString(!0);let R=0,D=0,A=0,M=b.getFg(0),O=b.getBg(0);for(let H=0;H<b.getTrimmedLength();H++)if(b.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==O){if(H-R>1){const U=this._getJoinedRanges(L,A,D,b,R);for(let P=0;P<U.length;P++)E.push(U[P])}R=H,A=D,M=this._workCell.fg,O=this._workCell.bg}D+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const H=this._getJoinedRanges(L,A,D,b,R);for(let U=0;U<H.length;U++)E.push(H[U])}return E}_getJoinedRanges(g,b,E,L,R){const D=g.substring(b,E);let A=[];try{A=this._characterJoiners[0].handler(D)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const O=this._characterJoiners[M].handler(D);for(let H=0;H<O.length;H++)m_._mergeRanges(A,O[H])}catch(O){console.error(O)}return this._stringRangesToCellRanges(A,L,R),A}_stringRangesToCellRanges(g,b,E){let L=0,R=!1,D=0,A=g[L];if(A){for(let M=E;M<this._bufferService.cols;M++){const O=b.getWidth(M),H=b.getString(M).length||S.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!R&&A[0]<=D&&(A[0]=M,R=!0),A[1]<=D){if(A[1]=M,A=g[++L],!A)break;A[0]<=D?(A[0]=M,R=!0):R=!1}D+=H}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(g,b){let E=!1;for(let L=0;L<g.length;L++){const R=g[L];if(E){if(b[1]<=R[0])return g[L-1][1]=b[1],g;if(b[1]<=R[1])return g[L-1][1]=Math.max(b[1],R[1]),g.splice(L,1),g;g.splice(L,1),L--}else{if(b[1]<=R[0])return g.splice(L,0,b),g;if(b[1]<=R[1])return R[0]=Math.min(b[0],R[0]),g;b[0]<R[1]&&(R[0]=Math.min(b[0],R[0]),E=!0)}}return E?g[g.length-1][1]=b[1]:g.push(b),g}};o.CharacterJoinerService=y=u([p(0,T.IBufferService)],y)},5114:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=c(844),p=c(8460),h=c(3656);class S extends u.Disposable{constructor(k,y,_){super(),this._textarea=k,this._window=y,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((g=>this._screenDprMonitor.setWindow(g)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(k){this._window!==k&&(this._window=k,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=S;class w extends u.Disposable{constructor(k){super(),this._parentWindow=k,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(k){this._parentWindow=k,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var k;this._outerListener&&((k=this._resolutionMediaMatchList)==null||k.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 u=c(844);class p extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(S){return this.linkProviders.push(S),{dispose:()=>{const w=this.linkProviders.indexOf(S);w!==-1&&this.linkProviders.splice(w,1)}}}}o.LinkProviderService=p},8934:function(f,o,c){var u=this&&this.__decorate||function(T,k,y,_){var g,b=arguments.length,E=b<3?k:_===null?_=Object.getOwnPropertyDescriptor(k,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(T,k,y,_);else for(var L=T.length-1;L>=0;L--)(g=T[L])&&(E=(b<3?g(E):b>3?g(k,y,E):g(k,y))||E);return b>3&&E&&Object.defineProperty(k,y,E),E},p=this&&this.__param||function(T,k){return function(y,_){k(y,_,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const h=c(4725),S=c(9806);let w=o.MouseService=class{constructor(T,k){this._renderService=T,this._charSizeService=k}getCoords(T,k,y,_,g){return(0,S.getCoords)(window,T,k,y,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(T,k){const y=(0,S.getCoordsRelativeToElement)(window,T,k);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};o.MouseService=w=u([p(0,h.IRenderService),p(1,h.ICharSizeService)],w)},3230:function(f,o,c){var u=this&&this.__decorate||function(g,b,E,L){var R,D=arguments.length,A=D<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,b,E,L);else for(var M=g.length-1;M>=0;M--)(R=g[M])&&(A=(D<3?R(A):D>3?R(b,E,A):R(b,E))||A);return D>3&&A&&Object.defineProperty(b,E,A),A},p=this&&this.__param||function(g,b){return function(E,L){b(E,L,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const h=c(6193),S=c(4725),w=c(8460),T=c(844),k=c(7226),y=c(2585);let _=o.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,b,E,L,R,D,A,M){super(),this._rowCount=g,this._charSizeService=L,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new k.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 h.RenderDebouncer(((O,H)=>this._renderRows(O,H)),A),this.register(this._renderDebouncer),this.register(A.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(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,b),this.register(A.onWindowChange((O=>this._registerIntersectionObserver(O,b))))}_registerIntersectionObserver(g,b){if("IntersectionObserver"in g){const E=new g.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});E.observe(b),this._observerDisposable.value=(0,T.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.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(g,b,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,b,this._rowCount))}_renderRows(g,b){this._renderer.value&&(g=Math.min(g,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(g,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:b}),this._onRender.fire({start:g,end:b}),this._isNextRenderRedrawOnly=!0)}resize(g,b){this._rowCount=b,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(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,b;this._renderer.value&&((b=(g=this._renderer.value).clearTextureAtlas)==null||b.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(g,b)})):this._renderer.value.handleResize(g,b),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,b,E){var L;this._selectionState.start=g,this._selectionState.end=b,this._selectionState.columnSelectMode=E,(L=this._renderer.value)==null||L.handleSelectionChanged(g,b,E)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};o.RenderService=_=u([p(2,y.IOptionsService),p(3,S.ICharSizeService),p(4,y.IDecorationService),p(5,y.IBufferService),p(6,S.ICoreBrowserService),p(7,S.IThemeService)],_)},9312:function(f,o,c){var u=this&&this.__decorate||function(A,M,O,H){var U,P=arguments.length,K=P<3?M:H===null?H=Object.getOwnPropertyDescriptor(M,O):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(A,M,O,H);else for(var G=A.length-1;G>=0;G--)(U=A[G])&&(K=(P<3?U(K):P>3?U(M,O,K):U(M,O))||K);return P>3&&K&&Object.defineProperty(M,O,K),K},p=this&&this.__param||function(A,M){return function(O,H){M(O,H,A)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const h=c(9806),S=c(9504),w=c(456),T=c(4725),k=c(8460),y=c(844),_=c(6114),g=c(4841),b=c(511),E=c(2585),L=" ",R=new RegExp(L,"g");let D=o.SelectionService=class extends y.Disposable{constructor(A,M,O,H,U,P,K,G,V){super(),this._element=A,this._screenElement=M,this._linkifier=O,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=K,this._renderService=G,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new k.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new k.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new k.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new k.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,y.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 A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!A||!M||A[0]===M[0]&&A[1]===M[1])}get selectionText(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!A||!M)return"";const O=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(A[0]===M[0])return"";const U=A[0]<M[0]?A[0]:M[0],P=A[0]<M[0]?M[0]:A[0];for(let K=A[1];K<=M[1];K++){const G=O.translateBufferLineToString(K,!0,U,P);H.push(G)}}else{const U=A[1]===M[1]?M[0]:void 0;H.push(O.translateBufferLineToString(A[1],!0,A[0],U));for(let P=A[1]+1;P<=M[1]-1;P++){const K=O.lines.get(P),G=O.translateBufferLineToString(P,!0);K!=null&&K.isWrapped?H[H.length-1]+=G:H.push(G)}if(A[1]!==M[1]){const P=O.lines.get(M[1]),K=O.translateBufferLineToString(M[1],!0,0,M[0]);P&&P.isWrapped?H[H.length-1]+=K:H.push(K)}}return H.map((U=>U.replace(R," "))).join(_.isWindows?`\r
|
|
56
|
+
`:`
|
|
57
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&A&&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(A){const M=this._getMouseBufferCoords(A),O=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(O&&H&&M)&&this._areCoordsInSelection(M,O,H)}isCellInSelection(A,M){const O=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!O||!H)&&this._areCoordsInSelection([A,M],O,H)}_areCoordsInSelection(A,M,O){return A[1]>M[1]&&A[1]<O[1]||M[1]===O[1]&&A[1]===M[1]&&A[0]>=M[0]&&A[0]<O[0]||M[1]<O[1]&&A[1]===O[1]&&A[0]<O[0]||M[1]<O[1]&&A[1]===M[1]&&A[0]>=M[0]}_selectWordAtCursor(A,M){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,g.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(A);return!!H&&(this._selectWordAt(H,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,M){this._model.clearSelection(),A=Math.max(A,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const M=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(A){let M=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(A){return _.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const M=this._getMouseBufferCoords(A);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(A){return A.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!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(A),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]++}M&&M[0]===this._model.selectionEnd[0]&&M[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const M=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const H=(0,S.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!A||!M||A[0]===M[0]&&A[1]===M[1]);O?A&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(A,M,O)}_fireOnSelectionChange(A,M,O){this._oldSelectionStart=A,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(A,M){let O=M;for(let H=0;M>=H;H++){const U=A.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:U>1&&M!==H&&(O+=U-1)}return O}setSelection(A,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,M,O=!0,H=!0){if(A[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,P=U.lines.get(A[1]);if(!P)return;const K=U.translateBufferLineToString(A[1],!1);let G=this._convertViewportColToCharacterIndex(P,A[0]),V=G;const Y=A[0]-G;let te=0,z=0,j=0,N=0;if(K.charAt(G)===" "){for(;G>0&&K.charAt(G-1)===" ";)G--;for(;V<K.length&&K.charAt(V+1)===" ";)V++}else{let ie=A[0],de=A[0];P.getWidth(ie)===0&&(te++,ie--),P.getWidth(de)===2&&(z++,de++);const _e=P.getString(de).length;for(_e>1&&(N+=_e-1,V+=_e-1);ie>0&&G>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?(te++,ie--):Q>1&&(j+=Q-1,G-=Q-1),G--,ie--}for(;de<P.length&&V+1<K.length&&!this._isCharWordSeparator(P.loadCell(de+1,this._workCell));){P.loadCell(de+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,de++):Q>1&&(N+=Q-1,V+=Q-1),V++,de++}}V++;let q=G+Y-te+j,I=Math.min(this._bufferService.cols,V-G+te+z-j-N);if(M||K.slice(G,V).trim()!==""){if(O&&q===0&&P.getCodePoint(0)!==32){const ie=U.lines.get(A[1]-1);if(ie&&P.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const de=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(de){const _e=this._bufferService.cols-de.start;q-=_e,I+=_e}}}if(H&&q+I===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const ie=U.lines.get(A[1]+1);if(ie!=null&&ie.isWrapped&&ie.getCodePoint(0)!==32){const de=this._getWordAt([0,A[1]+1],!1,!1,!0);de&&(I+=de.length)}}return{start:q,length:I}}}_selectWordAt(A,M){const O=this._getWordAt(A,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[O.start,A[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(A){const M=this._getWordAt(A,!0);if(M){let O=A[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const M=this._bufferService.buffer.getWrappedRangeForLine(A),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=D=u([p(3,E.IBufferService),p(4,E.ICoreService),p(5,T.IMouseService),p(6,E.IOptionsService),p(7,T.IRenderService),p(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 u=c(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(f,o,c){var u=this&&this.__decorate||function(D,A,M,O){var H,U=arguments.length,P=U<3?A:O===null?O=Object.getOwnPropertyDescriptor(A,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(D,A,M,O);else for(var K=D.length-1;K>=0;K--)(H=D[K])&&(P=(U<3?H(P):U>3?H(A,M,P):H(A,M))||P);return U>3&&P&&Object.defineProperty(A,M,P),P},p=this&&this.__param||function(D,A){return function(M,O){A(M,O,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),S=c(8055),w=c(8460),T=c(844),k=c(2585),y=S.css.toColor("#ffffff"),_=S.css.toColor("#000000"),g=S.css.toColor("#ffffff"),b=S.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=A[M/36%6|0],H=A[M/6%6|0],U=A[M%6];D.push({css:S.channels.toCss(O,H,U),rgba:S.channels.toRgba(O,H,U)})}for(let M=0;M<24;M++){const O=8+10*M;D.push({css:S.channels.toCss(O,O,O),rgba:S.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 h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:_,cursor:g,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:S.color.blend(_,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:S.color.blend(_,E),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 A=this._colors;if(A.foreground=R(D.foreground,y),A.background=R(D.background,_),A.cursor=R(D.cursor,g),A.cursorAccent=R(D.cursorAccent,b),A.selectionBackgroundTransparent=R(D.selectionBackground,E),A.selectionBackgroundOpaque=S.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=S.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=D.selectionForeground?R(D.selectionForeground,S.NULL_COLOR):void 0,A.selectionForeground===S.NULL_COLOR&&(A.selectionForeground=void 0),S.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=S.color.opacity(A.selectionBackgroundTransparent,.3)),S.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=S.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=o.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(D.black,o.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(D.red,o.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(D.green,o.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(D.yellow,o.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(D.blue,o.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(D.magenta,o.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(D.cyan,o.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(D.white,o.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const M=Math.min(A.ansi.length-16,D.extendedAnsi.length);for(let O=0;O<M;O++)A.ansi[O+16]=R(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 A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,A){if(D!==void 0)try{return S.css.toColor(D)}catch{}return A}o.ThemeService=L=u([p(0,k.IOptionsService)],L)},6349:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=c(8460),p=c(844);class h extends p.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.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 k=0;k<Math.min(w,this.length);k++)T[k]=this._array[this._getCyclicIndex(k)];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,...k){if(T){for(let y=w;y<this._length-T;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+T)];this._length-=T,this.onDeleteEmitter.fire({index:w,amount:T})}for(let y=this._length-1;y>=w;y--)this._array[this._getCyclicIndex(y+k.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<k.length;y++)this._array[this._getCyclicIndex(w+y)]=k[y];if(k.length&&this.onInsertEmitter.fire({index:w,amount:k.length}),this._length+k.length>this._maxLength){const y=this._length+k.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=k.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,T,k){if(!(T<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+k<0)throw new Error("Cannot shift elements in list beyond index 0");if(k>0){for(let _=T-1;_>=0;_--)this.set(w+_+k,this.get(w+_));const y=w+T+k-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<T;y++)this.set(w+y+k,this.get(w+y))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}o.CircularList=h},1439:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(u,p=5){if(typeof u!="object")return u;const h=Array.isArray(u)?[]:{};for(const S in u)h[S]=p<=1?u[S]:u[S]&&c(u[S],p-1);return h}},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,u=0,p=0,h=0;var S,w,T,k,y;function _(b){const E=b.toString(16);return E.length<2?"0"+E:E}function g(b,E){return b<E?(E+.05)/(b+.05):(b+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(E,L,R,D){return D!==void 0?`#${_(E)}${_(L)}${_(R)}${_(D)}`:`#${_(E)}${_(L)}${_(R)}`},b.toRgba=function(E,L,R,D=255){return(E<<24|L<<16|R<<8|D)>>>0},b.toColor=function(E,L,R,D){return{css:b.toCss(E,L,R,D),rgba:b.toRgba(E,L,R,D)}}})(S||(o.channels=S={})),(function(b){function E(L,R){return h=Math.round(255*R),[c,u,p]=y.toChannels(L.rgba),{css:S.toCss(c,u,p,h),rgba:S.toRgba(c,u,p,h)}}b.blend=function(L,R){if(h=(255&R.rgba)/255,h===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,A=R.rgba>>16&255,M=R.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)*h),u=H+Math.round((A-H)*h),p=U+Math.round((M-U)*h),{css:S.toCss(c,u,p),rgba:S.toRgba(c,u,p)}},b.isOpaque=function(L){return(255&L.rgba)==255},b.ensureContrastRatio=function(L,R,D){const A=y.ensureContrastRatio(L.rgba,R.rgba,D);if(A)return S.toColor(A>>24&255,A>>16&255,A>>8&255)},b.opaque=function(L){const R=(255|L.rgba)>>>0;return[c,u,p]=y.toChannels(R),{css:S.toCss(c,u,p),rgba:R}},b.opacity=E,b.multiplyOpacity=function(L,R){return h=255&L.rgba,E(L,h*R/255)},b.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(w||(o.color=w={})),(function(b){let E,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",L=E.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),p=parseInt(R.slice(3,4).repeat(2),16),S.toColor(c,u,p);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),p=parseInt(R.slice(3,4).repeat(2),16),h=parseInt(R.slice(4,5).repeat(2),16),S.toColor(c,u,p,h);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),u=parseInt(D[2]),p=parseInt(D[3]),h=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),S.toColor(c,u,p,h);if(!E||!L)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=L,E.fillStyle=R,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,u,p,h]=E.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(c,u,p,h),css:R}}})(T||(o.css=T={})),(function(b){function E(L,R,D){const A=L/255,M=R/255,O=D/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}b.relativeLuminance=function(L){return E(L>>16&255,L>>8&255,255&L)},b.relativeLuminance2=E})(k||(o.rgb=k={})),(function(b){function E(R,D,A){const M=R>>24&255,O=R>>16&255,H=R>>8&255;let U=D>>24&255,P=D>>16&255,K=D>>8&255,G=g(k.relativeLuminance2(U,P,K),k.relativeLuminance2(M,O,H));for(;G<A&&(U>0||P>0||K>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),K-=Math.max(0,Math.ceil(.1*K)),G=g(k.relativeLuminance2(U,P,K),k.relativeLuminance2(M,O,H));return(U<<24|P<<16|K<<8|255)>>>0}function L(R,D,A){const M=R>>24&255,O=R>>16&255,H=R>>8&255;let U=D>>24&255,P=D>>16&255,K=D>>8&255,G=g(k.relativeLuminance2(U,P,K),k.relativeLuminance2(M,O,H));for(;G<A&&(U<255||P<255||K<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),K=Math.min(255,K+Math.ceil(.1*(255-K))),G=g(k.relativeLuminance2(U,P,K),k.relativeLuminance2(M,O,H));return(U<<24|P<<16|K<<8|255)>>>0}b.blend=function(R,D){if(h=(255&D)/255,h===1)return D;const A=D>>24&255,M=D>>16&255,O=D>>8&255,H=R>>24&255,U=R>>16&255,P=R>>8&255;return c=H+Math.round((A-H)*h),u=U+Math.round((M-U)*h),p=P+Math.round((O-P)*h),S.toRgba(c,u,p)},b.ensureContrastRatio=function(R,D,A){const M=k.relativeLuminance(R>>8),O=k.relativeLuminance(D>>8);if(g(M,O)<A){if(O<M){const P=E(R,D,A),K=g(M,k.relativeLuminance(P>>8));if(K<A){const G=L(R,D,A);return K>g(M,k.relativeLuminance(G>>8))?P:G}return P}const H=L(R,D,A),U=g(M,k.relativeLuminance(H>>8));if(U<A){const P=E(R,D,A);return U>g(M,k.relativeLuminance(P>>8))?H:P}return H}},b.reduceLuminance=E,b.increaseLuminance=L,b.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(y||(o.rgba=y={})),o.toPaddedHex=_,o.contrastRatio=g},8969:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=c(844),p=c(2585),h=c(4348),S=c(7866),w=c(744),T=c(7302),k=c(6975),y=c(8460),_=c(1753),g=c(1480),b=c(7994),E=c(9282),L=c(5435),R=c(5981),D=c(2660);let A=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.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 u.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new T.OptionsService(H)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(k.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.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 R.WriteBuffer(((U,P)=>this._inputHandler.parse(U,P)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,U){this._writeBuffer.write(H,U)}writeSync(H,U){this._logService.logLevel<=p.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!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(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const U of H)U.dispose()}))}}}o.CoreTerminal=M},8460:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,u){return c((p=>u.fire(p)))},o.runAndSubscribe=function(c,u){return u(void 0),c((p=>u(p)))}},5435:function(f,o,c){var u=this&&this.__decorate||function(te,z,j,N){var q,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(te,z,j,N);else for(var de=te.length-1;de>=0;de--)(q=te[de])&&(ie=(I<3?q(ie):I>3?q(z,j,ie):q(z,j))||ie);return I>3&&ie&&Object.defineProperty(z,j,ie),ie},p=this&&this.__param||function(te,z){return function(j,N){z(j,N,te)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const h=c(2584),S=c(7116),w=c(2015),T=c(844),k=c(482),y=c(8437),_=c(8460),g=c(643),b=c(511),E=c(3734),L=c(2585),R=c(1480),D=c(6242),A=c(6351),M=c(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(te,z){if(te>24)return z.setWinLines||!1;switch(te){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(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let K=0;class G extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,q,I,ie,de,_e,Q=new w.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=q,this._optionsService=I,this._oscLinkService=ie,this._coreMouseService=de,this._unicodeService=_e,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new k.StringToUtf32,this._utf8Decoder=new k.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:ce.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,ce,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:ce,data:se})})),this._parser.setDcsHandlerFallback((($,ce,se)=>{ce==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:ce,payload:se})})),this._parser.setPrintHandler((($,ce,se)=>this.print($,ce,se))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new D.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new D.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new D.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new D.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new D.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new D.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new D.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new D.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new D.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new D.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new D.OscHandler(($=>this.restoreCursorColor($)))),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 $ in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler((($,ce)=>this.requestStatusString($,ce))))}_preserveStack(z,j,N,q){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=N,this._parseStack.position=q}_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,q=this._activeBuffer.x,I=this._activeBuffer.y,ie=0;const de=this._parseStack.paused;if(de){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(N),N;q=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,($=>String.fromCharCode($))).join("")}"`),typeof z=="string"?z.split("").map(($=>$.charCodeAt(0))):z),this._parseBuffer.length<z.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(z.length,H))),de||this._dirtyRowTracker.clearRange(),z.length>H)for(let $=ie;$<z.length;$+=H){const ce=$+H<z.length?$+H:z.length,se=typeof z=="string"?this._stringDecoder.decode(z.substring($,ce),this._parseBuffer):this._utf8Decoder.decode(z.subarray($,ce),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,se))return this._preserveStack(q,I,se,$),this._logSlowResolvingAsync(N),N}else if(!de){const $=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,$))return this._preserveStack(q,I,$,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===q&&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 q,I;const ie=this._charsetService.charset,de=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,ce=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let xe=this._parser.precedingJoinState;for(let be=j;be<N;++be){if(q=z[be],q<127&&ie){const Me=ie[String.fromCharCode(q)];Me&&(q=Me.charCodeAt(0))}const je=this._unicodeService.charProperties(q,xe);I=R.UnicodeService.extractWidth(je);const Ee=R.UnicodeService.extractShouldJoin(je),me=Ee?R.UnicodeService.extractWidth(xe):0;if(xe=je,de&&this._onA11yChar.fire((0,k.stringFromCodePoint)(q)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-me>_e){if(Q){const Me=se;let Ae=this._activeBuffer.x-me;for(this._activeBuffer.x=me,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),me>0&&se instanceof y.BufferLine&&se.copyCellsFrom(Me,Ae,0,me,!1);Ae<_e;)Me.setCellFromCodepoint(Ae++,0,1,ce)}else if(this._activeBuffer.x=_e-1,I===2)continue}if(Ee&&this._activeBuffer.x){const Me=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-Me,q,I);for(let Ae=I-me;--Ae>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if($&&(se.insertCells(this._activeBuffer.x,I-me,this._activeBuffer.getNullCell(ce)),se.getWidth(_e-1)===2&&se.setCellFromCodepoint(_e-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,ce)),se.setCellFromCodepoint(this._activeBuffer.x++,q,I,ce),I>0)for(;--I;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=xe,this._activeBuffer.x<_e&&N-j>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,ce),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,j){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,j):this._parser.registerCsiHandler(z,(N=>!U(N.params[0],this._optionsService.rawOptions.windowOptions)||j(N)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new A.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,q=!1,I=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);ie.replaceCells(j,N,this._activeBuffer.getNullCell(this._eraseAttrData()),I),q&&(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 q=this._activeBuffer.lines.length-this._bufferService.rows;q>0&&(this._activeBuffer.lines.trimStart(q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-q,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,q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-q+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 q;for(q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-q;j--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(q,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(y.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 q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),q.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 q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),q.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 q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),q.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 q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),q.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,q=R.UnicodeService.extractWidth(j),I=this._activeBuffer.x-q,ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),de=new Uint32Array(ie.length*N);let _e=0;for(let $=0;$<ie.length;){const ce=ie.codePointAt($)||0;de[_e++]=ce,$+=ce>65535?2:1}let Q=_e;for(let $=1;$<N;++$)de.copyWithin(Q,0,_e),Q+=_e;return this.print(de,0,Q),!0}sendDeviceAttributesPrimary(z){return z.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.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,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.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:q,activeEncoding:I}=this._coreMouseService,ie=this._coreService,{buffers:de,cols:_e}=this._bufferService,{active:Q,alt:$}=de,ce=this._optionsService.rawOptions,se=Ee=>Ee?1:2,xe=z.params[0];return be=xe,je=j?xe===2?4:xe===4?se(ie.modes.insertMode):xe===12?3:xe===20?se(ce.convertEol):0:xe===1?se(N.applicationCursorKeys):xe===3?ce.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:xe===6?se(N.origin):xe===7?se(N.wraparound):xe===8?3:xe===9?se(q==="X10"):xe===12?se(ce.cursorBlink):xe===25?se(!ie.isCursorHidden):xe===45?se(N.reverseWraparound):xe===66?se(N.applicationKeypad):xe===67?4:xe===1e3?se(q==="VT200"):xe===1002?se(q==="DRAG"):xe===1003?se(q==="ANY"):xe===1004?se(N.sendFocus):xe===1005?4:xe===1006?se(I==="SGR"):xe===1015?4:xe===1016?se(I==="SGR_PIXELS"):xe===1048?1:xe===47||xe===1047||xe===1049?se(Q===$):xe===2004?se(N.bracketedPasteMode):0,ie.triggerDataEvent(`${h.C0.ESC}[${j?"":"?"}${be};${je}$y`),!0;var be,je}_updateAttrColor(z,j,N,q,I){return j===2?(z|=50331648,z&=-16777216,z|=E.AttributeData.fromColorRGB([N,q,I])):j===5&&(z&=-50331904,z|=33554432|255&N),z}_extractColor(z,j,N){const q=[0,0,-1,0,0,0];let I=0,ie=0;do{if(q[ie+I]=z.params[j+ie],z.hasSubParams(j+ie)){const de=z.getSubParams(j+ie);let _e=0;do q[1]===5&&(I=1),q[ie+_e+1+I]=de[_e];while(++_e<de.length&&_e+ie+1+I<q.length);break}if(q[1]===5&&ie+I>=2||q[1]===2&&ie+I>=5)break;q[1]&&(I=1)}while(++ie+j<z.length&&ie+I<q.length);for(let de=2;de<q.length;++de)q[de]===-1&&(q[de]=0);switch(q[0]){case 38:N.fg=this._updateAttrColor(N.fg,q[1],q[3],q[4],q[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,q[1],q[3],q[4],q[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,q[1],q[3],q[4],q[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=y.DEFAULT_ATTR_DATA.fg,z.bg=y.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 q=this._curAttrData;for(let I=0;I<j;I++)N=z.params[I],N>=30&&N<=37?(q.fg&=-50331904,q.fg|=16777216|N-30):N>=40&&N<=47?(q.bg&=-50331904,q.bg|=16777216|N-40):N>=90&&N<=97?(q.fg&=-50331904,q.fg|=16777224|N-90):N>=100&&N<=107?(q.bg&=-50331904,q.bg|=16777224|N-100):N===0?this._processSGR0(q):N===1?q.fg|=134217728:N===3?q.bg|=67108864:N===4?(q.fg|=268435456,this._processUnderline(z.hasSubParams(I)?z.getSubParams(I)[0]:1,q)):N===5?q.fg|=536870912:N===7?q.fg|=67108864:N===8?q.fg|=1073741824:N===9?q.fg|=2147483648:N===2?q.bg|=134217728:N===21?this._processUnderline(2,q):N===22?(q.fg&=-134217729,q.bg&=-134217729):N===23?q.bg&=-67108865:N===24?(q.fg&=-268435457,this._processUnderline(0,q)):N===25?q.fg&=-536870913:N===27?q.fg&=-67108865:N===28?q.fg&=-1073741825:N===29?q.fg&=2147483647:N===39?(q.fg&=-67108864,q.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):N===49?(q.bg&=-67108864,q.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?I+=this._extractColor(z,I,q):N===53?q.bg|=1073741824:N===55?q.bg&=-1073741825:N===59?(q.extended=q.extended.clone(),q.extended.underlineColor=-1,q.updateExtended()):N===100?(q.fg&=-67108864,q.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,q.bg&=-67108864,q.bg|=16777215&y.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(`${h.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.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(`${h.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=y.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(`${h.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 q=N.shift(),I=N.shift();if(/^\d+$/.exec(q)){const ie=parseInt(q);if(Y(ie))if(I==="?")j.push({type:0,index:ie});else{const de=(0,M.parseColor)(I);de&&j.push({type:1,index:ie,color:de})}}}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 q;const I=N.findIndex((ie=>ie.startsWith("id=")));return I!==-1&&(q=N[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:q,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 q=0;q<N.length&&!(j>=this._specialColors.length);++q,++j)if(N[q]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const I=(0,M.parseColor)(N[q]);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 q=0;q<N.length;++q)if(/^\d+$/.exec(N[q])){const I=parseInt(N[q]);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,S.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(O[z[0]],S.CHARSETS[z[1]]||S.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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.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 b.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,q=this._activeBuffer.lines.get(N);q&&(q.fill(z),q.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const N=this._bufferService.buffer,q=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${I}${h.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}[q.cursorStyle]-(q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}o.InputHandler=G;let V=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){te<this.start?this.start=te:te>this.end&&(this.end=te)}markRangeDirty(te,z){te>z&&(K=te,te=z,z=K),te<this.start&&(this.start=te),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(te){return 0<=te&&te<256}V=u([p(0,L.IBufferService)],V)},844:(f,o)=>{function c(u){for(const p of u)p.dispose();u.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 u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const p=this._disposables.indexOf(u);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var p;this._isDisposed||u===this._value||((p=this._value)==null||p.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=c,o.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,h,S){this._data[p]||(this._data[p]={}),this._data[p][h]=S}get(p,h){return this._data[p]?this._data[p][h]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(u,p,h,S,w){this._data.get(u,p)||this._data.set(u,p,new c),this._data.get(u,p).set(h,S,w)}get(u,p,h,S){var w;return(w=this._data.get(u,p))==null?void 0:w.get(h,S)}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,u=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 p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.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(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const p=this._getKey(u);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===p);return!1}*getKeyIterator(u){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===u)}forEachByKey(u,p){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===u)}values(){return[...this._array].values()}_search(u){let p=0,h=this._array.length-1;for(;h>=p;){let S=p+h>>1;const w=this._getKey(this._array[S]);if(w>u)h=S-1;else{if(!(w<u)){for(;S>0&&this._getKey(this._array[S-1])===u;)S--;return S}p=S+1}}return p}}},7226:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=c(6114);class p{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,k=0,y=w.timeRemaining(),_=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),k=Math.max(T,k),_=w.timeRemaining(),1.5*k>_)return y-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-T))}ms`),void this._start();y=_}this.clear()}}class h extends p{_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=h,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:h,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=c(643);o.updateWindowsModeWrappedState=function(p){const h=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),S=h==null?void 0:h.get(p.cols-1),w=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);w&&S&&(w.isWrapped=S[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&S[u.CHAR_DATA_CODE_INDEX]!==u.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 u}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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 u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,S=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=S}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=c(6349),p=c(7226),h=c(3734),S=c(8437),w=c(4634),T=c(511),k=c(643),y=c(4863),_=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(g,b,E){this._hasScrollback=g,this._optionsService=b,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,b){return new S.BufferLine(this._bufferService.cols,this.getNullCell(g),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const b=g+this._optionsService.rawOptions.scrollback;return b>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:b}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=S.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,b){const E=this.getNullCell(S.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(b);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<g)for(let A=0;A<this.lines.length;A++)L+=+this.lines.get(A).resize(g,E);let D=0;if(this._rows<b)for(let A=this._rows;A<b;A++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(g,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(g,E)));else for(let A=this._rows;A>b;A--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,b-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(g,b),this._cols>g))for(let D=0;D<this.lines.length;D++)L+=+this.lines.get(D).resize(g,E);this._cols=g,this._rows=b,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,b){this._cols!==g&&(g>this._cols?this._reflowLarger(g,b):this._reflowSmaller(g,b))}_reflowLarger(g,b){const E=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(E.length>0){const L=(0,w.reflowLargerCreateNewLayout)(this.lines,E);(0,w.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(g,b,L.countRemoved)}}_reflowLargerAdjustViewport(g,b,E){const L=this.getNullCell(S.DEFAULT_ATTR_DATA);let R=E;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new S.BufferLine(g,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(g,b){const E=this.getNullCell(S.DEFAULT_ATTR_DATA),L=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let A=this.lines.get(D);if(!A||!A.isWrapped&&A.getTrimmedLength()<=g)continue;const M=[A];for(;A.isWrapped&&D>0;)A=this.lines.get(--D),M.unshift(A);const O=this.ybase+this.y;if(O>=D&&O<D+M.length)continue;const H=M[M.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(M,this._cols,g),P=U.length-M.length;let K;K=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 G=[];for(let N=0;N<P;N++){const q=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);G.push(q)}G.length>0&&(L.push({start:D+M.length+R,newLines:G}),R+=G.length),M.push(...G);let V=U.length-1,Y=U[V];Y===0&&(V--,Y=U[V]);let te=M.length-P-1,z=H;for(;te>=0;){const N=Math.min(z,Y);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[te],z-N,Y-N,N,!0),Y-=N,Y===0&&(V--,Y=U[V]),z-=N,z===0){te--;const q=Math.max(te,0);z=(0,w.getWrappedLineTrimmedLength)(M,q,this._cols)}}for(let N=0;N<M.length;N++)U[N]<g&&M[N].setCell(U[N],E);let j=P-K;for(;j-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+b-1)}if(L.length>0){const D=[],A=[];for(let V=0;V<this.lines.length;V++)A.push(this.lines.get(V));const M=this.lines.length;let O=M-1,H=0,U=L[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let P=0;for(let V=Math.min(this.lines.maxLength-1,M+R-1);V>=0;V--)if(U&&U.start>O+P){for(let Y=U.newLines.length-1;Y>=0;Y--)this.lines.set(V--,U.newLines[Y]);V++,D.push({index:O+1,amount:U.newLines.length}),P+=U.newLines.length,U=L[++H]}else this.lines.set(V,A[O--]);let K=0;for(let V=D.length-1;V>=0;V--)D[V].index+=K,this.lines.onInsertEmitter.fire(D[V]),K+=D[V].amount;const G=Math.max(0,M+R-this.lines.maxLength);G>0&&this.lines.onTrimEmitter.fire(G)}}translateBufferLineToString(g,b,E=0,L){const R=this.lines.get(g);return R?R.translateToString(b,E,L):""}getWrappedRangeForLine(g){let b=g,E=g;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:b,last:E}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===g&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const b=new y.Marker(g);return this.markers.push(b),b.register(this.lines.onTrim((E=>{b.line-=E,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((E=>{b.line>=E.index&&(b.line+=E.amount)}))),b.register(this.lines.onDelete((E=>{b.line>=E.index&&b.line<E.index+E.amount&&b.dispose(),b.line>E.index&&(b.line-=E.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=c(3734),p=c(511),h=c(643),S=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let w=0;class T{constructor(y,_,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const b=_||p.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let E=0;E<y;++E)this.setCell(E,b);this.length=y}get(y){const _=this._data[3*y+0],g=2097151&_;return[this._data[3*y+1],2097152&_?this._combined[y]:g?(0,S.stringFromCodePoint)(g):"",_>>22,2097152&_?this._combined[y].charCodeAt(this._combined[y].length-1):g]}set(y,_){this._data[3*y+1]=_[h.CHAR_DATA_ATTR_INDEX],_[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=_[1],this._data[3*y+0]=2097152|y|_[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const _=this._data[3*y+0];return 2097152&_?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&_}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const _=this._data[3*y+0];return 2097152&_?this._combined[y]:2097151&_?(0,S.stringFromCodePoint)(2097151&_):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,_){return w=3*y,_.content=this._data[w+0],_.fg=this._data[w+1],_.bg=this._data[w+2],2097152&_.content&&(_.combinedData=this._combined[y]),268435456&_.bg&&(_.extended=this._extendedAttrs[y]),_}setCell(y,_){2097152&_.content&&(this._combined[y]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[y]=_.extended),this._data[3*y+0]=_.content,this._data[3*y+1]=_.fg,this._data[3*y+2]=_.bg}setCellFromCodepoint(y,_,g,b){268435456&b.bg&&(this._extendedAttrs[y]=b.extended),this._data[3*y+0]=_|g<<22,this._data[3*y+1]=b.fg,this._data[3*y+2]=b.bg}addCodepointToCell(y,_,g){let b=this._data[3*y+0];2097152&b?this._combined[y]+=(0,S.stringFromCodePoint)(_):2097151&b?(this._combined[y]=(0,S.stringFromCodePoint)(2097151&b)+(0,S.stringFromCodePoint)(_),b&=-2097152,b|=2097152):b=_|4194304,g&&(b&=-12582913,b|=g<<22),this._data[3*y+0]=b}insertCells(y,_,g){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,g),_<this.length-y){const b=new p.CellData;for(let E=this.length-y-_-1;E>=0;--E)this.setCell(y+_+E,this.loadCell(y+E,b));for(let E=0;E<_;++E)this.setCell(y+E,g)}else for(let b=y;b<this.length;++b)this.setCell(b,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(y,_,g){if(y%=this.length,_<this.length-y){const b=new p.CellData;for(let E=0;E<this.length-y-_;++E)this.setCell(y+E,this.loadCell(y+_+E,b));for(let E=this.length-_;E<this.length;++E)this.setCell(E,g)}else for(let b=y;b<this.length;++b)this.setCell(b,g);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,g),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,g)}replaceCells(y,_,g,b=!1){if(b)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,g),_<this.length&&this.getWidth(_-1)===2&&!this.isProtected(_)&&this.setCellFromCodepoint(_,0,1,g);y<_&&y<this.length;)this.isProtected(y)||this.setCell(y,g),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,g),_<this.length&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_,0,1,g);y<_&&y<this.length;)this.setCell(y++,g)}resize(y,_){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const b=new Uint32Array(g);b.set(this._data),this._data=b}for(let b=this.length;b<y;++b)this.setCell(b,_)}else{this._data=this._data.subarray(0,g);const b=Object.keys(this._combined);for(let L=0;L<b.length;L++){const R=parseInt(b[L],10);R>=y&&delete this._combined[R]}const E=Object.keys(this._extendedAttrs);for(let L=0;L<E.length;L++){const R=parseInt(E[L],10);R>=y&&delete this._extendedAttrs[R]}}return this.length=y,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,_=!1){if(_)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,y);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const _ in y._combined)this._combined[_]=y._combined[_];this._extendedAttrs={};for(const _ in y._extendedAttrs)this._extendedAttrs[_]=y._extendedAttrs[_];this.isWrapped=y.isWrapped}clone(){const y=new T(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const _ in this._combined)y._combined[_]=this._combined[_];for(const _ in this._extendedAttrs)y._extendedAttrs[_]=this._extendedAttrs[_];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,_,g,b,E){const L=y._data;if(E)for(let D=b-1;D>=0;D--){for(let A=0;A<3;A++)this._data[3*(g+D)+A]=L[3*(_+D)+A];268435456&L[3*(_+D)+2]&&(this._extendedAttrs[g+D]=y._extendedAttrs[_+D])}else for(let D=0;D<b;D++){for(let A=0;A<3;A++)this._data[3*(g+D)+A]=L[3*(_+D)+A];268435456&L[3*(_+D)+2]&&(this._extendedAttrs[g+D]=y._extendedAttrs[_+D])}const R=Object.keys(y._combined);for(let D=0;D<R.length;D++){const A=parseInt(R[D],10);A>=_&&(this._combined[A-_+g]=y._combined[A])}}translateToString(y,_,g,b){_=_??0,g=g??this.length,y&&(g=Math.min(g,this.getTrimmedLength())),b&&(b.length=0);let E="";for(;_<g;){const L=this._data[3*_+0],R=2097151&L,D=2097152&L?this._combined[_]:R?(0,S.stringFromCodePoint)(R):h.WHITESPACE_CELL_CHAR;if(E+=D,b)for(let A=0;A<D.length;++A)b.push(_);_+=L>>22||1}return b&&b.push(_),E}}o.BufferLine=T},4841:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,u){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 u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,o)=>{function c(u,p,h){if(p===u.length-1)return u[p].getTrimmedLength();const S=!u[p].hasContent(h-1)&&u[p].getWidth(h-1)===1,w=u[p+1].getWidth(0)===2;return S&&w?h-1:h}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,p,h,S,w){const T=[];for(let k=0;k<u.length-1;k++){let y=k,_=u.get(++y);if(!_.isWrapped)continue;const g=[u.get(k)];for(;y<u.length&&_.isWrapped;)g.push(_),_=u.get(++y);if(S>=k&&S<y){k+=g.length-1;continue}let b=0,E=c(g,b,p),L=1,R=0;for(;L<g.length;){const A=c(g,L,p),M=A-R,O=h-E,H=Math.min(M,O);g[b].copyCellsFrom(g[L],R,E,H,!1),E+=H,E===h&&(b++,E=0),R+=H,R===A&&(L++,R=0),E===0&&b!==0&&g[b-1].getWidth(h-1)===2&&(g[b].copyCellsFrom(g[b-1],h-1,E++,1,!1),g[b-1].setCell(h-1,w))}g[b].replaceCells(E,h,w);let D=0;for(let A=g.length-1;A>0&&(A>b||g[A].getTrimmedLength()===0);A--)D++;D>0&&(T.push(k+g.length-D),T.push(D)),k+=g.length-1}return T},o.reflowLargerCreateNewLayout=function(u,p){const h=[];let S=0,w=p[S],T=0;for(let k=0;k<u.length;k++)if(w===k){const y=p[++S];u.onDeleteEmitter.fire({index:k-T,amount:y}),k+=y-1,T+=y,w=p[++S]}else h.push(k);return{layout:h,countRemoved:T}},o.reflowLargerApplyNewLayout=function(u,p){const h=[];for(let S=0;S<p.length;S++)h.push(u.get(p[S]));for(let S=0;S<h.length;S++)u.set(S,h[S]);u.length=p.length},o.reflowSmallerGetNewLineLengths=function(u,p,h){const S=[],w=u.map(((_,g)=>c(u,g,p))).reduce(((_,g)=>_+g));let T=0,k=0,y=0;for(;y<w;){if(w-y<h){S.push(w-y);break}T+=h;const _=c(u,k,p);T>_&&(T-=_,k++);const g=u[k].getWidth(T-1)===2;g&&T--;const b=g?h-1:h;S.push(b),y+=b}return S},o.getWrappedLineTrimmedLength=c},5295:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=c(8460),p=c(844),h=c(9092);class S extends p.Disposable{constructor(T,k){super(),this._optionsService=T,this._bufferService=k,this._onBufferActivate=this.register(new u.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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,k){this._normal.resize(T,k),this._alt.resize(T,k),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}o.BufferSet=S},511:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=c(482),p=c(643),h=c(3734);class S extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const k=new S;return k.setFromCharData(T),k}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(T){this.fg=T[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let k=!1;if(T[p.CHAR_DATA_CHAR_INDEX].length>2)k=!0;else if(T[p.CHAR_DATA_CHAR_INDEX].length===2){const y=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const _=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(y-55296)+_-56320+65536|T[p.CHAR_DATA_WIDTH_INDEX]<<22:k=!0}else k=!0}else this.content=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[p.CHAR_DATA_WIDTH_INDEX]<<22;k&&(this.combinedData=T[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=S},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 u=c(8460),p=c(844);class h{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}o.Marker=h,h._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,u,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
58
|
+
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(o.C0=c={})),(function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""})(u||(o.C1=u={})),(function(h){h.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(h,S,w,T){const k={type:0,cancel:!1,key:void 0},y=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?k.key=S?u.C0.ESC+"OA":u.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?k.key=S?u.C0.ESC+"OD":u.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?k.key=S?u.C0.ESC+"OC":u.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(k.key=S?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:k.key=h.ctrlKey?"\b":u.C0.DEL,h.altKey&&(k.key=u.C0.ESC+k.key);break;case 9:if(h.shiftKey){k.key=u.C0.ESC+"[Z";break}k.key=u.C0.HT,k.cancel=!0;break;case 13:k.key=h.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,k.cancel=!0;break;case 27:k.key=u.C0.ESC,h.altKey&&(k.key=u.C0.ESC+u.C0.ESC),k.cancel=!0;break;case 37:if(h.metaKey)break;y?(k.key=u.C0.ESC+"[1;"+(y+1)+"D",k.key===u.C0.ESC+"[1;3D"&&(k.key=u.C0.ESC+(w?"b":"[1;5D"))):k.key=S?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(h.metaKey)break;y?(k.key=u.C0.ESC+"[1;"+(y+1)+"C",k.key===u.C0.ESC+"[1;3C"&&(k.key=u.C0.ESC+(w?"f":"[1;5C"))):k.key=S?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(h.metaKey)break;y?(k.key=u.C0.ESC+"[1;"+(y+1)+"A",w||k.key!==u.C0.ESC+"[1;3A"||(k.key=u.C0.ESC+"[1;5A")):k.key=S?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(h.metaKey)break;y?(k.key=u.C0.ESC+"[1;"+(y+1)+"B",w||k.key!==u.C0.ESC+"[1;3B"||(k.key=u.C0.ESC+"[1;5B")):k.key=S?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(k.key=u.C0.ESC+"[2~");break;case 46:k.key=y?u.C0.ESC+"[3;"+(y+1)+"~":u.C0.ESC+"[3~";break;case 36:k.key=y?u.C0.ESC+"[1;"+(y+1)+"H":S?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:k.key=y?u.C0.ESC+"[1;"+(y+1)+"F":S?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:h.shiftKey?k.type=2:h.ctrlKey?k.key=u.C0.ESC+"[5;"+(y+1)+"~":k.key=u.C0.ESC+"[5~";break;case 34:h.shiftKey?k.type=3:h.ctrlKey?k.key=u.C0.ESC+"[6;"+(y+1)+"~":k.key=u.C0.ESC+"[6~";break;case 112:k.key=y?u.C0.ESC+"[1;"+(y+1)+"P":u.C0.ESC+"OP";break;case 113:k.key=y?u.C0.ESC+"[1;"+(y+1)+"Q":u.C0.ESC+"OQ";break;case 114:k.key=y?u.C0.ESC+"[1;"+(y+1)+"R":u.C0.ESC+"OR";break;case 115:k.key=y?u.C0.ESC+"[1;"+(y+1)+"S":u.C0.ESC+"OS";break;case 116:k.key=y?u.C0.ESC+"[15;"+(y+1)+"~":u.C0.ESC+"[15~";break;case 117:k.key=y?u.C0.ESC+"[17;"+(y+1)+"~":u.C0.ESC+"[17~";break;case 118:k.key=y?u.C0.ESC+"[18;"+(y+1)+"~":u.C0.ESC+"[18~";break;case 119:k.key=y?u.C0.ESC+"[19;"+(y+1)+"~":u.C0.ESC+"[19~";break;case 120:k.key=y?u.C0.ESC+"[20;"+(y+1)+"~":u.C0.ESC+"[20~";break;case 121:k.key=y?u.C0.ESC+"[21;"+(y+1)+"~":u.C0.ESC+"[21~";break;case 122:k.key=y?u.C0.ESC+"[23;"+(y+1)+"~":u.C0.ESC+"[23~";break;case 123:k.key=y?u.C0.ESC+"[24;"+(y+1)+"~":u.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(w&&!T||!h.altKey||h.metaKey)!w||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?k.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(k.key=u.C0.US),h.key==="@"&&(k.key=u.C0.NUL)):h.keyCode===65&&(k.type=1);else{const _=p[h.keyCode],g=_==null?void 0:_[h.shiftKey?1:0];if(g)k.key=u.C0.ESC+g;else if(h.keyCode>=65&&h.keyCode<=90){const b=h.ctrlKey?h.keyCode-64:h.keyCode+32;let E=String.fromCharCode(b);h.shiftKey&&(E=E.toUpperCase()),k.key=u.C0.ESC+E}else if(h.keyCode===32)k.key=u.C0.ESC+(h.ctrlKey?u.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let b=h.code.slice(3,4);h.shiftKey||(b=b.toLowerCase()),k.key=u.C0.ESC+b,k.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?k.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?k.key=u.C0.NUL:h.keyCode>=51&&h.keyCode<=55?k.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?k.key=u.C0.DEL:h.keyCode===219?k.key=u.C0.ESC:h.keyCode===220?k.key=u.C0.FS:h.keyCode===221&&(k.key=u.C0.GS)}return k}},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,u=0,p=c.length){let h="";for(let S=u;S<p;++S){let w=c[S];w>65535?(w-=65536,h+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):h+=String.fromCharCode(w)}return h},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const p=c.length;if(!p)return 0;let h=0,S=0;if(this._interim){const w=c.charCodeAt(S++);56320<=w&&w<=57343?u[h++]=1024*(this._interim-55296)+w-56320+65536:(u[h++]=this._interim,u[h++]=w),this._interim=0}for(let w=S;w<p;++w){const T=c.charCodeAt(w);if(55296<=T&&T<=56319){if(++w>=p)return this._interim=T,h;const k=c.charCodeAt(w);56320<=k&&k<=57343?u[h++]=1024*(T-55296)+k-56320+65536:(u[h++]=T,u[h++]=k)}else T!==65279&&(u[h++]=T)}return h}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const p=c.length;if(!p)return 0;let h,S,w,T,k=0,y=0,_=0;if(this.interim[0]){let E=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)L<<=6,L|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=A-D;for(;_<M;){if(_>=p)return 0;if(R=c[_++],(192&R)!=128){_--,E=!0;break}this.interim[D++]=R,L<<=6,L|=63&R}E||(A===2?L<128?_--:u[k++]=L:A===3?L<2048||L>=55296&&L<=57343||L===65279||(u[k++]=L):L<65536||L>1114111||(u[k++]=L)),this.interim.fill(0)}const g=p-4;let b=_;for(;b<p;){for(;!(!(b<g)||128&(h=c[b])||128&(S=c[b+1])||128&(w=c[b+2])||128&(T=c[b+3]));)u[k++]=h,u[k++]=S,u[k++]=w,u[k++]=T,b+=4;if(h=c[b++],h<128)u[k++]=h;else if((224&h)==192){if(b>=p)return this.interim[0]=h,k;if(S=c[b++],(192&S)!=128){b--;continue}if(y=(31&h)<<6|63&S,y<128){b--;continue}u[k++]=y}else if((240&h)==224){if(b>=p)return this.interim[0]=h,k;if(S=c[b++],(192&S)!=128){b--;continue}if(b>=p)return this.interim[0]=h,this.interim[1]=S,k;if(w=c[b++],(192&w)!=128){b--;continue}if(y=(15&h)<<12|(63&S)<<6|63&w,y<2048||y>=55296&&y<=57343||y===65279)continue;u[k++]=y}else if((248&h)==240){if(b>=p)return this.interim[0]=h,k;if(S=c[b++],(192&S)!=128){b--;continue}if(b>=p)return this.interim[0]=h,this.interim[1]=S,k;if(w=c[b++],(192&w)!=128){b--;continue}if(b>=p)return this.interim[0]=h,this.interim[1]=S,this.interim[2]=w,k;if(T=c[b++],(192&T)!=128){b--;continue}if(y=(7&h)<<18|(63&S)<<12|(63&w)<<6|63&T,y<65536||y>1114111)continue;u[k++]=y}}return k}}},225:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[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 S;o.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let w=0;w<p.length;++w)S.fill(0,p[w][0],p[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?S[w]:(function(T,k){let y,_=0,g=k.length-1;if(T<k[0][0]||T>k[g][1])return!1;for(;g>=_;)if(y=_+g>>1,T>k[y][1])_=y+1;else{if(!(T<k[y][0]))return!0;g=y-1}return!1})(w,h)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,T){let k=this.wcwidth(w),y=k===0&&T!==0;if(y){const _=u.UnicodeService.extractWidth(T);_===0?y=!1:_>k&&(k=_)}return u.UnicodeService.createPropertyValue(0,k,y)}}},5981:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=c(8460),p=c(844);class h extends p.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 u.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 k;for(this._isSyncWriting=!0;k=this._writeBuffer.shift();){this._action(k);const y=this._callbacks.shift();y&&y()}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 k=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],_=this._action(y,T);if(_){const b=E=>Date.now()-k>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(k,E);return void _.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(b)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-k>=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=h},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})$/,u=/^[\da-f]+$/;function p(h,S){const w=h.toString(16),T=w.length<2?"0"+w:w;switch(S){case 4:return w[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}o.parseColor=function(h){if(!h)return;let S=h.toLowerCase();if(S.indexOf("rgb:")===0){S=S.slice(4);const w=c.exec(S);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(S.indexOf("#")===0&&(S=S.slice(1),u.exec(S)&&[3,6,9,12].includes(S.length))){const w=S.length/3,T=[0,0,0];for(let k=0;k<3;++k){const y=parseInt(S.slice(w*k,w*k+w),16);T[k]=w===1?y<<4:w===2?y:w===3?y>>4:y>>8}return T}},o.toRgbString=function(h,S=16){const[w,T,k]=h;return`rgb:${p(w,S)}/${p(T,S)}/${p(k,S)}`}},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 u=c(482),p=c(8742),h=c(5770),S=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=S}registerHandler(T,k){this._handlers[T]===void 0&&(this._handlers[T]=[]);const y=this._handlers[T];return y.push(k),{dispose:()=>{const _=y.indexOf(k);_!==-1&&y.splice(_,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=S,this._ident=0}hook(T,k){if(this.reset(),this._ident=T,this._active=this._handlers[T]||S,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(k);else this._handlerFb(this._ident,"HOOK",k)}put(T,k,y){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(T,k,y);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(T,k,y))}unhook(T,k=!0){if(this._active.length){let y=!1,_=this._active.length-1,g=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,y=k,g=this._stack.fallThrough,this._stack.paused=!1),!g&&y===!1){for(;_>=0&&(y=this._active[_].unhook(T),y!==!0);_--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,y;_--}for(;_>=0;_--)if(y=this._active[_].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",T);this._active=S,this._ident=0}};const w=new p.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,k,y){this._hitLimit||(this._data+=(0,u.utf32ToString)(T,k,y),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let k=!1;if(this._hitLimit)k=!1;else if(T&&(k=this._handler(this._data,this._params),k instanceof Promise))return k.then((y=>(this._params=w,this._data="",this._hitLimit=!1,y)));return this._params=w,this._data="",this._hitLimit=!1,k}}},2015:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=c(844),p=c(8742),h=c(6242),S=c(6351);class w{constructor(_){this.table=new Uint8Array(_)}setDefault(_,g){this.table.fill(_<<4|g)}add(_,g,b,E){this.table[g<<8|_]=b<<4|E}addMany(_,g,b,E){for(let L=0;L<_.length;L++)this.table[g<<8|_[L]]=b<<4|E}}o.TransitionTable=w;const T=160;o.VT500_TRANSITION_TABLE=(function(){const y=new w(4095),_=Array.apply(null,Array(256)).map(((D,A)=>A)),g=(D,A)=>_.slice(D,A),b=g(32,127),E=g(0,24);E.push(25),E.push.apply(E,g(28,32));const L=g(0,14);let R;for(R in y.setDefault(1,0),y.addMany(b,0,2,0),L)y.addMany([24,26,153,154],R,3,0),y.addMany(g(128,144),R,3,0),y.addMany(g(144,152),R,3,0),y.add(156,R,0,0),y.add(27,R,11,1),y.add(157,R,4,8),y.addMany([152,158,159],R,0,7),y.add(155,R,11,3),y.add(144,R,11,9);return y.addMany(E,0,3,0),y.addMany(E,1,3,1),y.add(127,1,0,1),y.addMany(E,8,0,8),y.addMany(E,3,3,3),y.add(127,3,0,3),y.addMany(E,4,3,4),y.add(127,4,0,4),y.addMany(E,6,3,6),y.addMany(E,5,3,5),y.add(127,5,0,5),y.addMany(E,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(b,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(g(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(b,7,0,7),y.addMany(E,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(g(64,127),3,7,0),y.addMany(g(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(g(48,60),4,8,4),y.addMany(g(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(g(32,64),6,0,6),y.add(127,6,0,6),y.addMany(g(64,127),6,0,0),y.addMany(g(32,48),3,9,5),y.addMany(g(32,48),5,9,5),y.addMany(g(48,64),5,0,6),y.addMany(g(64,127),5,7,0),y.addMany(g(32,48),4,9,5),y.addMany(g(32,48),1,9,2),y.addMany(g(32,48),2,9,2),y.addMany(g(48,127),2,10,0),y.addMany(g(48,80),1,10,0),y.addMany(g(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(g(96,127),1,10,0),y.add(80,1,11,9),y.addMany(E,9,0,9),y.add(127,9,0,9),y.addMany(g(28,32),9,0,9),y.addMany(g(32,48),9,9,12),y.addMany(g(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(E,11,0,11),y.addMany(g(32,128),11,0,11),y.addMany(g(28,32),11,0,11),y.addMany(E,10,0,10),y.add(127,10,0,10),y.addMany(g(28,32),10,0,10),y.addMany(g(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(g(32,48),10,9,12),y.addMany(E,12,0,12),y.add(127,12,0,12),y.addMany(g(28,32),12,0,12),y.addMany(g(32,48),12,9,12),y.addMany(g(48,64),12,0,11),y.addMany(g(64,127),12,12,13),y.addMany(g(64,127),10,12,13),y.addMany(g(64,127),9,12,13),y.addMany(E,13,13,13),y.addMany(b,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(T,0,2,0),y.add(T,8,5,8),y.add(T,6,0,6),y.add(T,11,0,11),y.add(T,13,13,13),y})();class k extends u.Disposable{constructor(_=o.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,b,E)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,b)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new S.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,g=[64,126]){let b=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=_.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<_.intermediates.length;++L){const R=_.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=R}}if(_.final.length!==1)throw new Error("final must be a single byte");const E=_.final.charCodeAt(0);if(g[0]>E||E>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return b<<=8,b|=E,b}identToString(_){const g=[];for(;_;)g.push(String.fromCharCode(255&_)),_>>=8;return g.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,g){const b=this._identifier(_,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const E=this._escHandlers[b];return E.push(g),{dispose:()=>{const L=E.indexOf(g);L!==-1&&E.splice(L,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,g){this._executeHandlers[_.charCodeAt(0)]=g}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,g){const b=this._identifier(_);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const E=this._csiHandlers[b];return E.push(g),{dispose:()=>{const L=E.indexOf(g);L!==-1&&E.splice(L,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,g){return this._dcsParser.registerHandler(this._identifier(_),g)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,g){return this._oscParser.registerHandler(_,g)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}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(_,g,b,E,L){this._parseStack.state=_,this._parseStack.handlers=g,this._parseStack.handlerPos=b,this._parseStack.transition=E,this._parseStack.chunkPos=L}parse(_,g,b){let E,L=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&M>-1){for(;M>=0&&(E=A[M](this._params),E!==!0);M--)if(E instanceof Promise)return this._parseStack.handlerPos=M,E}this._parseStack.handlers=[];break;case 4:if(b===!1&&M>-1){for(;M>=0&&(E=A[M](),E!==!0);M--)if(E instanceof Promise)return this._parseStack.handlerPos=M,E}this._parseStack.handlers=[];break;case 6:if(L=_[this._parseStack.chunkPos],E=this._dcsParser.unhook(L!==24&&L!==26,b),E)return E;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=_[this._parseStack.chunkPos],E=this._oscParser.end(L!==24&&L!==26,b),E)return E;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 A=D;A<g;++A){switch(L=_[A],R=this._transitions.table[this.currentState<<8|(L<160?L:T)],R>>4){case 2:for(let P=A+1;;++P){if(P>=g||(L=_[P])<32||L>126&&L<T){this._printHandler(_,A,P),A=P-1;break}if(++P>=g||(L=_[P])<32||L>126&&L<T){this._printHandler(_,A,P),A=P-1;break}if(++P>=g||(L=_[P])<32||L>126&&L<T){this._printHandler(_,A,P),A=P-1;break}if(++P>=g||(L=_[P])<32||L>126&&L<T){this._printHandler(_,A,P),A=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:A,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|L];let O=M?M.length-1:-1;for(;O>=0&&(E=M[O](this._params),E!==!0);O--)if(E instanceof Promise)return this._preserveStack(3,M,O,R,A),E;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(++A<g&&(L=_[A])>47&&L<60);A--;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&&(E=H[U](),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(4,H,U,R,A),E;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=A+1;;++P)if(P>=g||(L=_[P])===24||L===26||L===27||L>127&&L<T){this._dcsParser.put(_,A,P),A=P-1;break}break;case 14:if(E=this._dcsParser.unhook(L!==24&&L!==26),E)return this._preserveStack(6,[],0,R,A),E;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let P=A+1;;P++)if(P>=g||(L=_[P])<32||L>127&&L<T){this._oscParser.put(_,A,P),A=P-1;break}break;case 6:if(E=this._oscParser.end(L!==24&&L!==26),E)return this._preserveStack(5,[],0,R,A),E;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}o.EscapeSequenceParser=k},6242:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=c(5770),p=c(482),h=[];o.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(S,w){this._handlers[S]===void 0&&(this._handlers[S]=[]);const T=this._handlers[S];return T.push(w),{dispose:()=>{const k=T.indexOf(w);k!==-1&&T.splice(k,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].start();else this._handlerFb(this._id,"START")}_put(S,w,T){if(this._active.length)for(let k=this._active.length-1;k>=0;k--)this._active[k].put(S,w,T);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(S,w,T))}start(){this.reset(),this._state=1}put(S,w,T){if(this._state!==3){if(this._state===1)for(;w<T;){const k=S[w++];if(k===59){this._state=2,this._start();break}if(k<48||57<k)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+k-48}this._state===2&&T-w>0&&this._put(S,w,T)}}end(S,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,k=this._active.length-1,y=!1;if(this._stack.paused&&(k=this._stack.loopPosition-1,T=w,y=this._stack.fallThrough,this._stack.paused=!1),!y&&T===!1){for(;k>=0&&(T=this._active[k].end(S),T!==!0);k--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!1,T;k--}for(;k>=0;k--)if(T=this._active[k].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",S);this._active=h,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(S){this._handler=S,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(S,w,T){this._hitLimit||(this._data+=(0,p.utf32ToString)(S,w,T),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(S){let w=!1;if(this._hitLimit)w=!1;else if(S&&(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 u{static fromArray(h){const S=new u;if(!h.length)return S;for(let w=Array.isArray(h[0])?1:0;w<h.length;++w){const T=h[w];if(Array.isArray(T))for(let k=0;k<T.length;++k)S.addSubParam(T[k]);else S.addParam(T)}return S}constructor(h=32,S=32){if(this.maxLength=h,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new u(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let S=0;S<this.length;++S){h.push(this.params[S]);const w=this._subParamsIdx[S]>>8,T=255&this._subParamsIdx[S];T-w>0&&h.push(Array.prototype.slice.call(this._subParams,w,T))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const S=this._subParamsIdx[h]>>8,w=255&this._subParamsIdx[h];return w-S>0?this._subParams.subarray(S,w):null}getSubParamsAll(){const h={};for(let S=0;S<this.length;++S){const w=this._subParamsIdx[S]>>8,T=255&this._subParamsIdx[S];T-w>0&&(h[S]=this._subParams.slice(w,T))}return h}addDigit(h){let S;if(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,T=w[S-1];w[S-1]=~T?Math.min(10*T+h,c):h}}o.Params=u},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,u){const p={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(p),u.dispose=()=>this._wrappedAddonDispose(p),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){u=p;break}if(u===-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(u,1)}}},8771:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=c(3785),p=c(511);o.BufferApiView=class{constructor(h,S){this._buffer=h,this.type=S}init(h){return this._buffer=h,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(h){const S=this._buffer.lines.get(h);if(S)return new u.BufferLineApiView(S)}getNullCell(){return new p.CellData}}},3785:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=c(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,h){if(!(p<0||p>=this._line.length))return h?(this._line.loadCell(p,h),h):this._line.loadCell(p,new u.CellData)}translateToString(p,h,S){return this._line.translateToString(p,h,S)}}},8285:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=c(8771),p=c(8460),h=c(844);class S extends h.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.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=S},7975:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,(p=>u(p.toArray())))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,((p,h)=>u(p,h.toArray())))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},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 u=this&&this.__decorate||function(y,_,g,b){var E,L=arguments.length,R=L<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,_,g,b);else for(var D=y.length-1;D>=0;D--)(E=y[D])&&(R=(L<3?E(R):L>3?E(_,g,R):E(_,g))||R);return L>3&&R&&Object.defineProperty(_,g,R),R},p=this&&this.__param||function(y,_){return function(g,b){_(g,b,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const h=c(8460),S=c(844),w=c(5295),T=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let k=o.BufferService=class extends S.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(y,this))}resize(y,_){this.cols=y,this.rows=_,this.buffers.resize(y,_),this._onResize.fire({cols:y,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,_=!1){const g=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===y.fg&&b.getBg(0)===y.bg||(b=g.getBlankLine(y,_),this._cachedBlankLine=b),b.isWrapped=_;const E=g.ybase+g.scrollTop,L=g.ybase+g.scrollBottom;if(g.scrollTop===0){const R=g.lines.isFull;L===g.lines.length-1?R?g.lines.recycle().copyFrom(b):g.lines.push(b.clone()):g.lines.splice(L+1,0,b.clone()),R?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const R=L-E+1;g.lines.shiftElements(E+1,R-1,-1),g.lines.set(L,b.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(y,_,g){const b=this.buffer;if(y<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else y+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const E=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+y,b.ybase),0),E!==b.ydisp&&(_||this._onScroll.fire(b.ydisp))}};o.BufferService=k=u([p(0,T.IOptionsService)],k)},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,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(f,o,c){var u=this&&this.__decorate||function(b,E,L,R){var D,A=arguments.length,M=A<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,E,L,R);else for(var O=b.length-1;O>=0;O--)(D=b[O])&&(M=(A<3?D(M):A>3?D(E,L,M):D(E,L))||M);return A>3&&M&&Object.defineProperty(E,L,M),M},p=this&&this.__param||function(b,E){return function(L,R){E(L,R,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const h=c(2585),S=c(8460),w=c(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function k(b,E){let L=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(L|=64,L|=b.action):(L|=3&b.button,4&b.button&&(L|=64),8&b.button&&(L|=128),b.action===32?L|=32:b.action!==0||E||(L|=3)),L}const y=String.fromCharCode,_={DEFAULT:b=>{const E=[k(b,!1)+32,b.col+32,b.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${y(E[0])}${y(E[1])}${y(E[2])}`},SGR:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${k(b,!0)};${b.col};${b.row}${E}`},SGR_PIXELS:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${k(b,!0)};${b.x};${b.y}${E}`}};let g=o.CoreMouseService=class extends w.Disposable{constructor(b,E){super(),this._bufferService=b,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new S.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(T))this.addProtocol(L,T[L]);for(const L of Object.keys(_))this.addEncoding(L,_[L]);this.reset()}addProtocol(b,E){this._protocols[b]=E}addEncoding(b,E){this._encodings[b]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const E=this._encodings[this._activeEncoding](b);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,E,L){if(L){if(b.x!==E.x||b.y!==E.y)return!1}else if(b.col!==E.col||b.row!==E.row)return!1;return b.button===E.button&&b.action===E.action&&b.ctrl===E.ctrl&&b.alt===E.alt&&b.shift===E.shift}};o.CoreMouseService=g=u([p(0,h.IBufferService),p(1,h.ICoreService)],g)},6975:function(f,o,c){var u=this&&this.__decorate||function(g,b,E,L){var R,D=arguments.length,A=D<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,b,E,L);else for(var M=g.length-1;M>=0;M--)(R=g[M])&&(A=(D<3?R(A):D>3?R(b,E,A):R(b,E))||A);return D>3&&A&&Object.defineProperty(b,E,A),A},p=this&&this.__param||function(g,b){return function(E,L){b(E,L,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const h=c(1439),S=c(8460),w=c(844),T=c(2585),k=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=o.CoreService=class extends w.Disposable{constructor(g,b,E){super(),this._bufferService=g,this._logService=b,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new S.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new S.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(k),this.decPrivateModes=(0,h.clone)(y)}reset(){this.modes=(0,h.clone)(k),this.decPrivateModes=(0,h.clone)(y)}triggerDataEvent(g,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,(()=>g.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,(()=>g.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(g))}};o.CoreService=_=u([p(0,T.IBufferService),p(1,T.ILogService),p(2,T.IOptionsService)],_)},9074:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=c(8055),p=c(8460),h=c(844),S=c(6106);let w=0,T=0;class k extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new S.SortedList((g=>g==null?void 0:g.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(g){if(g.marker.isDisposed)return;const b=new y(g);if(b){const E=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),E.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,b,E){let L=0,R=0;for(const D of this._decorations.getKeyIterator(b))L=D.options.x??0,R=L+(D.options.width??1),g>=L&&g<R&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(g,b,E,L){this._decorations.forEachByKey(b,(R=>{w=R.options.x??0,T=w+(R.options.width??1),g>=w&&g<T&&(!E||(R.options.layer??"bottom")===E)&&L(R)}))}}o.DecorationService=k;class y extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.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 u=c(2585),p=c(8343);class h{constructor(...w){this._entries=new Map;for(const[T,k]of w)this.set(T,k)}set(w,T){const k=this._entries.get(w);return this._entries.set(w,T),k}forEach(w){for(const[T,k]of this._entries.entries())w(T,k)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}o.ServiceCollection=h,o.InstantiationService=class{constructor(){this._services=new h,this._services.set(u.IInstantiationService,this)}setService(S,w){this._services.set(S,w)}getService(S){return this._services.get(S)}createInstance(S,...w){const T=(0,p.getServiceDependencies)(S).sort(((_,g)=>_.index-g.index)),k=[];for(const _ of T){const g=this._services.get(_.id);if(!g)throw new Error(`[createInstance] ${S.name} depends on UNKNOWN service ${_.id}.`);k.push(g)}const y=T.length>0?T[0].index:w.length;if(w.length!==y)throw new Error(`[createInstance] First service dependency of ${S.name} at position ${y+1} conflicts with ${w.length} static arguments`);return new S(...w,...k)}}},7866:function(f,o,c){var u=this&&this.__decorate||function(y,_,g,b){var E,L=arguments.length,R=L<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,_,g,b);else for(var D=y.length-1;D>=0;D--)(E=y[D])&&(R=(L<3?E(R):L>3?E(_,g,R):E(_,g))||R);return L>3&&R&&Object.defineProperty(_,g,R),R},p=this&&this.__param||function(y,_){return function(g,b){_(g,b,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const h=c(844),S=c(2585),w={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let T,k=o.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let _=0;_<y.length;_++)typeof y[_]=="function"&&(y[_]=y[_]())}_log(y,_,g){this._evalLazyOptionalParams(g),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+_,...g)}trace(y,..._){var g;this._logLevel<=S.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,y,_)}debug(y,..._){var g;this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,y,_)}info(y,..._){var g;this._logLevel<=S.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,y,_)}warn(y,..._){var g;this._logLevel<=S.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,y,_)}error(y,..._){var g;this._logLevel<=S.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,y,_)}};o.LogService=k=u([p(0,S.IOptionsService)],k),o.setTraceLogger=function(y){T=y},o.traceCall=function(y,_,g){if(typeof g.value!="function")throw new Error("not supported");const b=g.value;g.value=function(...E){if(T.logLevel!==S.LogLevelEnum.TRACE)return b.apply(this,E);T.trace(`GlyphRenderer#${b.name}(${E.map((R=>JSON.stringify(R))).join(", ")})`);const L=b.apply(this,E);return T.trace(`GlyphRenderer#${b.name} return`,L),L}}},7302:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=c(8460),p=c(844),h=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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const S=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends p.Disposable{constructor(k){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...o.DEFAULT_OPTIONS};for(const _ in k)if(_ in y)try{const g=k[_];y[_]=this._sanitizeAndValidateOption(_,g)}catch(g){console.error(g)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(k,y){return this.onOptionChange((_=>{_===k&&y(this.rawOptions[k])}))}onMultipleOptionChange(k,y){return this.onOptionChange((_=>{k.indexOf(_)!==-1&&y()}))}_setupOptions(){const k=_=>{if(!(_ in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},y=(_,g)=>{if(!(_ in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);g=this._sanitizeAndValidateOption(_,g),this.rawOptions[_]!==g&&(this.rawOptions[_]=g,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const g={get:k.bind(this,_),set:y.bind(this,_)};Object.defineProperty(this.options,_,g)}}_sanitizeAndValidateOption(k,y){switch(k){case"cursorStyle":if(y||(y=o.DEFAULT_OPTIONS[k]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${k}`);break;case"wordSeparator":y||(y=o.DEFAULT_OPTIONS[k]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=S.includes(y)?y:o.DEFAULT_OPTIONS[k];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${k} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${k} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${k} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${k} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}o.OptionsService=w},2660:function(f,o,c){var u=this&&this.__decorate||function(w,T,k,y){var _,g=arguments.length,b=g<3?T:y===null?y=Object.getOwnPropertyDescriptor(T,k):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(w,T,k,y);else for(var E=w.length-1;E>=0;E--)(_=w[E])&&(b=(g<3?_(b):g>3?_(T,k,b):_(T,k))||b);return g>3&&b&&Object.defineProperty(T,k,b),b},p=this&&this.__param||function(w,T){return function(k,y){T(k,y,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const h=c(2585);let S=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 E=T.addMarker(T.ybase+T.y),L={data:w,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(L,E))),this._dataByLinkId.set(L.id,L),L.id}const k=w,y=this._getEntryIdKey(k),_=this._entriesWithId.get(y);if(_)return this.addLineToLink(_.id,T.ybase+T.y),_.id;const g=T.addMarker(T.ybase+T.y),b={id:this._nextId++,key:this._getEntryIdKey(k),data:k,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(b,g))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(w,T){const k=this._dataByLinkId.get(w);if(k&&k.lines.every((y=>y.line!==T))){const y=this._bufferService.buffer.addMarker(T);k.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(k,y)))}}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 k=w.lines.indexOf(T);k!==-1&&(w.lines.splice(k,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};o.OscLinkService=S=u([p(0,h.IBufferService)],S)},8343:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[u]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const h=function(S,w,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(k,y,_){y[c]===y?y[u].push({id:k,index:_}):(y[u]=[{id:k,index:_}],y[c]=y)})(h,S,T)};return h.toString=()=>p,o.serviceRegistry.set(p,h),h}},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 u=c(8343);var p;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=c(8460),p=c(225);class h{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,T,k=!1){return(16777215&w)<<3|(3&T)<<1|(k?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const w=new p.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,k=0;const y=w.length;for(let _=0;_<y;++_){let g=w.charCodeAt(_);if(55296<=g&&g<=56319){if(++_>=y)return T+this.wcwidth(g);const L=w.charCodeAt(_);56320<=L&&L<=57343?g=1024*(g-55296)+L-56320+65536:T+=this.wcwidth(L)}const b=this.charProperties(g,k);let E=h.extractWidth(b);h.extractShouldJoin(b)&&(E-=h.extractWidth(k)),T+=E,k=b}return T}charProperties(w,T){return this._activeProvider.charProperties(w,T)}}o.UnicodeService=h}},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 v={};return(()=>{var f=v;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const o=d(9042),c=d(3236),u=d(844),p=d(5741),h=d(8285),S=d(7975),w=d(7090),T=["cols","rows"];class k extends u.Disposable{constructor(_){super(),this._core=this.register(new c.Terminal(_)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const g=E=>this._core.options[E],b=(E,L)=>{this._checkReadonlyOptions(E),this._core.options[E]=L};for(const E in this._core.options){const L={get:g.bind(this,E),set:b.bind(this,E)};Object.defineProperty(this._publicOptions,E,L)}}_checkReadonlyOptions(_){if(T.includes(_))throw new Error(`Option "${_}" 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 S.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const g in _)this._publicOptions[g]=_[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,g=!0){this._core.input(_,g)}resize(_,g){this._verifyIntegers(_,g),this._core.resize(_,g)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,g,b){this._verifyIntegers(_,g,b),this._core.select(_,g,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,g){this._verifyIntegers(_,g),this._core.selectLines(_,g)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,g){this._core.write(_,g)}writeln(_,g){this._core.write(_),this._core.write(`\r
|
|
59
|
+
`,g)}paste(_){this._core.paste(_)}refresh(_,g){this._verifyIntegers(_,g),this._core.refresh(_,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return o}_verifyIntegers(..._){for(const g of _)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const g of _)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}f.Terminal=k})(),v})()))})(Zu)),Zu.exports}var S1=y1();class b1{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",v=>{var o,c,u;let f;try{f=JSON.parse(v.data)}catch(p){(o=s.onError)==null||o.call(s,`Terminal message parse failed for session ${r}. Reason: ${No(p)}`);return}f.type==="output"?s.onOutput(f.data):f.type==="error"?(c=s.onError)==null||c.call(s,f.message):(u=s.onStatus)==null||u.call(s,f)}),this.socket.addEventListener("error",()=>{var v;(v=s.onError)==null||v.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 Ho({sessionId:t,active:r=!0,onEvent:s}){const l=ee.useRef(null),d=ee.useRef(null),v=ee.useRef(null),f=ee.useRef(null),o=ee.useRef(null),c=ee.useRef(""),u=ee.useRef(""),p=ee.useRef(r),h=ee.useRef(s),[S,w]=ee.useState("idle");function T(_){w(_),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null,w("idle")},1600)}async function k(){const _=f.current,g=Km(_,c.current,u.current);if(!g){T("empty"),_==null||_.focus();return}T(await Xm(g)?"copied":"failed"),_==null||_.focus()}function y(_={}){const g=l.current,b=d.current,E=v.current,L=f.current;if(!g||!b||!E||!L)return!1;const R=g.getBoundingClientRect();return R.width<Qm||R.height<Jm||(E.fit(),L.cols<Zm||L.rows<eg)?!1:(b.resize(L.cols,L.rows),_.focus&&L.focus(),!0)}return ee.useEffect(()=>{h.current=s},[s]),ee.useEffect(()=>{p.current=r},[r]),ee.useEffect(()=>{var K;if(!l.current)return;const _=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}),g=new g1.FitAddon;_.loadAddon(g),_.loadAddon(new v1.WebLinksAddon),_.open(l.current),f.current=_,v.current=g;const b=_.onSelectionChange(()=>{const G=_.getSelection();G&&(c.current=G,u.current="")}),E=_.parser.registerOscHandler(52,G=>{const V=x1(G);return V?(u.current=V,g_(V).then(Y=>{T(Y?"copied":"ready")}),!0):!1}),L=G=>{const V=Km(_,c.current,u.current);!V||!G.clipboardData||(G.clipboardData.setData("text/plain",V),G.preventDefault(),T("copied"))};(K=_.element)==null||K.addEventListener("copy",L),_.attachCustomKeyEventHandler(G=>{if(!w1(G))return!0;const V=_.getSelection()||c.current;return V?(G.preventDefault(),G.stopPropagation(),Xm(V).then(Y=>{T(Y?"copied":"failed")}),!1):!0});const R=l.current.getBoundingClientRect();R.width>=Qm&&R.height>=Jm&&g.fit();const D=new b1(t,{onOutput(G){_.write(G)},onStatus(G){var V;(V=h.current)==null||V.call(h,G.type)},onError(G){var V;_.writeln(`\r
|
|
60
|
+
[VCM] ${G}`),(V=h.current)==null||V.call(h,G)}});d.current=D,_.cols>=Zm&&_.rows>=eg&&D.resize(_.cols,_.rows);const A=_.onData(G=>{D.sendInput(G)});let M=0,O=0,H=0;const U=()=>{M&&window.cancelAnimationFrame(M),M=window.requestAnimationFrame(()=>{M=0,y({focus:p.current})})},P=new ResizeObserver(()=>{U()});return P.observe(l.current),O=window.requestAnimationFrame(U),H=window.setTimeout(U,120),()=>{var G;M&&window.cancelAnimationFrame(M),O&&window.cancelAnimationFrame(O),H&&window.clearTimeout(H),P.disconnect(),(G=_.element)==null||G.removeEventListener("copy",L),b.dispose(),E.dispose(),A.dispose(),D.close(),_.dispose(),d.current=null,f.current=null,v.current=null}},[t]),ee.useEffect(()=>{if(!r)return;const _=[],g=[];return _.push(window.requestAnimationFrame(()=>{y({focus:!0}),_.push(window.requestAnimationFrame(()=>y({focus:!0})))})),g.push(window.setTimeout(()=>y({focus:!0}),160)),g.push(window.setTimeout(()=>y({focus:!0}),360)),()=>{for(const b of _)window.cancelAnimationFrame(b);for(const b of g)window.clearTimeout(b)}},[r]),ee.useEffect(()=>{const _=()=>{p.current&&y()};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]),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 _;return(_=f.current)==null?void 0:_.focus()}}),x.jsx("button",{type:"button",className:`terminal-copy-button is-${S}`,title:"Copy selected terminal text",onMouseDown:Ym,onPointerDown:Ym,onClick:()=>void k(),children:C1(S)})]})}function C1(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 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 v=0;v<l.length;v+=1)d[v]=l.charCodeAt(v);return new TextDecoder().decode(d)}catch{return null}}function Ym(t){t.preventDefault(),t.stopPropagation()}async function Xm(t){return await g_(t)?!0:E1(t)}async function g_(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 Qm=160,Jm=80,Zm=20,eg=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"};function ei({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,modelOptions:v=d_(),busy:f=!1,onPermissionModeChange:o,onModelChange:c,onEffortChange:u,onStart:p,onResume:h,onStop:S,onRestart:w,onNotifyHarnessUpdated:T}){const k=(r==null?void 0:r.status)==="running",y=!!(r!=null&&r.claudeSessionId&&!k),_=!k&&!(r!=null&&r.claudeSessionId),g=!!(r!=null&&r.harnessOutdated),b=v.find(E=>E.value===l);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:E=>o(E.target.value),children:f_.map(E=>x.jsx("option",{value:E.value,children:E.label},E.value))})]}),x.jsxs("label",{className:"session-option-field model-field",children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:l,title:b!=null&&b.available?b.description:b==null?void 0:b.unavailableReason,onChange:E=>c(E.target.value),children:v.map(E=>x.jsx("option",{value:E.value,disabled:!E.available,title:E.available?E.description:E.unavailableReason,children:E.label},E.value))})]}),x.jsxs("label",{className:"session-option-field effort-field",children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:d,onChange:E=>u(E.target.value),children:p_.map(E=>x.jsx("option",{value:E.value,children:E.label},E.value))})]}),x.jsxs("div",{className:"session-toolbar",children:[x.jsx("button",{type:"button",disabled:f||!_,onClick:p,children:"Start"}),x.jsx("button",{type:"button",disabled:f||!y,onClick:h,children:"Resume"}),x.jsx("button",{type:"button",disabled:f||!r,onClick:w,children:"Restart"}),x.jsx("button",{type:"button",disabled:f||!r,onClick:S,children:"Stop"})]}),g?x.jsxs("div",{className:"session-harness-notice",children:[x.jsx(ei,{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:f||!k||!T,onClick:T,children:"Notify role"})]}):null]})}function A1({busy:t,effort:r,model:s,modelOptions:l,open:d,permissionMode:v,taskSlug:f,bootstrapStatus:o,engineerSession:c,status:u,feedbackState:p,memoryState:h,onClose:S,onEffortChange:w,onModelChange:T,onPermissionModeChange:k,onEngineerResume:y,onEngineerRestart:_,onEngineerStart:g,onEngineerStop:b,onEngineerNotifyHarnessUpdated:E,onSendFeedback:L,onOpenRepositoryDiff:R,onReviewTaskHarness:D,onRefresh:A,onMemoryStateChange:M}){const[O,H]=ee.useState(null),[U,P]=ee.useState(!1),[K,G]=ee.useState(null),[V,Y]=ee.useState(""),[te,z]=ee.useState(!1),[j,N]=ee.useState(!1),[,q]=ji(null),[I,ie]=ee.useState(null),de=(u==null?void 0:u.files)??[],_e=de.filter(ge=>ge.kind.startsWith("agent-")),Q=_e.filter(ge=>tg(ge)),$=_e.filter(ge=>!tg(ge)),ce=de.filter(ge=>ge.kind.startsWith("skill-")),se=de.filter(ge=>ge.kind.startsWith("tool-")),xe=de.filter(ge=>ge.kind==="root-claude"||ge.kind==="gitignore"||ge.kind==="pull-request-template"),be=!!(K&&V!==K.content);ee.useEffect(()=>{d||(H(null),P(!1),G(null),Y(""),z(!1),q(null))},[de,d,O]),ee.useEffect(()=>{if(!d||!O||!f||O.startsWith("memory-review:"))return;let ge=!1;return N(!0),q(null),z(!1),(U?ye.getMemoryFileContent(f,O).then(Ke=>({path:Ke.path,title:Ke.title,content:Ke.content,editable:Ke.editable,source:"memory"})):ye.getHarnessFileContent(f,O).then(Ke=>({path:Ke.path,title:Ke.title,content:Ke.content,editable:Ke.editable,readonlyReason:Ke.readonlyReason,source:"harness"}))).then(Ke=>{ge||(G(Ke),Y(Ke.content))}).catch(Ke=>{ge||q(ht(`Load harness file ${O}`,Ke))}).finally(()=>{ge||N(!1)}),()=>{ge=!0}},[d,U,O,f]);async function je(){if(!(!K||!K.editable||!be||!f)){N(!0),q(null);try{if(K.source==="memory"){const ge=await ye.updateMemoryFileContent(f,K.path,{content:V}),ze=await ye.getMemoryFileContent(f,K.path);G({path:ze.path,title:ze.title,content:ze.content,editable:!0,source:"memory"}),Y(ze.content),M(ge)}else{const ge=await ye.updateHarnessFileContent(f,K.path,{content:V});G({path:ge.file.path,title:ge.file.title,content:ge.file.content,editable:ge.file.editable,readonlyReason:ge.file.readonlyReason,source:"harness"}),Y(ge.file.content)}z(!1),A()}catch(ge){q(ht(`Save harness file ${K.path}`,ge))}finally{N(!1)}}}function Ee(){H(null),P(!1),G(null),Y(""),z(!1),q(null)}async function me(ge){q(null);try{await L1(ge),ie(ge),window.setTimeout(()=>{ie(ze=>ze===ge?null:ze)},1200)}catch(ze){q(ht(`Copy harness file path ${ge}`,ze))}}function Me(ge){const ze=`memory-review:${ge.runId}`;H(ze),P(!1),G({path:ge.runId,title:`Memory Diff: ${ge.runId}`,content:ge.diff||"No memory diff was recorded.",editable:!1,readonlyReason:`Applied by ${ge.source}. Status: ${ge.status}.`,source:"memory-diff"}),Y(ge.diff||"No memory diff was recorded."),z(!1)}async function Ae(ge){if(!(!f||!ge.canRevert||!window.confirm(`Revert memory changes from ${ge.runId}?`))){N(!0),q(null);try{const ze=await ye.revertMemoryRun({taskSlug:f,runId:ge.runId});M(ze),Ee()}catch(ze){q(ht(`Revert memory review ${ge.runId}`,ze))}finally{N(!1)}}}async function rt(){if(f){N(!0),q(null);try{M(await ye.retryMemoryReview({taskSlug:f}))}catch(ge){q(ht("Retry Auto Memory review",ge))}finally{N(!1)}}}return d?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"}),f?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||!f,onClick:D,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:t,onClick:R,children:"Review Diff"}),x.jsx("button",{type:"button",disabled:t,onClick:A,children:"Refresh"}),x.jsx("button",{type:"button",onClick:S,children:"Close"})]})]}),x.jsxs("div",{className:"harness-studio-layout",children:[x.jsx("aside",{className:O?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:O?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:(K==null?void 0:K.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(K==null?void 0:K.path)??O})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[K?x.jsx(ei,{status:K.editable?"ok":"unknown"}):null,te?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:j||!f||!(K!=null&&K.editable)||!be,onClick:()=>void je(),children:"Save"}),x.jsx("button",{type:"button",disabled:j,onClick:()=>{Y((K==null?void 0:K.content)??""),z(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:j||!f||!(K!=null&&K.editable),onClick:()=>z(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:Ee,children:"Return"})]})]}),K!=null&&K.readonlyReason?x.jsx("p",{className:"muted",children:K.readonlyReason}):null,x.jsx("textarea",{className:te?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:V,spellCheck:!1,readOnly:!te,disabled:j,onChange:ge=>Y(ge.target.value)})]}):x.jsxs("div",{className:"harness-studio-left-scroll",children:[x.jsx($a,{title:"VCM Roles",files:Q,selectedPath:O,copiedPath:I,onCopy:ge=>void me(ge),onSelect:ge=>{P(!1),H(ge)}}),x.jsx($a,{title:"Auxiliary Roles",files:$,selectedPath:O,copiedPath:I,onCopy:ge=>void me(ge),onSelect:ge=>{P(!1),H(ge)}}),x.jsx(R1,{state:h,busy:j,copiedPath:I,onCopy:ge=>void me(ge),onSelect:ge=>{P(!0),H(ge)},onViewDiff:Me,onRevert:ge=>void Ae(ge),onRetry:()=>void rt()}),x.jsx(T1,{state:p,busy:t,taskSlug:f,onSend:L}),x.jsx(nl,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(Hs,{label:"Fixed install",value:u?u.initialized?u.needsApply?"updates":"current":"new":"unknown"}),x.jsx(Hs,{label:"Revision",value:String((u==null?void 0:u.harnessRevision)??0)}),x.jsx(Hs,{label:"Managed files",value:String(de.length)}),x.jsx(Hs,{label:"Pending updates",value:String((u==null?void 0:u.plannedChanges.length)??0)}),x.jsx(Hs,{label:"Bootstrap",value:(o==null?void 0:o.status.replaceAll("_"," "))??"unknown"}),x.jsx(Hs,{label:"Engineer",value:ng(c)})]}),u!=null&&u.warnings.length?x.jsx("ul",{className:"warnings",children:u.warnings.map(ge=>x.jsx("li",{children:ge},ge))}):null]})}),x.jsx($a,{title:"Skills",files:ce,selectedPath:O,copiedPath:I,onCopy:ge=>void me(ge),onSelect:ge=>{P(!1),H(ge)},collapsible:!0}),x.jsx($a,{title:"Root Context",files:xe,selectedPath:O,copiedPath:I,onCopy:ge=>void me(ge),onSelect:ge=>{P(!1),H(ge)},collapsible:!0}),x.jsx($a,{title:"Tools",files:se,selectedPath:O,copiedPath:I,onCopy:ge=>void me(ge),onSelect:ge=>{P(!1),H(ge)},collapsible:!0}),x.jsx(nl,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(o==null?void 0:o.checks.map(ge=>x.jsxs("li",{children:[x.jsx("span",{children:ge.path??ge.label}),x.jsx(ei,{status:ge.status})]},ge.key)))??x.jsx("li",{children:x.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),x.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[x.jsxs("div",{className:"harness-studio-engineer-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:"Harness Engineer"}),x.jsx("p",{className:"muted",children:ng(c)})]}),x.jsx(ei,{status:(c==null?void 0:c.status)??"unknown"})]}),x.jsx(zh,{role:"harness-engineer",session:c??void 0,permissionMode:v,model:s,modelOptions:l,effort:r,busy:t,onPermissionModeChange:k,onModelChange:T,onEffortChange:w,onStart:g,onResume:y,onRestart:_,onStop:b,onNotifyHarnessUpdated:E}),x.jsx("div",{className:"harness-engineer-terminal",children:(c==null?void 0:c.status)==="running"?x.jsx(Ho,{sessionId:c.id,active:d},c.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:c!=null&&c.claudeSessionId?"Resume this task Harness Engineer session.":"Start this task Harness Engineer session."})]})})]})]})]})})}):null}function Hs({label:t,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:t}),x.jsx("strong",{children:r})]})}function T1({state:t,busy:r,taskSlug:s,onSend:l}){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(d=>x.jsxs("li",{children:[x.jsx("span",{title:d.path,children:d.title}),x.jsx("code",{children:d.reporterRole??"unknown"}),x.jsx("button",{type:"button",title:"Send this feedback to Harness Engineer",disabled:r||!s,onClick:()=>l(d.path),children:"Send"})]},d.path)):x.jsx("li",{children:x.jsx("span",{children:"No pending harness feedback."})})})})}function $a({title:t,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:v,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:()=>v(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(ei,{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 R1({state:t,busy:r,copiedPath:s,onCopy:l,onSelect:d,onViewDiff:v,onRevert:f,onRetry:o}){var c,u;return x.jsxs(nl,{title:"Memory",children:[x.jsxs("div",{className:"harness-memory-status",children:[x.jsx("span",{children:"Status"}),x.jsx(ei,{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,(u=t==null?void 0:t.active)!=null&&u.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(p=>x.jsxs("li",{children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:p.path,onClick:()=>d(p.path),children:p.path}),x.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${p.path}`,onClick:()=>l(p.path),children:s===p.path?"Copied":"Copy"}),x.jsx("span",{className:"muted",children:D1(p.sizeBytes)})]},p.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(p=>x.jsxs("li",{children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",onClick:()=>v(p),children:p.runId}),x.jsx(ei,{status:p.status==="applied"?"ok":p.status==="failed"?"failed":"unknown"}),p.canRevert?x.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,onClick:()=>f(p),children:"Revert"}):null]},p.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 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 A;const[l,d]=ee.useState(null),[v,f]=ee.useState(null),[o,c]=ee.useState(null),[u,p]=ee.useState(null),[h,S]=ee.useState(null),[w,T]=ee.useState(!1),[k,y]=ee.useState(!1),[,_]=ji(null),[g,b]=ee.useState(null),E=ee.useMemo(()=>(l==null?void 0:l.files.find(M=>M.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function L(M=v){var O;T(!0),_(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await ye.getRepositoryDiff(r,M);d(H),p(null),f(((O=H.commit)==null?void 0:O.sha)??null),c(U=>{var P;return U&&H.files.some(K=>K.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){_(ht(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{T(!1)}}ee.useEffect(()=>{t&&(f(null),b(null),L(null))},[t,r]);async function R(M){S(M),_(null);try{if(!r)throw new Error("Create or select a task before reviewing file diffs.");const O=await ye.getRepositoryFileDiff(r,M);p(O),c(M)}catch(O){_(ht(`Load task file diff for ${M}`,O))}finally{S(null)}}async function D(){if(_(null),b(null),!r){_("Create or select a task before merging the task branch.");return}if(!l){_("Load the commit diff before merging the task branch.");return}const M=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.targetBranch}?`,"","VCM will run a fast-forward merge only.","The merge will fail if the task worktree or connected repository has uncommitted changes.","If the connected repository branch has diverged, rebase or merge manually first.","","Commits:",...M].join(`
|
|
61
|
+
`))){y(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);b(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){_(ht("Merge task branch to connected repository branch",H))}finally{y(!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?`${((A=l.commit)==null?void 0:A.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:v??"",disabled:w||!(l!=null&&l.commits.length),onChange:M=>{const O=M.target.value||null;f(O),L(O)},children:l==null?void 0:l.commits.map(M=>x.jsxs("option",{value:M.sha,children:[M.shortSha," · ",M.subject]},M.sha))})]}),x.jsx("button",{type:"button",disabled:w,onClick:()=>void L(),children:"Refresh"}),x.jsx("button",{type:"button",disabled:w||k||!r||!(l!=null&&l.commits.length),onClick:()=>void D(),children:k?"Merging...":"Merge to Main"}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),g?x.jsx("p",{className:"success-banner",children:g}):null,l!=null&&l.warnings.length?x.jsx("ul",{className:"warnings repository-diff-warnings",children:l.warnings.map(M=>x.jsx("li",{children:M},M))}):null,x.jsxs("div",{className:"repository-diff-body",children:[x.jsxs("aside",{className:"repository-diff-sidebar",children:[x.jsx(B1,{report:l,busy:w}),x.jsxs("ol",{className:"repository-diff-file-list",children:[l==null?void 0:l.files.map(M=>x.jsx("li",{className:[(E==null?void 0:E.path)===M.path&&!u?"selected":"",(u==null?void 0:u.path)===M.path?"task-diff-selected":""].filter(Boolean).join(" "),children:x.jsxs("div",{className:"repository-diff-file-row",children:[x.jsxs("button",{className:"repository-diff-file-select",type:"button",onClick:()=>{p(null),c(M.path)},children:[x.jsx("span",{children:M.path}),x.jsxs("small",{children:[Ch(M.status)," · ",ig(M.stage)," · ",bh(M.category)]})]}),x.jsx("button",{className:"repository-diff-task-file-button",type:"button",disabled:h===M.path,title:"View this file diff across the whole task worktree",onClick:()=>void R(M.path),children:h===M.path?"...":"Task diff"})]})},M.path)),l&&l.files.length===0?x.jsx("li",{className:"repository-diff-empty",children:l.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),x.jsx("main",{className:"repository-diff-main",children:u?x.jsx(j1,{diff:u,onClose:()=>p(null)}):E?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:E.path}),x.jsxs("p",{children:[bh(E.category)," · ",Ch(E.status)," · ",ig(E.stage)]})]}),x.jsxs("span",{className:"repository-diff-stats",children:["+",E.additions," / -",E.deletions]})]}),E.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,E.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${E.path} diff`,children:__(E.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:[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=>!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,modelOptions:l,open:d,permissionMode:v,session:f,onClose:o,onEffortChange:c,onModelChange:u,onPermissionModeChange:p,onResume:h,onRestart:S,onStart:w,onStop:T,onNotifyHarnessUpdated:k}){return d?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(f)})]}),x.jsx("button",{type:"button",onClick:o,children:"Close"})]}),x.jsx(zh,{role:"translator",session:f??void 0,permissionMode:v,model:s,modelOptions:l,effort:r,busy:t,onPermissionModeChange:p,onModelChange:u,onEffortChange:c,onStart:w,onResume:h,onRestart:S,onStop:T,onNotifyHarnessUpdated:k}),x.jsx("div",{className:"translator-session-terminal",children:(f==null?void 0:f.status)==="running"?x.jsx(Ho,{sessionId:f.id,active:d},f.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"translator"}),x.jsx("span",{children:f!=null&&f.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 P1(t,r){const s={};return(t[t.length-1]===""?[...t,""]:t).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const U1=/^[$_\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 rg(t,r){return(q1.jsx?F1:U1).test(t)}const $1=/[ \t\n\f\r]/g;function G1(t){return typeof t=="object"?t.type==="text"?sg(t.value):!1:sg(t)}function sg(t){return t.replace($1,"")===""}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 bn{constructor(r,s){this.attribute=s,this.property=r}}bn.prototype.attribute="";bn.prototype.booleanish=!1;bn.prototype.boolean=!1;bn.prototype.commaOrSpaceSeparated=!1;bn.prototype.commaSeparated=!1;bn.prototype.defined=!1;bn.prototype.mustUseProperty=!1;bn.prototype.number=!1;bn.prototype.overloadedBoolean=!1;bn.prototype.property="";bn.prototype.spaceSeparated=!1;bn.prototype.space=void 0;let V1=0;const $e=Wr(),Lt=Wr(),xh=Wr(),we=Wr(),dt=Wr(),Fs=Wr(),On=Wr();function Wr(){return 2**++V1}const Eh=Object.freeze(Object.defineProperty({__proto__:null,boolean:$e,booleanish:Lt,commaOrSpaceSeparated:On,commaSeparated:Fs,number:we,overloadedBoolean:xh,spaceSeparated:dt},Symbol.toStringTag,{value:"Module"})),eh=Object.keys(Eh);class Ih extends bn{constructor(r,s,l,d){let v=-1;if(super(r,s),ag(this,"space",d),typeof l=="number")for(;++v<eh.length;){const f=eh[v];ag(this,eh[v],(l&Eh[f])===Eh[f])}}}Ih.prototype.defined=!0;function ag(t,r,s){s&&(t[r]=s)}function Vs(t){const r={},s={};for(const[l,d]of Object.entries(t.properties)){const v=new Ih(l,t.transform(t.attributes||{},l),d,t.space);t.mustUseProperty&&t.mustUseProperty.includes(l)&&(v.mustUseProperty=!0),r[l]=v,s[wh(l)]=l,s[wh(v.attribute)]=l}return new al(r,s,t.space)}const y_=Vs({properties:{ariaActiveDescendant:null,ariaAtomic:Lt,ariaAutoComplete:null,ariaBusy:Lt,ariaChecked:Lt,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:Lt,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:Lt,ariaFlowTo:dt,ariaGrabbed:Lt,ariaHasPopup:null,ariaHidden:Lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:we,ariaLive:null,ariaModal:Lt,ariaMultiLine:Lt,ariaMultiSelectable:Lt,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:Lt,ariaReadOnly:Lt,ariaRelevant:null,ariaRequired:Lt,ariaRoleDescription:dt,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:Lt,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 W1=Vs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fs,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:$e,allowPaymentRequest:$e,allowUserMedia:$e,alt:null,as:null,async:$e,autoCapitalize:null,autoComplete:dt,autoFocus:$e,autoPlay:$e,blocking:dt,capture:null,charSet:null,checked:$e,cite:null,className:dt,cols:we,colSpan:null,content:null,contentEditable:Lt,controls:$e,controlsList:dt,coords:we|Fs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:$e,defer:$e,dir:null,dirName:null,disabled:$e,download:xh,draggable:Lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:$e,formTarget:null,headers:dt,height:we,hidden:xh,high:we,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:$e,inputMode:null,integrity:null,is:null,isMap:$e,itemId:null,itemProp:dt,itemRef:dt,itemScope:$e,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:$e,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:$e,muted:$e,name:null,nonce:null,noModule:$e,noValidate:$e,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:$e,optimum:we,pattern:null,ping:dt,placeholder:null,playsInline:$e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:$e,referrerPolicy:null,rel:dt,required:$e,reversed:$e,rows:we,rowSpan:we,sandbox:dt,scope:null,scoped:$e,seamless:$e,selected:$e,shadowRootClonable:$e,shadowRootDelegatesFocus:$e,shadowRootMode:null,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:Lt,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:$e,useMap:null,value:Lt,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,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:$e,declare:$e,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:$e,noHref:$e,noShade:$e,noWrap:$e,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:Lt,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:$e,disableRemotePlayback:$e,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:b_}),K1=Vs({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:On,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:dt,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:$e,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:Fs,g2:Fs,glyphName:Fs,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:On,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:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:On,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:On,rev:On,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:On,requiredFeatures:On,requiredFonts:On,requiredFormats:On,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:On,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:On,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:On,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_=Vs({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_=Vs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:b_}),x_=Vs({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,lg=/-[a-z]/g,Q1=/^data[-\w.:]+$/i;function J1(t,r){const s=wh(r);let l=r,d=bn;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 v=r.slice(5).replace(lg,eS);l="data"+v.charAt(0).toUpperCase()+v.slice(1)}else{const v=r.slice(4);if(!lg.test(v)){let f=v.replace(X1,Z1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Ih}return new d(l,r)}function Z1(t){return"-"+t.toLowerCase()}function eS(t){return t.charAt(1).toUpperCase()}const tS=v_([y_,W1,C_,w_,x_],"html"),Ph=v_([y_,K1,C_,w_,x_],"svg");function nS(t){return t.join(" ").trim()}var zs={},th,og;function iS(){if(og)return th;og=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,v=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
|
|
63
|
+
`,u="/",p="*",h="",S="comment",w="declaration";function T(y,_){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];_=_||{};var g=1,b=1;function E(K){var G=K.match(r);G&&(g+=G.length);var V=K.lastIndexOf(c);b=~V?K.length-V:b+K.length}function L(){var K={line:g,column:b};return function(G){return G.position=new R(K),M(),G}}function R(K){this.start=K,this.end={line:g,column:b},this.source=_.source}R.prototype.content=y;function D(K){var G=new Error(_.source+":"+g+":"+b+": "+K);if(G.reason=K,G.filename=_.source,G.line=g,G.column=b,G.source=y,!_.silent)throw G}function A(K){var G=K.exec(y);if(G){var V=G[0];return E(V),y=y.slice(V.length),G}}function M(){A(s)}function O(K){var G;for(K=K||[];G=H();)G!==!1&&K.push(G);return K}function H(){var K=L();if(!(u!=y.charAt(0)||p!=y.charAt(1))){for(var G=2;h!=y.charAt(G)&&(p!=y.charAt(G)||u!=y.charAt(G+1));)++G;if(G+=2,h===y.charAt(G-1))return D("End of comment missing");var V=y.slice(2,G-2);return b+=2,E(V),y=y.slice(G),b+=2,K({type:S,comment:V})}}function U(){var K=L(),G=A(l);if(G){if(H(),!A(d))return D("property missing ':'");var V=A(v),Y=K({type:w,property:k(G[0].replace(t,h)),value:V?k(V[0].replace(t,h)):h});return A(f),Y}}function P(){var K=[];O(K);for(var G;G=U();)G!==!1&&(K.push(G),O(K));return K}return M(),P()}function k(y){return y?y.replace(o,h):h}return th=T,th}var cg;function rS(){if(cg)return zs;cg=1;var t=zs&&zs.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(zs,"__esModule",{value:!0}),zs.default=s;const r=t(iS());function s(l,d){let v=null;if(!l||typeof l!="string")return v;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:p}=c;o?d(u,p,c):p&&(v=v||{},v[u]=p)}),v}return zs}var Ga={},ug;function sS(){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)-/,v=function(u){return!u||s.test(u)||t.test(u)},f=function(u,p){return p.toUpperCase()},o=function(u,p){return"".concat(p,"-")},c=function(u,p){return p===void 0&&(p={}),v(u)?u:(u=u.toLowerCase(),p.reactCompat?u=u.replace(d,o):u=u.replace(l,o),u.replace(r,f))};return Ga.camelCase=c,Ga}var Va,hg;function aS(){if(hg)return Va;hg=1;var t=Va&&Va.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=t(rS()),s=sS();function l(d,v){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,v)]=c)}),f}return l.default=l,Va=l,Va}var lS=aS();const oS=a_(lS),E_=k_("end"),Uh=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 cS(t){const r=Uh(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 tn extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=s,s=void 0);let d="",v={},f=!1;if(s&&("line"in s&&"column"in s?v={place:s}:"start"in s&&"end"in s?v={place:s}:"type"in s?v={ancestors:[s],place:s.position}:v={...s}),typeof r=="string"?d=r:!v.cause&&r&&(f=!0,d=r.message,v.cause=r),!v.ruleId&&!v.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?v.ruleId=l:(v.source=l.slice(0,c),v.ruleId=l.slice(c+1))}if(!v.place&&v.ancestors&&v.ancestors){const c=v.ancestors[v.ancestors.length-1];c&&(v.place=c.position)}const o=v.place&&"start"in v.place?v.place.start:v.place;this.ancestors=v.ancestors||void 0,this.cause=v.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=Xa(v.place)||"1:1",this.place=v.place||void 0,this.reason=this.message,this.ruleId=v.ruleId||void 0,this.source=v.source||void 0,this.stack=f&&v.cause&&typeof v.cause.stack=="string"?v.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tn.prototype.file="";tn.prototype.name="";tn.prototype.reason="";tn.prototype.message="";tn.prototype.stack="";tn.prototype.column=void 0;tn.prototype.line=void 0;tn.prototype.ancestors=void 0;tn.prototype.cause=void 0;tn.prototype.fatal=void 0;tn.prototype.place=void 0;tn.prototype.ruleId=void 0;tn.prototype.source=void 0;const Fh={}.hasOwnProperty,uS=new Map,hS=/[A-Z]/g,fS=new Set(["table","tbody","thead","tfoot","tr"]),dS=new Set(["td","th"]),A_="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"?Ph:tS,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},v=T_(d,t,void 0);return v&&typeof v!="string"?v:d.create(t,d.Fragment,{children:v||void 0},void 0)}function T_(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=Ph,t.schema=d),t.ancestors.push(r);const v=D_(t,r.tagName,!1),f=wS(t,r);let o=$h(t,r);return fS.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!G1(c):!0})),R_(t,f,v,r),qh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,v,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)}il(t,r.position)}function _S(t,r){if(r.data&&r.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(r.data.estree);il(t,r.position)}function vS(t,r,s){const l=t.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Ph,t.schema=d),t.ancestors.push(r);const v=r.name===null?t.Fragment:D_(t,r.name,!0),f=xS(t,r),o=$h(t,r);return R_(t,f,v,r),qh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,v,f,s)}function yS(t,r,s){const l={};return qh(l,$h(t,r)),t.create(r,t.Fragment,l,s)}function SS(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 bS(t,r,s){return l;function l(d,v,f,o){const u=Array.isArray(f.children)?s:r;return o?u(v,f,o):u(v,f)}}function CS(t,r){return s;function s(l,d,v,f){const o=Array.isArray(v.children),c=Uh(l);return r(d,v,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"&&Fh.call(r.properties,d)){const v=ES(t,d,r.properties[d]);if(v){const[f,o]=v;t.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&dS.has(r.tagName)?l=o:s[f]=o}}if(l){const v=s.style||(s.style={});v[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 v=l.data.estree.body[0];v.type;const f=v.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 v;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,v=t.evaluater.evaluateExpression(o.expression)}else il(t,r.position);else v=l.value===null?!0:l.value;s[d]=v}return s}function $h(t,r){const s=[];let l=-1;const d=t.passKeys?new Map:uS;for(;++l<r.children.length;){const v=r.children[l];let f;if(t.passKeys){const c=v.type==="element"?v.tagName:v.type==="mdxJsxFlowElement"||v.type==="mdxJsxTextElement"?v.name:void 0;if(c){const u=d.get(c)||0;f=c+"-"+u,d.set(c,u+1)}}const o=T_(t,v,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?P1(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 tn("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 v=-1,f;for(;++v<d.length;){const o=rg(d[v])?{type:"Identifier",name:d[v]}:{type:"Literal",value:d[v]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(v&&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 tn("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 AS(t){const r={};let s;for(s in t)Fh.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 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"]},DS={};function Gh(t,r){const s=DS,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(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 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 MS(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 Bn(t,r,s,l){const d=t.length;let v=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);v<l.length;)f=l.slice(v,v+1e4),f.unshift(r,0),t.splice(...f),v+=1e4,r+=1e4}function Vn(t,r){return t.length>0?(Bn(t,t.length,0,r),t):r}const gg={}.hasOwnProperty;function L_(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=(gg.call(t,s)?t[s]:void 0)||(t[s]={}),v=r[s];let f;if(v)for(f in v){gg.call(d,f)||(d[f]=[]);const o=v[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]);Bn(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 ti(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cn=vr(/[A-Za-z]/),en=vr(/[\dA-Za-z]/),BS=vr(/[#-'*+\--9=?A-Z^-~]/);function Ro(t){return t!==null&&(t<32||t===127)}const Ah=vr(/\d/),jS=vr(/[\dA-Fa-f]/),NS=vr(/[!-/:-@[-`{-~]/);function Oe(t){return t!==null&&t<-2}function ft(t){return t!==null&&(t<0||t===32)}function We(t){return t===-2||t===-1||t===32}const zo=vr(new RegExp("\\p{P}|\\p{S}","u")),Gr=vr(/\s/);function vr(t){return r;function r(s){return s!==null&&s>-1&&t.test(String.fromCharCode(s))}}function Ws(t){const r=[];let s=-1,l=0,d=0;for(;++s<t.length;){const v=t.charCodeAt(s);let f="";if(v===37&&en(t.charCodeAt(s+1))&&en(t.charCodeAt(s+2)))d=2;else if(v<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(v))||(f=String.fromCharCode(v));else if(v>55295&&v<57344){const o=t.charCodeAt(s+1);v<56320&&o>56319&&o<57344?(f=String.fromCharCode(v,o),d=1):f="�"}else f=String.fromCharCode(v);f&&(r.push(t.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+t.slice(l)}function Ze(t,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let v=0;return f;function f(c){return We(c)?(t.enter(s),o(c)):r(c)}function o(c){return We(c)&&v++<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"),Ze(t,r,"linePrefix")}function d(o){return t.enter("paragraph"),v(o)}function v(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"),v):(t.consume(o),f)}}const IS={tokenize:PS},_g={tokenize:US};function PS(t){const r=this,s=[];let l=0,d,v,f;return o;function o(b){if(l<s.length){const E=s[l];return r.containerState=E[1],t.attempt(E[0].continuation,c,u)(b)}return u(b)}function c(b){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&g();const E=r.events.length;let L=E,R;for(;L--;)if(r.events[L][0]==="exit"&&r.events[L][1].type==="chunkFlow"){R=r.events[L][1].end;break}_(l);let D=E;for(;D<r.events.length;)r.events[D][1].end={...R},D++;return Bn(r.events,L+1,0,r.events.slice(E)),r.events.length=D,u(b)}return o(b)}function u(b){if(l===s.length){if(!d)return S(b);if(d.currentConstruct&&d.currentConstruct.concrete)return T(b);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},t.check(_g,p,h)(b)}function p(b){return d&&g(),_(l),S(b)}function h(b){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,T(b)}function S(b){return r.containerState={},t.attempt(_g,w,T)(b)}function w(b){return l++,s.push([r.currentConstruct,r.containerState]),S(b)}function T(b){if(b===null){d&&g(),_(0),t.consume(b);return}return d=d||r.parser.flow(r.now()),t.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:v}),k(b)}function k(b){if(b===null){y(t.exit("chunkFlow"),!0),_(0),t.consume(b);return}return Oe(b)?(t.consume(b),y(t.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(t.consume(b),k)}function y(b,E){const L=r.sliceStream(b);if(E&&L.push(null),b.previous=v,v&&(v.next=b),v=b,d.defineSkip(b.start),d.write(L),r.parser.lazy[b.start.line]){let R=d.events.length;for(;R--;)if(d.events[R][1].start.offset<f&&(!d.events[R][1].end||d.events[R][1].end.offset>f))return;const D=r.events.length;let A=D,M,O;for(;A--;)if(r.events[A][0]==="exit"&&r.events[A][1].type==="chunkFlow"){if(M){O=r.events[A][1].end;break}M=!0}for(_(l),R=D;R<r.events.length;)r.events[R][1].end={...O},R++;Bn(r.events,A+1,0,r.events.slice(D)),r.events.length=R}}function _(b){let E=s.length;for(;E-- >b;){const L=s[E];r.containerState=L[1],L[0].exit.call(r,t)}s.length=b}function g(){d.write([null]),v=void 0,d=void 0,r.containerState._closeFlow=void 0}}function US(t,r,s){return Ze(t,t.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qs(t){if(t===null||ft(t)||Gr(t))return 1;if(zo(t))return 2}function Io(t,r,s){const l=[];let d=-1;for(;++d<t.length;){const v=t[d].resolveAll;v&&!l.includes(v)&&(r=v(r,s),l.push(v))}return r}const Th={name:"attention",resolveAll:FS,tokenize:qS};function FS(t,r){let s=-1,l,d,v,f,o,c,u,p;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 h={...t[l][1].end},S={...t[s][1].start};vg(h,-c),vg(S,c),f={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...t[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...t[s][1].start},end:S},v={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},u=[],t[l][1].end.offset-t[l][1].start.offset&&(u=Vn(u,[["enter",t[l][1],r],["exit",t[l][1],r]])),u=Vn(u,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",v,r]]),u=Vn(u,Io(r.parser.constructs.insideSpan.null,t.slice(l+1,s),r)),u=Vn(u,[["exit",v,r],["enter",o,r],["exit",o,r],["exit",d,r]]),t[s][1].end.offset-t[s][1].start.offset?(p=2,u=Vn(u,[["enter",t[s][1],r],["exit",t[s][1],r]])):p=0,Bn(t,l-1,s-l+3,u),s=l+u.length-p-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=qs(l);let v;return f;function f(c){return v=c,t.enter("attentionSequence"),o(c)}function o(c){if(c===v)return t.consume(c),o;const u=t.exit("attentionSequence"),p=qs(c),h=!p||p===2&&d||s.includes(c),S=!d||d===2&&p||s.includes(l);return u._open=!!(v===42?h:h&&(d||!S)),u._close=!!(v===42?S:S&&(p||!h)),r(c)}}function vg(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"),v}function v(w){return cn(w)?(t.consume(w),f):w===64?s(w):u(w)}function f(w){return w===43||w===45||w===46||en(w)?(l=1,o(w)):u(w)}function o(w){return w===58?(t.consume(w),l=0,c):(w===43||w===45||w===46||en(w))&&l++<32?(t.consume(w),o):(l=0,u(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||Ro(w)?s(w):(t.consume(w),c)}function u(w){return w===64?(t.consume(w),p):BS(w)?(t.consume(w),u):s(w)}function p(w){return en(w)?h(w):s(w)}function h(w){return w===46?(t.consume(w),l=0,p):w===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),r):S(w)}function S(w){if((w===45||en(w))&&l++<63){const T=w===45?S:h;return t.consume(w),T}return s(w)}}const ll={partial:!0,tokenize:VS};function VS(t,r,s){return l;function l(v){return We(v)?Ze(t,d,"linePrefix")(v):d(v)}function d(v){return v===null||Oe(v)?r(v):s(v)}}const B_={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"),v}return s(f)}function v(f){return We(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 We(f)?Ze(t,v,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):v(f)}function v(f){return t.attempt(B_,r,s)(f)}}function YS(t){t.exit("blockQuote")}const j_={name:"characterEscape",tokenize:XS};function XS(t,r,s){return l;function l(v){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(v),t.exit("escapeMarker"),d}function d(v){return NS(v)?(t.enter("characterEscapeValue"),t.consume(v),t.exit("characterEscapeValue"),t.exit("characterEscape"),r):s(v)}}const N_={name:"characterReference",tokenize:QS};function QS(t,r,s){const l=this;let d=0,v,f;return o;function o(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),c}function c(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),v=31,f=en,p(h))}function u(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),v=6,f=jS,p):(t.enter("characterReferenceValue"),v=7,f=Ah,p(h))}function p(h){if(h===59&&d){const S=t.exit("characterReferenceValue");return f===en&&!Vh(l.sliceSerialize(S))?s(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),r)}return f(h)&&d++<v?(t.consume(h),p):s(h)}}const yg={partial:!0,tokenize:ZS},Sg={concrete:!0,name:"codeFenced",tokenize:JS};function JS(t,r,s){const l=this,d={partial:!0,tokenize:L};let v=0,f=0,o;return c;function c(R){return u(R)}function u(R){const D=l.events[l.events.length-1];return v=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=R,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),p(R)}function p(R){return R===o?(f++,t.consume(R),p):f<3?s(R):(t.exit("codeFencedFenceSequence"),We(R)?Ze(t,h,"whitespace")(R):h(R))}function h(R){return R===null||Oe(R)?(t.exit("codeFencedFence"),l.interrupt?r(R):t.check(yg,k,E)(R)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||Oe(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(R)):We(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ze(t,w,"whitespace")(R)):R===96&&R===o?s(R):(t.consume(R),S)}function w(R){return R===null||Oe(R)?h(R):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),T(R))}function T(R){return R===null||Oe(R)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(R)):R===96&&R===o?s(R):(t.consume(R),T)}function k(R){return t.attempt(d,E,y)(R)}function y(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),_}function _(R){return v>0&&We(R)?Ze(t,g,"linePrefix",v+1)(R):g(R)}function g(R){return R===null||Oe(R)?t.check(yg,k,E)(R):(t.enter("codeFlowValue"),b(R))}function b(R){return R===null||Oe(R)?(t.exit("codeFlowValue"),g(R)):(t.consume(R),b)}function E(R){return t.exit("codeFenced"),r(R)}function L(R,D,A){let M=0;return O;function O(G){return R.enter("lineEnding"),R.consume(G),R.exit("lineEnding"),H}function H(G){return R.enter("codeFencedFence"),We(G)?Ze(R,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(G):U(G)}function U(G){return G===o?(R.enter("codeFencedFenceSequence"),P(G)):A(G)}function P(G){return G===o?(M++,R.consume(G),P):M>=f?(R.exit("codeFencedFenceSequence"),We(G)?Ze(R,K,"whitespace")(G):K(G)):A(G)}function K(G){return G===null||Oe(G)?(R.exit("codeFencedFence"),D(G)):A(G)}}}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"),v)}function v(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}const ih={name:"codeIndented",tokenize:tb},eb={partial:!0,tokenize:nb};function tb(t,r,s){const l=this;return d;function d(u){return t.enter("codeIndented"),Ze(t,v,"linePrefix",5)(u)}function v(u){const p=l.events[l.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?f(u):s(u)}function f(u){return u===null?c(u):Oe(u)?t.attempt(eb,f,c)(u):(t.enter("codeFlowValue"),o(u))}function o(u){return u===null||Oe(u)?(t.exit("codeFlowValue"),f(u)):(t.consume(u),o)}function c(u){return t.exit("codeIndented"),r(u)}}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):Ze(t,v,"linePrefix",5)(f)}function v(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,v;return f;function f(h){return t.enter("codeText"),t.enter("codeTextSequence"),o(h)}function o(h){return h===96?(t.consume(h),l++,o):(t.exit("codeTextSequence"),c(h))}function c(h){return h===null?s(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),c):h===96?(v=t.enter("codeTextSequence"),d=0,p(h)):Oe(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Oe(h)?(t.exit("codeTextData"),c(h)):(t.consume(h),u)}function p(h){return h===96?(t.consume(h),d++,p):d===l?(t.exit("codeTextSequence"),t.exit("codeText"),r(h)):(v.type="codeTextData",u(h))}}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 v=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Wa(this.left,l),v.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),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,v,f,o,c,u;const p=new lb(t);for(;++s<p.length;){for(;s in r;)s=r[s];if(l=p.get(s),s&&l[1].type==="chunkFlow"&&p.get(s-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,v=0,v<c.length&&c[v][1].type==="lineEndingBlank"&&(v+=2),v<c.length&&c[v][1].type==="content"))for(;++v<c.length&&c[v][1].type!=="content";)c[v][1].type==="chunkText"&&(c[v][1]._isInFirstContentOfListItem=!0,v++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,ob(p,s)),s=r[s],u=!0);else if(l[1]._container){for(v=s,d=void 0;v--;)if(f=p.get(v),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(p.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=v);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(l[1].end={...p.get(d)[1].start},o=p.slice(d,s),o.unshift(l),p.splice(d,s-d+1,o))}}return Bn(t,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function ob(t,r){const s=t.get(r)[1],l=t.get(r)[2];let d=r-1;const v=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],u={};let p,h,S=-1,w=s,T=0,k=0;const y=[k];for(;w;){for(;t.get(++d)[1]!==w;);v.push(d),w._tokenizer||(p=l.sliceStream(w),w.next||p.push(null),h&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(p),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),h=w,w=w.next}for(w=s;++S<o.length;)o[S][0]==="exit"&&o[S-1][0]==="enter"&&o[S][1].type===o[S-1][1].type&&o[S][1].start.line!==o[S][1].end.line&&(k=S+1,y.push(k),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):y.pop(),S=y.length;S--;){const _=o.slice(y[S],y[S+1]),g=v.pop();c.push([g,g+_.length-1]),t.splice(g,2,_)}for(c.reverse(),S=-1;++S<c.length;)u[T+c[S][0]]=T+c[S][1],T+=c[S][1]-c[S][0]-1;return u}const cb={resolve:hb,tokenize:fb},ub={partial:!0,tokenize:db};function hb(t){return H_(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?v(o):Oe(o)?t.check(ub,f,v)(o):(t.consume(o),d)}function v(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"),Ze(t,v,"linePrefix")}function v(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 z_(t,r,s,l,d,v,f,o,c){const u=c||Number.POSITIVE_INFINITY;let p=0;return h;function h(_){return _===60?(t.enter(l),t.enter(d),t.enter(v),t.consume(_),t.exit(v),S):_===null||_===32||_===41||Ro(_)?s(_):(t.enter(l),t.enter(f),t.enter(o),t.enter("chunkString",{contentType:"string"}),k(_))}function S(_){return _===62?(t.enter(v),t.consume(_),t.exit(v),t.exit(d),t.exit(l),r):(t.enter(o),t.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===62?(t.exit("chunkString"),t.exit(o),S(_)):_===null||_===60||Oe(_)?s(_):(t.consume(_),_===92?T:w)}function T(_){return _===60||_===62||_===92?(t.consume(_),w):w(_)}function k(_){return!p&&(_===null||_===41||ft(_))?(t.exit("chunkString"),t.exit(o),t.exit(f),t.exit(l),r(_)):p<u&&_===40?(t.consume(_),p++,k):_===41?(t.consume(_),p--,k):_===null||_===32||_===40||Ro(_)?s(_):(t.consume(_),_===92?y:k)}function y(_){return _===40||_===41||_===92?(t.consume(_),k):k(_)}}function I_(t,r,s,l,d,v){const f=this;let o=0,c;return u;function u(w){return t.enter(l),t.enter(d),t.consume(w),t.exit(d),t.enter(v),p}function p(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(v),t.enter(d),t.consume(w),t.exit(d),t.exit(l),r):Oe(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),p):(t.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||w===91||w===93||Oe(w)||o++>999?(t.exit("chunkString"),p(w)):(t.consume(w),c||(c=!We(w)),w===92?S:h)}function S(w){return w===91||w===92||w===93?(t.consume(w),o++,h):h(w)}}function P_(t,r,s,l,d,v){let f;return o;function o(S){return S===34||S===39||S===40?(t.enter(l),t.enter(d),t.consume(S),t.exit(d),f=S===40?41:S,c):s(S)}function c(S){return S===f?(t.enter(d),t.consume(S),t.exit(d),t.exit(l),r):(t.enter(v),u(S))}function u(S){return S===f?(t.exit(v),c(f)):S===null?s(S):Oe(S)?(t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),Ze(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===f||S===null||Oe(S)?(t.exit("chunkString"),u(S)):(t.consume(S),S===92?h:p)}function h(S){return S===f||S===92?(t.consume(S),p):p(S)}}function Qa(t,r){let s;return l;function l(d){return Oe(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),s=!0,l):We(d)?Ze(t,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const pb={name:"definition",tokenize:gb},mb={partial:!0,tokenize:_b};function gb(t,r,s){const l=this;let d;return v;function v(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=ti(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 ft(w)?Qa(t,u)(w):u(w)}function u(w){return z_(t,p,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function p(w){return t.attempt(mb,h,h)(w)}function h(w){return We(w)?Ze(t,S,"whitespace")(w):S(w)}function S(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 ft(o)?Qa(t,d)(o):s(o)}function d(o){return P_(t,v,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function v(o){return We(o)?Ze(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(v){return t.enter("hardBreakEscape"),t.consume(v),d}function d(v){return Oe(v)?(t.exit("hardBreakEscape"),r(v)):s(v)}}const Sb={name:"headingAtx",resolve:bb,tokenize:Cb};function bb(t,r){let s=t.length-2,l=3,d,v;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},v={type:"chunkText",start:t[l][1].start,end:t[s][1].end,contentType:"text"},Bn(t,l,s-l+1,[["enter",d,r],["enter",v,r],["exit",v,r],["exit",d,r]])),t}function Cb(t,r,s){let l=0;return d;function d(p){return t.enter("atxHeading"),v(p)}function v(p){return t.enter("atxHeadingSequence"),f(p)}function f(p){return p===35&&l++<6?(t.consume(p),f):p===null||ft(p)?(t.exit("atxHeadingSequence"),o(p)):s(p)}function o(p){return p===35?(t.enter("atxHeadingSequence"),c(p)):p===null||Oe(p)?(t.exit("atxHeading"),r(p)):We(p)?Ze(t,o,"whitespace")(p):(t.enter("atxHeadingText"),u(p))}function c(p){return p===35?(t.consume(p),c):(t.exit("atxHeadingSequence"),o(p))}function u(p){return p===null||p===35||ft(p)?(t.exit("atxHeadingText"),o(p)):(t.consume(p),u)}}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"],bg=["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,v,f,o,c;return u;function u(I){return p(I)}function p(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),h}function h(I){return I===33?(t.consume(I),S):I===47?(t.consume(I),v=!0,k):I===63?(t.consume(I),d=3,l.interrupt?r:j):cn(I)?(t.consume(I),f=String.fromCharCode(I),y):s(I)}function S(I){return I===45?(t.consume(I),d=2,w):I===91?(t.consume(I),d=5,o=0,T):cn(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 k(I){return cn(I)?(t.consume(I),f=String.fromCharCode(I),y):s(I)}function y(I){if(I===null||I===47||I===62||ft(I)){const ie=I===47,de=f.toLowerCase();return!ie&&!v&&bg.includes(de)?(d=1,l.interrupt?r(I):U(I)):wb.includes(f.toLowerCase())?(d=6,ie?(t.consume(I),_):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):v?g(I):b(I))}return I===45||en(I)?(t.consume(I),f+=String.fromCharCode(I),y):s(I)}function _(I){return I===62?(t.consume(I),l.interrupt?r:U):s(I)}function g(I){return We(I)?(t.consume(I),g):O(I)}function b(I){return I===47?(t.consume(I),O):I===58||I===95||cn(I)?(t.consume(I),E):We(I)?(t.consume(I),b):O(I)}function E(I){return I===45||I===46||I===58||I===95||en(I)?(t.consume(I),E):L(I)}function L(I){return I===61?(t.consume(I),R):We(I)?(t.consume(I),L):b(I)}function R(I){return I===null||I===60||I===61||I===62||I===96?s(I):I===34||I===39?(t.consume(I),c=I,D):We(I)?(t.consume(I),R):A(I)}function D(I){return I===c?(t.consume(I),c=null,M):I===null||Oe(I)?s(I):(t.consume(I),D)}function A(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ft(I)?L(I):(t.consume(I),A)}function M(I){return I===47||I===62||We(I)?b(I):s(I)}function O(I){return I===62?(t.consume(I),H):s(I)}function H(I){return I===null||Oe(I)?U(I):We(I)?(t.consume(I),H):s(I)}function U(I){return I===45&&d===2?(t.consume(I),V):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,q,P)(I)):I===null||Oe(I)?(t.exit("htmlFlowData"),P(I)):(t.consume(I),U)}function P(I){return t.check(kb,K,q)(I)}function K(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),G}function G(I){return I===null||Oe(I)?P(I):(t.enter("htmlFlowData"),U(I))}function V(I){return I===45?(t.consume(I),j):U(I)}function Y(I){return I===47?(t.consume(I),f="",te):U(I)}function te(I){if(I===62){const ie=f.toLowerCase();return bg.includes(ie)?(t.consume(I),N):U(I)}return cn(I)&&f.length<8?(t.consume(I),f+=String.fromCharCode(I),te):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"),q(I)):(t.consume(I),N)}function q(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"),v):s(f)}function v(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(ll,r,s)}}const Mb={name:"htmlText",tokenize:Lb};function Lb(t,r,s){const l=this;let d,v,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),u):j===47?(t.consume(j),L):j===63?(t.consume(j),b):cn(j)?(t.consume(j),A):s(j)}function u(j){return j===45?(t.consume(j),p):j===91?(t.consume(j),v=0,T):cn(j)?(t.consume(j),g):s(j)}function p(j){return j===45?(t.consume(j),w):s(j)}function h(j){return j===null?s(j):j===45?(t.consume(j),S):Oe(j)?(f=h,Y(j)):(t.consume(j),h)}function S(j){return j===45?(t.consume(j),w):h(j)}function w(j){return j===62?V(j):j===45?S(j):h(j)}function T(j){const N="CDATA[";return j===N.charCodeAt(v++)?(t.consume(j),v===N.length?k:T):s(j)}function k(j){return j===null?s(j):j===93?(t.consume(j),y):Oe(j)?(f=k,Y(j)):(t.consume(j),k)}function y(j){return j===93?(t.consume(j),_):k(j)}function _(j){return j===62?V(j):j===93?(t.consume(j),_):k(j)}function g(j){return j===null||j===62?V(j):Oe(j)?(f=g,Y(j)):(t.consume(j),g)}function b(j){return j===null?s(j):j===63?(t.consume(j),E):Oe(j)?(f=b,Y(j)):(t.consume(j),b)}function E(j){return j===62?V(j):b(j)}function L(j){return cn(j)?(t.consume(j),R):s(j)}function R(j){return j===45||en(j)?(t.consume(j),R):D(j)}function D(j){return Oe(j)?(f=D,Y(j)):We(j)?(t.consume(j),D):V(j)}function A(j){return j===45||en(j)?(t.consume(j),A):j===47||j===62||ft(j)?M(j):s(j)}function M(j){return j===47?(t.consume(j),V):j===58||j===95||cn(j)?(t.consume(j),O):Oe(j)?(f=M,Y(j)):We(j)?(t.consume(j),M):V(j)}function O(j){return j===45||j===46||j===58||j===95||en(j)?(t.consume(j),O):H(j)}function H(j){return j===61?(t.consume(j),U):Oe(j)?(f=H,Y(j)):We(j)?(t.consume(j),H):M(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(t.consume(j),d=j,P):Oe(j)?(f=U,Y(j)):We(j)?(t.consume(j),U):(t.consume(j),K)}function P(j){return j===d?(t.consume(j),d=void 0,G):j===null?s(j):Oe(j)?(f=P,Y(j)):(t.consume(j),P)}function K(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ft(j)?M(j):(t.consume(j),K)}function G(j){return j===47||j===62||ft(j)?M(j):s(j)}function V(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"),te}function te(j){return We(j)?Ze(t,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return t.enter("htmlTextData"),f(j)}}const Wh={name:"labelEnd",resolveAll:Nb,resolveTo:Hb,tokenize:zb},Ob={tokenize:Ib},Bb={tokenize:Pb},jb={tokenize:Ub};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&&Bn(t,0,t.length,s),t}function Hb(t,r){let s=t.length,l=0,d,v,f,o;for(;s--;)if(d=t[s][1],v){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&&(v=s,d.type!=="labelLink")){l=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:t[v][1].type==="labelLink"?"link":"image",start:{...t[v][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[v][1].start},end:{...t[f][1].end}},p={type:"labelText",start:{...t[v+l+2][1].end},end:{...t[f-2][1].start}};return o=[["enter",c,r],["enter",u,r]],o=Vn(o,t.slice(v+1,v+l+3)),o=Vn(o,[["enter",p,r]]),o=Vn(o,Io(r.parser.constructs.insideSpan.null,t.slice(v+l+4,f-3),r)),o=Vn(o,[["exit",p,r],t[f-2],t[f-1],["exit",u,r]]),o=Vn(o,t.slice(f+1)),o=Vn(o,[["exit",c,r]]),Bn(t,v,t.length,o),t}function zb(t,r,s){const l=this;let d=l.events.length,v,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){v=l.events[d][1];break}return o;function o(S){return v?v._inactive?h(S):(f=l.parser.defined.includes(ti(l.sliceSerialize({start:v.end,end:l.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(S),t.exit("labelMarker"),t.exit("labelEnd"),c):s(S)}function c(S){return S===40?t.attempt(Ob,p,f?p:h)(S):S===91?t.attempt(Bb,p,f?u:h)(S):f?p(S):h(S)}function u(S){return t.attempt(jb,p,h)(S)}function p(S){return r(S)}function h(S){return v._balanced=!0,s(S)}}function Ib(t,r,s){return l;function l(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),d}function d(h){return ft(h)?Qa(t,v)(h):v(h)}function v(h){return h===41?p(h):z_(t,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function f(h){return ft(h)?Qa(t,c)(h):p(h)}function o(h){return s(h)}function c(h){return h===34||h===39||h===40?P_(t,u,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):p(h)}function u(h){return ft(h)?Qa(t,p)(h):p(h)}function p(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),r):s(h)}}function Pb(t,r,s){const l=this;return d;function d(o){return I_.call(l,t,v,f,"reference","referenceMarker","referenceString")(o)}function v(o){return l.parser.defined.includes(ti(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Ub(t,r,s){return l;function l(v){return t.enter("reference"),t.enter("referenceMarker"),t.consume(v),t.exit("referenceMarker"),d}function d(v){return v===93?(t.enter("referenceMarker"),t.consume(v),t.exit("referenceMarker"),t.exit("reference"),r):s(v)}}const Fb={name:"labelStartImage",resolveAll:Wh.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"),v}function v(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:Wh.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"),v}function v(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(f):r(f)}}const rh={name:"lineEnding",tokenize:Vb};function Vb(t,r){return s;function s(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Ze(t,r,"linePrefix")}}const ko={name:"thematicBreak",tokenize:Wb};function Wb(t,r,s){let l=0,d;return v;function v(u){return t.enter("thematicBreak"),f(u)}function f(u){return d=u,o(u)}function o(u){return u===d?(t.enter("thematicBreakSequence"),c(u)):l>=3&&(u===null||Oe(u))?(t.exit("thematicBreak"),r(u)):s(u)}function c(u){return u===d?(t.consume(u),l++,c):(t.exit("thematicBreakSequence"),We(u)?Ze(t,o,"whitespace")(u):o(u))}}const Sn={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 v=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(ko,s,u)(w):u(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"),u(w)):s(w)}function u(w){return t.enter("listItemMarker"),t.consume(w),t.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||w,t.check(ll,l.interrupt?s:p,t.attempt(Kb,S,h))}function p(w){return l.containerState.initialBlankLine=!0,v++,S(w)}function h(w){return We(w)?(t.enter("listItemPrefixWhitespace"),t.consume(w),t.exit("listItemPrefixWhitespace"),S):s(w)}function S(w){return l.containerState.size=v+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(ll,d,v);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Ze(t,r,"listItemIndent",l.containerState.size+1)(o)}function v(o){return l.containerState.furtherBlankLines||!We(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,t.attempt(Yb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Ze(t,t.attempt(Sn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Jb(t,r,s){const l=this;return Ze(t,d,"listItemIndent",l.containerState.size+1);function d(v){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(v):s(v)}}function Zb(t){t.exit(this.containerState.type)}function eC(t,r,s){const l=this;return Ze(t,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(v){const f=l.events[l.events.length-1];return!We(v)&&f&&f[1].type==="listItemPrefixWhitespace"?r(v):s(v)}}const Cg={name:"setextUnderline",resolveTo:tC,tokenize:nC};function tC(t,r){let s=t.length,l,d,v;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),!v&&t[s][1].type==="definition"&&(v=s);const f={type:"setextHeading",start:{...t[l][1].start},end:{...t[t.length-1][1].end}};return t[d][1].type="setextHeadingText",v?(t.splice(d,0,["enter",f,r]),t.splice(v+1,0,["exit",t[l][1],r]),t[l][1].end={...t[v][1].end}):t[l][1]=f,t.push(["exit",f,r]),t}function nC(t,r,s){const l=this;let d;return v;function v(u){let p=l.events.length,h;for(;p--;)if(l.events[p][1].type!=="lineEnding"&&l.events[p][1].type!=="linePrefix"&&l.events[p][1].type!=="content"){h=l.events[p][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||h)?(t.enter("setextHeadingLine"),d=u,f(u)):s(u)}function f(u){return t.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===d?(t.consume(u),o):(t.exit("setextHeadingLineSequence"),We(u)?Ze(t,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Oe(u)?(t.exit("setextHeadingLine"),r(u)):s(u)}}const iC={tokenize:rC};function rC(t){const r=this,s=t.attempt(ll,l,t.attempt(this.parser.constructs.flowInitial,d,Ze(t,t.attempt(this.parser.constructs.flow,d,t.attempt(cb,d)),"linePrefix")));return s;function l(v){if(v===null){t.consume(v);return}return t.enter("lineEndingBlank"),t.consume(v),t.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(v){if(v===null){t.consume(v);return}return t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),r.currentConstruct=void 0,s}}const sC={resolveAll:F_()},aC=U_("string"),lC=U_("text");function U_(t){return{resolveAll:F_(t==="text"?oC:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[t],v=s.attempt(d,f,o);return f;function f(p){return u(p)?v(p):o(p)}function o(p){if(p===null){s.consume(p);return}return s.enter("data"),s.consume(p),c}function c(p){return u(p)?(s.exit("data"),v(p)):(s.consume(p),c)}function u(p){if(p===null)return!0;const h=d[p];let S=-1;if(h)for(;++S<h.length;){const w=h[S];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,v;for(;++d<=s.length;)v===void 0?s[d]&&s[d][1].type==="data"&&(v=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==v+2&&(s[v][1].end=s[d-1][1].end,s.splice(v+2,d-v-2),d=v+2),v=void 0);return 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 v=d.length,f=-1,o=0,c;for(;v--;){const u=d[v];if(typeof u=="string"){for(f=u.length;u.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(u===-2)c=!0,o++;else if(u!==-1){v++;break}}if(r._contentTypeTextTrailing&&s===t.length&&(o=0),o){const u={type:s===t.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:v?f:l.start._bufferIndex+f,_index:l.start._index+v,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...u.start},l.start.offset===l.end.offset?Object.assign(l,u):(t.splice(s,0,["enter",u,r],["exit",u,r]),s+=2)}s++}return t}const cC={42:Sn,43:Sn,45:Sn,48:Sn,49:Sn,50:Sn,51:Sn,52:Sn,53:Sn,54:Sn,55:Sn,56:Sn,57:Sn,62:B_},uC={91:pb},hC={[-2]:ih,[-1]:ih,32:ih},fC={35:Sb,42:ko,45:[Cg,ko],60:xb,61:Cg,95:ko,96:Sg,126:Sg},dC={38:N_,92:j_},pC={[-5]:rh,[-4]:rh,[-3]:rh,33:Fb,38:N_,42:Th,60:[$S,Mb],91:$b,92:[vb,j_],93:Wh,95:Th,96:ib},mC={null:[Th,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={},v=[];let f=[],o=[];const c={attempt:D(L),check:D(R),consume:g,enter:b,exit:E,interrupt:D(R,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:T,parser:t,previous:null,sliceSerialize:S,sliceStream:w,write:h};let p=r.tokenize.call(u,c);return r.resolveAll&&v.push(r),u;function h(H){return f=Vn(f,H),y(),f[f.length-1]!==null?[]:(A(r,0),u.events=Io(v,u.events,u),u.events)}function S(H,U){return bC(w(H),U)}function w(H){return SC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:K,offset:G}=l;return{_bufferIndex:H,_index:U,line:P,column:K,offset:G}}function k(H){d[H.line]=H.column,O()}function y(){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;)_(U.charCodeAt(l._bufferIndex));else _(U)}}function _(H){p=p(H)}function g(H){Oe(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++)),u.previous=H}function b(H,U){const P=U||{};return P.type=H,P.start=T(),u.events.push(["enter",P,u]),o.push(P),P}function E(H){const U=o.pop();return U.end=T(),u.events.push(["exit",U,u]),U}function L(H,U){A(H,U.from)}function R(H,U){U.restore()}function D(H,U){return P;function P(K,G,V){let Y,te,z,j;return Array.isArray(K)?q(K):"tokenize"in K?q([K]):N(K);function N(_e){return Q;function Q($){const ce=$!==null&&_e[$],se=$!==null&&_e.null,xe=[...Array.isArray(ce)?ce:ce?[ce]:[],...Array.isArray(se)?se:se?[se]:[]];return q(xe)($)}}function q(_e){return Y=_e,te=0,_e.length===0?V:I(_e[te])}function I(_e){return Q;function Q($){return j=M(),z=_e,_e.partial||(u.currentConstruct=_e),_e.name&&u.parser.constructs.disable.null.includes(_e.name)?de():_e.tokenize.call(U?Object.assign(Object.create(u),U):u,c,ie,de)($)}}function ie(_e){return H(z,j),G}function de(_e){return j.restore(),++te<Y.length?I(Y[te]):V}}}function A(H,U){H.resolveAll&&!v.includes(H)&&v.push(H),H.resolve&&Bn(u.events,U,u.events.length-U,H.resolve(u.events.slice(U),u)),H.resolveTo&&(u.events=H.resolveTo(u.events,u))}function M(){const H=T(),U=u.previous,P=u.currentConstruct,K=u.events.length,G=Array.from(o);return{from:K,restore:V};function V(){l=H,u.previous=U,u.currentConstruct=P,u.events.length=K,o=G,O()}}function O(){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,v=r.end._bufferIndex;let f;if(s===d)f=[t[s].slice(l,v)];else{if(f=t.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}v>0&&f.push(t[d].slice(0,v))}return f}function bC(t,r){let s=-1;const l=[];let d;for(;++s<t.length;){const v=t[s];let f;if(typeof v=="string")f=v;else switch(v){case-5:{f="\r";break}case-4:{f=`
|
|
64
|
+
`;break}case-3:{f=`\r
|
|
65
|
+
`;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(v)}d=v===-2,l.push(f)}return l.join("")}function CC(t){const l={constructs:L_([vC,...(t||{}).extensions||[]]),content:d(HS),defined:[],document:d(IS),flow:d(iC),lazy:{},string:d(aC),text:d(lC)};return l;function d(v){return f;function f(o){return yC(l,v,o)}}}function wC(t){for(;!H_(t););return t}const wg=/[\0\t\n\r]/g;function xC(){let t=1,r="",s=!0,l;return d;function d(v,f,o){const c=[];let u,p,h,S,w;for(v=r+(typeof v=="string"?v.toString():new TextDecoder(f||void 0).decode(v)),h=0,r="",s&&(v.charCodeAt(0)===65279&&h++,s=void 0);h<v.length;){if(wg.lastIndex=h,u=wg.exec(v),S=u&&u.index!==void 0?u.index:v.length,w=v.charCodeAt(S),!u){r=v.slice(h);break}if(w===10&&h===S&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),h<S&&(c.push(v.slice(h,S)),t+=S-h),w){case 0:{c.push(65533),t++;break}case 9:{for(p=Math.ceil(t/4)*4,c.push(-2);t++<p;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:l=!0,t=1}h=S+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),v=d===120||d===88;return O_(s.slice(v?2:1),v?16:10)}return Vh(s)||t}const q_={}.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:v(ge),autolinkProtocol:M,autolinkEmail:M,atxHeading:v(me),blockQuote:v(se),characterEscape:M,characterReference:M,codeFenced:v(xe),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:v(xe,f),codeText:v(be,f),codeTextData:M,data:M,codeFlowValue:M,definition:v(je),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:v(Ee),hardBreakEscape:v(Me),hardBreakTrailing:v(Me),htmlFlow:v(Ae,f),htmlFlowData:M,htmlText:v(Ae,f),htmlTextData:M,image:v(rt),label:f,link:v(ge),listItem:v(Ke),listItemValue:S,listOrdered:v(ze,h),listUnordered:v(ze),paragraph:v(zt),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:v(me),strong:v(pt),thematicBreak:v(Ot)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ce,autolinkProtocol:$,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:_e,characterReference:Q,codeFenced:c(y),codeFencedFence:k,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:O,codeIndented:c(_),codeText:c(G),codeTextData:O,data:O,definition:c(),definitionDestinationString:E,definitionLabelString:g,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:O,htmlText:c(K),htmlTextData:O,image:c(Y),label:z,labelText:te,lineEnding:H,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:j,resourceTitleString:N,resource:q,setextHeading:c(A),setextHeadingLineSequence:D,setextHeadingText:R,strong:c(),thematicBreak:c()}};$_(r,(t||{}).mdastExtensions||[]);const s={};return l;function l(he){let Ce={type:"root",children:[]};const Te={stack:[Ce],tokenStack:[],config:r,enter:o,exit:u,buffer:f,resume:p,data:s},He=[];let Ie=-1;for(;++Ie<he.length;)if(he[Ie][1].type==="listOrdered"||he[Ie][1].type==="listUnordered")if(he[Ie][0]==="enter")He.push(Ie);else{const vt=He.pop();Ie=d(he,vt,Ie)}for(Ie=-1;++Ie<he.length;){const vt=r[he[Ie][0]];q_.call(vt,he[Ie][1].type)&&vt[he[Ie][1].type].call(Object.assign({sliceSerialize:he[Ie][2].sliceSerialize},Te),he[Ie][1])}if(Te.tokenStack.length>0){const vt=Te.tokenStack[Te.tokenStack.length-1];(vt[1]||xg).call(Te,void 0,vt[0])}for(Ce.position={start:gr(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:gr(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<r.transforms.length;)Ce=r.transforms[Ie](Ce)||Ce;return Ce}function d(he,Ce,Te){let He=Ce-1,Ie=-1,vt=!1,Fe,Ct,St,Bt;for(;++He<=Te;){const et=he[He];switch(et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{et[0]==="enter"?Ie++:Ie--,Bt=void 0;break}case"lineEndingBlank":{et[0]==="enter"&&(Fe&&!Bt&&!Ie&&!St&&(St=He),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=void 0}if(!Ie&&et[0]==="enter"&&et[1].type==="listItemPrefix"||Ie===-1&&et[0]==="exit"&&(et[1].type==="listUnordered"||et[1].type==="listOrdered")){if(Fe){let Ut=He;for(Ct=void 0;Ut--;){const nn=he[Ut];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;Ct&&(he[Ct][1].type="lineEndingBlank",vt=!0),nn[1].type="lineEnding",Ct=Ut}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}St&&(!Ct||St<Ct)&&(Fe._spread=!0),Fe.end=Object.assign({},Ct?he[Ct][1].start:et[1].end),he.splice(Ct||He,0,["exit",Fe,et[2]]),He++,Te++}if(et[1].type==="listItemPrefix"){const Ut={type:"listItem",_spread:!1,start:Object.assign({},et[1].start),end:void 0};Fe=Ut,he.splice(He,0,["enter",Ut,et[2]]),He++,Te++,St=void 0,Bt=!0}}}return he[Ce][1]._spread=vt,Te}function v(he,Ce){return Te;function Te(He){o.call(this,he(He),He),Ce&&Ce.call(this,He)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(he,Ce,Te){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Ce,Te||void 0]),he.position={start:gr(Ce.start),end:void 0}}function c(he){return Ce;function Ce(Te){he&&he.call(this,Te),u.call(this,Te)}}function u(he,Ce){const Te=this.stack.pop(),He=this.tokenStack.pop();if(He)He[0].type!==he.type&&(Ce?Ce.call(this,he,He[0]):(He[1]||xg).call(this,he,He[0]));else throw new Error("Cannot close `"+he.type+"` ("+Xa({start:he.start,end:he.end})+"): it’s not open");Te.position.end=gr(he.end)}function p(){return Gh(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function S(he){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function w(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=he}function T(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=he}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he.replace(/(\r?\n|\r)$/g,"")}function g(he){const Ce=this.resume(),Te=this.stack[this.stack.length-1];Te.label=Ce,Te.identifier=ti(this.sliceSerialize(he)).toLowerCase()}function b(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function E(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function L(he){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Te=this.sliceSerialize(he).length;Ce.depth=Te}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(he){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function M(he){const Te=this.stack[this.stack.length-1].children;let He=Te[Te.length-1];(!He||He.type!=="text")&&(He=mt(),He.position={start:gr(he.start),end:void 0},Te.push(He)),this.stack.push(He)}function O(he){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(he),Ce.position.end=gr(he.end)}function H(he){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=Ce.children[Ce.children.length-1];Te.position.end=gr(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Ce.type)&&(M.call(this,he),O.call(this,he))}function U(){this.data.atHardBreak=!0}function P(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function K(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function G(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=he}function V(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Y(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Ce,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function te(he){const Ce=this.sliceSerialize(he),Te=this.stack[this.stack.length-2];Te.label=kC(Ce),Te.identifier=ti(Ce).toLowerCase()}function z(){const he=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 He=he.children;Te.children=He}else Te.alt=Ce}function j(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=he}function N(){const he=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=he}function q(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ie(he){const Ce=this.resume(),Te=this.stack[this.stack.length-1];Te.label=Ce,Te.identifier=ti(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function de(he){this.data.characterReferenceType=he.type}function _e(he){const Ce=this.sliceSerialize(he),Te=this.data.characterReferenceType;let He;Te?(He=O_(Ce,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):He=Vh(Ce);const Ie=this.stack[this.stack.length-1];Ie.value+=He}function Q(he){const Ce=this.stack.pop();Ce.position.end=gr(he.end)}function $(he){O.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(he)}function ce(he){O.call(this,he);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(he)}function se(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function be(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function me(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function Ae(){return{type:"html",value:""}}function rt(){return{type:"image",title:null,url:"",alt:null}}function ge(){return{type:"link",title:null,url:"",children:[]}}function ze(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Ke(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function zt(){return{type:"paragraph",children:[]}}function pt(){return{type:"strong",children:[]}}function mt(){return{type:"text",value:""}}function Ot(){return{type:"thematicBreak"}}}function gr(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):DC(t,l)}}function DC(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 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 v={type:"element",tagName:"code",properties:l,children:[{type:"text",value:s}]};return r.meta&&(v.data={meta:r.meta}),t.patch(r,v),v=t.applyData(r,v),v={type:"element",tagName:"pre",properties:{},children:[v]},t.patch(r,v),v}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=Ws(l.toLowerCase()),v=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=v+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 u={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(r,u),t.applyData(r,u)}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 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),v=d[0];v&&v.type==="text"?v.value="["+v.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=l:d.push({type:"text",value:l}),d}function PC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return G_(t,r);const d={src:Ws(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(d.title=l.title);const v={type:"element",tagName:"img",properties:d,children:[]};return t.patch(r,v),t.applyData(r,v)}function UC(t,r){const s={src:Ws(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 G_(t,r);const d={href:Ws(l.url||"")};l.title!==null&&l.title!==void 0&&(d.title=l.title);const v={type:"element",tagName:"a",properties:d,children:t.all(r)};return t.patch(r,v),t.applyData(r,v)}function $C(t,r){const s={href:Ws(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):V_(r),v={},f=[];if(typeof r.checked=="boolean"){const p=l[0];let h;p&&p.type==="element"&&p.tagName==="p"?h=p:(h={type:"element",tagName:"p",properties:{},children:[]},l.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),v.className=["task-list-item"]}let o=-1;for(;++o<l.length;){const p=l[o];(d||o!==0||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
|
|
68
|
+
`}),p.type==="element"&&p.tagName==="p"&&!d?f.push(...p.children):f.push(p)}const c=l[l.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
|
|
69
|
+
`});const u={type:"element",tagName:"li",properties:v,children:f};return t.patch(r,u),t.applyData(r,u)}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=V_(s[l])}return r}function V_(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 v={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:t.wrap(l,!0)};return t.patch(r,v),t.applyData(r,v)}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=E_(r.children[r.children.length-1]);o&&c&&(f.position={start:o,end:c}),d.push(f)}const v={type:"element",tagName:"table",properties:{},children:t.wrap(d,!0)};return t.patch(r,v),t.applyData(r,v)}function JC(t,r,s){const l=s?s.children:void 0,v=(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 u=[];for(;++c<o;){const h=r.children[c],S={},w=f?f[c]:void 0;w&&(S.align=w);let T={type:"element",tagName:v,properties:S,children:[]};h&&(T.children=t.all(h),t.patch(h,T),T=t.applyData(h,T)),u.push(T)}const p={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(r,p),t.applyData(r,p)}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 Eg=9,kg=32;function ew(t){const r=String(t),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const v=[];for(;l;)v.push(Ag(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return v.push(Ag(r.slice(d),d>0,!1)),v.join("")}function Ag(t,r,s){let l=0,d=t.length;if(r){let v=t.codePointAt(l);for(;v===Eg||v===kg;)l++,v=t.codePointAt(l)}if(s){let v=t.codePointAt(d-1);for(;v===Eg||v===kg;)d--,v=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:PC,image:UC,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:bo,yaml:bo,definition:bo,footnoteDefinition:bo};function bo(){}const W_=-1,Po=0,Ja=1,Do=2,Kh=3,Yh=4,Xh=5,Qh=6,K_=7,Y_=8,rw=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 rw[t](r)},sw=(t,r)=>{const s=(d,v)=>(t.set(v,d),d),l=d=>{if(t.has(d))return t.get(d);const[v,f]=r[d];switch(v){case Po:case W_:return s(f,d);case Ja:{const o=s([],d);for(const c of f)o.push(l(c));return o}case Do:{const o=s({},d);for(const[c,u]of f)o[l(c)]=l(u);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,u]of f)o.set(l(c),l(u));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(v,f),d)};return l},Rg=t=>sw(new Map,t)(0),Is="",{toString:aw}={},{keys:lw}=Object,Ka=t=>{const r=typeof t;if(r!=="object"||!t)return[Po,r];const s=aw.call(t).slice(8,-1);switch(s){case"Array":return[Ja,Is];case"Object":return[Do,Is];case"Date":return[Kh,Is];case"RegExp":return[Yh,Is];case"Map":return[Xh,Is];case"Set":return[Qh,Is];case"DataView":return[Ja,s]}return s.includes("Array")?[Ja,s]:s.includes("Error")?[K_,s]:[Do,s]},Co=([t,r])=>t===Po&&(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},v=f=>{if(s.has(f))return s.get(f);let[o,c]=Ka(f);switch(o){case Po:{let p=f;switch(c){case"bigint":o=Y_,p=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return d([W_],f)}return d([o,p],f)}case Ja:{if(c){let S=f;return c==="DataView"?S=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(S=new Uint8Array(f)),d([c,[...S]],f)}const p=[],h=d([o,p],f);for(const S of f)p.push(v(S));return h}case Do:{if(c)switch(c){case"BigInt":return d([c,f.toString()],f);case"Boolean":case"Number":case"String":return d([c,f.valueOf()],f)}if(r&&"toJSON"in f)return v(f.toJSON());const p=[],h=d([o,p],f);for(const S of lw(f))(t||!Co(Ka(f[S])))&&p.push([v(S),v(f[S])]);return h}case Kh:return d([o,f.toISOString()],f);case Yh:{const{source:p,flags:h}=f;return d([o,{source:p,flags:h}],f)}case Xh:{const p=[],h=d([o,p],f);for(const[S,w]of f)(t||!(Co(Ka(S))||Co(Ka(w))))&&p.push([v(S),v(w)]);return h}case Qh:{const p=[],h=d([o,p],f);for(const S of f)(t||!Co(Ka(S)))&&p.push(v(S));return h}}const{message:u}=f;return d([o,{name:c,message:u}],f)};return v},Dg=(t,{json:r,lossy:s}={})=>{const l=[];return ow(!(r||s),!!r,new Map,l)(t),l},Mo=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 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",v=t.options.footnoteLabelTagName||"h2",f=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[c]);if(!u)continue;const p=t.all(u),h=String(u.identifier).toUpperCase(),S=Ws(h.toLowerCase());let w=0;const T=[],k=t.footnoteCounts.get(h);for(;k!==void 0&&++w<=k;){T.length>0&&T.push({type:"text",value:" "});let g=typeof s=="string"?s:s(c,w);typeof g=="string"&&(g={type:"text",value:g}),T.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+S+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(c,w),className:["data-footnote-backref"]},children:Array.isArray(g)?g:[g]})}const y=p[p.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const g=y.children[y.children.length-1];g&&g.type==="text"?g.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...T)}else p.push(...T);const _={type:"element",tagName:"li",properties:{id:r+"fn-"+S},children:t.wrap(p,!0)};t.patch(u,_),o.push(_)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:v,properties:{...Mo(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
|
|
70
|
+
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
|
|
71
|
+
`}]}}const Uo=(function(t){if(t==null)return mw;if(typeof t=="function")return Fo(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]=Uo(t[s]);return Fo(l);function l(...d){let v=-1;for(;++v<r.length;)if(r[v].apply(this,d))return!0;return!1}}function dw(t){const r=t;return Fo(s);function s(l){const d=l;let v;for(v in t)if(d[v]!==r[v])return!1;return!0}}function pw(t){return Fo(r);function r(s){return s&&s.type===t}}function Fo(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 X_=[],_w=!0,Rh=!1,vw="skip";function Q_(t,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const v=Uo(d),f=l?-1:1;o(t,void 0,[])();function o(c,u,p){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const w=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=X_,T,k,y;if((!r||v(c,u,p[p.length-1]||void 0))&&(w=yw(s(c,p)),w[0]===Rh))return w;if("children"in c&&c.children){const _=c;if(_.children&&w[0]!==vw)for(k=(l?_.children.length:-1)+f,y=p.concat(_);k>-1&&k<_.children.length;){const g=_.children[k];if(T=o(g,k,y)(),T[0]===Rh)return T;k=typeof T[1]=="number"?T[1]:k+f}}return w}}}function yw(t){return Array.isArray(t)?t:typeof t=="number"?[_w,t]:t==null?X_:[t]}function Jh(t,r,s,l){let d,v,f;typeof r=="function"&&typeof s!="function"?(v=void 0,f=r,d=s):(v=r,f=s,d=l),Q_(t,v,o,d);function o(c,u){const p=u[u.length-1],h=p?p.children.indexOf(c):void 0;return f(c,h,p)}}const Dh={}.hasOwnProperty,Sw={};function bw(t,r){const s=r||Sw,l=new Map,d=new Map,v=new Map,f={...iw,...s.handlers},o={all:u,applyData:ww,definitionById:l,footnoteById:d,footnoteCounts:v,footnoteOrder:[],handlers:f,one:c,options:s,patch:Cw,wrap:Ew};return Jh(t,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const h=p.type==="definition"?l:d,S=String(p.identifier).toUpperCase();h.has(S)||h.set(S,p)}}),o;function c(p,h){const S=p.type,w=o.handlers[S];if(Dh.call(o.handlers,S)&&w)return w(o,p,h);if(o.options.passThrough&&o.options.passThrough.includes(S)){if("children"in p){const{children:k,...y}=p,_=Mo(y);return _.children=o.all(p),_}return Mo(p)}return(o.options.unknownHandler||xw)(o,p,h)}function u(p){const h=[];if("children"in p){const S=p.children;let w=-1;for(;++w<S.length;){const T=o.one(S[w],p);if(T){if(w&&S[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=Mg(T.value)),!Array.isArray(T)&&T.type==="element")){const k=T.children[0];k&&k.type==="text"&&(k.value=Mg(k.value))}Array.isArray(T)?h.push(...T):h.push(T)}}}return h}}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,v=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"&&v&&Object.assign(s.properties,Mo(v)),"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&&!(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 Ew(t,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
|
|
72
|
+
`});++l<t.length;)l&&s.push({type:"text",value:`
|
|
73
|
+
`}),s.push(t[l]);return r&&t.length>0&&s.push({type:"text",value:`
|
|
74
|
+
`}),s}function 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=bw(t,r),l=s.one(t,void 0),d=hw(s),v=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return d&&v.children.push({type:"text",value:`
|
|
75
|
+
`},d),v}function kw(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 Aw(){if(Bg)return sh;Bg=1;var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=function(u){return typeof Array.isArray=="function"?Array.isArray(u):r.call(u)==="[object Array]"},v=function(u){if(!u||r.call(u)!=="[object Object]")return!1;var p=t.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!p&&!h)return!1;var S;for(S in u);return typeof S>"u"||t.call(u,S)},f=function(u,p){s&&p.name==="__proto__"?s(u,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):u[p.name]=p.newValue},o=function(u,p){if(p==="__proto__")if(t.call(u,p)){if(l)return l(u,p).value}else return;return u[p]};return sh=function c(){var u,p,h,S,w,T,k=arguments[0],y=1,_=arguments.length,g=!1;for(typeof k=="boolean"&&(g=k,k=arguments[1]||{},y=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});y<_;++y)if(u=arguments[y],u!=null)for(p in u)h=o(k,p),S=o(u,p),k!==S&&(g&&S&&(v(S)||(w=d(S)))?(w?(w=!1,T=h&&d(h)?h:[]):T=h&&v(h)?h:{},f(k,{name:p,newValue:c(g,T,S)})):typeof S<"u"&&f(k,{name:p,newValue:S}));return k},sh}var Tw=Aw();const ah=a_(Tw);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 Rw(){const t=[],r={run:s,use:l};return r;function s(...d){let v=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);o(null,...d);function o(c,...u){const p=t[++v];let h=-1;if(c){f(c);return}for(;++h<d.length;)(u[h]===null||u[h]===void 0)&&(u[h]=d[h]);d=u,p?Dw(p,o)(...u):f(null,...u)}}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(u){const p=u;if(o&&s)throw p;return d(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(v,d):c instanceof Error?d(c):v(c))}function d(f,...o){s||(s=!0,r(f,...o))}function v(f){d(null,f)}}const ui={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');ol(t);let s=0,l=-1,d=t.length,v;if(r===void 0||r.length===0||r.length>t.length){for(;d--;)if(t.codePointAt(d)===47){if(v){s=d+1;break}}else l<0&&(v=!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(v){s=d+1;break}}else f<0&&(v=!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(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 Ow(t){ol(t);let r=t.length,s=-1,l=0,d=-1,v=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:v!==1&&(v=1):d>-1&&(v=-1)}return d<0||s<0||v===0||v===1&&d===s-1&&d===l+1?"":t.slice(d,s)}function Bw(...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?".":jw(s)}function jw(t){ol(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,v=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||v===1))if(d!==f-1&&v===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,v=0;continue}}else if(s.length>0){s="",l=0,d=f,v=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,v=0}else o===46&&v>-1?v++:v=-1}return s}function ol(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 Lh(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(!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 Pw(t)}function Pw(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"||Uw(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<lh.length;){const v=lh[l];v in s&&s[v]!==void 0&&s[v]!==null&&(this[v]=v==="history"?[...s[v]]:s[v])}let d;for(d in s)lh.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?ui.basename(this.path):void 0}set basename(r){ch(r,"basename"),oh(r,"basename"),this.path=ui.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?ui.dirname(this.path):void 0}set dirname(r){jg(this.basename,"dirname"),this.path=ui.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?ui.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=ui.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Lh(r)&&(r=Iw(r)),ch(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?ui.basename(this.path,this.extname):void 0}set stem(r){ch(r,"stem"),oh(r,"stem"),this.path=ui.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 tn(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(ui.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+ui.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 Uw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Fw=(function(t){const l=this.constructor.prototype,d=l[t],v=function(){return d.apply(v,arguments)};return Object.setPrototypeOf(v,l),v}),qw={}.hasOwnProperty;class Zh 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 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):qw.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=wo(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(v,f){const o=wo(r),c=l.parse(o);l.run(c,o,function(p,h,S){if(p||!h||!S)return u(p);const w=h,T=l.stringify(w,S);Vw(T)?S.value=T:S.result=T,u(p,S)});function u(p,h){p||!h?f(p):v?v(h):s(void 0,h)}}}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(v,f){s=!0,Og(v),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?v(void 0,l):new Promise(v);function v(f,o){const c=wo(s);d.run(r,c,u);function u(p,h,S){const w=h||r;p?o(p):f?f(w):l(void 0,w,S)}}}runSync(r,s){let l=!1,d;return this.run(r,s,v),Hg("runSync","run",l),d;function v(f,o){Og(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=wo(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 v(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[p,...h]=u;c(p,h)}else f(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function f(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(d.settings=ah(!0,d.settings,u.settings))}function o(u){let p=-1;if(u!=null)if(Array.isArray(u))for(;++p<u.length;){const h=u[p];v(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,p){let h=-1,S=-1;for(;++h<l.length;)if(l[h][0]===u){S=h;break}if(S===-1)l.push([u,...p]);else if(p.length>0){let[w,...T]=p;const k=l[S][1];Mh(k)&&Mh(w)&&(w=ah(!0,k,w)),l[S]=[u,w,...T]}}}}const $w=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 wo(t){return Gw(t)?t:new J_(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",zg=[],Ig={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 Z_(t){const r=Qw(t),s=Jw(t);return Zw(r.runSync(r.parse(s),s),t)}function Qw(t){const r=t.rehypePlugins||zg,s=t.remarkPlugins||zg,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Ig}:Ig;return $w().use(MC).use(s).use(kw,l).use(r)}function Jw(t){const r=t.children||"",s=new J_;return typeof r=="string"&&(s.value=r),s}function Zw(t,r){const s=r.allowedElements,l=r.allowElement,d=r.components,v=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||ex;for(const p of Xw)Object.hasOwn(r,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Kw+p.id,void 0);return Jh(t,u),pS(t,{Fragment:x.Fragment,components:d,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function u(p,h,S){if(p.type==="raw"&&S&&typeof h=="number")return f?S.children.splice(h,1):S.children[h]={type:"text",value:p.value},h;if(p.type==="element"){let w;for(w in nh)if(Object.hasOwn(nh,w)&&Object.hasOwn(p.properties,w)){const T=p.properties[w],k=nh[w];(k===null||k.includes(p.tagName))&&(p.properties[w]=c(String(T||""),w,p))}}if(p.type==="element"){let w=s?!s.includes(p.tagName):v?v.includes(p.tagName):!1;if(!w&&l&&typeof h=="number"&&(w=!l(p,h,S)),w&&S&&typeof h=="number")return o&&p.children?S.children.splice(h,1,...p.children):S.children.splice(h,1),h}}}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 Pg(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=Uo((s||{}).ignore||[]),v=ix(r);let f=-1;for(;++f<v.length;)Q_(t,"text",o);function o(u,p){let h=-1,S;for(;++h<p.length;){const w=p[h],T=S?S.children:void 0;if(d(w,T?T.indexOf(w):void 0,S))return;S=w}if(S)return c(u,p)}function c(u,p){const h=p[p.length-1],S=v[f][0],w=v[f][1];let T=0;const y=h.children.indexOf(u);let _=!1,g=[];S.lastIndex=0;let b=S.exec(u.value);for(;b;){const E=b.index,L={index:b.index,input:b.input,stack:[...p,u]};let R=w(...b,L);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?S.lastIndex=E+1:(T!==E&&g.push({type:"text",value:u.value.slice(T,E)}),Array.isArray(R)?g.push(...R):R&&g.push(R),T=E+b[0].length,_=!0),!S.global)break;b=S.exec(u.value)}return _?(T<u.value.length&&g.push({type:"text",value:u.value.slice(T)}),h.children.splice(y,1,...g)):g=[u],y+g.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 dh="phrasing",ph=["autolink","link","image","label"];function ax(){return{transforms:[dx],enter:{literalAutolink:ox,literalAutolinkEmail:mh,literalAutolinkHttp:mh,literalAutolinkWww:mh},exit:{literalAutolink:fx,literalAutolinkEmail:hx,literalAutolinkHttp:cx,literalAutolinkWww:ux}}}function lx(){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 ox(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function mh(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 v="";if(!ev(d)||(/^w/i.test(r)&&(s=r+s,r="",v="http://"),!gx(s)))return!1;const f=_x(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:v+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!ev(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=Pg(t,"(");let v=Pg(t,")");for(;l!==-1&&d>v;)t+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),v++;return[t,s]}function ev(t,r){const s=t.input.charCodeAt(t.index-1);return(t.index===0||Gr(s)||zo(s))&&(!r||s!==47)}tv.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=ti(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=ti(this.sliceSerialize(t)).toLowerCase(),s.label=r}function Ex(t){this.exit(t)}function kx(){return"["}function tv(t,r,s,l){const d=s.createTracker(l);let v=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return v+=d.move(s.safe(s.associationId(t),{after:"]",before:v})),o(),f(),v+=d.move("]"),v}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:tv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,v,f){const o=v.createTracker(f);let c=o.move("[^");const u=v.enter("footnoteDefinition"),p=v.enter("label");return c+=o.move(v.safe(v.associationId(l),{before:c,after:"]"})),p(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
|
|
76
|
+
`:" ")+v.indentLines(v.containerFlow(l,o.current()),r?nv:Rx))),u(),c}}function Rx(t,r,s){return r===0?t:nv(t,r,s)}function nv(t,r,s){return(s?"":" ")+t}const Dx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];iv.peek=jx;function Mx(){return{canContainEols:["delete"],enter:{strikethrough:Ox},exit:{strikethrough:Bx}}}function Lx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Dx}],handlers:{delete:iv}}}function Ox(t){this.enter({type:"delete",children:[]},t)}function Bx(t){this.exit(t)}function iv(t,r,s,l){const d=s.createTracker(l),v=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(t,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),v(),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,v=[],f=[],o=[],c=[];let u=0,p=-1;for(;++p<t.length;){const k=[],y=[];let _=-1;for(t[p].length>u&&(u=t[p].length);++_<t[p].length;){const g=zx(t[p][_]);if(s.alignDelimiters!==!1){const b=d(g);y[_]=b,(c[_]===void 0||b>c[_])&&(c[_]=b)}k.push(g)}f[p]=k,o[p]=y}let h=-1;if(typeof l=="object"&&"length"in l)for(;++h<u;)v[h]=Ug(l[h]);else{const k=Ug(l);for(;++h<u;)v[h]=k}h=-1;const S=[],w=[];for(;++h<u;){const k=v[h];let y="",_="";k===99?(y=":",_=":"):k===108?y=":":k===114&&(_=":");let g=s.alignDelimiters===!1?1:Math.max(1,c[h]-y.length-_.length);const b=y+"-".repeat(g)+_;s.alignDelimiters!==!1&&(g=y.length+g+_.length,g>c[h]&&(c[h]=g),w[h]=g),S[h]=b}f.splice(1,0,S),o.splice(1,0,w),p=-1;const T=[];for(;++p<f.length;){const k=f[p],y=o[p];h=-1;const _=[];for(;++h<u;){const g=k[h]||"";let b="",E="";if(s.alignDelimiters!==!1){const L=c[h]-(y[h]||0),R=v[h];R===114?b=" ".repeat(L):R===99?L%2?(b=" ".repeat(L/2+.5),E=" ".repeat(L/2-.5)):(b=" ".repeat(L/2),E=b):E=" ".repeat(L)}s.delimiterStart!==!1&&!h&&_.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&g==="")&&(s.delimiterStart!==!1||h)&&_.push(" "),s.alignDelimiters!==!1&&_.push(b),_.push(g),s.alignDelimiters!==!1&&_.push(E),s.padding!==!1&&_.push(" "),(s.delimiterEnd!==!1||h!==u-1)&&_.push("|")}T.push(s.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.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"),v=s.createTracker(l);v.move("> "),v.shift(2);const f=s.indentLines(s.containerFlow(t,v.current()),Px);return d(),f}function Px(t,r,s){return">"+(s?"":" ")+t}function Ux(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
|
+
`&&Ux(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,v=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===d?++v>f&&(f=v):v=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),v=t.value||"",f=d==="`"?"GraveAccent":"Tilde";if(qx(t,s)){const h=s.enter("codeIndented"),S=s.indentLines(v,Vx);return h(),S}const o=s.createTracker(l),c=d.repeat(Math.max(Fx(v,d)+1,3)),u=s.enter("codeFenced");let p=o.move(c);if(t.lang){const h=s.enter(`codeFencedLang${f}`);p+=o.move(s.safe(t.lang,{before:p,after:" ",encode:["`"],...o.current()})),h()}if(t.lang&&t.meta){const h=s.enter(`codeFencedMeta${f}`);p+=o.move(" "),p+=o.move(s.safe(t.meta,{before:p,after:`
|
|
80
|
+
`,encode:["`"],...o.current()})),h()}return p+=o.move(`
|
|
81
|
+
`),v&&(p+=o.move(v+`
|
|
82
|
+
`)),p+=o.move(c),u(),p}function Vx(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 Wx(t,r,s,l){const d=ef(s),v=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let o=s.enter("label");const c=s.createTracker(l);let u=c.move("[");return u+=c.move(s.safe(s.associationId(t),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=s.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(s.safe(t.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=s.enter("destinationRaw"),u+=c.move(s.safe(t.url,{before:u,after:t.title?" ":`
|
|
83
|
+
`,...c.current()}))),o(),t.title&&(o=s.enter(`title${v}`),u+=c.move(" "+d),u+=c.move(s.safe(t.title,{before:u,after:d,...c.current()})),u+=c.move(d),o()),f(),u}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 rl(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Lo(t,r,s){const l=qs(t),d=qs(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=Yx;function rv(t,r,s,l){const d=Kx(s),v=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 u=c.charCodeAt(0),p=Lo(l.before.charCodeAt(l.before.length-1),u,d);p.inside&&(c=rl(u)+c.slice(1));const h=c.charCodeAt(c.length-1),S=Lo(l.after.charCodeAt(0),h,d);S.inside&&(c=c.slice(0,-1)+rl(h));const w=f.move(d);return v(),s.attentionEncodeSurroundingInfo={after:S.outside,before:p.outside},o+c+w}function Yx(t,r,s){return s.options.emphasis||"*"}function Xx(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 Qx(t,r,s,l){const d=Math.max(Math.min(6,t.depth||1),1),v=s.createTracker(l);if(Xx(t,s)){const p=s.enter("headingSetext"),h=s.enter("phrasing"),S=s.containerPhrasing(t,{...v.current(),before:`
|
|
84
|
+
`,after:`
|
|
85
|
+
`});return h(),p(),S+`
|
|
86
|
+
`+(d===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
|
|
87
|
+
`))+1))}const f="#".repeat(d),o=s.enter("headingAtx"),c=s.enter("phrasing");v.move(f+" ");let u=s.containerPhrasing(t,{before:"# ",after:`
|
|
88
|
+
`,...v.current()});return/^[\t ]/.test(u)&&(u=rl(u.charCodeAt(0))+u.slice(1)),u=u?f+" "+u:f,s.options.closeAtx&&(u+=" "+f),c(),o(),u}sv.peek=Jx;function sv(t){return t.value||""}function Jx(){return"<"}av.peek=Zx;function av(t,r,s,l){const d=ef(s),v=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let o=s.enter("label");const c=s.createTracker(l);let u=c.move("![");return u+=c.move(s.safe(t.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=s.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(s.safe(t.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=s.enter("destinationRaw"),u+=c.move(s.safe(t.url,{before:u,after:t.title?" ":")",...c.current()}))),o(),t.title&&(o=s.enter(`title${v}`),u+=c.move(" "+d),u+=c.move(s.safe(t.title,{before:u,after:d,...c.current()})),u+=c.move(d),o()),u+=c.move(")"),f(),u}function Zx(){return"!"}lv.peek=eE;function lv(t,r,s,l){const d=t.referenceType,v=s.enter("imageReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("![");const u=s.safe(t.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const h=s.safe(s.associationId(t),{before:c,after:"]",...o.current()});return f(),s.stack=p,v(),d==="full"||!u||u!==h?c+=o.move(h+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function eE(){return"!"}ov.peek=tE;function ov(t,r,s){let l=t.value||"",d="`",v=-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+" ");++v<s.unsafe.length;){const f=s.unsafe[v],o=s.compilePattern(f);let c;if(f.atBreak)for(;c=o.exec(l);){let u=c.index;l.charCodeAt(u)===10&&l.charCodeAt(u-1)===13&&u--,l=l.slice(0,u)+" "+l.slice(c.index+1)}}return d+l+d}function tE(){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=nE;function uv(t,r,s,l){const d=ef(s),v=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(cv(t,s)){const p=s.stack;s.stack=[],o=s.enter("autolink");let h=f.move("<");return h+=f.move(s.containerPhrasing(t,{before:h,after:">",...f.current()})),h+=f.move(">"),o(),s.stack=p,h}o=s.enter("link"),c=s.enter("label");let u=f.move("[");return u+=f.move(s.containerPhrasing(t,{before:u,after:"](",...f.current()})),u+=f.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=s.enter("destinationLiteral"),u+=f.move("<"),u+=f.move(s.safe(t.url,{before:u,after:">",...f.current()})),u+=f.move(">")):(c=s.enter("destinationRaw"),u+=f.move(s.safe(t.url,{before:u,after:t.title?" ":")",...f.current()}))),c(),t.title&&(c=s.enter(`title${v}`),u+=f.move(" "+d),u+=f.move(s.safe(t.title,{before:u,after:d,...f.current()})),u+=f.move(d),c()),u+=f.move(")"),o(),u}function nE(t,r,s){return cv(t,s)?"<":"["}hv.peek=iE;function hv(t,r,s,l){const d=t.referenceType,v=s.enter("linkReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("[");const u=s.containerPhrasing(t,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const h=s.safe(s.associationId(t),{before:c,after:"]",...o.current()});return f(),s.stack=p,v(),d==="full"||!u||u!==h?c+=o.move(h+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function iE(){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 rE(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 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 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 aE(t,r,s,l){const d=s.enter("list"),v=s.bulletCurrent;let f=t.ordered?sE(s):tf(s);const o=t.ordered?f==="."?")":".":rE(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!t.ordered){const p=t.children?t.children[0]:void 0;if((f==="*"||f==="-")&&p&&(!p.children||!p.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(c=!0),fv(s)===f&&p){let h=-1;for(;++h<t.children.length;){const S=t.children[h];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=o),s.bulletCurrent=f;const u=s.containerFlow(t,l);return s.bulletLastUsed=f,s.bulletCurrent=v,d(),u}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 v=s.bulletCurrent||tf(s);r&&r.type==="list"&&r.ordered&&(v=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(t))+v);let f=v.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(v+" ".repeat(f-v.length)),o.shift(f);const c=s.enter("listItem"),u=s.indentLines(s.containerFlow(t,o.current()),p);return c(),u;function p(h,S,w){return S?(w?"":" ".repeat(f))+h:(w?v:v+" ".repeat(f-v.length))+h}}function cE(t,r,s,l){const d=s.enter("paragraph"),v=s.enter("phrasing"),f=s.containerPhrasing(t,l);return v(),d(),f}const uE=Uo(["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}dv.peek=dE;function dv(t,r,s,l){const d=fE(s),v=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 u=c.charCodeAt(0),p=Lo(l.before.charCodeAt(l.before.length-1),u,d);p.inside&&(c=rl(u)+c.slice(1));const h=c.charCodeAt(c.length-1),S=Lo(l.after.charCodeAt(0),h,d);S.inside&&(c=c.slice(0,-1)+rl(h));const w=f.move(d+d);return v(),s.attentionEncodeSurroundingInfo={after:S.outside,before:p.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=(fv(s)+(s.options.ruleSpaces?" ":"")).repeat(mE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const pv={blockquote:Ix,break:qg,code:Gx,definition:Wx,emphasis:rv,hardBreak:qg,heading:Qx,html:sv,image:av,imageReference:lv,inlineCode:ov,link:uv,linkReference:hv,list:aE,listItem:oE,paragraph:cE,root:hE,strong:dv,text:pE,thematicBreak:gE};function _E(){return{enter:{table:vE,tableData:$g,tableHeader:$g,tableRow:SE},exit:{codeText:bE,table:yE,tableData:gh,tableHeader:gh,tableRow:gh}}}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 gh(t){this.exit(t)}function $g(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,v=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
89
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:f,tableCell:c,tableRow:o}};function f(w,T,k,y){return u(p(w,k,y),w.align)}function o(w,T,k,y){const _=h(w,k,y),g=u([_]);return g.slice(0,g.indexOf(`
|
|
90
|
+
`))}function c(w,T,k,y){const _=k.enter("tableCell"),g=k.enter("phrasing"),b=k.containerPhrasing(w,{...y,before:v,after:v});return g(),_(),b}function u(w,T){return Hx(w,{align:T,alignDelimiters:l,padding:s,stringLength:d})}function p(w,T,k){const y=w.children;let _=-1;const g=[],b=T.enter("table");for(;++_<y.length;)g[_]=h(y[_],T,k);return b(),g}function h(w,T,k){const y=w.children;let _=-1;const g=[],b=T.enter("tableRow");for(;++_<y.length;)g[_]=c(y[_],w,T,k);return b(),g}function S(w,T,k){let y=pv.inlineCode(w,T,k);return k.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function xE(){return{exit:{taskListCheckValueChecked:Gg,taskListCheckValueUnchecked:Gg,paragraph:kE}}}function EE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:AE}}}function Gg(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 v=-1,f;for(;++v<d.length;){const o=d[v];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],v=typeof t.checked=="boolean"&&d&&d.type==="paragraph",f="["+(t.checked?"x":" ")+"] ",o=s.createTracker(l);v&&o.move(f);let c=pv.listItem(t,r,s,{...l,...o.current()});return v&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(p){return p+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},mv={tokenize:HE,partial:!0},gv={tokenize:zE,partial:!0},_v={tokenize:IE,partial:!0},ME={tokenize:PE,partial:!0},vv={name:"wwwAutolink",tokenize:BE,previous:Sv},yv={name:"protocolAutolink",tokenize:jE,previous:bv},Ni={name:"emailAutolink",tokenize:OE,previous:Cv},hi={};function LE(){return{text:hi}}let Fr=48;for(;Fr<123;)hi[Fr]=Ni,Fr++,Fr===58?Fr=65:Fr===91&&(Fr=97);hi[43]=Ni;hi[45]=Ni;hi[46]=Ni;hi[95]=Ni;hi[72]=[Ni,yv];hi[104]=[Ni,yv];hi[87]=[Ni,vv];hi[119]=[Ni,vv];function OE(t,r,s){const l=this;let d,v;return f;function f(h){return!Oh(h)||!Cv.call(l,l.previous)||nf(l.events)?s(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(h))}function o(h){return Oh(h)?(t.consume(h),o):h===64?(t.consume(h),c):s(h)}function c(h){return h===46?t.check(ME,p,u)(h):h===45||h===95||en(h)?(v=!0,t.consume(h),c):p(h)}function u(h){return t.consume(h),d=!0,c}function p(h){return v&&d&&cn(l.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),r(h)):s(h)}}function BE(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(DE,t.attempt(mv,t.attempt(gv,v),s),s)(f))}function v(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),r(f)}}function jE(t,r,s){const l=this;let d="",v=!1;return f;function f(h){return(h===72||h===104)&&bv.call(l,l.previous)&&!nf(l.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),d+=String.fromCodePoint(h),t.consume(h),o):s(h)}function o(h){if(cn(h)&&d.length<5)return d+=String.fromCodePoint(h),t.consume(h),o;if(h===58){const S=d.toLowerCase();if(S==="http"||S==="https")return t.consume(h),c}return s(h)}function c(h){return h===47?(t.consume(h),v?u:(v=!0,c)):s(h)}function u(h){return h===null||Ro(h)||ft(h)||Gr(h)||zo(h)?s(h):t.attempt(mv,t.attempt(gv,p),s)(h)}function p(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),r(h)}}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),v):s(f)}function v(f){return f===null?s(f):r(f)}}function HE(t,r,s){let l,d,v;return f;function f(u){return u===46||u===95?t.check(_v,c,o)(u):u===null||ft(u)||Gr(u)||u!==45&&zo(u)?c(u):(v=!0,t.consume(u),f)}function o(u){return u===95?l=!0:(d=l,l=void 0),t.consume(u),f}function c(u){return d||l||!v?s(u):r(u)}}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?v(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?t.check(_v,r,v)(f):f===null||ft(f)||Gr(f)?r(f):(t.consume(f),d)}function v(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),v):o===93?(t.consume(o),d):o===60||o===null||ft(o)||Gr(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ft(o)||Gr(o)?r(o):l(o)}function v(o){return cn(o)?f(o):s(o)}function f(o){return o===59?(t.consume(o),l):cn(o)?(t.consume(o),f):s(o)}}function PE(t,r,s){return l;function l(v){return t.consume(v),d}function d(v){return en(v)?s(v):r(v)}}function Sv(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ft(t)}function bv(t){return!cn(t)}function Cv(t){return!(t===47||Oh(t))}function Oh(t){return t===43||t===45||t===46||t===95||en(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 UE={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 v=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 u=ti(l.sliceSerialize({start:f.end,end:l.now()}));return u.codePointAt(0)!==94||!v.includes(u.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 v={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},t[t.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},v.start),end:Object.assign({},v.end)},o=[t[s+1],t[s+2],["enter",l,r],t[s+3],t[s+4],["enter",d,r],["exit",d,r],["enter",v,r],["enter",f,r],["exit",f,r],["exit",v,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 v=0,f;return o;function o(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?s(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(h){if(v>999||h===93&&!f||h===null||h===91||ft(h))return s(h);if(h===93){t.exit("chunkString");const S=t.exit("gfmFootnoteCallString");return d.includes(ti(l.sliceSerialize(S)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),r):s(h)}return ft(h)||(f=!0),v++,t.consume(h),h===92?p:u}function p(h){return h===91||h===92||h===93?(t.consume(h),v++,u):u(h)}}function VE(t,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let v,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"),u}function u(T){return T===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",p):s(T)}function p(T){if(f>999||T===93&&!o||T===null||T===91||ft(T))return s(T);if(T===93){t.exit("chunkString");const k=t.exit("gfmFootnoteDefinitionLabelString");return v=ti(l.sliceSerialize(k)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),S}return ft(T)||(o=!0),f++,t.consume(T),T===92?h:p}function h(T){return T===91||T===92||T===93?(t.consume(T),f++,p):p(T)}function S(T){return T===58?(t.enter("definitionMarker"),t.consume(T),t.exit("definitionMarker"),d.includes(v)||d.push(v),Ze(t,w,"gfmFootnoteDefinitionWhitespace")):s(T)}function w(T){return r(T)}}function WE(t,r,s){return t.check(ll,r,t.attempt(UE,r,s))}function KE(t){t.exit("gfmFootnoteDefinition")}function YE(t,r,s){const l=this;return Ze(t,d,"gfmFootnoteDefinitionIndent",5);function d(v){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(v):s(v)}}function XE(t){let s=(t||{}).singleTilde;const l={name:"strikethrough",tokenize:v,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 u=c;for(;u--;)if(f[u][0]==="exit"&&f[u][1].type==="strikethroughSequenceTemporary"&&f[u][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[u][1].end.offset-f[u][1].start.offset){f[c][1].type="strikethroughSequence",f[u][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},f[u][1].start),end:Object.assign({},f[c][1].end)},h={type:"strikethroughText",start:Object.assign({},f[u][1].end),end:Object.assign({},f[c][1].start)},S=[["enter",p,o],["enter",f[u][1],o],["exit",f[u][1],o],["enter",h,o]],w=o.parser.constructs.insideSpan.null;w&&Bn(S,S.length,0,Io(w,f.slice(u+1,c),o)),Bn(S,S.length,0,[["exit",h,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",p,o]]),Bn(f,u-1,c-u+3,S),c=u+S.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function v(f,o,c){const u=this.previous,p=this.events;let h=0;return S;function S(T){return u===126&&p[p.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const k=qs(u);if(T===126)return h>1?c(T):(f.consume(T),h++,w);if(h<2&&!s)return c(T);const y=f.exit("strikethroughSequenceTemporary"),_=qs(T);return y._open=!_||_===2&&!!k,y._close=!k||k===2&&!!_,o(T)}}}class QE{constructor(){this.map=[]}add(r,s,l){JE(this,r,s,l)}consume(r){if(this.map.sort(function(v,f){return v[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const 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 v of d)r.push(v);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 v=l.length-1;l[v]=l[v]==="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,v=0,f;return o;function o(O){let H=l.events.length-1;for(;H>-1;){const K=l.events[H][1].type;if(K==="lineEnding"||K==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?R:c;return P===R&&l.parser.lazy[l.now().line]?s(O):P(O)}function c(O){return t.enter("tableHead"),t.enter("tableRow"),u(O)}function u(O){return O===124||(f=!0,v+=1),p(O)}function p(O){return O===null?s(O):Oe(O)?v>1?(v=0,l.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),w):s(O):We(O)?Ze(t,p,"whitespace")(O):(v+=1,f&&(f=!1,d+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),f=!0,p):(t.enter("data"),h(O)))}function h(O){return O===null||O===124||ft(O)?(t.exit("data"),p(O)):(t.consume(O),O===92?S:h)}function S(O){return O===92||O===124?(t.consume(O),h):h(O)}function w(O){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(O):(t.enter("tableDelimiterRow"),f=!1,We(O)?Ze(t,T,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):T(O))}function T(O){return O===45||O===58?y(O):O===124?(f=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),k):L(O)}function k(O){return We(O)?Ze(t,y,"whitespace")(O):y(O)}function y(O){return O===58?(v+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),_):O===45?(v+=1,_(O)):O===null||Oe(O)?E(O):L(O)}function _(O){return O===45?(t.enter("tableDelimiterFiller"),g(O)):L(O)}function g(O){return O===45?(t.consume(O),g):O===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(O))}function b(O){return We(O)?Ze(t,E,"whitespace")(O):E(O)}function E(O){return O===124?T(O):O===null||Oe(O)?!f||d!==v?L(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),r(O)):L(O)}function L(O){return s(O)}function R(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||Oe(O)?(t.exit("tableRow"),r(O)):We(O)?Ze(t,D,"whitespace")(O):(t.enter("data"),A(O))}function A(O){return O===null||O===124||ft(O)?(t.exit("data"),D(O)):(t.consume(O),O===92?M:A)}function M(O){return O===92||O===124?(t.consume(O),A):A(O)}}function n2(t,r){let s=-1,l=!0,d=0,v=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,u,p,h;const S=new QE;for(;++s<t.length;){const w=t[s],T=w[1];w[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(Vg(S,r,c,u,p),p=void 0,c=0),u={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},S.add(s,0,[["enter",u,r]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(l=!0,h=void 0,v=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},S.add(s,0,[["enter",p,r]])),d=T.type==="tableDelimiterRow"?2:p?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(v[1]!==0&&(f[0]=f[1],h=xo(S,r,v,d,void 0,h),v=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(l?l=!1:(v[1]!==0&&(f[0]=f[1],h=xo(S,r,v,d,void 0,h)),v=f,f=[v[1],s,0,0])):T.type==="tableHead"?(o=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,v[1]!==0?(f[0]=f[1],h=xo(S,r,v,d,s,h)):f[1]!==0&&(h=xo(S,r,f,d,s,h)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Vg(S,r,c,u,p),S.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 xo(t,r,s,l,d,v){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(v.end=Object.assign({},Ps(r.events,s[0])),t.add(s[0],0,[["exit",v,r]]));const c=Ps(r.events,s[1]);if(v={type:f,start:Object.assign({},c),end:Object.assign({},c)},t.add(s[1],0,[["enter",v,r]]),s[2]!==0){const u=Ps(r.events,s[2]),p=Ps(r.events,s[3]),h={type:o,start:Object.assign({},u),end:Object.assign({},p)};if(t.add(s[2],0,[["enter",h,r]]),l!==2){const S=r.events[s[2]],w=r.events[s[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",s[3]>s[2]+1){const T=s[2]+1,k=s[3]-s[2]-1;t.add(T,k,[])}}t.add(s[3]+1,0,[["exit",h,r]])}return d!==void 0&&(v.end=Object.assign({},Ps(r.events,d)),t.add(d,0,[["exit",v,r]]),v=void 0),v}function Vg(t,r,s,l,d){const v=[],f=Ps(r.events,s);d&&(d.end=Object.assign({},f),v.push(["exit",d,r])),l.end=Object.assign({},f),v.push(["exit",l,r]),t.add(s+1,0,v)}function Ps(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"),v)}function v(c){return ft(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):s(c)}function o(c){return Oe(c)?r(c):We(c)?t.check({tokenize:a2},r,s)(c):s(c)}}function a2(t,r,s){return Ze(t,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function l2(t){return L_([LE(),FE(),XE(t),e2(),r2()])}const o2={};function wv(t){const r=this,s=t||o2,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),v=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(l2(s)),v.push(TE()),f.push(RE(s))}const xv=1e3,Us=new Map;let Za;function c2(t,r,s){const l=Symbol(t),d=Math.max(xv,s.intervalMs),v=Date.now();return Us.set(t,{id:t,intervalMs:d,nextRunAt:s.runImmediately===!1?v+d:v,inFlight:!1,run:r,token:l}),u2(),Ev(),()=>{const f=Us.get(t);(f==null?void 0:f.token)===l&&(Us.delete(t),Us.size===0&&Za!==void 0&&(window.clearInterval(Za),Za=void 0))}}function u2(){Za!==void 0||typeof window>"u"||(Za=window.setInterval(()=>{Ev()},xv))}async function Ev(){const t=Date.now();for(const r of Us.values())r.inFlight||r.nextRunAt>t||h2(r)}async function h2(t){t.inFlight=!0;try{await t.run()}catch{}finally{const r=Us.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 c2(t,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[t,s.enabled,s.intervalMs,s.runImmediately])}const Oo=`
|
|
91
|
+
|
|
92
|
+
--- Translation ---
|
|
93
|
+
`;function f2({active:t=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:v,panelState:f,onClearSession:o,onEntry:c,onFailures:u}){const[p,h]=ee.useState(""),[S,w]=ee.useState(""),[T,k]=ee.useState(!1),[y,_]=ee.useState(Date.now()),[g,b]=ee.useState(!1),[,E]=ji(""),L=ee.useRef(null),R=f.entries,D=f.failures,A=f.status;ee.useEffect(()=>{if(!t)return;const N=L.current;if(!N)return;const q=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame(q)},[t,R]);const M=S2(R);ee.useEffect(()=>{if(!M)return;_(Date.now());const N=window.setInterval(()=>_(Date.now()),250);return()=>window.clearInterval(N)},[M]);async function O(N=!1){const q=p;b(!0),E(""),k(!1);try{const I=await ye.translateUserInput(l,d,{text:q,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});I.sent?(h(""),k(!1)):(h(Av(q,I.englishPreview)),k(!0))}catch(I){E(ht("Translate composer input",I))}finally{b(!1)}}async function H(){const N=S.trim();if(N){b(!0),E("");try{const q=await ye.translateManualOutput(l,d,{text:N});c(v,d,q),w("")}catch(q){E(ht("Translate pasted English output",q))}finally{b(!1)}}}async function U(){b(!0),E("");try{const N=await ye.translateLatestReply(l,d);c(v,d,N)}catch(N){E(ht("Translate final reply",N))}finally{b(!1)}}async function P(){const N=T?Kg(p):p;if(N.trim()){b(!0),E("");try{await ye.sendTranslatedInput(l,d,{englishText:N}),h(""),k(!1)}catch(q){E(ht("Send translated English input to role",q))}finally{b(!1)}}}function K(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!g&&p.trim()&&(T?P():O(r)))}async function G(){o(v,d),await ye.clearTranslationSession(v).catch(N=>E(ht("Clear conversation translation panel",N)))}async function V(){b(!0),E("");try{const N=await ye.ignoreTranslationFailures(v);u(v,d,N.failures)}catch(N){E(ht("Ignore failed conversation translations",N))}finally{b(!1)}}async function Y(N){b(!0),E("");try{const q=await ye.retryTranslation(v,N.translationId);c(v,d,q)}catch(q){E(ht("Retry latest failed conversation translation",q))}finally{b(!1)}}const te=b2(R,A,y),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:g,onClick:()=>void V(),children:["Ignore ",z]}),j?x.jsx("button",{type:"button",disabled:g,onClick:()=>void Y(j),children:"Retry latest"}):null]}):null,x.jsx("button",{type:"button",disabled:g,onClick:()=>void U(),children:"Translate final reply"}),x.jsx("button",{type:"button",onClick:()=>void G(),children:"Clear"})]})]}),x.jsx("div",{className:"translation-status-row",children:x.jsxs("p",{children:["Claude Code · target ",d2(s)," · ",te]})})]}),x.jsx("div",{className:"translation-manual-panel",children:x.jsxs("div",{className:"translation-composer-row translation-manual-row",children:[x.jsx("textarea",{value:S,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:g||!S.trim(),onClick:()=>void H(),children:"Translate"})})]})}),x.jsxs("div",{className:"translation-entry-list",ref:L,children:[R.length===0?x.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,R.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:p,onChange:N=>{h(N.target.value),(!N.target.value.trim()||T&&!x2(N.target.value))&&k(!1)},onKeyDown:K,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:g||!T||!Kg(p).trim(),onClick:()=>void P(),children:"Send English"})})]})})]})}function d2(t){var r;return((r=h_.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),v=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||v>=s)&&(r=l,s=v)}return r}function m2({open:t,taskSlug:r,targetLanguage:s,onClose:l}){const[d,v]=ee.useState(!1),[,f]=ji(""),[o,c]=ee.useState(null),[u,p]=ee.useState(""),[h,S]=ee.useState(""),[w,T]=ee.useState(""),[k,y]=ee.useState(!1),[_,g]=ee.useState(null),[b,E]=ee.useState(""),[L,R]=ee.useState(""),[D,A]=ee.useState(""),[M,O]=ee.useState(!1);sl(t?`file-translation:${u||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(V=!1){try{const Y=await ye.getTranslationState();c(Y);const te=u?Y.fileIndex.jobs.some(z=>z.id===u):!1;if((!u||!te)&&Y.fileIndex.jobs[0])U(Y.fileIndex.jobs[0].id);else if(!Y.fileIndex.jobs[0])p(""),S(""),T("");else if(V&&u){const z=await ye.readFileTranslation(u);S(z.output),T(z.report)}}catch(Y){f(ht("Load file translation list",Y))}}async function U(V){p(V),S(""),T("");try{const Y=await ye.readFileTranslation(V);S(Y.output),T(Y.report)}catch(Y){f(ht(`Read translated file ${V}`,Y))}}async function P(){y(!0),await K(b,L)}async function K(V="",Y=""){O(!0),f("");try{const te=await ye.browseTranslationSourceFiles({path:V,query:Y,limit:250});g(te),E(te.currentPath),R(Y)}catch(te){f(ht("Browse translation source files",te))}finally{O(!1)}}async function G(V=D){const Y=V.trim();if(Y){v(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const te=await ye.createFileTranslation({taskSlug:r,sourcePath:Y,targetLanguage:s});y(!1),await H(),await U(te.id)}catch(te){f(ht(`Create file translation for ${Y}`,te))}finally{v(!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:u,output:h,report:w,onClose:()=>{y(!1),l()},onRefresh:()=>void H(),onSelectJob:V=>void U(V),onTranslate:()=>void P()})}),k?x.jsx(g2,{busy:d||M,state:_,currentPath:b,query:L,selectedPath:D,onBrowse:(V,Y)=>void K(V,Y),onClose:()=>y(!1),onQueryChange:R,onSelectPath:A,onTranslate:()=>void G()}):null]}):null}function g2({busy:t,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:v,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:u}){const p=(r==null?void 0:r.entries)??[],h=p.filter(w=>w.type==="directory"),S=p.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:()=>v((r==null?void 0:r.parentPath)??"",""),children:"Up"}),x.jsx("button",{type:"button",disabled:t||!s,onClick:()=>v("",""),children:"Root"})]}),x.jsxs("form",{className:"translation-file-browser-search",onSubmit:w=>{w.preventDefault(),v(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:()=>v(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&&p.length===0?x.jsx("p",{className:"muted",children:"No source files found."}):null,h.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Folders"}),h.map(w=>x.jsx(Wg,{entry:w,selected:d===w.path,onBrowse:v,onSelectPath:c},w.path))]}):null,S.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Files"}),S.map(w=>x.jsx(Wg,{entry:w,selected:d===w.path,onBrowse:v,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:u,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 _2({busy:t,state:r,selectedJobId:s,output:l,report:d,onClose:v,onRefresh:f,onSelectJob:o,onTranslate:c}){const u=(r==null?void 0:r.fileIndex.jobs)??[],p=u.find(h=>h.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:v,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:[u.length===0?x.jsx("p",{className:"muted",children:"No translated files yet."}):null,u.map(h=>x.jsxs("button",{className:h.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>o(h.id),children:[x.jsx("strong",{children:h.sourcePath}),x.jsxs("span",{children:[h.status," · ",h.targetLanguage]})]},h.id))]}),x.jsx("div",{className:"file-translation-preview",children:p?x.jsxs(x.Fragment,{children:[x.jsxs("header",{children:[x.jsx("strong",{children:p.sourcePath}),x.jsx("span",{children:p.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 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(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 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(kv);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function b2(t,r,s){const l=t.find(kv);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 kv(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"?Av(t.sourceText,t.translatedText):t.translatedText:t.translatedText||t.sourceText}function Av(t,r){return`${t.trimEnd()}${Oo}${r.trimStart()}`}function x2(t){return t.includes(Oo)}function Kg(t){const r=t.indexOf(Oo);return r===-1?t:t.slice(r+Oo.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=v=>{var c,u;const f=(u=(c=v.detail)==null?void 0:c.message)==null?void 0:u.trim();if(!f)return;const o=new Date().toISOString();r(p=>{const h=p.find(S=>S.message===f);return h?[{...h,count:h.count+1,updatedAt:o},...p.filter(S=>S.id!==h.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...p].slice(0,A2)})},l=v=>{var o;const f=((o=v.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(u=>!f.some(p=>u.message.startsWith(`${p} failed.`))))},d=v=>{var o,c;const f=(c=(o=v.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(u=>u.filter(p=>p.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:[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.roundId??t.startedAt??t.taskSlug,s=t.stoppedAt??t.lastTurnEndedAt??"stopped";return`${r}:${s}`}function B2(t){return t?"strong":"none"}function j2(t,r){if(!r)return{observation:t,dismissPauseAlert:!1};const s=r.lastPmInputMessageId??null;return t.initialized?{observation:{initialized:!0,messageId:s},dismissPauseAlert:!!(r.enabled&&s&&s!==t.messageId)}:{observation:{initialized:!0,messageId:s},dismissPauseAlert:!1}}const N2=3,H2=3e4,Ao=new Map;function Tv(t,r){const s=ht(t,r);if(!z2(r))return Ao.set(t,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=Ao.get(t),d=((l==null?void 0:l.consecutiveFailures)??0)+1,v=Date.now(),f=d>=N2&&(!l||l.lastMessage!==s||v-l.lastReportedAt>=H2);return Ao.set(t,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?v:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Bo(t){Ao.delete(t),p1([t])}function z2(t){const r=No(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 I2=["architecture-plan","validation-adequacy","code-diff"];function P2({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,v)=>x.jsx("li",{children:d},`${d}-${v}`))})]})}function jn({checked:t,className:r,disabled:s,label:l,stateLabel:d,title:v,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:v,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 U2({status:t,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,autoMemoryEnabled:v,modelOptions:f,busy:o=!1,onRefresh:c,onApply:u,onOpenStudio:p,onOpenRepositoryDiff:h,onAutoTaskHarnessReviewChange:S,onAutoMemoryChange:w,onStartBootstrap:T,onRestartBootstrap:k,onStopBootstrap:y,onRunBootstrap:_}){const[g,b]=ee.useState(!1),[E,L]=ee.useState("bypassPermissions"),[R,D]=ee.useState("default"),[A,M]=ee.useState("default"),O=r==null?void 0:r.session,H=(r==null?void 0:r.status)==="running",U=(O==null?void 0:O.status)==="running",P=(r==null?void 0:r.status)!=="complete",K={permissionMode:E,model:R,effort:A};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:o,onClick:()=>void c(),children:"Refresh"}),t.needsApply?x.jsx("button",{type:"button",disabled:o,onClick:()=>void u(),children:"Update"}):null]}):x.jsx("button",{type:"button",disabled:o,onClick:()=>void u(),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(G=>x.jsxs("li",{children:[x.jsx("span",{children:G.path}),x.jsx(ei,{status:G.action})]},`${G.path}:${G.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:o,onClick:p,children:"Open Studio"})})]}),x.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:o,onClick:h,children:"Review Diff"}),x.jsx(jn,{checked:d,className:"sidebar-switch",disabled:o,label:"Auto task harness review",title:"Automatically ask Harness Engineer to review task harness after final acceptance completes",onChange:S}),x.jsx(jn,{checked:v,className:"sidebar-switch",disabled:o,label:"Auto memory",title:"Collect role memory drafts after Final Acceptance and let Harness Engineer apply reviewed memory",onChange:w})]}),P?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?F2(r.status):"not loaded"})]}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:o||!(r!=null&&r.canStart),onClick:()=>{b(!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(G=>x.jsx("li",{children:G},G))}):null,r!=null&&r.warnings.length?x.jsx("ul",{className:"warnings",children:r.warnings.map(G=>x.jsx("li",{children:G},G))}):null,P&&g?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:(O==null?void 0:O.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),x.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[O?x.jsx(ei,{status:O.status}):null,x.jsx("button",{type:"button",onClick:()=>b(!1),children:"Close"})]})]}),x.jsxs("div",{className:"harness-bootstrap-controls",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:E,disabled:o||H||U,onChange:G=>L(G.target.value),children:f_.map(G=>x.jsx("option",{value:G.value,children:G.label},G.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:R,title:(()=>{const G=f.find(V=>V.value===R);return G!=null&&G.available?G.description:G==null?void 0:G.unavailableReason})(),disabled:o||H||U,onChange:G=>D(G.target.value),children:f.map(G=>x.jsx("option",{value:G.value,disabled:!G.available,title:G.available?G.description:G.unavailableReason,children:G.label},G.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:A,disabled:o||H||U,onChange:G=>M(G.target.value),children:p_.map(G=>x.jsx("option",{value:G.value,children:G.label},G.value))})]}),x.jsxs("div",{className:"harness-bootstrap-control-actions",children:[x.jsx("button",{type:"button",disabled:o||H||!(r!=null&&r.canStart),onClick:()=>void T(K),children:"Start"}),x.jsx("button",{type:"button",disabled:o||H||!(r!=null&&r.canStart),onClick:()=>void k(K),children:"Restart"}),x.jsx("button",{type:"button",disabled:o||!O,onClick:()=>void y(),children:"Stop"}),x.jsx("button",{type:"button",disabled:o||H||!U,onClick:()=>void _(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:U?x.jsx(Ho,{sessionId:O.id,active:g}):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 F2(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 q2(t,r=6){const s=[...t].sort(V2).map((d,v)=>({message:d,sequence:v+1}));return[...r===null?s:s.slice(-r)].sort((d,v)=>v.sequence-d.sequence)}function $2({messages:t,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:v=!0,onModeChange:f,onMarkAllDone:o}){const[c,u]=ee.useState(null),p=rf(t),h=(r==null?void 0:r.mode)??"auto",S=q2(t,l);async function w(T){await W2(T.body),u(T.id),window.setTimeout(()=>u(k=>k===T.id?null:k),1200)}return x.jsxs("section",{className:"message-panel",children:[v?x.jsxs("div",{className:"message-panel-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[p.total," total / ",p.accepted," accepted"]})]}),d&&f?x.jsx("div",{className:"message-controls",children:x.jsx(jn,{checked:h==="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:S.map(({message:T,sequence:k})=>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:["#",k]}),x.jsx("time",{dateTime:jo(T),children:G2(jo(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 G2(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 jo(t){return t.acceptedAt??t.deliveredAt??t.dispatchingAt??t.createdAt}function V2(t,r){const s=jo(t).localeCompare(jo(r));if(s!==0)return s;const l=t.createdAt.localeCompare(r.createdAt);return l!==0?l:t.id.localeCompare(r.id)}async function W2(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 K2({defaultPath:t="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,v]=ee.useState(t);ee.useEffect(()=>{t&&v(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=>v(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&&v(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 Y2({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(ei,{status:l.status})]},l.taskSlug))})}function X2({project:t,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:v,events:f,roundState:o,gateReview:c,translationEnabled:u,translationAutoSendEnabled:p,translationTargetLanguage:h,translationOutputMode:S,translationMemoryInitialized:w,translatorSession:T,harnessStatus:k,harnessBootstrapStatus:y,harnessApplyResult:_,autoTaskHarnessReviewEnabled:g,autoMemoryEnabled:b,gatewayStatus:E,gatewayQrLogin:L,gatewayQrCheck:R,gatewayLarkRegistration:D,gatewayLarkRegistrationCheck:A,ccrStatus:M,modelOptions:O,busy:H,onConnect:U,onRefreshConnectedRepository:P,onPullConnectedRepository:K,onRefreshHarness:G,onApplyHarness:V,onStartHarnessBootstrap:Y,onRestartHarnessBootstrap:te,onStopHarnessBootstrap:z,onRunHarnessBootstrap:j,onOpenHarnessStudio:N,onOpenRepositoryDiff:q,onAutoTaskHarnessReviewChange:I,onAutoMemoryChange:ie,onRefreshGateway:de,onGatewayEnabledChange:_e,onGatewaySettingsChange:Q,onCcrSettingsChange:$,onCcrCheck:ce,onGatewayTranslationChange:se,onGatewayConnectionChange:xe,onStartGatewayQrLogin:be,onStartGatewayLarkRegistration:je,onResetGatewayBinding:Ee,onGateReviewGateEnabledChange:me,onTranslationEnabledChange:Me,onTranslationAutoSendChange:Ae,onTranslationTargetLanguageChange:rt,onTranslationOutputModeChange:ge,onOpenFileTranslation:ze,onOpenTranslatorSession:Ke,onCreateTranslationBootstrap:zt,onUpdateTranslationMemory:pt,onCreateTask:mt,onCloseTask:Ot,onSelectTask:he,themeMode:Ce,onAutoOrchestrationChange:Te,onThemeModeChange:He,pauseAlertSound:Ie,onPauseAlertSoundChange:vt,roleRetryEnabled:Fe,onRoleRetryEnabledChange:Ct,permissionRequestMode:St,onPermissionRequestModeChange:Bt,launchTemplate:et,canSaveLaunchTemplate:Ut,canOneClickStart:nn,onSaveLaunchTemplate:Kr,onOneClickStart:Hi,onMarkAllMessagesDone:fi,onDeleteMessageHistory:zi}){const[Cn,di]=ee.useState(""),[Wn,ni]=ee.useState(!1),[un,Kn]=ee.useState(!1),[Ft,pi]=ee.useState(()=>l?null:"repository"),Ii=rf(d),hn=Cn.trim(),Pi=tk(t,l,k),mi=s.filter(Ne=>Ne.cleanupStatus!=="cleaned"),jt=mi.find(Ne=>Ne.taskSlug===l)??null;ee.useEffect(()=>{pi(Ne=>!l&&Ne===null?t?"task":"repository":Ne)},[l,t]);function rn(Ne,bt){pi(bt?Ne:null)}async function Ui(Ne){Ne.preventDefault(),await mt({taskSlug:hn}),di("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(qr,{title:"Repository",open:Ft==="repository",onOpenChange:Ne=>{rn("repository",Ne),Ne&&t&&P()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(K2,{defaultPath:(t==null?void 0:t.repoRoot)??"",recentPaths:r,busy:H,onConnect:U}),t?x.jsx(sk,{busy:H,project:t,onPull:K}):null]})}),x.jsx(qr,{title:"Settings",open:Ft==="settings",onOpenChange:Ne=>rn("settings",Ne),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Xg(Ce)}`,className:"settings-toggle theme-mode-toggle",disabled:H,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>He(uk(Ce)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Xg(Ce)})]}),x.jsx(jn,{checked:((v==null?void 0:v.mode)??"auto")==="auto",className:"sidebar-switch",disabled:H||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:Te}),x.jsx(jn,{checked:Ie,className:"sidebar-switch",disabled:H,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:Ne=>vt(Ne)}),x.jsx(jn,{checked:Fe,className:"sidebar-switch",disabled:H,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:Ne=>Ct(Ne)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:St,disabled:H,onChange:Ne=>Bt(Ne.target.value),children:[x.jsx("option",{value:"off",children:"off"}),x.jsx("option",{value:"allowAll",children:"allow all"})]})]}),x.jsx(J2,{busy:H,status:M,onCheck:ce,onSettingsChange:$}),x.jsxs("button",{className:"settings-toggle",disabled:H||!Ut,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:Kr,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:Ut?"ready":"open task"})]}),nn?x.jsxs("button",{className:"settings-toggle is-active",disabled:H,title:Q2(et),type:"button",onClick:Hi,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:Rv(et)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>ni(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Ii.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>Kn(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx(qr,{title:"Translation",open:Ft==="translation",onOpenChange:Ne=>rn("translation",Ne),children:x.jsx(Z2,{busy:H,enabled:u,autoSendEnabled:p,targetLanguage:h,outputMode:S,memoryInitialized:w,baseUnavailableReason:Pi,translatorSession:T,onAutoSendChange:Ae,onCreateBootstrap:zt,onEnabledChange:Me,onUpdateMemory:pt,onTargetLanguageChange:rt,onOutputModeChange:ge,onOpenFileTranslation:ze,onOpenTranslatorSession:Ke})}),t&&l?x.jsx(qr,{title:"Gate Review Gates",open:Ft==="gate-review-gates",onOpenChange:Ne=>rn("gate-review-gates",Ne),children:x.jsx(nk,{busy:H,state:c,onGateEnabledChange:me})}):null,x.jsx(qr,{title:"Gateway",open:Ft==="gateway",onOpenChange:Ne=>{rn("gateway",Ne),Ne&&de()},children:x.jsx(rk,{busy:H,qrCheck:R,qrLogin:L,larkRegistration:D,larkRegistrationCheck:A,status:E,onEnabledChange:_e,onSettingsChange:Q,onResetBinding:Ee,onStartLarkRegistration:je,onStartQrLogin:be,onTranslationChange:se,onConnectionChange:xe})}),t?x.jsx(qr,{title:"VCM Harness",open:Ft==="vcm-harness",onOpenChange:Ne=>rn("vcm-harness",Ne),children:x.jsx(U2,{status:k,bootstrapStatus:y,applyResult:_,hasActiveTask:!!jt,autoTaskHarnessReviewEnabled:g,autoMemoryEnabled:b,modelOptions:O,busy:H,onRefresh:G,onApply:V,onOpenStudio:N,onOpenRepositoryDiff:q,onAutoTaskHarnessReviewChange:I,onAutoMemoryChange:ie,onStartBootstrap:Y,onRestartBootstrap:te,onStopBootstrap:z,onRunBootstrap:j})}):null,t?x.jsx(qr,{title:"Task",open:Ft==="task",onOpenChange:Ne=>rn("task",Ne),children:mi.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(Y2,{tasks:mi,activeTaskSlug:l,onSelect:he}),jt?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:H,type:"button",onClick:Ot,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:Ui,children:[x.jsx("input",{value:Cn,onChange:Ne=>di(Ne.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",hn?`feature/${hn}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",hn?`.claude/worktrees/${hn}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:H||!hn,children:"Create"})]})})}):null,t&&jt?x.jsx(ok,{task:jt,roundState:o}):null,Wn?x.jsx(fk,{busy:H,messages:d,orchestration:v,onClose:()=>ni(!1),onMarkAllDone:()=>{l&&fi(l)},onDeleteMessageHistory:()=>{l&&zi(l)}}):null,un?x.jsx(hk,{events:f,onClose:()=>Kn(!1)}):null]})}function Rv(t){return[t.autoOrchestration?"auto":"manual"].join(" + ")}function Q2(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 J2({busy:t,status:r,onCheck:s,onSettingsChange:l}){const[d,v]=ee.useState(""),f=!!(r!=null&&r.apiKeyConfigured),o=async c=>{c.preventDefault();const u=d.trim();u&&(await l({apiKey:u}),v(""))};return x.jsxs("div",{className:"ccr-settings",children:[x.jsx(jn,{checked:!!(r!=null&&r.enabled),className:"sidebar-switch",disabled:t||!f,label:"CCR GPT models",title:f?"Enable GPT models through Claude Code Router":"Save the CCR API key first",onChange:c=>void l({enabled:c})}),x.jsxs("form",{className:"ccr-api-key-form",onSubmit:c=>void o(c),children:[x.jsx("label",{htmlFor:"ccr-api-key",children:"CCR API key"}),x.jsxs("div",{children:[x.jsx("input",{id:"ccr-api-key",type:"password",autoComplete:"off",disabled:t,placeholder:f?"Saved":"Required",value:d,onChange:c=>v(c.target.value)}),x.jsx("button",{type:"submit",disabled:t||!d.trim(),children:"Save"})]})]}),x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"CCR status"}),x.jsx("strong",{children:(r==null?void 0:r.connectionState)??"loading"})]}),x.jsxs("div",{className:"ccr-actions",children:[x.jsx("button",{type:"button",disabled:t||!(r!=null&&r.enabled),onClick:()=>void s(),children:"Check"}),x.jsx("button",{type:"button",disabled:t||!f,onClick:()=>void l({clearApiKey:!0}),children:"Clear key"})]}),r!=null&&r.error?x.jsx("p",{className:"settings-help-text",children:r.error}):null]})}function Z2({autoSendEnabled:t,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:v,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:u,onEnabledChange:p,onUpdateMemory:h,onOutputModeChange:S,onTargetLanguageChange:w,onOpenFileTranslation:T,onOpenTranslatorSession:k}){const y=!!(s||r),_=(o==null?void 0:o.status)==="running",g=!!(l&&!r&&_),b=r??(_?null:"Start Translator session first."),E=!!(s||b),R=r??"Open Translator session",D=b??"Translation tools are ready";return x.jsxs("div",{className:"sidebar-settings",children:[x.jsx(jn,{checked:g,className:"sidebar-switch",disabled:y||!_,label:"Conversation translation",title:D,onChange:p}),x.jsx(jn,{checked:t,className:"sidebar-switch",disabled:y,label:"Auto-send",onChange:c}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Language"}),x.jsx("select",{value:f,disabled:y,onChange:A=>w(A.target.value),children:h_.map(A=>x.jsx("option",{value:A.value,children:A.label},A.value))})]}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Reply scope"}),x.jsx("select",{value:v,disabled:y,onChange:A=>S(A.target.value),children:i1.map(A=>x.jsx("option",{value:A.value,children:A.label},A.value))})]}),x.jsxs("button",{className:"settings-toggle",disabled:E,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:E,title:D,type:"button",onClick:u,children:[x.jsx("span",{children:"Bootstrap"}),x.jsx("span",{children:"run"})]}),x.jsxs("button",{className:"settings-toggle",disabled:E,title:D,type:"button",onClick:h,children:[x.jsx("span",{children:"Update memory"}),x.jsx("span",{children:"run"})]}),b?x.jsx("p",{className:"settings-help-text",children:b}):null,x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"Session status"}),x.jsx("strong",{children:ek(o)})]}),x.jsxs("button",{className:"settings-toggle",disabled:y,title:R,type:"button",onClick:k,children:[x.jsx("span",{children:"Open Session"}),x.jsx("span",{children:"open"})]})]})}function ek(t){return t?t.status==="running"?t.activityStatus??"idle":t.status:"not started"}function tk(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 nk({busy:t,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:I2.map(l=>{const d=s==null?void 0:s.gates[l],v=!!(d!=null&&d.required);return x.jsx(jn,{checked:v,className:"sidebar-switch",disabled:t||!s,label:ik(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function ik(t){switch(t){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"code-diff":return"Code diff"}return t}function rk({busy:t,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:l,onResetBinding:d,onSettingsChange:v,onStartLarkRegistration:f,onStartQrLogin:o,onTranslationChange:c,onConnectionChange:u,qrCheck:p,qrLogin:h,status:S}){const w=(S==null?void 0:S.channel)==="lark",T=(S==null?void 0:S.channel)==="lark"?!!(S.binding.appIdConfigured&&S.binding.appSecretConfigured):!!(S!=null&&S.binding.tokenConfigured),k=(S==null?void 0:S.channel)==="lark"?!!(S.binding.appIdConfigured&&S.binding.appSecretConfigured):!!(S!=null&&S.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||!S,value:(S==null?void 0:S.channel)??"weixin-ilink",onChange:y=>{v({channel:y.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(jn,{checked:!!(S!=null&&S.connectionEnabled),className:"sidebar-switch",disabled:t||!S||!S.connectionEnabled&&!T,label:"Connection",stateLabel:S!=null&&S.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:y=>u(y)}),x.jsx(jn,{checked:!!(S!=null&&S.enabled),className:"sidebar-switch",disabled:t||!S||!S.enabled&&!T,label:"Gateway",title:T?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:y=>l(y)}),x.jsx(jn,{checked:!!(S!=null&&S.translationEnabled),className:"sidebar-switch",disabled:t||!S,label:"Translation",onChange:y=>c(y)}),w?x.jsx("button",{type:"button",disabled:t,onClick:f,children:"Start QR Setup"}):k?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:S!=null&&S.binding.appIdConfigured&&S.binding.appSecretConfigured?`Lark app configured${S.binding.larkBotName?` · ${S.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]}):h?x.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!w&&p?x.jsxs("p",{className:"muted",children:["QR status: ",p.status,p.message?` · ${p.message}`:""]}):null]})}function sk({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:ak(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:lk(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(v=>x.jsx("li",{children:v},v))}):null]})}function ak(t){return t.branch||"unknown"}function lk(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 ok({roundState:t,task:r}){var p;const[s,l]=ee.useState(()=>Date.now()),d=!!(t!=null&&t.startedAt),v=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?ck(t,s):0,u=((p=r.title)==null?void 0:p.trim())||r.taskSlug;return ee.useEffect(()=>{const h=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(h)},[]),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:u,children:u}),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:Eo(v)})]}),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:Eo(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:Eo(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:Eo(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 ck(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 Eo(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 uk(t){return t==="system"?"light":t==="light"?"dark":"system"}function Xg(t){return t==="system"?"System":t==="light"?"Light":"Dark"}function hk({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(P2,{events:t,maxEvents:null,showHeader:!1})]})})}function fk({busy:t,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:v}){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
|
+
`))&&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
|
+
`))&&v()}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($2,{busy:t,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function qr({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 dk({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 v=Mv(s,d.name),f=(v==null?void 0:v.status)==="running"?v.activityStatus??"idle":(v==null?void 0:v.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(ei,{status:f})]},d.name)})})}function pk({role:t,session:r,permissionMode:s,model:l,effort:d,modelOptions:v,active:f=!0,busy:o,translationEnabled:c,translationAutoSendEnabled:u,translationTargetLanguage:p,translationPanelState:h,onClearTranslationSession:S,onTranslationEntry:w,onTranslationFailures:T,onPermissionModeChange:k,onModelChange:y,onEffortChange:_,onStart:g,onResume:b,onStop:E,onRestart:L,onNotifyHarnessUpdated:R,onTerminalEvent:D}){const A=e1(t)&&c&&(r==null?void 0:r.status)==="running";return x.jsx("section",{className:"session-console",children:x.jsxs("div",{className:A?"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,modelOptions:v,busy:o,onPermissionModeChange:k,onModelChange:y,onEffortChange:_,onStart:g,onResume:b,onStop:E,onRestart:L,onNotifyHarnessUpdated:R}),(r==null?void 0:r.status)==="running"?x.jsx(Ho,{sessionId:r.id,active:f,onEvent:D},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."})]})]}),A?x.jsx("div",{className:"translation-pane",children:x.jsx(f2,{active:f,autoSendEnabled:u,targetLanguage:p,taskSlug:r.taskSlug,role:t,sessionId:r.id,panelState:h??{role:t,status:"ready",entries:[],failures:[]},onClearSession:S??(()=>{}),onEntry:w??(()=>{}),onFailures:T??(()=>{})},`${t}:${r.id}`)}):null]})})}const _h=500;function jh(t){return{taskSlug:t,cursor:1,sessions:{}}}function mk(t,r,s){return t.sessions[r]??$s(s)}function gk(t,r){const l={...Sk(t,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...$s(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const v=l[d.sessionId]??$s(d.role);if(d.event.type==="status")l[d.sessionId]={...v,role:d.role,status:d.event.status};else if(d.event.type==="failures")l[d.sessionId]={...v,role:d.role,failures:d.event.failures};else if(d.event.type==="entry"){const f=Ov(Lv(v.entries,d.event.entry));l[d.sessionId]={...v,role:d.role,entries:f.entries,failures:f.removedIds.size>0?v.failures.filter(o=>!f.removedIds.has(o.translationId)):v.failures}}}return{taskSlug:r.taskSlug,cursor:r.nextCursor,sessions:l}}function _k(t,r,s){return{...t,sessions:{...t.sessions,[r]:$s(s)}}}function vk(t,r,s,l){const d=t.sessions[r]??$s(s),v=Ov(Lv(d.entries,l));return{...t,sessions:{...t.sessions,[r]:{...d,role:s,entries:v.entries,failures:v.removedIds.size>0?d.failures.filter(f=>!v.removedIds.has(f.translationId)):d.failures}}}}function yk(t,r,s,l){const d=t.sessions[r]??$s(s);return{...t,sessions:{...t.sessions,[r]:{...d,role:s,failures:l}}}}function Sk(t,r){return t.taskSlug===r?t:jh(r)}function $s(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 bk={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",tester:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},Ck={"project-manager":"default",architect:"default",coder:"default",tester:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},wk={"project-manager":"default",architect:"default",coder:"default",tester:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function xk({task:t,activeRole:r,gateReviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:v,launchTemplate:f,modelOptions:o,refreshNonce:c=0,onTaskChanged:u,onActiveRoleChange:p,onMessagesChanged:h,onOrchestrationChanged:S,onRoundStateChanged:w,onEventsChanged:T,onLaunchStateChanged:k}){const[y,_]=ee.useState(null),[g,b]=ee.useState(()=>Jg(f)),[E,L]=ee.useState(()=>Zg(f)),[R,D]=ee.useState(()=>e_(f)),[A,M]=ee.useState(!1),[,O]=ji(""),[H,U]=ee.useState([]),[P,K]=ee.useState(null),[G,V]=ee.useState(null),[Y,te]=ee.useState(()=>jh(t.taskSlug)),z=ee.useRef(""),j=ee.useRef(1),N=ee.useMemo(()=>JSON.stringify(f),[f]),q=!!(y!=null&&y.sessions.some(Ee=>Ee.role==="gate-reviewer")),I=s||q,ie=[...tl,...I?[o_]:[]],de=ee.useCallback((Ee,me)=>{K(me),h==null||h(Ee),S==null||S(me)},[h,S]),_e=ee.useCallback((Ee,me,Me,Ae,rt)=>{_(Ee),V(rt),de(me,Me),w==null||w(Ae)},[de,w]),Q=ee.useCallback(async()=>{const Ee=await ye.getTaskWorkspaceState(t.taskSlug);_e(Ee.taskStatus,Ee.messages,Ee.orchestration,Ee.roundState,Ee.workflowState),Bo("Poll task workspace state"),O(me=>To(me,["Load task workspace state","Poll task workspace state"]))},[_e,t.taskSlug]),$=ee.useCallback((Ee,me)=>{const Me=Tv(Ee,me);Me&&O(Me)},[]);sl(`task-workspace:${t.taskSlug}:${c}`,()=>Q().catch(Ee=>{$("Poll task workspace state",Ee)}),{intervalMs:3e3,runImmediately:!0}),sl(l?`task-translation-feed:${t.taskSlug}`:null,async()=>{try{const Ee=await ye.pollTranslationTaskFeed(t.taskSlug,j.current);j.current=Ee.nextCursor,te(me=>gk(me,Ee)),Bo("Poll task translation feed"),O(me=>To(me,["Poll task translation feed"]))}catch(Ee){$("Poll task translation feed",Ee)}},{intervalMs:1e3,runImmediately:!0}),ee.useEffect(()=>{U([]),V(null),T==null||T([])},[T,t.taskSlug]),ee.useEffect(()=>{j.current=1,te(jh(t.taskSlug))},[t.taskSlug]),ee.useEffect(()=>{b(Jg(f)),L(Zg(f)),D(e_(f))},[N,t.taskSlug]),ee.useEffect(()=>{y&&!I&&r==="gate-reviewer"&&p("project-manager"),y&&r==="translator"&&p("project-manager")},[r,I,p,y]),ee.useEffect(()=>{const Ee=y==null?void 0:y.task;if(!Ee||Ee.taskSlug!==t.taskSlug)return;const me=Qg(Ee);if(me===Qg(t)){z.current="";return}z.current!==me&&(z.current=me,u().catch(Me=>{z.current="",O(ht("Refresh task list after task status changed",Me))}))},[u,y==null?void 0:y.task,t]),ee.useEffect(()=>{const Ee=(y==null?void 0:y.sessions)??[],me=Ee.filter(ge=>Ek(ge.role)),Me=new Set(me.map(ge=>ge.role)),Ae=Ee.some(ge=>ge.role==="gate-reviewer"),rt={};for(const ge of Gs)rt[ge.name]={permissionMode:g[ge.name],model:E[ge.name],effort:R[ge.name]};k==null||k({taskSlug:t.taskSlug,roles:rt,autoOrchestration:((P==null?void 0:P.mode)??"auto")==="auto",statusLoaded:!!y,sessionCount:me.length,hasAnySession:me.length>0,hasGateReviewerSession:Ae,allRolesHaveSession:tl.every(ge=>Me.has(ge.name))})},[E,R,k,P==null?void 0:P.mode,g,y,t.taskSlug]);async function ce(Ee,me="Run role session action"){M(!0),O("");try{await Ee(),await Q(),await u()}catch(Me){O(ht(me,Me))}finally{M(!1)}}function se(Ee){U(me=>{const Me=[...me,`${new Date().toLocaleTimeString()} ${Ee}`];return T==null||T(Me),Me})}function xe(Ee,me){b(Me=>({...Me,[Ee]:me}))}function be(Ee,me){L(Me=>({...Me,[Ee]:me}))}function je(Ee,me){D(Me=>({...Me,[Ee]:me}))}return x.jsxs("div",{className:"task-workspace",children:[x.jsxs("header",{className:"workspace-header",children:[x.jsxs("div",{className:"workspace-title-line",children:[x.jsx("h1",{children:t.title||t.taskSlug}),G!=null&&G.declared?x.jsxs("div",{className:"workspace-workflow-state",title:[G.declared.branch?`Branch: ${G.declared.branch}`:"",G.declared.resumePoint?`Resume: ${G.declared.resumePoint}`:"",G.declared.status?`Status: ${G.declared.status}`:""].filter(Boolean).join(" | "),children:[x.jsx("span",{children:G.declared.flow??"Workflow"}),G.declared.step?x.jsx("strong",{children:G.declared.step}):null]}):null]}),x.jsx(dk,{activeRole:r,roles:ie,sessions:(y==null?void 0:y.sessions)??[],onSelect:p})]}),x.jsx("div",{className:"workspace-grid",children:x.jsx("div",{className:"workspace-main",children:x.jsx("div",{className:"role-console-stack",children:ie.map(Ee=>{const me=Ee.name,Me=me===r,Ae=(y==null?void 0:y.sessions)??[],rt=Mv(Ae,me),ge=rt?mk(Y,rt.id,me):void 0;return x.jsx("div",{className:Me?"role-console-panel is-active":"role-console-panel","aria-hidden":!Me,children:x.jsx(pk,{role:me,session:rt,permissionMode:g[me],model:E[me],effort:R[me],modelOptions:o,active:Me,busy:A,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:v,translationPanelState:ge,onClearTranslationSession:(ze,Ke)=>{te(zt=>_k(zt,ze,Ke))},onTranslationEntry:(ze,Ke,zt)=>{te(pt=>vk(pt,ze,Ke,zt))},onTranslationFailures:(ze,Ke,zt)=>{te(pt=>yk(pt,ze,Ke,zt))},onPermissionModeChange:ze=>xe(me,ze),onModelChange:ze=>be(me,ze),onEffortChange:ze=>je(me,ze),onStart:()=>void ce(async()=>{await ye.startRoleSession(t.taskSlug,me,{cols:100,rows:28,permissionMode:g[me],model:E[me],effort:R[me]}),se(`started ${me} with ${g[me]} / ${E[me]} / ${R[me]}`)},`Start ${me} session`),onResume:()=>void ce(async()=>{await ye.resumeRoleSession(t.taskSlug,me,{cols:100,rows:28,permissionMode:g[me],model:E[me],effort:R[me]}),se(`resumed ${me} with ${g[me]} / ${E[me]} / ${R[me]}`)},`Resume ${me} session`),onStop:()=>void ce(async()=>{await ye.stopRoleSession(t.taskSlug,me),se(`stopped ${me}`)},`Stop ${me} session`),onRestart:()=>void ce(async()=>{await ye.restartRoleSession(t.taskSlug,me,{cols:100,rows:28,permissionMode:g[me],model:E[me],effort:R[me]}),se(`restarted ${me} with ${g[me]} / ${E[me]} / ${R[me]}`)},`Restart ${me} session`),onNotifyHarnessUpdated:()=>void ce(async()=>{await ye.notifyRoleHarnessUpdated(t.taskSlug,me),se(`notified ${me} to reload latest harness`)},`Notify ${me} to reload harness`),onTerminalEvent:ze=>se(`${Ee.label}: ${ze}`)})},me)})})})})]})}function Ek(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={...bk};for(const l of Gs)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={...Ck};for(const l of Gs)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={...wk};for(const l of Gs)r[l.name]=((s=t.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const kk=1400;function Ak(t){return!!(t!=null&&t.initialized)}function Tk(){const[t,r]=ee.useState(null),[s,l]=ee.useState([]),[d,v]=ee.useState(null),[f,o]=ee.useState(null),[c,u]=ee.useState(null),[p,h]=ee.useState(null),[S,w]=ee.useState(null),[T,k]=ee.useState(null),[y,_]=ee.useState(null),[g,b]=ee.useState(null),[E,L]=ee.useState(null),[R,D]=ee.useState(null),[A,M]=ee.useState(null),[O,H]=ee.useState(null),[U,P]=ee.useState(!1),[K,G]=ee.useState(null),[V,Y]=ee.useState(null),[te,z]=ee.useState(!1),[j,N]=ee.useState([]),[q,I]=ee.useState(null),[ie,de]=ee.useState(null),[_e,Q]=ee.useState(null),[$,ce]=ee.useState(null),[se,xe]=ee.useState(null),[be,je]=ee.useState(null),[Ee,me]=ee.useState("project-manager"),[Me,Ae]=ee.useState("system"),[rt,ge]=ee.useState(!0),[ze,Ke]=ee.useState(!0),[zt,pt]=ee.useState("off"),[mt,Ot]=ee.useState(!1),[he,Ce]=ee.useState(!1),[Te,He]=ee.useState(!1),[Ie,vt]=ee.useState(!1),[Fe,Ct]=ee.useState(t1),[St,Bt]=ee.useState(n1),[et,Ut]=ee.useState(!1),[nn,Kr]=ee.useState(!1),[Hi,fi]=ee.useState(!1),[zi,Cn]=ee.useState(!1),[di,Wn]=ee.useState(!1),[ni,un]=ee.useState(null),[Kn,Ft]=ee.useState("bypassPermissions"),[pi,Ii]=ee.useState("default"),[hn,Pi]=ee.useState("medium"),[mi,jt]=ee.useState(null),[rn,Ui]=ee.useState("bypassPermissions"),[Ne,bt]=ee.useState("default"),[Nt,ii]=ee.useState("medium"),[Yr,qo]=ee.useState(()=>r1()),[ri,cl]=ee.useState(null),[yr,Xr]=ee.useState(0),[wn,gi]=ee.useState(null),[Sr,Fi]=ee.useState(null),[Et,ul]=ee.useState(!1),[qi,si]=ee.useState(!1),[,fn]=ji(""),hl=ee.useRef({}),Qr=ee.useRef({}),Ks=ee.useRef({}),fl=ee.useRef({}),br=ee.useRef({}),_i=ee.useRef(null),Nn=ee.useRef({initialized:!1,messageId:null}),Kt=ee.useRef(""),Z=ee.useMemo(()=>D2(j,q),[j,q]),dn=(ri==null?void 0:ri.taskSlug)===(Z==null?void 0:Z.taskSlug)?ri:null,Cr=c===(Z==null?void 0:Z.taskSlug)?d:null,Ys=p===(Z==null?void 0:Z.taskSlug)?f:null,Jr=g===(Z==null?void 0:Z.taskSlug)?y:null,$o=!!(t&&Z&&Ak(Cr)),pn=(ni==null?void 0:ni.status)==="running",Zr=!!(Te&&$o&&pn),dl=!!(dn!=null&&dn.statusLoaded),Xs=!!(Z&&(dn!=null&&dn.statusLoaded)&&!dn.hasAnySession),Yn=(R==null?void 0:R.modelOptions)??d_(),qt=ee.useCallback(W=>{Ae(W.themeMode),ge(W.flowPauseAlerts),Ke(W.roleRetryEnabled),pt(W.permissionRequestMode),Ot(W.autoTaskHarnessReviewEnabled),Ce(W.autoMemoryEnabled),He(W.translationEnabled),vt(W.translationAutoSendEnabled),Ct(W.translationTargetLanguage),Bt(W.translationOutputMode),qo(W.launchTemplate)},[]);ee.useEffect(()=>{if(!rt)return;let W=!1;const ue=()=>{W||(W=!0,t_(),window.removeEventListener("pointerdown",ue),window.removeEventListener("keydown",ue))};return window.addEventListener("pointerdown",ue),window.addEventListener("keydown",ue),()=>{window.removeEventListener("pointerdown",ue),window.removeEventListener("keydown",ue)}},[rt]);const Hn=ee.useCallback(()=>{_i.current!==null&&(window.clearInterval(_i.current),_i.current=null)},[]),vi=ee.useCallback(()=>{Hn(),n_(),_i.current=window.setInterval(()=>{n_()},kk)},[Hn]),pl=ee.useCallback((W,ue=`manual-${Date.now()}`)=>{gi({id:ue,text:W})},[]),es=ee.useCallback(()=>{Hn(),gi(null)},[Hn]);ee.useEffect(()=>{Z!=null&&Z.taskSlug&&(br.current[Z.taskSlug]=Date.now())},[Z==null?void 0:Z.taskSlug]);const ml=ee.useCallback(W=>{Z!=null&&Z.taskSlug&&de({taskSlug:Z.taskSlug,messages:W})},[Z==null?void 0:Z.taskSlug]),Qs=ee.useCallback(W=>{Ks.current[W.taskSlug]=W.mode,Z!=null&&Z.taskSlug&&Q({taskSlug:Z.taskSlug,orchestration:W})},[Z==null?void 0:Z.taskSlug]),Go=ee.useCallback(W=>{Z!=null&&Z.taskSlug&&ce({taskSlug:Z.taskSlug,events:W})},[Z==null?void 0:Z.taskSlug]),Vo=ee.useCallback(W=>{if(!(Z!=null&&Z.taskSlug)||W.taskSlug!==Z.taskSlug)return;xe({taskSlug:W.taskSlug,roundState:W});const ue=M2({mode:Ks.current[W.taskSlug],status:W.status,activeRole:W.activeRole,lastFollowedRole:fl.current[W.taskSlug]});ue&&(fl.current[W.taskSlug]=ue,me(ue));const Je=L2(W,Bk);if(Je===null){Qr.current[W.taskSlug]={status:W.status};return}const ln=O2(W),yi=hl.current[W.taskSlug],Yo=Qr.current[W.taskSlug];Qr.current[W.taskSlug]={status:W.status},yi!==ln&&(hl.current[W.taskSlug]=ln,Mk(W,Yo,br.current[W.taskSlug])&&pl(Je,ln))},[Z==null?void 0:Z.taskSlug,pl]),ts=ee.useCallback(W=>{cl(ue=>(ue==null?void 0:ue.taskSlug)===W.taskSlug&&ue.statusLoaded===W.statusLoaded&&ue.sessionCount===W.sessionCount&&ue.hasAnySession===W.hasAnySession&&ue.hasGateReviewerSession===W.hasGateReviewerSession&&ue.allRolesHaveSession===W.allRolesHaveSession&&ue.autoOrchestration===W.autoOrchestration&&JSON.stringify(ue.roles)===JSON.stringify(W.roles)?ue:W)},[]);async function Yt(){const W=await ye.listTasks();return N(W),I(ue=>{var Je;return ue&&W.some(ln=>ln.taskSlug===ue)?ue:((Je=W[0])==null?void 0:Je.taskSlug)??null}),W}async function wr(W=Z==null?void 0:Z.taskSlug){if(!W)return v(null),u(null),null;const ue=await ye.getHarnessStatus(W);return v(ue),u(W),ue}async function xr(W=Z==null?void 0:Z.taskSlug){if(!W)return o(null),h(null),null;const ue=await ye.getHarnessBootstrapStatus(W);return o(ue),h(W),ue}async function xn(){const W=await ye.getGatewayStatus();return L(W),W}async function $i(){const W=await ye.getRecentRepositoryPaths();return l(W),W}async function Js(){if(!t)return Ut(!1),!1;const W=await ye.getTranslationState();return Ut(W.memoryInitialized),W.memoryInitialized}async function Er(W){const[ue,Je]=await Promise.all([ye.listMessages(W),ye.getOrchestrationState(W)]);de({taskSlug:W,messages:ue}),Q({taskSlug:W,orchestration:Je})}async function Zs(W){const ue=await ye.getGateReviewState(W);return je({taskSlug:W,state:ue}),Bo("Poll Gate Review state"),fn(Je=>To(Je,["Refresh Gate Review state","Poll Gate Review state"])),ue}function Gi(W,ue){const Je=Tv(W,ue);Je&&fn(Je)}function Xt(W){W&&(Ft(W.permissionMode),W.model&&Ii(W.model),W.effort&&Pi(W.effort))}async function ns(W={}){const ue=await ye.getTranslatorSession((Z==null?void 0:Z.taskSlug)??null);return un(ue),W.syncLaunchOptions&&Xt(ue),ue}function En(W){W&&(Ui(W.permissionMode),W.model&&bt(W.model),W.effort&&ii(W.effort))}async function sn(W={}){const ue=await ye.getHarnessEngineerSession((Z==null?void 0:Z.taskSlug)??null);return jt(ue),W.syncLaunchOptions&&En(ue),ue}async function ea(W=Z==null?void 0:Z.taskSlug){if(!t)return k(null),null;const ue=await ye.getHarnessFeedbackState(W);return k(ue),ue}function is(W,ue,Je={}){var ln;un(W.translatorSession),Ut(!!((ln=W.translationState)!=null&&ln.memoryInitialized)),jt(W.harnessEngineerSession),k(W.harnessFeedbackState),_(W.autoMemoryState),b(ue&&W.autoMemoryState?ue:null),L(W.gatewayStatus),ue&&W.harnessStatus?(v(W.harnessStatus),u(ue)):(v(null),u(null)),ue&&W.harnessBootstrapStatus?(o(W.harnessBootstrapStatus),h(ue)):(o(null),h(null)),Je.syncLaunchOptions&&(Xt(W.translatorSession),En(W.harnessEngineerSession))}async function ta(W={}){if(!t)return un(null),Ut(!1),jt(null),v(null),o(null),u(null),h(null),k(null),_(null),b(null),null;const ue=(Z==null?void 0:Z.taskSlug)??null,Je=await ye.getProjectRuntimeState(ue);return is(Je,ue,W),Je}function rs(){const W=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const ue of W)Bo(ue);fn(ue=>To(ue,W))}ee.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus(),ye.getCcrIntegrationStatus()]).then(async([W,ue,Je,ln,yi])=>{r(W),l(ue),L(ln),D(yi),qt(Je),W&&await Yt()}).catch(W=>fn(ht("Load initial app data",W)))},[qt]),ee.useEffect(()=>{const W=window.matchMedia("(prefers-color-scheme: dark)"),ue=()=>ul(W.matches);return ue(),W.addEventListener("change",ue),()=>W.removeEventListener("change",ue)},[]),ee.useEffect(()=>()=>Hn(),[Hn]),ee.useEffect(()=>{(E==null?void 0:E.pauseAlertSoundEnabled)!==void 0&&ge(E.pauseAlertSoundEnabled);const W=j2(Nn.current,E);Nn.current=W.observation,W.dismissPauseAlert&&es()},[es,E]),ee.useEffect(()=>{if(wn&&B2(rt)==="strong")return vi(),Hn;Hn()},[wn==null?void 0:wn.id,rt,vi,Hn]),ee.useEffect(()=>{const W=Me==="system"?Et?"dark":"light":Me;document.documentElement.dataset.theme=W,document.documentElement.dataset.themeMode=Me},[Et,Me]),ee.useEffect(()=>{if(!(Z!=null&&Z.taskSlug)){je(null);return}Zs(Z.taskSlug).catch(W=>fn(ht("Refresh Gate Review state",W)))},[Z==null?void 0:Z.taskSlug]),ee.useEffect(()=>{Kt.current="",un(null),Ft("bypassPermissions"),Ii("default"),Pi("medium"),Ut(!1),jt(null),Ui("bypassPermissions"),bt("default"),ii("medium"),v(null),o(null),u(null),h(null),k(null)},[t==null?void 0:t.repoRoot]),sl(t?`project-runtime:${t.repoRoot}:${(Z==null?void 0:Z.taskSlug)??"no-task"}`:null,async()=>{try{const W=(t==null?void 0:t.repoRoot)??"",ue=!!(t&&Kt.current!==W);await ta({syncLaunchOptions:ue}),ue&&(Kt.current=W),rs()}catch(W){Gi("Poll project runtime state",W)}},{intervalMs:3e3,runImmediately:!0});const Qt=(Z==null?void 0:Z.taskSlug)??null,ss=Qt&&(be==null?void 0:be.taskSlug)===Qt?be.state:null,It=Qt&&(se==null?void 0:se.taskSlug)===Qt?se.roundState:null,Xn=Qt&&(ri==null?void 0:ri.taskSlug)===Qt?ri:null,as=!!(Qt&&(ss!=null&&ss.activeGate||(It==null?void 0:It.activeRole)==="gate-reviewer"||Xn!=null&&Xn.hasGateReviewerSession));sl(as&&Qt?`gate-review:${Qt}`:null,async()=>{if(Qt)try{await Zs(Qt)}catch(W){Gi("Poll Gate Review state",W)}},{intervalMs:3e3,runImmediately:!1});async function Re(W,ue="Run UI action"){si(!0),fn("");try{await W()}catch(Je){fn(ht(ue,Je))}finally{si(!1)}}async function Wo(){var ln;if(!Z)throw new Error("Create or select a task before closing it.");const W=[`Close task "${Z.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- stops Translator and Harness Engineer sessions for this task",`- deletes the task worktree: ${Z.worktreePath}`,`- deletes the Git branch: ${Z.branch}`,"- deletes VCM task/session/message/orchestration state","","The task will close even if a cleanup step fails; cleanup issues are reported as warnings."].join(`
|
|
96
|
+
`);if(!window.confirm(W))return;const Je=await ye.cleanupTask(Z.taskSlug);I(null),de(null),Q(null),ce(null),xe(null),je(null),Xr(yi=>yi+1),await Yt(),(ln=Je.warnings)!=null&&ln.length&&window.alert([`Task "${Je.taskSlug}" closed with cleanup warnings:`,"",...Je.warnings.map(yi=>`- ${yi}`)].join(`
|
|
97
|
+
`))}const na=ie&&ie.taskSlug===(Z==null?void 0:Z.taskSlug)?ie.messages:[],ia=_e&&_e.taskSlug===(Z==null?void 0:Z.taskSlug)?_e.orchestration:null,kr=$&&$.taskSlug===(Z==null?void 0:Z.taskSlug)?$.events:[],an=se&&se.taskSlug===(Z==null?void 0:Z.taskSlug)?se.roundState:null,ls=Z!=null&&Z.taskSlug&&(an!=null&&an.roleRecovery)?Lk(Z.taskSlug,an.roleRecovery):null,gl=an!=null&&an.roleRecovery&&an.roleRecovery.status!=="failed"&&ls!==Sr?Ok(an.roleRecovery):null,ra=be&&be.taskSlug===(Z==null?void 0:Z.taskSlug)?be.state:null,Ko=!!(ra&&Object.values(ra.gates).some(W=>W.required));return x.jsxs(c1,{sidebar:x.jsx(X2,{project:t,recentRepositoryPaths:s,tasks:j,activeTaskSlug:(Z==null?void 0:Z.taskSlug)??null,messages:na,orchestration:ia,events:kr,roundState:an,gateReview:ra,translationEnabled:Zr,translationAutoSendEnabled:Ie,translationTargetLanguage:Fe,translationOutputMode:St,translationMemoryInitialized:et,translatorSession:ni,harnessStatus:Cr,harnessBootstrapStatus:Ys,harnessApplyResult:S,autoTaskHarnessReviewEnabled:mt,autoMemoryEnabled:he,gatewayStatus:E,gatewayQrLogin:A,gatewayQrCheck:O,gatewayLarkRegistration:K,gatewayLarkRegistrationCheck:V,ccrStatus:R,modelOptions:Yn,busy:qi,onConnect:W=>Re(async()=>{const ue=await ye.connectProject({repoPath:W});r(ue),w(null),await Promise.all([Yt(),$i()])},"Connect repository"),onRefreshConnectedRepository:()=>Re(async()=>{const W=await ye.getCurrentProject();r(W)},"Refresh connected repository"),onPullConnectedRepository:()=>Re(async()=>{const W=await ye.pullCurrentProject();r(W)},"Pull connected repository"),onRefreshHarness:()=>Re(async()=>{if(!Z)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([wr(Z.taskSlug),xr(Z.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>Re(async()=>{if(!Z)throw new Error("Create or select a task before applying VCM Harness.");const W=await ye.applyHarness({taskSlug:Z.taskSlug});w(W),await Promise.all([wr(Z.taskSlug),xr(Z.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:W=>Re(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Bootstrap.");const ue=await ye.startHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...W});o(ue.status),h(Z.taskSlug),await sn({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:W=>Re(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Bootstrap.");const ue=await ye.restartHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...W});o(ue.status),h(Z.taskSlug),await sn({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>Re(async()=>{if(!Z)throw new Error("Create or select a task before stopping Harness Bootstrap.");const W=await ye.stopHarnessBootstrap({taskSlug:Z.taskSlug});o(W),h((Z==null?void 0:Z.taskSlug)??null),await sn()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>Re(async()=>{if(!Z)throw new Error("Create or select a task before running Harness Bootstrap.");const W=await ye.runHarnessBootstrap({taskSlug:Z.taskSlug});o(W.status),h(Z.taskSlug),await sn()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>Cn(!0),onOpenRepositoryDiff:()=>Wn(!0),onAutoTaskHarnessReviewChange:W=>{Ot(W),Re(async()=>{const ue=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:W});qt(ue)},"Update auto task harness review setting")},onAutoMemoryChange:W=>{Ce(W),Re(async()=>{const ue=await ye.updateAppPreferences({autoMemoryEnabled:W});qt(ue),await ta()},"Update auto memory setting")},onRefreshGateway:()=>Re(async()=>{await xn()},"Refresh Gateway status"),onGatewayEnabledChange:W=>{Re(async()=>{const ue=await ye.updateGatewaySettings({enabled:W,...W&&t?{currentProjectId:t.repoRoot,currentTaskSlug:(Z==null?void 0:Z.taskSlug)??null}:{}});L(ue),W&&qt(await ye.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:W=>Re(async()=>{const ue=await ye.updateGatewaySettings(W);L(ue)},"Update Gateway settings"),onCcrSettingsChange:W=>Re(async()=>{D(await ye.updateCcrIntegration(W))},"Update CCR settings"),onCcrCheck:()=>Re(async()=>{D(await ye.checkCcrIntegration())},"Check CCR connection"),onGatewayTranslationChange:W=>{Re(async()=>{const ue=await ye.updateGatewaySettings({translationEnabled:W});L(ue)},"Update Gateway translation setting")},onGatewayConnectionChange:W=>{Re(async()=>{const ue=await ye.setGatewayConnection(W);L(ue)},"Update Gateway connection setting")},onStartGatewayQrLogin:()=>{Re(async()=>{const W=await ye.startGatewayQrLogin();M(W),H(null),P(!0),await xn()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{Re(async()=>{const W=await ye.startGatewayLarkRegistration();G(W),Y(null),z(!0),await xn()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{Re(async()=>{const W=await ye.resetGatewayBinding();L(W),M(null),H(null),P(!1),G(null),Y(null),z(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(W,ue)=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before changing Gate Review Gates.");const Je=await ye.updateGateReviewSettings(Z.taskSlug,{gates:{[W]:ue}});je({taskSlug:Z.taskSlug,state:Je})},`Update ${W} Gate Review setting`)},onTranslationEnabledChange:W=>{He(W),Re(async()=>{const ue=await ye.updateAppPreferences({translationEnabled:W});qt(ue)},"Update conversation translation setting")},onTranslationAutoSendChange:W=>{vt(W),Re(async()=>{const ue=await ye.updateAppPreferences({translationAutoSendEnabled:W});qt(ue)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:W=>{Ct(W),Re(async()=>{const ue=await ye.updateAppPreferences({translationTargetLanguage:W});qt(ue)},"Update translation target language")},onTranslationOutputModeChange:W=>{Bt(W),Re(async()=>{const ue=await ye.updateAppPreferences({translationOutputMode:W});qt(ue)},"Update translation output mode")},onOpenFileTranslation:()=>Kr(!0),onOpenTranslatorSession:()=>fi(!0),onCreateTranslationBootstrap:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:Z.taskSlug,targetLanguage:Fe}),await Js(),await ns()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:Z.taskSlug,targetLanguage:Fe}),await Js(),await ns()},"Create translation memory update task")},onCreateTask:W=>Re(async()=>{const ue=await ye.createTask(W);await Yt(),I(ue.taskSlug)},"Create task"),onCloseTask:()=>{Re(Wo,"Close task")},onSelectTask:I,themeMode:Me,onAutoOrchestrationChange:W=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before changing auto orchestration.");const ue=await ye.updateOrchestrationState(Z.taskSlug,{mode:W?"auto":"manual"});Q({taskSlug:Z.taskSlug,orchestration:ue})},"Update auto orchestration mode")},onThemeModeChange:W=>{Ae(W),Re(async()=>{const ue=await ye.updateAppPreferences({themeMode:W});qt(ue)},"Update theme setting")},pauseAlertSound:rt,onPauseAlertSoundChange:W=>{ge(W),W&&t_(),Re(async()=>{const ue=await ye.updateAppPreferences({flowPauseAlerts:W});qt(ue)},"Update pause alert sound setting")},roleRetryEnabled:ze,onRoleRetryEnabledChange:W=>{Ke(W),Re(async()=>{const ue=await ye.updateAppPreferences({roleRetryEnabled:W});qt(ue)},"Update CC retry setting")},permissionRequestMode:zt,onPermissionRequestModeChange:W=>{pt(W),Re(async()=>{const ue=await ye.updateAppPreferences({permissionRequestMode:W});qt(ue)},"Update permission request setting")},launchTemplate:Yr,canSaveLaunchTemplate:dl,canOneClickStart:Xs,onSaveLaunchTemplate:()=>{Re(async()=>{if(!(dn!=null&&dn.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const W=await ye.updateAppPreferences({launchTemplate:{version:1,roles:dn.roles,autoOrchestration:dn.autoOrchestration}});qt(W)},"Save launch template")},onOneClickStart:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before one-click start.");const W=await ye.oneClickStart(Z.taskSlug);Q({taskSlug:Z.taskSlug,orchestration:W.orchestration}),me("project-manager"),await Er(Z.taskSlug),await Yt(),Xr(ue=>ue+1)},"One-click start role sessions")},onMarkAllMessagesDone:W=>{Re(async()=>{const ue=await ye.markAllMessagesDone(W);de({taskSlug:W,messages:ue.messages}),await Er(W)},"Mark all role messages done")},onDeleteMessageHistory:W=>{Re(async()=>{const ue=await ye.deleteMessageHistory(W);de({taskSlug:W,messages:ue.messages}),await Er(W)},"Delete role message history")}}),children:[x.jsx(T2,{}),wn?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:wn.text}),x.jsx("p",{id:"flow-pause-alert-hint",className:"flow-pause-alert-hint",children:"The task may be complete, waiting for your decision, or blocked by a workflow issue."}),x.jsx("button",{type:"button",autoFocus:!0,onClick:es,children:"Confirm"})]})}):null,gl&&ls?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:gl}),x.jsx("button",{type:"button",onClick:()=>Fi(ls),children:"Close"})]}):null,U&&A?x.jsx(Rk,{busy:qi,qrCheck:O,qrLogin:A,onCheck:()=>{Re(async()=>{const W=await ye.checkGatewayQrLogin();H(W),(W.status==="confirmed"||W.status==="binded_redirect")&&P(!1),await xn()})},onClose:()=>P(!1)}):null,te&&K?x.jsx(Dk,{busy:qi,registration:K,registrationCheck:V,onCheck:()=>{Re(async()=>{const W=await ye.checkGatewayLarkRegistration();Y(W),W.gatewayStatus&&L(W.gatewayStatus),W.status==="confirmed"&&(z(!1),await xn())},"Check Lark Gateway QR setup")},onManualBind:(W,ue)=>{Re(async()=>{const Je=await ye.bindGatewayLarkApp({appId:W,appSecret:ue,larkDomain:"lark"});Y(Je),Je.gatewayStatus&&L(Je.gatewayStatus),Je.status==="confirmed"&&(z(!1),await xn())},"Bind Lark Gateway app")},onClose:()=>z(!1)}):null,t&&Z?x.jsx(xk,{task:Z,activeRole:Ee,gateReviewerEnabled:Ko,translationEnabled:Zr,translationAutoSendEnabled:Ie,translationTargetLanguage:Fe,launchTemplate:Yr,modelOptions:Yn,refreshNonce:yr,onTaskChanged:async()=>{await Yt()},onActiveRoleChange:me,onMessagesChanged:ml,onOrchestrationChanged:Qs,onRoundStateChanged:Vo,onEventsChanged:Go,onLaunchStateChanged:ts}):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:nn,taskSlug:(Z==null?void 0:Z.taskSlug)??null,targetLanguage:Fe,onClose:()=>Kr(!1)}),x.jsx(A1,{open:zi,busy:qi,status:Cr,feedbackState:T,memoryState:Jr,bootstrapStatus:Ys,engineerSession:mi,permissionMode:rn,model:Ne,modelOptions:Yn,effort:Nt,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>Cn(!1),onRefresh:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([wr(Z.taskSlug),xr(Z.taskSlug),sn(),ea(Z.taskSlug),ye.getAutoMemoryState(Z.taskSlug).then(W=>{_(W),b(Z.taskSlug)})])},"Refresh Harness Studio")},onPermissionModeChange:Ui,onModelChange:bt,onEffortChange:ii,onEngineerStart:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Engineer.");const W=await ye.startHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:rn,model:Ne,effort:Nt});jt(W),En(W)},"Start Harness Engineer")},onEngineerResume:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before resuming Harness Engineer.");const W=await ye.resumeHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:rn,model:Ne,effort:Nt});jt(W),En(W)},"Resume Harness Engineer")},onEngineerRestart:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Engineer.");const W=await ye.restartHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:rn,model:Ne,effort:Nt});jt(W),En(W)},"Restart Harness Engineer")},onEngineerStop:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before stopping Harness Engineer.");const W=await ye.stopHarnessEngineerSession({taskSlug:Z.taskSlug});jt(W)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before notifying Harness Engineer.");const W=await ye.notifyHarnessEngineerHarnessUpdated({taskSlug:Z.taskSlug});jt(W),En(W)},"Notify Harness Engineer to reload harness")},onSendFeedback:W=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before sending Harness Feedback.");const ue=await ye.sendHarnessFeedback({taskSlug:Z.taskSlug,feedbackPath:W});jt(ue),En(ue)},"Send Harness Feedback to Harness Engineer")},onOpenRepositoryDiff:()=>Wn(!0),onReviewTaskHarness:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before reviewing task harness.");const W=await ye.startTaskHarnessRetrospective({taskSlug:Z.taskSlug,trigger:"manual"});k(W),await sn({syncLaunchOptions:!0})},"Review task harness")},onMemoryStateChange:W=>{_(W),b((Z==null?void 0:Z.taskSlug)??null)}}),x.jsx(O1,{open:di,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>Wn(!1)}),x.jsx(z1,{open:Hi,busy:qi,session:ni,permissionMode:Kn,model:pi,modelOptions:Yn,effort:hn,onClose:()=>fi(!1),onPermissionModeChange:Ft,onModelChange:Ii,onEffortChange:Pi,onStart:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before starting Translator.");const W=await ye.startTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:Kn,model:pi,effort:hn});un(W),Xt(W)},"Start Translator session")},onResume:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before resuming Translator.");const W=await ye.resumeTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:Kn,model:pi,effort:hn});un(W),Xt(W)},"Resume Translator session")},onRestart:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before restarting Translator.");const W=await ye.restartTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:Kn,model:pi,effort:hn});un(W),Xt(W)},"Restart Translator session")},onStop:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before stopping Translator.");const W=await ye.stopTranslatorSession({taskSlug:Z.taskSlug});un(W)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{Re(async()=>{if(!Z)throw new Error("Create or select a task before notifying Translator.");const W=await ye.notifyTranslatorHarnessUpdated({taskSlug:Z.taskSlug});un(W),Xt(W)},"Notify Translator to reload harness")}})]})}function Rk({busy:t,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[v,f]=ee.useState(""),[o,c]=ji("");return ee.useEffect(()=>{let u=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const p=Vr(0,"M");p.addData(d.qrcodeUrl),p.make(),u||f(p.createDataURL(8,2))}catch(p){u||c(ht("Render Gateway QR login code",p))}return()=>{u=!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:v?x.jsx("img",{alt:"Weixin Gateway QR login",src:v}):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 Dk({busy:t,onCheck:r,onClose:s,onManualBind:l,registration:d,registrationCheck:v}){const[f,o]=ee.useState(""),[c,u]=ji(""),[p,h]=ee.useState(""),[S,w]=ee.useState(""),[T,k]=ji("");return ee.useEffect(()=>{let y=!1;u(""),o("");try{const _=Vr(0,"M");_.addData(d.qrUrl),_.make(),y||o(_.createDataURL(8,2))}catch(_){y||u(ht("Render Lark Gateway setup QR code",_))}return()=>{y=!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:(v==null?void 0:v.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,v!=null&&v.larkBotName?x.jsxs("div",{children:[x.jsx("dt",{children:"Bot"}),x.jsx("dd",{children:v.larkBotName})]}):null,v!=null&&v.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:v.message})]}):null]}),x.jsxs("form",{className:"gateway-manual-bind",onSubmit:y=>{y.preventDefault();const _=p.trim(),g=S.trim();if(!_||!g){k("Enter both App ID and App Secret.");return}k(""),w(""),l(_,g)},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:p,onChange:y=>h(y.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:S,onChange:y=>w(y.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 $r=null;function Mk(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 Lk(t,r){return`${t}:${r.role}:${r.lastFailureAt}`}function Ok(t){const r=Nk(t.role),s=jv(t);return t.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次 · ${Hk(t.nextRetryAt)}`}function Bk(t,r){const s=jv(t);return t.retryable===!1?`CC stopped for ${r}: ${jk(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 jk(t){return t.error&&t.error!=="unknown"?t.error:"this error"}function Nk(t){return t.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function Hk(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=Nv();return t?Hv(t):!1}async function n_(){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(!$r||$r.state==="closed")&&($r=new t),$r}catch{return null}}function i_(t){$r=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===$r&&i_(t),r}catch{return t===$r&&i_(t),!1}}function r_(t){return t.state==="running"}function s_(t,r,s){const l=t.createGain(),d=t.createOscillator(),v=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),v.type="triangle",v.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(l),v.connect(l),l.connect(r),d.start(s.startAt),v.start(s.startAt),d.stop(f+.02),v.stop(f+.02)}const zv=document.getElementById("root");if(!zv)throw new Error("Missing #root element.");q0.createRoot(zv).render(x.jsx(ee.StrictMode,{children:x.jsx(Tk,{})}));
|