@caoruhua/open-claude-remote 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,198 +0,0 @@
1
- (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))o(h);new MutationObserver(h=>{for(const m of h)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function r(h){const m={};return h.integrity&&(m.integrity=h.integrity),h.referrerPolicy&&(m.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?m.credentials="include":h.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(h){if(h.ep)return;h.ep=!0;const m=r(h);fetch(h.href,m)}})();function xc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zh={exports:{}},Za={};/**
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 o_;function ZS(){if(o_)return Za;o_=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(o,h,m){var p=null;if(m!==void 0&&(p=""+m),h.key!==void 0&&(p=""+h.key),"key"in h){m={};for(var a in h)a!=="key"&&(m[a]=h[a])}else m=h;return h=m.ref,{$$typeof:e,type:o,key:p,ref:h!==void 0?h:null,props:m}}return Za.Fragment=i,Za.jsx=r,Za.jsxs=r,Za}var l_;function QS(){return l_||(l_=1,zh.exports=ZS()),zh.exports}var Y=QS(),Ph={exports:{}},Xe={};/**
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 c_;function JS(){if(c_)return Xe;c_=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),p=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),y=Symbol.iterator;function C(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,g={};function _(z,j,H){this.props=z,this.context=j,this.refs=g,this.updater=H||w}_.prototype.isReactComponent={},_.prototype.setState=function(z,j){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,j,"setState")},_.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function v(){}v.prototype=_.prototype;function S(z,j,H){this.props=z,this.context=j,this.refs=g,this.updater=H||w}var D=S.prototype=new v;D.constructor=S,b(D,_.prototype),D.isPureReactComponent=!0;var R=Array.isArray;function x(){}var M={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function L(z,j,H){var ee=H.ref;return{$$typeof:e,type:z,key:j,ref:ee!==void 0?ee:null,props:H}}function T(z,j){return L(z.type,j,z.props)}function P(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function B(z){var j={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(H){return j[H]})}var F=/\/+/g;function $(z,j){return typeof z=="object"&&z!==null&&z.key!=null?B(""+z.key):j.toString(36)}function q(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(x,x):(z.status="pending",z.then(function(j){z.status==="pending"&&(z.status="fulfilled",z.value=j)},function(j){z.status==="pending"&&(z.status="rejected",z.reason=j)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function W(z,j,H,ee,he){var se=typeof z;(se==="undefined"||se==="boolean")&&(z=null);var Z=!1;if(z===null)Z=!0;else switch(se){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(z.$$typeof){case e:case i:Z=!0;break;case f:return Z=z._init,W(Z(z._payload),j,H,ee,he)}}if(Z)return he=he(z),Z=ee===""?"."+$(z,0):ee,R(he)?(H="",Z!=null&&(H=Z.replace(F,"$&/")+"/"),W(he,j,H,"",function(ne){return ne})):he!=null&&(P(he)&&(he=T(he,H+(he.key==null||z&&z.key===he.key?"":(""+he.key).replace(F,"$&/")+"/")+Z)),j.push(he)),1;Z=0;var G=ee===""?".":ee+":";if(R(z))for(var re=0;re<z.length;re++)ee=z[re],se=G+$(ee,re),Z+=W(ee,j,H,se,he);else if(re=C(z),typeof re=="function")for(z=re.call(z),re=0;!(ee=z.next()).done;)ee=ee.value,se=G+$(ee,re++),Z+=W(ee,j,H,se,he);else if(se==="object"){if(typeof z.then=="function")return W(q(z),j,H,ee,he);throw j=String(z),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return Z}function K(z,j,H){if(z==null)return z;var ee=[],he=0;return W(z,ee,"","",function(se){return j.call(H,se,he++)}),ee}function X(z){if(z._status===-1){var j=z._result;j=j(),j.then(function(H){(z._status===0||z._status===-1)&&(z._status=1,z._result=H)},function(H){(z._status===0||z._status===-1)&&(z._status=2,z._result=H)}),z._status===-1&&(z._status=0,z._result=j)}if(z._status===1)return z._result.default;throw z._result}var U=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},O={map:K,forEach:function(z,j,H){K(z,function(){j.apply(this,arguments)},H)},count:function(z){var j=0;return K(z,function(){j++}),j},toArray:function(z){return K(z,function(j){return j})||[]},only:function(z){if(!P(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Xe.Activity=u,Xe.Children=O,Xe.Component=_,Xe.Fragment=r,Xe.Profiler=h,Xe.PureComponent=S,Xe.StrictMode=o,Xe.Suspense=l,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(z){return M.H.useMemoCache(z)}},Xe.cache=function(z){return function(){return z.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(z,j,H){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var ee=b({},z.props),he=z.key;if(j!=null)for(se in j.key!==void 0&&(he=""+j.key),j)!k.call(j,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&j.ref===void 0||(ee[se]=j[se]);var se=arguments.length-2;if(se===1)ee.children=H;else if(1<se){for(var Z=Array(se),G=0;G<se;G++)Z[G]=arguments[G+2];ee.children=Z}return L(z.type,he,ee)},Xe.createContext=function(z){return z={$$typeof:p,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:m,_context:z},z},Xe.createElement=function(z,j,H){var ee,he={},se=null;if(j!=null)for(ee in j.key!==void 0&&(se=""+j.key),j)k.call(j,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(he[ee]=j[ee]);var Z=arguments.length-2;if(Z===1)he.children=H;else if(1<Z){for(var G=Array(Z),re=0;re<Z;re++)G[re]=arguments[re+2];he.children=G}if(z&&z.defaultProps)for(ee in Z=z.defaultProps,Z)he[ee]===void 0&&(he[ee]=Z[ee]);return L(z,se,he)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(z){return{$$typeof:a,render:z}},Xe.isValidElement=P,Xe.lazy=function(z){return{$$typeof:f,_payload:{_status:-1,_result:z},_init:X}},Xe.memo=function(z,j){return{$$typeof:c,type:z,compare:j===void 0?null:j}},Xe.startTransition=function(z){var j=M.T,H={};M.T=H;try{var ee=z(),he=M.S;he!==null&&he(H,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(x,U)}catch(se){U(se)}finally{j!==null&&H.types!==null&&(j.types=H.types),M.T=j}},Xe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Xe.use=function(z){return M.H.use(z)},Xe.useActionState=function(z,j,H){return M.H.useActionState(z,j,H)},Xe.useCallback=function(z,j){return M.H.useCallback(z,j)},Xe.useContext=function(z){return M.H.useContext(z)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(z,j){return M.H.useDeferredValue(z,j)},Xe.useEffect=function(z,j){return M.H.useEffect(z,j)},Xe.useEffectEvent=function(z){return M.H.useEffectEvent(z)},Xe.useId=function(){return M.H.useId()},Xe.useImperativeHandle=function(z,j,H){return M.H.useImperativeHandle(z,j,H)},Xe.useInsertionEffect=function(z,j){return M.H.useInsertionEffect(z,j)},Xe.useLayoutEffect=function(z,j){return M.H.useLayoutEffect(z,j)},Xe.useMemo=function(z,j){return M.H.useMemo(z,j)},Xe.useOptimistic=function(z,j){return M.H.useOptimistic(z,j)},Xe.useReducer=function(z,j,H){return M.H.useReducer(z,j,H)},Xe.useRef=function(z){return M.H.useRef(z)},Xe.useState=function(z){return M.H.useState(z)},Xe.useSyncExternalStore=function(z,j,H){return M.H.useSyncExternalStore(z,j,H)},Xe.useTransition=function(){return M.H.useTransition()},Xe.version="19.2.4",Xe}var u_;function Kd(){return u_||(u_=1,Ph.exports=JS()),Ph.exports}var N=Kd();const un=xc(N);var Uh={exports:{}},Qa={},Hh={exports:{}},jh={};/**
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 h_;function eC(){return h_||(h_=1,(function(e){function i(W,K){var X=W.length;W.push(K);e:for(;0<X;){var U=X-1>>>1,O=W[U];if(0<h(O,K))W[U]=K,W[X]=O,X=U;else break e}}function r(W){return W.length===0?null:W[0]}function o(W){if(W.length===0)return null;var K=W[0],X=W.pop();if(X!==K){W[0]=X;e:for(var U=0,O=W.length,z=O>>>1;U<z;){var j=2*(U+1)-1,H=W[j],ee=j+1,he=W[ee];if(0>h(H,X))ee<O&&0>h(he,H)?(W[U]=he,W[ee]=X,U=ee):(W[U]=H,W[j]=X,U=j);else if(ee<O&&0>h(he,X))W[U]=he,W[ee]=X,U=ee;else break e}}return K}function h(W,K){var X=W.sortIndex-K.sortIndex;return X!==0?X:W.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;e.unstable_now=function(){return m.now()}}else{var p=Date,a=p.now();e.unstable_now=function(){return p.now()-a}}var l=[],c=[],f=1,u=null,y=3,C=!1,w=!1,b=!1,g=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function D(W){for(var K=r(c);K!==null;){if(K.callback===null)o(c);else if(K.startTime<=W)o(c),K.sortIndex=K.expirationTime,i(l,K);else break;K=r(c)}}function R(W){if(b=!1,D(W),!w)if(r(l)!==null)w=!0,x||(x=!0,B());else{var K=r(c);K!==null&&q(R,K.startTime-W)}}var x=!1,M=-1,k=5,L=-1;function T(){return g?!0:!(e.unstable_now()-L<k)}function P(){if(g=!1,x){var W=e.unstable_now();L=W;var K=!0;try{e:{w=!1,b&&(b=!1,v(M),M=-1),C=!0;var X=y;try{t:{for(D(W),u=r(l);u!==null&&!(u.expirationTime>W&&T());){var U=u.callback;if(typeof U=="function"){u.callback=null,y=u.priorityLevel;var O=U(u.expirationTime<=W);if(W=e.unstable_now(),typeof O=="function"){u.callback=O,D(W),K=!0;break t}u===r(l)&&o(l),D(W)}else o(l);u=r(l)}if(u!==null)K=!0;else{var z=r(c);z!==null&&q(R,z.startTime-W),K=!1}}break e}finally{u=null,y=X,C=!1}K=void 0}}finally{K?B():x=!1}}}var B;if(typeof S=="function")B=function(){S(P)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,$=F.port2;F.port1.onmessage=P,B=function(){$.postMessage(null)}}else B=function(){_(P,0)};function q(W,K){M=_(function(){W(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(W){W.callback=null},e.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<W?Math.floor(1e3/W):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(W){switch(y){case 1:case 2:case 3:var K=3;break;default:K=y}var X=y;y=K;try{return W()}finally{y=X}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(W,K){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var X=y;y=W;try{return K()}finally{y=X}},e.unstable_scheduleCallback=function(W,K,X){var U=e.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?U+X:U):X=U,W){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=X+O,W={id:f++,callback:K,priorityLevel:W,startTime:X,expirationTime:O,sortIndex:-1},X>U?(W.sortIndex=X,i(c,W),r(l)===null&&W===r(c)&&(b?(v(M),M=-1):b=!0,q(R,X-U))):(W.sortIndex=O,i(l,W),w||C||(w=!0,x||(x=!0,B()))),W},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(W){var K=y;return function(){var X=y;y=K;try{return W.apply(this,arguments)}finally{y=X}}}})(jh)),jh}var d_;function tC(){return d_||(d_=1,Hh.exports=eC()),Hh.exports}var $h={exports:{}},yn={};/**
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 f_;function nC(){if(f_)return yn;f_=1;var e=Kd();function i(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},h=Symbol.for("react.portal");function m(l,c,f){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:u==null?null:""+u,children:l,containerInfo:c,implementation:f}}var p=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,c){if(l==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return yn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,yn.createPortal=function(l,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(i(299));return m(l,c,null,f)},yn.flushSync=function(l){var c=p.T,f=o.p;try{if(p.T=null,o.p=2,l)return l()}finally{p.T=c,o.p=f,o.d.f()}},yn.preconnect=function(l,c){typeof l=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,o.d.C(l,c))},yn.prefetchDNS=function(l){typeof l=="string"&&o.d.D(l)},yn.preinit=function(l,c){if(typeof l=="string"&&c&&typeof c.as=="string"){var f=c.as,u=a(f,c.crossOrigin),y=typeof c.integrity=="string"?c.integrity:void 0,C=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;f==="style"?o.d.S(l,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:u,integrity:y,fetchPriority:C}):f==="script"&&o.d.X(l,{crossOrigin:u,integrity:y,fetchPriority:C,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},yn.preinitModule=function(l,c){if(typeof l=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var f=a(c.as,c.crossOrigin);o.d.M(l,{crossOrigin:f,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&o.d.M(l)},yn.preload=function(l,c){if(typeof l=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var f=c.as,u=a(f,c.crossOrigin);o.d.L(l,f,{crossOrigin:u,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},yn.preloadModule=function(l,c){if(typeof l=="string")if(c){var f=a(c.as,c.crossOrigin);o.d.m(l,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:f,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else o.d.m(l)},yn.requestFormReset=function(l){o.d.r(l)},yn.unstable_batchedUpdates=function(l,c){return l(c)},yn.useFormState=function(l,c,f){return p.H.useFormState(l,c,f)},yn.useFormStatus=function(){return p.H.useHostTransitionStatus()},yn.version="19.2.4",yn}var g_;function l0(){if(g_)return $h.exports;g_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),$h.exports=nC(),$h.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 p_;function iC(){if(p_)return Qa;p_=1;var e=tC(),i=Kd(),r=l0();function o(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function m(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function p(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function a(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function l(t){if(m(t)!==t)throw Error(o(188))}function c(t){var n=t.alternate;if(!n){if(n=m(t),n===null)throw Error(o(188));return n!==t?null:t}for(var s=t,d=n;;){var E=s.return;if(E===null)break;var A=E.alternate;if(A===null){if(d=E.return,d!==null){s=d;continue}break}if(E.child===A.child){for(A=E.child;A;){if(A===s)return l(E),t;if(A===d)return l(E),n;A=A.sibling}throw Error(o(188))}if(s.return!==d.return)s=E,d=A;else{for(var I=!1,V=E.child;V;){if(V===s){I=!0,s=E,d=A;break}if(V===d){I=!0,d=E,s=A;break}V=V.sibling}if(!I){for(V=A.child;V;){if(V===s){I=!0,s=A,d=E;break}if(V===d){I=!0,d=A,s=E;break}V=V.sibling}if(!I)throw Error(o(189))}}if(s.alternate!==d)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?t:n}function f(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=f(t),n!==null)return n;t=t.sibling}return null}var u=Object.assign,y=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),S=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function B(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var F=Symbol.for("react.client.reference");function $(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===F?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case b:return"Fragment";case _:return"Profiler";case g:return"StrictMode";case R:return"Suspense";case x:return"SuspenseList";case L:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case w:return"Portal";case S:return t.displayName||"Context";case v:return(t._context.displayName||"Context")+".Consumer";case D:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return n=t.displayName||null,n!==null?n:$(t.type)||"Memo";case k:n=t._payload,t=t._init;try{return $(t(n))}catch{}}return null}var q=Array.isArray,W=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},U=[],O=-1;function z(t){return{current:t}}function j(t){0>O||(t.current=U[O],U[O]=null,O--)}function H(t,n){O++,U[O]=t.current,t.current=n}var ee=z(null),he=z(null),se=z(null),Z=z(null);function G(t,n){switch(H(se,n),H(he,t),H(ee,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Tm(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Tm(n),t=Mm(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}j(ee),H(ee,t)}function re(){j(ee),j(he),j(se)}function ne(t){t.memoizedState!==null&&H(Z,t);var n=ee.current,s=Mm(n,t.type);n!==s&&(H(he,t),H(ee,s))}function ve(t){he.current===t&&(j(ee),j(he)),Z.current===t&&(j(Z),Ka._currentValue=X)}var me,Te;function xe(t){if(me===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);me=n&&n[1]||"",Te=-1<s.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+me+t+Te}var Ve=!1;function Me(t,n){if(!t||Ve)return"";Ve=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(n){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ue){var ce=ue}Reflect.construct(t,[],pe)}else{try{pe.call()}catch(ue){ce=ue}t.call(pe.prototype)}}else{try{throw Error()}catch(ue){ce=ue}(pe=t())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ue){if(ue&&ce&&typeof ue.stack=="string")return[ue.stack,ce.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=d.DetermineComponentFrameRoot(),I=A[0],V=A[1];if(I&&V){var J=I.split(`
44
- `),oe=V.split(`
45
- `);for(E=d=0;d<J.length&&!J[d].includes("DetermineComponentFrameRoot");)d++;for(;E<oe.length&&!oe[E].includes("DetermineComponentFrameRoot");)E++;if(d===J.length||E===oe.length)for(d=J.length-1,E=oe.length-1;1<=d&&0<=E&&J[d]!==oe[E];)E--;for(;1<=d&&0<=E;d--,E--)if(J[d]!==oe[E]){if(d!==1||E!==1)do if(d--,E--,0>E||J[d]!==oe[E]){var fe=`
46
- `+J[d].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),fe}while(1<=d&&0<=E);break}}}finally{Ve=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?xe(s):""}function ke(t,n){switch(t.tag){case 26:case 27:case 5:return xe(t.type);case 16:return xe("Lazy");case 13:return t.child!==n&&n!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return Me(t.type,!1);case 11:return Me(t.type.render,!1);case 1:return Me(t.type,!0);case 31:return xe("Activity");default:return""}}function Bt(t){try{var n="",s=null;do n+=ke(t,s),s=t,t=t.return;while(t);return n}catch(d){return`
47
- Error generating stack: `+d.message+`
48
- `+d.stack}}var Gt=Object.prototype.hasOwnProperty,$e=e.unstable_scheduleCallback,Ke=e.unstable_cancelCallback,Ye=e.unstable_shouldYield,De=e.unstable_requestPaint,Ne=e.unstable_now,_t=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,_e=e.unstable_UserBlockingPriority,Ae=e.unstable_NormalPriority,Fe=e.unstable_LowPriority,ze=e.unstable_IdlePriority,qe=e.log,He=e.unstable_setDisableYieldValue,Ft=null,Ct=null;function zt(t){if(typeof qe=="function"&&He(t),Ct&&typeof Ct.setStrictMode=="function")try{Ct.setStrictMode(Ft,t)}catch{}}var ut=Math.clz32?Math.clz32:nr,hn=Math.log,Zt=Math.LN2;function nr(t){return t>>>=0,t===0?32:31-(hn(t)/Zt|0)|0}var qn=256,mi=262144,Mt=4194304;function yt(t){var n=t&42;if(n!==0)return n;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Q(t,n,s){var d=t.pendingLanes;if(d===0)return 0;var E=0,A=t.suspendedLanes,I=t.pingedLanes;t=t.warmLanes;var V=d&134217727;return V!==0?(d=V&~A,d!==0?E=yt(d):(I&=V,I!==0?E=yt(I):s||(s=V&~t,s!==0&&(E=yt(s))))):(V=d&~A,V!==0?E=yt(V):I!==0?E=yt(I):s||(s=d&~t,s!==0&&(E=yt(s)))),E===0?0:n!==0&&n!==E&&(n&A)===0&&(A=E&-E,s=n&-n,A>=s||A===32&&(s&4194048)!==0)?n:E}function de(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function ye(t,n){switch(t){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 Le(){var t=Mt;return Mt<<=1,(Mt&62914560)===0&&(Mt=4194304),t}function at(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function ft(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ee(t,n,s,d,E,A){var I=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var V=t.entanglements,J=t.expirationTimes,oe=t.hiddenUpdates;for(s=I&~s;0<s;){var fe=31-ut(s),pe=1<<fe;V[fe]=0,J[fe]=-1;var ce=oe[fe];if(ce!==null)for(oe[fe]=null,fe=0;fe<ce.length;fe++){var ue=ce[fe];ue!==null&&(ue.lane&=-536870913)}s&=~pe}d!==0&&we(t,d,0),A!==0&&E===0&&t.tag!==0&&(t.suspendedLanes|=A&~(I&~n))}function we(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var d=31-ut(n);t.entangledLanes|=n,t.entanglements[d]=t.entanglements[d]|1073741824|s&261930}function Ie(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var d=31-ut(s),E=1<<d;E&n|t[d]&n&&(t[d]|=n),s&=~E}}function vt(t,n){var s=n&-n;return s=(s&42)!==0?1:St(s),(s&(t.suspendedLanes|n))!==0?0:s}function St(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function wn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function xn(){var t=K.p;return t!==0?t:(t=window.event,t===void 0?32:e_(t.type))}function ni(t,n){var s=K.p;try{return K.p=t,n()}finally{K.p=s}}var Ln=Math.random().toString(36).slice(2),Kt="__reactFiber$"+Ln,vn="__reactProps$"+Ln,ir="__reactContainer$"+Ln,ra="__reactEvents$"+Ln,Oo="__reactListeners$"+Ln,ss="__reactHandles$"+Ln,Bo="__reactResources$"+Ln,Br="__reactMarker$"+Ln;function sa(t){delete t[Kt],delete t[vn],delete t[ra],delete t[Oo],delete t[ss]}function Dn(t){var n=t[Kt];if(n)return n;for(var s=t.parentNode;s;){if(n=s[ir]||s[Kt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=zm(t);t!==null;){if(s=t[Kt])return s;t=zm(t)}return n}t=s,s=t.parentNode}return null}function Oi(t){if(t=t[Kt]||t[ir]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function rr(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(o(33))}function sr(t){var n=t[Bo];return n||(n=t[Bo]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Qt(t){t[Br]=!0}var No=new Set,Nr={};function Bi(t,n){be(t,n),be(t+"Capture",n)}function be(t,n){for(Nr[t]=n,t=0;t<n.length;t++)No.add(n[t])}var Pe=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]*$"),tt={},Et={};function Vt(t){return Gt.call(Et,t)?!0:Gt.call(tt,t)?!1:Pe.test(t)?Et[t]=!0:(tt[t]=!0,!1)}function bn(t,n,s){if(Vt(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var d=n.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function Wn(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function On(t,n,s,d){if(d===null)t.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+d)}}function Nt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Gn(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Io(t,n,s){var d=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var E=d.get,A=d.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return E.call(this)},set:function(I){s=""+I,A.call(this,I)}}),Object.defineProperty(t,n,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(I){s=""+I},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function as(t){if(!t._valueTracker){var n=Gn(t)?"checked":"value";t._valueTracker=Io(t,n,""+t[n])}}function aa(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),d="";return t&&(d=Gn(t)?t.checked?"true":"false":t.value),t=d,t!==s?(n.setValue(t),!0):!1}function os(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Fc=/[\n"\\]/g;function Bn(t){return t.replace(Fc,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function oa(t,n,s,d,E,A,I,V){t.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?t.type=I:t.removeAttribute("type"),n!=null?I==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Nt(n)):t.value!==""+Nt(n)&&(t.value=""+Nt(n)):I!=="submit"&&I!=="reset"||t.removeAttribute("value"),n!=null?ls(t,I,Nt(n)):s!=null?ls(t,I,Nt(s)):d!=null&&t.removeAttribute("value"),E==null&&A!=null&&(t.defaultChecked=!!A),E!=null&&(t.checked=E&&typeof E!="function"&&typeof E!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?t.name=""+Nt(V):t.removeAttribute("name")}function Ir(t,n,s,d,E,A,I,V){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(t.type=A),n!=null||s!=null){if(!(A!=="submit"&&A!=="reset"||n!=null)){as(t);return}s=s!=null?""+Nt(s):"",n=n!=null?""+Nt(n):s,V||n===t.value||(t.value=n),t.defaultValue=n}d=d??E,d=typeof d!="function"&&typeof d!="symbol"&&!!d,t.checked=V?t.checked:!!d,t.defaultChecked=!!d,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(t.name=I),as(t)}function ls(t,n,s){n==="number"&&os(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function dn(t,n,s,d){if(t=t.options,n){n={};for(var E=0;E<s.length;E++)n["$"+s[E]]=!0;for(s=0;s<t.length;s++)E=n.hasOwnProperty("$"+t[s].value),t[s].selected!==E&&(t[s].selected=E),E&&d&&(t[s].defaultSelected=!0)}else{for(s=""+Nt(s),n=null,E=0;E<t.length;E++){if(t[E].value===s){t[E].selected=!0,d&&(t[E].defaultSelected=!0);return}n!==null||t[E].disabled||(n=t[E])}n!==null&&(n.selected=!0)}}function Fo(t,n,s){if(n!=null&&(n=""+Nt(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Nt(s):""}function cs(t,n,s,d){if(n==null){if(d!=null){if(s!=null)throw Error(o(92));if(q(d)){if(1<d.length)throw Error(o(93));d=d[0]}s=d}s==null&&(s=""),n=s}s=Nt(n),t.defaultValue=s,d=t.textContent,d===s&&d!==""&&d!==null&&(t.value=d),as(t)}function Ge(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var zo=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 Jt(t,n,s){var d=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":d?t.setProperty(n,s):typeof s!="number"||s===0||zo.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function wt(t,n,s){if(n!=null&&typeof n!="object")throw Error(o(62));if(t=t.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||n!=null&&n.hasOwnProperty(d)||(d.indexOf("--")===0?t.setProperty(d,""):d==="float"?t.cssFloat="":t[d]="");for(var E in n)d=n[E],n.hasOwnProperty(E)&&s[E]!==d&&Jt(t,E,d)}else for(var A in n)n.hasOwnProperty(A)&&Jt(t,A,n[A])}function ar(t){if(t.indexOf("-")===-1)return!1;switch(t){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 Ni=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"]]),la=/^[\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 or(t){return la.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Ce(){}var Oe=null;function Ze(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ot=null,jt=null;function ii(t){var n=Oi(t);if(n&&(t=n.stateNode)){var s=t[vn]||null;e:switch(t=n.stateNode,n.type){case"input":if(oa(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Bn(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var d=s[n];if(d!==t&&d.form===t.form){var E=d[vn]||null;if(!E)throw Error(o(90));oa(d,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(n=0;n<s.length;n++)d=s[n],d.form===t.form&&aa(d)}break e;case"textarea":Fo(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&dn(t,!!s.multiple,n,!1)}}}var ca=!1;function Po(t,n,s){if(ca)return t(n,s);ca=!0;try{var d=t(n);return d}finally{if(ca=!1,(ot!==null||jt!==null)&&(Dl(),ot&&(n=ot,t=jt,jt=ot=null,ii(n),t)))for(n=0;n<t.length;n++)ii(t[n])}}function ua(t,n){var s=t.stateNode;if(s===null)return null;var d=s[vn]||null;if(d===null)return null;s=d[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":(d=!d.disabled)||(t=t.type,d=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!d;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(o(231,n,typeof s));return s}var Ii=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zc=!1;if(Ii)try{var ha={};Object.defineProperty(ha,"passive",{get:function(){zc=!0}}),window.addEventListener("test",ha,ha),window.removeEventListener("test",ha,ha)}catch{zc=!1}var lr=null,Pc=null,Uo=null;function Mf(){if(Uo)return Uo;var t,n=Pc,s=n.length,d,E="value"in lr?lr.value:lr.textContent,A=E.length;for(t=0;t<s&&n[t]===E[t];t++);var I=s-t;for(d=1;d<=I&&n[s-d]===E[A-d];d++);return Uo=E.slice(t,1<d?1-d:void 0)}function Ho(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function jo(){return!0}function Lf(){return!1}function Nn(t){function n(s,d,E,A,I){this._reactName=s,this._targetInst=E,this.type=d,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var V in t)t.hasOwnProperty(V)&&(s=t[V],this[V]=s?s(A):A[V]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?jo:Lf,this.isPropagationStopped=Lf,this}return u(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=jo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=jo)},persist:function(){},isPersistent:jo}),n}var Fr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$o=Nn(Fr),da=u({},Fr,{view:0,detail:0}),Y1=Nn(da),Uc,Hc,fa,qo=u({},da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$c,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==fa&&(fa&&t.type==="mousemove"?(Uc=t.screenX-fa.screenX,Hc=t.screenY-fa.screenY):Hc=Uc=0,fa=t),Uc)},movementY:function(t){return"movementY"in t?t.movementY:Hc}}),Of=Nn(qo),X1=u({},qo,{dataTransfer:0}),Z1=Nn(X1),Q1=u({},da,{relatedTarget:0}),jc=Nn(Q1),J1=u({},Fr,{animationName:0,elapsedTime:0,pseudoElement:0}),ey=Nn(J1),ty=u({},Fr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ny=Nn(ty),iy=u({},Fr,{data:0}),Bf=Nn(iy),ry={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sy={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"},ay={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oy(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=ay[t])?!!n[t]:!1}function $c(){return oy}var ly=u({},da,{key:function(t){if(t.key){var n=ry[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Ho(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?sy[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$c,charCode:function(t){return t.type==="keypress"?Ho(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ho(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),cy=Nn(ly),uy=u({},qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nf=Nn(uy),hy=u({},da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$c}),dy=Nn(hy),fy=u({},Fr,{propertyName:0,elapsedTime:0,pseudoElement:0}),gy=Nn(fy),py=u({},qo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),my=Nn(py),_y=u({},Fr,{newState:0,oldState:0}),vy=Nn(_y),by=[9,13,27,32],qc=Ii&&"CompositionEvent"in window,ga=null;Ii&&"documentMode"in document&&(ga=document.documentMode);var yy=Ii&&"TextEvent"in window&&!ga,If=Ii&&(!qc||ga&&8<ga&&11>=ga),Ff=" ",zf=!1;function Pf(t,n){switch(t){case"keyup":return by.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uf(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var us=!1;function Sy(t,n){switch(t){case"compositionend":return Uf(n);case"keypress":return n.which!==32?null:(zf=!0,Ff);case"textInput":return t=n.data,t===Ff&&zf?null:t;default:return null}}function Cy(t,n){if(us)return t==="compositionend"||!qc&&Pf(t,n)?(t=Mf(),Uo=Pc=lr=null,us=!1,t):null;switch(t){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 If&&n.locale!=="ko"?null:n.data;default:return null}}var Ey={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hf(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!Ey[t.type]:n==="textarea"}function jf(t,n,s,d){ot?jt?jt.push(d):jt=[d]:ot=d,n=Ol(n,"onChange"),0<n.length&&(s=new $o("onChange","change",null,s,d),t.push({event:s,listeners:n}))}var pa=null,ma=null;function wy(t){wm(t,0)}function Wo(t){var n=rr(t);if(aa(n))return t}function $f(t,n){if(t==="change")return n}var qf=!1;if(Ii){var Wc;if(Ii){var Gc="oninput"in document;if(!Gc){var Wf=document.createElement("div");Wf.setAttribute("oninput","return;"),Gc=typeof Wf.oninput=="function"}Wc=Gc}else Wc=!1;qf=Wc&&(!document.documentMode||9<document.documentMode)}function Gf(){pa&&(pa.detachEvent("onpropertychange",Kf),ma=pa=null)}function Kf(t){if(t.propertyName==="value"&&Wo(ma)){var n=[];jf(n,ma,t,Ze(t)),Po(wy,n)}}function xy(t,n,s){t==="focusin"?(Gf(),pa=n,ma=s,pa.attachEvent("onpropertychange",Kf)):t==="focusout"&&Gf()}function Dy(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Wo(ma)}function Ay(t,n){if(t==="click")return Wo(n)}function ky(t,n){if(t==="input"||t==="change")return Wo(n)}function Ry(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Kn=typeof Object.is=="function"?Object.is:Ry;function _a(t,n){if(Kn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),d=Object.keys(n);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var E=s[d];if(!Gt.call(n,E)||!Kn(t[E],n[E]))return!1}return!0}function Vf(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Yf(t,n){var s=Vf(t);t=0;for(var d;s;){if(s.nodeType===3){if(d=t+s.textContent.length,t<=n&&d>=n)return{node:s,offset:n-t};t=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Vf(s)}}function Xf(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Xf(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Zf(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=os(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=os(t.document)}return n}function Kc(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var Ty=Ii&&"documentMode"in document&&11>=document.documentMode,hs=null,Vc=null,va=null,Yc=!1;function Qf(t,n,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Yc||hs==null||hs!==os(d)||(d=hs,"selectionStart"in d&&Kc(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),va&&_a(va,d)||(va=d,d=Ol(Vc,"onSelect"),0<d.length&&(n=new $o("onSelect","select",null,n,s),t.push({event:n,listeners:d}),n.target=hs)))}function zr(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var ds={animationend:zr("Animation","AnimationEnd"),animationiteration:zr("Animation","AnimationIteration"),animationstart:zr("Animation","AnimationStart"),transitionrun:zr("Transition","TransitionRun"),transitionstart:zr("Transition","TransitionStart"),transitioncancel:zr("Transition","TransitionCancel"),transitionend:zr("Transition","TransitionEnd")},Xc={},Jf={};Ii&&(Jf=document.createElement("div").style,"AnimationEvent"in window||(delete ds.animationend.animation,delete ds.animationiteration.animation,delete ds.animationstart.animation),"TransitionEvent"in window||delete ds.transitionend.transition);function Pr(t){if(Xc[t])return Xc[t];if(!ds[t])return t;var n=ds[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Jf)return Xc[t]=n[s];return t}var eg=Pr("animationend"),tg=Pr("animationiteration"),ng=Pr("animationstart"),My=Pr("transitionrun"),Ly=Pr("transitionstart"),Oy=Pr("transitioncancel"),ig=Pr("transitionend"),rg=new Map,Zc="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(" ");Zc.push("scrollEnd");function _i(t,n){rg.set(t,n),Bi(n,[t])}var Go=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ri=[],fs=0,Qc=0;function Ko(){for(var t=fs,n=Qc=fs=0;n<t;){var s=ri[n];ri[n++]=null;var d=ri[n];ri[n++]=null;var E=ri[n];ri[n++]=null;var A=ri[n];if(ri[n++]=null,d!==null&&E!==null){var I=d.pending;I===null?E.next=E:(E.next=I.next,I.next=E),d.pending=E}A!==0&&sg(s,E,A)}}function Vo(t,n,s,d){ri[fs++]=t,ri[fs++]=n,ri[fs++]=s,ri[fs++]=d,Qc|=d,t.lanes|=d,t=t.alternate,t!==null&&(t.lanes|=d)}function Jc(t,n,s,d){return Vo(t,n,s,d),Yo(t)}function Ur(t,n){return Vo(t,null,null,n),Yo(t)}function sg(t,n,s){t.lanes|=s;var d=t.alternate;d!==null&&(d.lanes|=s);for(var E=!1,A=t.return;A!==null;)A.childLanes|=s,d=A.alternate,d!==null&&(d.childLanes|=s),A.tag===22&&(t=A.stateNode,t===null||t._visibility&1||(E=!0)),t=A,A=A.return;return t.tag===3?(A=t.stateNode,E&&n!==null&&(E=31-ut(s),t=A.hiddenUpdates,d=t[E],d===null?t[E]=[n]:d.push(n),n.lane=s|536870912),A):null}function Yo(t){if(50<Ua)throw Ua=0,lh=null,Error(o(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var gs={};function By(t,n,s,d){this.tag=t,this.key=s,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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(t,n,s,d){return new By(t,n,s,d)}function eu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Fi(t,n){var s=t.alternate;return s===null?(s=Vn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function ag(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Xo(t,n,s,d,E,A){var I=0;if(d=t,typeof t=="function")eu(t)&&(I=1);else if(typeof t=="string")I=PS(t,s,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case L:return t=Vn(31,s,n,E),t.elementType=L,t.lanes=A,t;case b:return Hr(s.children,E,A,n);case g:I=8,E|=24;break;case _:return t=Vn(12,s,n,E|2),t.elementType=_,t.lanes=A,t;case R:return t=Vn(13,s,n,E),t.elementType=R,t.lanes=A,t;case x:return t=Vn(19,s,n,E),t.elementType=x,t.lanes=A,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case S:I=10;break e;case v:I=9;break e;case D:I=11;break e;case M:I=14;break e;case k:I=16,d=null;break e}I=29,s=Error(o(130,t===null?"null":typeof t,"")),d=null}return n=Vn(I,s,n,E),n.elementType=t,n.type=d,n.lanes=A,n}function Hr(t,n,s,d){return t=Vn(7,t,d,n),t.lanes=s,t}function tu(t,n,s){return t=Vn(6,t,null,n),t.lanes=s,t}function og(t){var n=Vn(18,null,null,0);return n.stateNode=t,n}function nu(t,n,s){return n=Vn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var lg=new WeakMap;function si(t,n){if(typeof t=="object"&&t!==null){var s=lg.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Bt(n)},lg.set(t,n),n)}return{value:t,source:n,stack:Bt(n)}}var ps=[],ms=0,Zo=null,ba=0,ai=[],oi=0,cr=null,Ei=1,wi="";function zi(t,n){ps[ms++]=ba,ps[ms++]=Zo,Zo=t,ba=n}function cg(t,n,s){ai[oi++]=Ei,ai[oi++]=wi,ai[oi++]=cr,cr=t;var d=Ei;t=wi;var E=32-ut(d)-1;d&=~(1<<E),s+=1;var A=32-ut(n)+E;if(30<A){var I=E-E%5;A=(d&(1<<I)-1).toString(32),d>>=I,E-=I,Ei=1<<32-ut(n)+E|s<<E|d,wi=A+t}else Ei=1<<A|s<<E|d,wi=t}function iu(t){t.return!==null&&(zi(t,1),cg(t,1,0))}function ru(t){for(;t===Zo;)Zo=ps[--ms],ps[ms]=null,ba=ps[--ms],ps[ms]=null;for(;t===cr;)cr=ai[--oi],ai[oi]=null,wi=ai[--oi],ai[oi]=null,Ei=ai[--oi],ai[oi]=null}function ug(t,n){ai[oi++]=Ei,ai[oi++]=wi,ai[oi++]=cr,Ei=n.id,wi=n.overflow,cr=t}var fn=null,Pt=null,ht=!1,ur=null,li=!1,su=Error(o(519));function hr(t){var n=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ya(si(n,t)),su}function hg(t){var n=t.stateNode,s=t.type,d=t.memoizedProps;switch(n[Kt]=t,n[vn]=d,s){case"dialog":it("cancel",n),it("close",n);break;case"iframe":case"object":case"embed":it("load",n);break;case"video":case"audio":for(s=0;s<ja.length;s++)it(ja[s],n);break;case"source":it("error",n);break;case"img":case"image":case"link":it("error",n),it("load",n);break;case"details":it("toggle",n);break;case"input":it("invalid",n),Ir(n,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":it("invalid",n);break;case"textarea":it("invalid",n),cs(n,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||d.suppressHydrationWarning===!0||km(n.textContent,s)?(d.popover!=null&&(it("beforetoggle",n),it("toggle",n)),d.onScroll!=null&&it("scroll",n),d.onScrollEnd!=null&&it("scrollend",n),d.onClick!=null&&(n.onclick=Ce),n=!0):n=!1,n||hr(t,!0)}function dg(t){for(fn=t.return;fn;)switch(fn.tag){case 5:case 31:case 13:li=!1;return;case 27:case 3:li=!0;return;default:fn=fn.return}}function _s(t){if(t!==fn)return!1;if(!ht)return dg(t),ht=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Eh(t.type,t.memoizedProps)),s=!s),s&&Pt&&hr(t),dg(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));Pt=Fm(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(317));Pt=Fm(t)}else n===27?(n=Pt,xr(t.type)?(t=kh,kh=null,Pt=t):Pt=n):Pt=fn?ui(t.stateNode.nextSibling):null;return!0}function jr(){Pt=fn=null,ht=!1}function au(){var t=ur;return t!==null&&(Pn===null?Pn=t:Pn.push.apply(Pn,t),ur=null),t}function ya(t){ur===null?ur=[t]:ur.push(t)}var ou=z(null),$r=null,Pi=null;function dr(t,n,s){H(ou,n._currentValue),n._currentValue=s}function Ui(t){t._currentValue=ou.current,j(ou)}function lu(t,n,s){for(;t!==null;){var d=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,d!==null&&(d.childLanes|=n)):d!==null&&(d.childLanes&n)!==n&&(d.childLanes|=n),t===s)break;t=t.return}}function cu(t,n,s,d){var E=t.child;for(E!==null&&(E.return=t);E!==null;){var A=E.dependencies;if(A!==null){var I=E.child;A=A.firstContext;e:for(;A!==null;){var V=A;A=E;for(var J=0;J<n.length;J++)if(V.context===n[J]){A.lanes|=s,V=A.alternate,V!==null&&(V.lanes|=s),lu(A.return,s,t),d||(I=null);break e}A=V.next}}else if(E.tag===18){if(I=E.return,I===null)throw Error(o(341));I.lanes|=s,A=I.alternate,A!==null&&(A.lanes|=s),lu(I,s,t),I=null}else I=E.child;if(I!==null)I.return=E;else for(I=E;I!==null;){if(I===t){I=null;break}if(E=I.sibling,E!==null){E.return=I.return,I=E;break}I=I.return}E=I}}function vs(t,n,s,d){t=null;for(var E=n,A=!1;E!==null;){if(!A){if((E.flags&524288)!==0)A=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var I=E.alternate;if(I===null)throw Error(o(387));if(I=I.memoizedProps,I!==null){var V=E.type;Kn(E.pendingProps.value,I.value)||(t!==null?t.push(V):t=[V])}}else if(E===Z.current){if(I=E.alternate,I===null)throw Error(o(387));I.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(t!==null?t.push(Ka):t=[Ka])}E=E.return}t!==null&&cu(n,t,s,d),n.flags|=262144}function Qo(t){for(t=t.firstContext;t!==null;){if(!Kn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function qr(t){$r=t,Pi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function gn(t){return fg($r,t)}function Jo(t,n){return $r===null&&qr(t),fg(t,n)}function fg(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},Pi===null){if(t===null)throw Error(o(308));Pi=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Pi=Pi.next=n;return s}var Ny=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,d){t.push(d)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},Iy=e.unstable_scheduleCallback,Fy=e.unstable_NormalPriority,en={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uu(){return{controller:new Ny,data:new Map,refCount:0}}function Sa(t){t.refCount--,t.refCount===0&&Iy(Fy,function(){t.controller.abort()})}var Ca=null,hu=0,bs=0,ys=null;function zy(t,n){if(Ca===null){var s=Ca=[];hu=0,bs=gh(),ys={status:"pending",value:void 0,then:function(d){s.push(d)}}}return hu++,n.then(gg,gg),n}function gg(){if(--hu===0&&Ca!==null){ys!==null&&(ys.status="fulfilled");var t=Ca;Ca=null,bs=0,ys=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Py(t,n){var s=[],d={status:"pending",value:null,reason:null,then:function(E){s.push(E)}};return t.then(function(){d.status="fulfilled",d.value=n;for(var E=0;E<s.length;E++)(0,s[E])(n)},function(E){for(d.status="rejected",d.reason=E,E=0;E<s.length;E++)(0,s[E])(void 0)}),d}var pg=W.S;W.S=function(t,n){Qp=Ne(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&zy(t,n),pg!==null&&pg(t,n)};var Wr=z(null);function du(){var t=Wr.current;return t!==null?t:Lt.pooledCache}function el(t,n){n===null?H(Wr,Wr.current):H(Wr,n.pool)}function mg(){var t=du();return t===null?null:{parent:en._currentValue,pool:t}}var Ss=Error(o(460)),fu=Error(o(474)),tl=Error(o(542)),nl={then:function(){}};function _g(t){return t=t.status,t==="fulfilled"||t==="rejected"}function vg(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(Ce,Ce),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,yg(t),t;default:if(typeof n.status=="string")n.then(Ce,Ce);else{if(t=Lt,t!==null&&100<t.shellSuspendCounter)throw Error(o(482));t=n,t.status="pending",t.then(function(d){if(n.status==="pending"){var E=n;E.status="fulfilled",E.value=d}},function(d){if(n.status==="pending"){var E=n;E.status="rejected",E.reason=d}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,yg(t),t}throw Kr=n,Ss}}function Gr(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Kr=s,Ss):s}}var Kr=null;function bg(){if(Kr===null)throw Error(o(459));var t=Kr;return Kr=null,t}function yg(t){if(t===Ss||t===tl)throw Error(o(483))}var Cs=null,Ea=0;function il(t){var n=Ea;return Ea+=1,Cs===null&&(Cs=[]),vg(Cs,t,n)}function wa(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function rl(t,n){throw n.$$typeof===y?Error(o(525)):(t=Object.prototype.toString.call(n),Error(o(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Sg(t){function n(ie,te){if(t){var ae=ie.deletions;ae===null?(ie.deletions=[te],ie.flags|=16):ae.push(te)}}function s(ie,te){if(!t)return null;for(;te!==null;)n(ie,te),te=te.sibling;return null}function d(ie){for(var te=new Map;ie!==null;)ie.key!==null?te.set(ie.key,ie):te.set(ie.index,ie),ie=ie.sibling;return te}function E(ie,te){return ie=Fi(ie,te),ie.index=0,ie.sibling=null,ie}function A(ie,te,ae){return ie.index=ae,t?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<te?(ie.flags|=67108866,te):ae):(ie.flags|=67108866,te)):(ie.flags|=1048576,te)}function I(ie){return t&&ie.alternate===null&&(ie.flags|=67108866),ie}function V(ie,te,ae,ge){return te===null||te.tag!==6?(te=tu(ae,ie.mode,ge),te.return=ie,te):(te=E(te,ae),te.return=ie,te)}function J(ie,te,ae,ge){var Ue=ae.type;return Ue===b?fe(ie,te,ae.props.children,ge,ae.key):te!==null&&(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===k&&Gr(Ue)===te.type)?(te=E(te,ae.props),wa(te,ae),te.return=ie,te):(te=Xo(ae.type,ae.key,ae.props,null,ie.mode,ge),wa(te,ae),te.return=ie,te)}function oe(ie,te,ae,ge){return te===null||te.tag!==4||te.stateNode.containerInfo!==ae.containerInfo||te.stateNode.implementation!==ae.implementation?(te=nu(ae,ie.mode,ge),te.return=ie,te):(te=E(te,ae.children||[]),te.return=ie,te)}function fe(ie,te,ae,ge,Ue){return te===null||te.tag!==7?(te=Hr(ae,ie.mode,ge,Ue),te.return=ie,te):(te=E(te,ae),te.return=ie,te)}function pe(ie,te,ae){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=tu(""+te,ie.mode,ae),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case C:return ae=Xo(te.type,te.key,te.props,null,ie.mode,ae),wa(ae,te),ae.return=ie,ae;case w:return te=nu(te,ie.mode,ae),te.return=ie,te;case k:return te=Gr(te),pe(ie,te,ae)}if(q(te)||B(te))return te=Hr(te,ie.mode,ae,null),te.return=ie,te;if(typeof te.then=="function")return pe(ie,il(te),ae);if(te.$$typeof===S)return pe(ie,Jo(ie,te),ae);rl(ie,te)}return null}function ce(ie,te,ae,ge){var Ue=te!==null?te.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Ue!==null?null:V(ie,te,""+ae,ge);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:return ae.key===Ue?J(ie,te,ae,ge):null;case w:return ae.key===Ue?oe(ie,te,ae,ge):null;case k:return ae=Gr(ae),ce(ie,te,ae,ge)}if(q(ae)||B(ae))return Ue!==null?null:fe(ie,te,ae,ge,null);if(typeof ae.then=="function")return ce(ie,te,il(ae),ge);if(ae.$$typeof===S)return ce(ie,te,Jo(ie,ae),ge);rl(ie,ae)}return null}function ue(ie,te,ae,ge,Ue){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ie=ie.get(ae)||null,V(te,ie,""+ge,Ue);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case C:return ie=ie.get(ge.key===null?ae:ge.key)||null,J(te,ie,ge,Ue);case w:return ie=ie.get(ge.key===null?ae:ge.key)||null,oe(te,ie,ge,Ue);case k:return ge=Gr(ge),ue(ie,te,ae,ge,Ue)}if(q(ge)||B(ge))return ie=ie.get(ae)||null,fe(te,ie,ge,Ue,null);if(typeof ge.then=="function")return ue(ie,te,ae,il(ge),Ue);if(ge.$$typeof===S)return ue(ie,te,ae,Jo(te,ge),Ue);rl(te,ge)}return null}function Re(ie,te,ae,ge){for(var Ue=null,pt=null,Be=te,Je=te=0,ct=null;Be!==null&&Je<ae.length;Je++){Be.index>Je?(ct=Be,Be=null):ct=Be.sibling;var mt=ce(ie,Be,ae[Je],ge);if(mt===null){Be===null&&(Be=ct);break}t&&Be&&mt.alternate===null&&n(ie,Be),te=A(mt,te,Je),pt===null?Ue=mt:pt.sibling=mt,pt=mt,Be=ct}if(Je===ae.length)return s(ie,Be),ht&&zi(ie,Je),Ue;if(Be===null){for(;Je<ae.length;Je++)Be=pe(ie,ae[Je],ge),Be!==null&&(te=A(Be,te,Je),pt===null?Ue=Be:pt.sibling=Be,pt=Be);return ht&&zi(ie,Je),Ue}for(Be=d(Be);Je<ae.length;Je++)ct=ue(Be,ie,Je,ae[Je],ge),ct!==null&&(t&&ct.alternate!==null&&Be.delete(ct.key===null?Je:ct.key),te=A(ct,te,Je),pt===null?Ue=ct:pt.sibling=ct,pt=ct);return t&&Be.forEach(function(Tr){return n(ie,Tr)}),ht&&zi(ie,Je),Ue}function We(ie,te,ae,ge){if(ae==null)throw Error(o(151));for(var Ue=null,pt=null,Be=te,Je=te=0,ct=null,mt=ae.next();Be!==null&&!mt.done;Je++,mt=ae.next()){Be.index>Je?(ct=Be,Be=null):ct=Be.sibling;var Tr=ce(ie,Be,mt.value,ge);if(Tr===null){Be===null&&(Be=ct);break}t&&Be&&Tr.alternate===null&&n(ie,Be),te=A(Tr,te,Je),pt===null?Ue=Tr:pt.sibling=Tr,pt=Tr,Be=ct}if(mt.done)return s(ie,Be),ht&&zi(ie,Je),Ue;if(Be===null){for(;!mt.done;Je++,mt=ae.next())mt=pe(ie,mt.value,ge),mt!==null&&(te=A(mt,te,Je),pt===null?Ue=mt:pt.sibling=mt,pt=mt);return ht&&zi(ie,Je),Ue}for(Be=d(Be);!mt.done;Je++,mt=ae.next())mt=ue(Be,ie,Je,mt.value,ge),mt!==null&&(t&&mt.alternate!==null&&Be.delete(mt.key===null?Je:mt.key),te=A(mt,te,Je),pt===null?Ue=mt:pt.sibling=mt,pt=mt);return t&&Be.forEach(function(XS){return n(ie,XS)}),ht&&zi(ie,Je),Ue}function Rt(ie,te,ae,ge){if(typeof ae=="object"&&ae!==null&&ae.type===b&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:e:{for(var Ue=ae.key;te!==null;){if(te.key===Ue){if(Ue=ae.type,Ue===b){if(te.tag===7){s(ie,te.sibling),ge=E(te,ae.props.children),ge.return=ie,ie=ge;break e}}else if(te.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===k&&Gr(Ue)===te.type){s(ie,te.sibling),ge=E(te,ae.props),wa(ge,ae),ge.return=ie,ie=ge;break e}s(ie,te);break}else n(ie,te);te=te.sibling}ae.type===b?(ge=Hr(ae.props.children,ie.mode,ge,ae.key),ge.return=ie,ie=ge):(ge=Xo(ae.type,ae.key,ae.props,null,ie.mode,ge),wa(ge,ae),ge.return=ie,ie=ge)}return I(ie);case w:e:{for(Ue=ae.key;te!==null;){if(te.key===Ue)if(te.tag===4&&te.stateNode.containerInfo===ae.containerInfo&&te.stateNode.implementation===ae.implementation){s(ie,te.sibling),ge=E(te,ae.children||[]),ge.return=ie,ie=ge;break e}else{s(ie,te);break}else n(ie,te);te=te.sibling}ge=nu(ae,ie.mode,ge),ge.return=ie,ie=ge}return I(ie);case k:return ae=Gr(ae),Rt(ie,te,ae,ge)}if(q(ae))return Re(ie,te,ae,ge);if(B(ae)){if(Ue=B(ae),typeof Ue!="function")throw Error(o(150));return ae=Ue.call(ae),We(ie,te,ae,ge)}if(typeof ae.then=="function")return Rt(ie,te,il(ae),ge);if(ae.$$typeof===S)return Rt(ie,te,Jo(ie,ae),ge);rl(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,te!==null&&te.tag===6?(s(ie,te.sibling),ge=E(te,ae),ge.return=ie,ie=ge):(s(ie,te),ge=tu(ae,ie.mode,ge),ge.return=ie,ie=ge),I(ie)):s(ie,te)}return function(ie,te,ae,ge){try{Ea=0;var Ue=Rt(ie,te,ae,ge);return Cs=null,Ue}catch(Be){if(Be===Ss||Be===tl)throw Be;var pt=Vn(29,Be,null,ie.mode);return pt.lanes=ge,pt.return=ie,pt}finally{}}}var Vr=Sg(!0),Cg=Sg(!1),fr=!1;function gu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pu(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function gr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function pr(t,n,s){var d=t.updateQueue;if(d===null)return null;if(d=d.shared,(bt&2)!==0){var E=d.pending;return E===null?n.next=n:(n.next=E.next,E.next=n),d.pending=n,n=Yo(t),sg(t,null,s),n}return Vo(t,d,n,s),Yo(t)}function xa(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var d=n.lanes;d&=t.pendingLanes,s|=d,n.lanes=s,Ie(t,s)}}function mu(t,n){var s=t.updateQueue,d=t.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var E=null,A=null;if(s=s.firstBaseUpdate,s!==null){do{var I={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};A===null?E=A=I:A=A.next=I,s=s.next}while(s!==null);A===null?E=A=n:A=A.next=n}else E=A=n;s={baseState:d.baseState,firstBaseUpdate:E,lastBaseUpdate:A,shared:d.shared,callbacks:d.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var _u=!1;function Da(){if(_u){var t=ys;if(t!==null)throw t}}function Aa(t,n,s,d){_u=!1;var E=t.updateQueue;fr=!1;var A=E.firstBaseUpdate,I=E.lastBaseUpdate,V=E.shared.pending;if(V!==null){E.shared.pending=null;var J=V,oe=J.next;J.next=null,I===null?A=oe:I.next=oe,I=J;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,V=fe.lastBaseUpdate,V!==I&&(V===null?fe.firstBaseUpdate=oe:V.next=oe,fe.lastBaseUpdate=J))}if(A!==null){var pe=E.baseState;I=0,fe=oe=J=null,V=A;do{var ce=V.lane&-536870913,ue=ce!==V.lane;if(ue?(lt&ce)===ce:(d&ce)===ce){ce!==0&&ce===bs&&(_u=!0),fe!==null&&(fe=fe.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var Re=t,We=V;ce=n;var Rt=s;switch(We.tag){case 1:if(Re=We.payload,typeof Re=="function"){pe=Re.call(Rt,pe,ce);break e}pe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=We.payload,ce=typeof Re=="function"?Re.call(Rt,pe,ce):Re,ce==null)break e;pe=u({},pe,ce);break e;case 2:fr=!0}}ce=V.callback,ce!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=E.callbacks,ue===null?E.callbacks=[ce]:ue.push(ce))}else ue={lane:ce,tag:V.tag,payload:V.payload,callback:V.callback,next:null},fe===null?(oe=fe=ue,J=pe):fe=fe.next=ue,I|=ce;if(V=V.next,V===null){if(V=E.shared.pending,V===null)break;ue=V,V=ue.next,ue.next=null,E.lastBaseUpdate=ue,E.shared.pending=null}}while(!0);fe===null&&(J=pe),E.baseState=J,E.firstBaseUpdate=oe,E.lastBaseUpdate=fe,A===null&&(E.shared.lanes=0),yr|=I,t.lanes=I,t.memoizedState=pe}}function Eg(t,n){if(typeof t!="function")throw Error(o(191,t));t.call(n)}function wg(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Eg(s[t],n)}var Es=z(null),sl=z(0);function xg(t,n){t=Yi,H(sl,t),H(Es,n),Yi=t|n.baseLanes}function vu(){H(sl,Yi),H(Es,Es.current)}function bu(){Yi=sl.current,j(Es),j(sl)}var Yn=z(null),ci=null;function mr(t){var n=t.alternate;H(Yt,Yt.current&1),H(Yn,t),ci===null&&(n===null||Es.current!==null||n.memoizedState!==null)&&(ci=t)}function yu(t){H(Yt,Yt.current),H(Yn,t),ci===null&&(ci=t)}function Dg(t){t.tag===22?(H(Yt,Yt.current),H(Yn,t),ci===null&&(ci=t)):_r()}function _r(){H(Yt,Yt.current),H(Yn,Yn.current)}function Xn(t){j(Yn),ci===t&&(ci=null),j(Yt)}var Yt=z(0);function al(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Dh(s)||Ah(s)))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===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Hi=0,Qe=null,At=null,tn=null,ol=!1,ws=!1,Yr=!1,ll=0,ka=0,xs=null,Uy=0;function qt(){throw Error(o(321))}function Su(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Kn(t[s],n[s]))return!1;return!0}function Cu(t,n,s,d,E,A){return Hi=A,Qe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,W.H=t===null||t.memoizedState===null?cp:Fu,Yr=!1,A=s(d,E),Yr=!1,ws&&(A=kg(n,s,d,E)),Ag(t),A}function Ag(t){W.H=Ma;var n=At!==null&&At.next!==null;if(Hi=0,tn=At=Qe=null,ol=!1,ka=0,xs=null,n)throw Error(o(300));t===null||nn||(t=t.dependencies,t!==null&&Qo(t)&&(nn=!0))}function kg(t,n,s,d){Qe=t;var E=0;do{if(ws&&(xs=null),ka=0,ws=!1,25<=E)throw Error(o(301));if(E+=1,tn=At=null,t.updateQueue!=null){var A=t.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}W.H=up,A=n(s,d)}while(ws);return A}function Hy(){var t=W.H,n=t.useState()[0];return n=typeof n.then=="function"?Ra(n):n,t=t.useState()[0],(At!==null?At.memoizedState:null)!==t&&(Qe.flags|=1024),n}function Eu(){var t=ll!==0;return ll=0,t}function wu(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function xu(t){if(ol){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}ol=!1}Hi=0,tn=At=Qe=null,ws=!1,ka=ll=0,xs=null}function An(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Qe.memoizedState=tn=t:tn=tn.next=t,tn}function Xt(){if(At===null){var t=Qe.alternate;t=t!==null?t.memoizedState:null}else t=At.next;var n=tn===null?Qe.memoizedState:tn.next;if(n!==null)tn=n,At=t;else{if(t===null)throw Qe.alternate===null?Error(o(467)):Error(o(310));At=t,t={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},tn===null?Qe.memoizedState=tn=t:tn=tn.next=t}return tn}function cl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ra(t){var n=ka;return ka+=1,xs===null&&(xs=[]),t=vg(xs,t,n),n=Qe,(tn===null?n.memoizedState:tn.next)===null&&(n=n.alternate,W.H=n===null||n.memoizedState===null?cp:Fu),t}function ul(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ra(t);if(t.$$typeof===S)return gn(t)}throw Error(o(438,String(t)))}function Du(t){var n=null,s=Qe.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var d=Qe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(n={data:d.data.map(function(E){return E.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=cl(),Qe.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),d=0;d<t;d++)s[d]=T;return n.index++,s}function ji(t,n){return typeof n=="function"?n(t):n}function hl(t){var n=Xt();return Au(n,At,t)}function Au(t,n,s){var d=t.queue;if(d===null)throw Error(o(311));d.lastRenderedReducer=s;var E=t.baseQueue,A=d.pending;if(A!==null){if(E!==null){var I=E.next;E.next=A.next,A.next=I}n.baseQueue=E=A,d.pending=null}if(A=t.baseState,E===null)t.memoizedState=A;else{n=E.next;var V=I=null,J=null,oe=n,fe=!1;do{var pe=oe.lane&-536870913;if(pe!==oe.lane?(lt&pe)===pe:(Hi&pe)===pe){var ce=oe.revertLane;if(ce===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),pe===bs&&(fe=!0);else if((Hi&ce)===ce){oe=oe.next,ce===bs&&(fe=!0);continue}else pe={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},J===null?(V=J=pe,I=A):J=J.next=pe,Qe.lanes|=ce,yr|=ce;pe=oe.action,Yr&&s(A,pe),A=oe.hasEagerState?oe.eagerState:s(A,pe)}else ce={lane:pe,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},J===null?(V=J=ce,I=A):J=J.next=ce,Qe.lanes|=pe,yr|=pe;oe=oe.next}while(oe!==null&&oe!==n);if(J===null?I=A:J.next=V,!Kn(A,t.memoizedState)&&(nn=!0,fe&&(s=ys,s!==null)))throw s;t.memoizedState=A,t.baseState=I,t.baseQueue=J,d.lastRenderedState=A}return E===null&&(d.lanes=0),[t.memoizedState,d.dispatch]}function ku(t){var n=Xt(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=t;var d=s.dispatch,E=s.pending,A=n.memoizedState;if(E!==null){s.pending=null;var I=E=E.next;do A=t(A,I.action),I=I.next;while(I!==E);Kn(A,n.memoizedState)||(nn=!0),n.memoizedState=A,n.baseQueue===null&&(n.baseState=A),s.lastRenderedState=A}return[A,d]}function Rg(t,n,s){var d=Qe,E=Xt(),A=ht;if(A){if(s===void 0)throw Error(o(407));s=s()}else s=n();var I=!Kn((At||E).memoizedState,s);if(I&&(E.memoizedState=s,nn=!0),E=E.queue,Mu(Lg.bind(null,d,E,t),[t]),E.getSnapshot!==n||I||tn!==null&&tn.memoizedState.tag&1){if(d.flags|=2048,Ds(9,{destroy:void 0},Mg.bind(null,d,E,s,n),null),Lt===null)throw Error(o(349));A||(Hi&127)!==0||Tg(d,n,s)}return s}function Tg(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Qe.updateQueue,n===null?(n=cl(),Qe.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function Mg(t,n,s,d){n.value=s,n.getSnapshot=d,Og(n)&&Bg(t)}function Lg(t,n,s){return s(function(){Og(n)&&Bg(t)})}function Og(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Kn(t,s)}catch{return!0}}function Bg(t){var n=Ur(t,2);n!==null&&Un(n,t,2)}function Ru(t){var n=An();if(typeof t=="function"){var s=t;if(t=s(),Yr){zt(!0);try{s()}finally{zt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:t},n}function Ng(t,n,s,d){return t.baseState=s,Au(t,At,typeof d=="function"?d:ji)}function jy(t,n,s,d,E){if(gl(t))throw Error(o(485));if(t=n.action,t!==null){var A={payload:E,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){A.listeners.push(I)}};W.T!==null?s(!0):A.isTransition=!1,d(A),s=n.pending,s===null?(A.next=n.pending=A,Ig(n,A)):(A.next=s.next,n.pending=s.next=A)}}function Ig(t,n){var s=n.action,d=n.payload,E=t.state;if(n.isTransition){var A=W.T,I={};W.T=I;try{var V=s(E,d),J=W.S;J!==null&&J(I,V),Fg(t,n,V)}catch(oe){Tu(t,n,oe)}finally{A!==null&&I.types!==null&&(A.types=I.types),W.T=A}}else try{A=s(E,d),Fg(t,n,A)}catch(oe){Tu(t,n,oe)}}function Fg(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){zg(t,n,d)},function(d){return Tu(t,n,d)}):zg(t,n,s)}function zg(t,n,s){n.status="fulfilled",n.value=s,Pg(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,Ig(t,s)))}function Tu(t,n,s){var d=t.pending;if(t.pending=null,d!==null){d=d.next;do n.status="rejected",n.reason=s,Pg(n),n=n.next;while(n!==d)}t.action=null}function Pg(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Ug(t,n){return n}function Hg(t,n){if(ht){var s=Lt.formState;if(s!==null){e:{var d=Qe;if(ht){if(Pt){t:{for(var E=Pt,A=li;E.nodeType!==8;){if(!A){E=null;break t}if(E=ui(E.nextSibling),E===null){E=null;break t}}A=E.data,E=A==="F!"||A==="F"?E:null}if(E){Pt=ui(E.nextSibling),d=E.data==="F!";break e}}hr(d)}d=!1}d&&(n=s[0])}}return s=An(),s.memoizedState=s.baseState=n,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ug,lastRenderedState:n},s.queue=d,s=ap.bind(null,Qe,d),d.dispatch=s,d=Ru(!1),A=Iu.bind(null,Qe,!1,d.queue),d=An(),E={state:n,dispatch:null,action:t,pending:null},d.queue=E,s=jy.bind(null,Qe,E,A,s),E.dispatch=s,d.memoizedState=t,[n,s,!1]}function jg(t){var n=Xt();return $g(n,At,t)}function $g(t,n,s){if(n=Au(t,n,Ug)[0],t=hl(ji)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var d=Ra(n)}catch(I){throw I===Ss?tl:I}else d=n;n=Xt();var E=n.queue,A=E.dispatch;return s!==n.memoizedState&&(Qe.flags|=2048,Ds(9,{destroy:void 0},$y.bind(null,E,s),null)),[d,A,t]}function $y(t,n){t.action=n}function qg(t){var n=Xt(),s=At;if(s!==null)return $g(n,s,t);Xt(),n=n.memoizedState,s=Xt();var d=s.queue.dispatch;return s.memoizedState=t,[n,d,!1]}function Ds(t,n,s,d){return t={tag:t,create:s,deps:d,inst:n,next:null},n=Qe.updateQueue,n===null&&(n=cl(),Qe.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(d=s.next,s.next=t,t.next=d,n.lastEffect=t),t}function Wg(){return Xt().memoizedState}function dl(t,n,s,d){var E=An();Qe.flags|=t,E.memoizedState=Ds(1|n,{destroy:void 0},s,d===void 0?null:d)}function fl(t,n,s,d){var E=Xt();d=d===void 0?null:d;var A=E.memoizedState.inst;At!==null&&d!==null&&Su(d,At.memoizedState.deps)?E.memoizedState=Ds(n,A,s,d):(Qe.flags|=t,E.memoizedState=Ds(1|n,A,s,d))}function Gg(t,n){dl(8390656,8,t,n)}function Mu(t,n){fl(2048,8,t,n)}function qy(t){Qe.flags|=4;var n=Qe.updateQueue;if(n===null)n=cl(),Qe.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function Kg(t){var n=Xt().memoizedState;return qy({ref:n,nextImpl:t}),function(){if((bt&2)!==0)throw Error(o(440));return n.impl.apply(void 0,arguments)}}function Vg(t,n){return fl(4,2,t,n)}function Yg(t,n){return fl(4,4,t,n)}function Xg(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Zg(t,n,s){s=s!=null?s.concat([t]):null,fl(4,4,Xg.bind(null,n,t),s)}function Lu(){}function Qg(t,n){var s=Xt();n=n===void 0?null:n;var d=s.memoizedState;return n!==null&&Su(n,d[1])?d[0]:(s.memoizedState=[t,n],t)}function Jg(t,n){var s=Xt();n=n===void 0?null:n;var d=s.memoizedState;if(n!==null&&Su(n,d[1]))return d[0];if(d=t(),Yr){zt(!0);try{t()}finally{zt(!1)}}return s.memoizedState=[d,n],d}function Ou(t,n,s){return s===void 0||(Hi&1073741824)!==0&&(lt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=em(),Qe.lanes|=t,yr|=t,s)}function ep(t,n,s,d){return Kn(s,n)?s:Es.current!==null?(t=Ou(t,s,d),Kn(t,n)||(nn=!0),t):(Hi&42)===0||(Hi&1073741824)!==0&&(lt&261930)===0?(nn=!0,t.memoizedState=s):(t=em(),Qe.lanes|=t,yr|=t,n)}function tp(t,n,s,d,E){var A=K.p;K.p=A!==0&&8>A?A:8;var I=W.T,V={};W.T=V,Iu(t,!1,n,s);try{var J=E(),oe=W.S;if(oe!==null&&oe(V,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var fe=Py(J,d);Ta(t,n,fe,Jn(t))}else Ta(t,n,d,Jn(t))}catch(pe){Ta(t,n,{then:function(){},status:"rejected",reason:pe},Jn())}finally{K.p=A,I!==null&&V.types!==null&&(I.types=V.types),W.T=I}}function Wy(){}function Bu(t,n,s,d){if(t.tag!==5)throw Error(o(476));var E=np(t).queue;tp(t,E,n,X,s===null?Wy:function(){return ip(t),s(d)})}function np(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:X},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function ip(t){var n=np(t);n.next===null&&(n=t.alternate.memoizedState),Ta(t,n.next.queue,{},Jn())}function Nu(){return gn(Ka)}function rp(){return Xt().memoizedState}function sp(){return Xt().memoizedState}function Gy(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=Jn();t=gr(s);var d=pr(n,t,s);d!==null&&(Un(d,n,s),xa(d,n,s)),n={cache:uu()},t.payload=n;return}n=n.return}}function Ky(t,n,s){var d=Jn();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},gl(t)?op(n,s):(s=Jc(t,n,s,d),s!==null&&(Un(s,t,d),lp(s,n,d)))}function ap(t,n,s){var d=Jn();Ta(t,n,s,d)}function Ta(t,n,s,d){var E={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(gl(t))op(n,E);else{var A=t.alternate;if(t.lanes===0&&(A===null||A.lanes===0)&&(A=n.lastRenderedReducer,A!==null))try{var I=n.lastRenderedState,V=A(I,s);if(E.hasEagerState=!0,E.eagerState=V,Kn(V,I))return Vo(t,n,E,0),Lt===null&&Ko(),!1}catch{}finally{}if(s=Jc(t,n,E,d),s!==null)return Un(s,t,d),lp(s,n,d),!0}return!1}function Iu(t,n,s,d){if(d={lane:2,revertLane:gh(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},gl(t)){if(n)throw Error(o(479))}else n=Jc(t,s,d,2),n!==null&&Un(n,t,2)}function gl(t){var n=t.alternate;return t===Qe||n!==null&&n===Qe}function op(t,n){ws=ol=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function lp(t,n,s){if((s&4194048)!==0){var d=n.lanes;d&=t.pendingLanes,s|=d,n.lanes=s,Ie(t,s)}}var Ma={readContext:gn,use:ul,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useLayoutEffect:qt,useInsertionEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useSyncExternalStore:qt,useId:qt,useHostTransitionStatus:qt,useFormState:qt,useActionState:qt,useOptimistic:qt,useMemoCache:qt,useCacheRefresh:qt};Ma.useEffectEvent=qt;var cp={readContext:gn,use:ul,useCallback:function(t,n){return An().memoizedState=[t,n===void 0?null:n],t},useContext:gn,useEffect:Gg,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,dl(4194308,4,Xg.bind(null,n,t),s)},useLayoutEffect:function(t,n){return dl(4194308,4,t,n)},useInsertionEffect:function(t,n){dl(4,2,t,n)},useMemo:function(t,n){var s=An();n=n===void 0?null:n;var d=t();if(Yr){zt(!0);try{t()}finally{zt(!1)}}return s.memoizedState=[d,n],d},useReducer:function(t,n,s){var d=An();if(s!==void 0){var E=s(n);if(Yr){zt(!0);try{s(n)}finally{zt(!1)}}}else E=n;return d.memoizedState=d.baseState=E,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:E},d.queue=t,t=t.dispatch=Ky.bind(null,Qe,t),[d.memoizedState,t]},useRef:function(t){var n=An();return t={current:t},n.memoizedState=t},useState:function(t){t=Ru(t);var n=t.queue,s=ap.bind(null,Qe,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:Lu,useDeferredValue:function(t,n){var s=An();return Ou(s,t,n)},useTransition:function(){var t=Ru(!1);return t=tp.bind(null,Qe,t.queue,!0,!1),An().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var d=Qe,E=An();if(ht){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),Lt===null)throw Error(o(349));(lt&127)!==0||Tg(d,n,s)}E.memoizedState=s;var A={value:s,getSnapshot:n};return E.queue=A,Gg(Lg.bind(null,d,A,t),[t]),d.flags|=2048,Ds(9,{destroy:void 0},Mg.bind(null,d,A,s,n),null),s},useId:function(){var t=An(),n=Lt.identifierPrefix;if(ht){var s=wi,d=Ei;s=(d&~(1<<32-ut(d)-1)).toString(32)+s,n="_"+n+"R_"+s,s=ll++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=Uy++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:Nu,useFormState:Hg,useActionState:Hg,useOptimistic:function(t){var n=An();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Iu.bind(null,Qe,!0,s),s.dispatch=n,[t,n]},useMemoCache:Du,useCacheRefresh:function(){return An().memoizedState=Gy.bind(null,Qe)},useEffectEvent:function(t){var n=An(),s={impl:t};return n.memoizedState=s,function(){if((bt&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Fu={readContext:gn,use:ul,useCallback:Qg,useContext:gn,useEffect:Mu,useImperativeHandle:Zg,useInsertionEffect:Vg,useLayoutEffect:Yg,useMemo:Jg,useReducer:hl,useRef:Wg,useState:function(){return hl(ji)},useDebugValue:Lu,useDeferredValue:function(t,n){var s=Xt();return ep(s,At.memoizedState,t,n)},useTransition:function(){var t=hl(ji)[0],n=Xt().memoizedState;return[typeof t=="boolean"?t:Ra(t),n]},useSyncExternalStore:Rg,useId:rp,useHostTransitionStatus:Nu,useFormState:jg,useActionState:jg,useOptimistic:function(t,n){var s=Xt();return Ng(s,At,t,n)},useMemoCache:Du,useCacheRefresh:sp};Fu.useEffectEvent=Kg;var up={readContext:gn,use:ul,useCallback:Qg,useContext:gn,useEffect:Mu,useImperativeHandle:Zg,useInsertionEffect:Vg,useLayoutEffect:Yg,useMemo:Jg,useReducer:ku,useRef:Wg,useState:function(){return ku(ji)},useDebugValue:Lu,useDeferredValue:function(t,n){var s=Xt();return At===null?Ou(s,t,n):ep(s,At.memoizedState,t,n)},useTransition:function(){var t=ku(ji)[0],n=Xt().memoizedState;return[typeof t=="boolean"?t:Ra(t),n]},useSyncExternalStore:Rg,useId:rp,useHostTransitionStatus:Nu,useFormState:qg,useActionState:qg,useOptimistic:function(t,n){var s=Xt();return At!==null?Ng(s,At,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:Du,useCacheRefresh:sp};up.useEffectEvent=Kg;function zu(t,n,s,d){n=t.memoizedState,s=s(d,n),s=s==null?n:u({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Pu={enqueueSetState:function(t,n,s){t=t._reactInternals;var d=Jn(),E=gr(d);E.payload=n,s!=null&&(E.callback=s),n=pr(t,E,d),n!==null&&(Un(n,t,d),xa(n,t,d))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var d=Jn(),E=gr(d);E.tag=1,E.payload=n,s!=null&&(E.callback=s),n=pr(t,E,d),n!==null&&(Un(n,t,d),xa(n,t,d))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=Jn(),d=gr(s);d.tag=2,n!=null&&(d.callback=n),n=pr(t,d,s),n!==null&&(Un(n,t,s),xa(n,t,s))}};function hp(t,n,s,d,E,A,I){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(d,A,I):n.prototype&&n.prototype.isPureReactComponent?!_a(s,d)||!_a(E,A):!0}function dp(t,n,s,d){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,d),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,d),n.state!==t&&Pu.enqueueReplaceState(n,n.state,null)}function Xr(t,n){var s=n;if("ref"in n){s={};for(var d in n)d!=="ref"&&(s[d]=n[d])}if(t=t.defaultProps){s===n&&(s=u({},s));for(var E in t)s[E]===void 0&&(s[E]=t[E])}return s}function fp(t){Go(t)}function gp(t){console.error(t)}function pp(t){Go(t)}function pl(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(d){setTimeout(function(){throw d})}}function mp(t,n,s){try{var d=t.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Uu(t,n,s){return s=gr(s),s.tag=3,s.payload={element:null},s.callback=function(){pl(t,n)},s}function _p(t){return t=gr(t),t.tag=3,t}function vp(t,n,s,d){var E=s.type.getDerivedStateFromError;if(typeof E=="function"){var A=d.value;t.payload=function(){return E(A)},t.callback=function(){mp(n,s,d)}}var I=s.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(t.callback=function(){mp(n,s,d),typeof E!="function"&&(Sr===null?Sr=new Set([this]):Sr.add(this));var V=d.stack;this.componentDidCatch(d.value,{componentStack:V!==null?V:""})})}function Vy(t,n,s,d,E){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(n=s.alternate,n!==null&&vs(n,s,E,!0),s=Yn.current,s!==null){switch(s.tag){case 31:case 13:return ci===null?Al():s.alternate===null&&Wt===0&&(Wt=3),s.flags&=-257,s.flags|=65536,s.lanes=E,d===nl?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([d]):n.add(d),hh(t,d,E)),!1;case 22:return s.flags|=65536,d===nl?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([d]):s.add(d)),hh(t,d,E)),!1}throw Error(o(435,s.tag))}return hh(t,d,E),Al(),!1}if(ht)return n=Yn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=E,d!==su&&(t=Error(o(422),{cause:d}),ya(si(t,s)))):(d!==su&&(n=Error(o(423),{cause:d}),ya(si(n,s))),t=t.current.alternate,t.flags|=65536,E&=-E,t.lanes|=E,d=si(d,s),E=Uu(t.stateNode,d,E),mu(t,E),Wt!==4&&(Wt=2)),!1;var A=Error(o(520),{cause:d});if(A=si(A,s),Pa===null?Pa=[A]:Pa.push(A),Wt!==4&&(Wt=2),n===null)return!0;d=si(d,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=E&-E,s.lanes|=t,t=Uu(s.stateNode,d,t),mu(s,t),!1;case 1:if(n=s.type,A=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(Sr===null||!Sr.has(A))))return s.flags|=65536,E&=-E,s.lanes|=E,E=_p(E),vp(E,t,s,d),mu(s,E),!1}s=s.return}while(s!==null);return!1}var Hu=Error(o(461)),nn=!1;function pn(t,n,s,d){n.child=t===null?Cg(n,null,s,d):Vr(n,t.child,s,d)}function bp(t,n,s,d,E){s=s.render;var A=n.ref;if("ref"in d){var I={};for(var V in d)V!=="ref"&&(I[V]=d[V])}else I=d;return qr(n),d=Cu(t,n,s,I,A,E),V=Eu(),t!==null&&!nn?(wu(t,n,E),$i(t,n,E)):(ht&&V&&iu(n),n.flags|=1,pn(t,n,d,E),n.child)}function yp(t,n,s,d,E){if(t===null){var A=s.type;return typeof A=="function"&&!eu(A)&&A.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=A,Sp(t,n,A,d,E)):(t=Xo(s.type,null,d,n,n.mode,E),t.ref=n.ref,t.return=n,n.child=t)}if(A=t.child,!Yu(t,E)){var I=A.memoizedProps;if(s=s.compare,s=s!==null?s:_a,s(I,d)&&t.ref===n.ref)return $i(t,n,E)}return n.flags|=1,t=Fi(A,d),t.ref=n.ref,t.return=n,n.child=t}function Sp(t,n,s,d,E){if(t!==null){var A=t.memoizedProps;if(_a(A,d)&&t.ref===n.ref)if(nn=!1,n.pendingProps=d=A,Yu(t,E))(t.flags&131072)!==0&&(nn=!0);else return n.lanes=t.lanes,$i(t,n,E)}return ju(t,n,s,d,E)}function Cp(t,n,s,d){var E=d.children,A=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((n.flags&128)!==0){if(A=A!==null?A.baseLanes|s:s,t!==null){for(d=n.child=t.child,E=0;d!==null;)E=E|d.lanes|d.childLanes,d=d.sibling;d=E&~A}else d=0,n.child=null;return Ep(t,n,A,s,d)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&el(n,A!==null?A.cachePool:null),A!==null?xg(n,A):vu(),Dg(n);else return d=n.lanes=536870912,Ep(t,n,A!==null?A.baseLanes|s:s,s,d)}else A!==null?(el(n,A.cachePool),xg(n,A),_r(),n.memoizedState=null):(t!==null&&el(n,null),vu(),_r());return pn(t,n,E,s),n.child}function La(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Ep(t,n,s,d,E){var A=du();return A=A===null?null:{parent:en._currentValue,pool:A},n.memoizedState={baseLanes:s,cachePool:A},t!==null&&el(n,null),vu(),Dg(n),t!==null&&vs(t,n,d,!0),n.childLanes=E,null}function ml(t,n){return n=vl({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function wp(t,n,s){return Vr(n,t.child,null,s),t=ml(n,n.pendingProps),t.flags|=2,Xn(n),n.memoizedState=null,t}function Yy(t,n,s){var d=n.pendingProps,E=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(ht){if(d.mode==="hidden")return t=ml(n,d),n.lanes=536870912,La(null,t);if(yu(n),(t=Pt)?(t=Im(t,li),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:cr!==null?{id:Ei,overflow:wi}:null,retryLane:536870912,hydrationErrors:null},s=og(t),s.return=n,n.child=s,fn=n,Pt=null)):t=null,t===null)throw hr(n);return n.lanes=536870912,null}return ml(n,d)}var A=t.memoizedState;if(A!==null){var I=A.dehydrated;if(yu(n),E)if(n.flags&256)n.flags&=-257,n=wp(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(o(558));else if(nn||vs(t,n,s,!1),E=(s&t.childLanes)!==0,nn||E){if(d=Lt,d!==null&&(I=vt(d,s),I!==0&&I!==A.retryLane))throw A.retryLane=I,Ur(t,I),Un(d,t,I),Hu;Al(),n=wp(t,n,s)}else t=A.treeContext,Pt=ui(I.nextSibling),fn=n,ht=!0,ur=null,li=!1,t!==null&&ug(n,t),n=ml(n,d),n.flags|=4096;return n}return t=Fi(t.child,{mode:d.mode,children:d.children}),t.ref=n.ref,n.child=t,t.return=n,t}function _l(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function ju(t,n,s,d,E){return qr(n),s=Cu(t,n,s,d,void 0,E),d=Eu(),t!==null&&!nn?(wu(t,n,E),$i(t,n,E)):(ht&&d&&iu(n),n.flags|=1,pn(t,n,s,E),n.child)}function xp(t,n,s,d,E,A){return qr(n),n.updateQueue=null,s=kg(n,d,s,E),Ag(t),d=Eu(),t!==null&&!nn?(wu(t,n,A),$i(t,n,A)):(ht&&d&&iu(n),n.flags|=1,pn(t,n,s,A),n.child)}function Dp(t,n,s,d,E){if(qr(n),n.stateNode===null){var A=gs,I=s.contextType;typeof I=="object"&&I!==null&&(A=gn(I)),A=new s(d,A),n.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=Pu,n.stateNode=A,A._reactInternals=n,A=n.stateNode,A.props=d,A.state=n.memoizedState,A.refs={},gu(n),I=s.contextType,A.context=typeof I=="object"&&I!==null?gn(I):gs,A.state=n.memoizedState,I=s.getDerivedStateFromProps,typeof I=="function"&&(zu(n,s,I,d),A.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(I=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),I!==A.state&&Pu.enqueueReplaceState(A,A.state,null),Aa(n,d,A,E),Da(),A.state=n.memoizedState),typeof A.componentDidMount=="function"&&(n.flags|=4194308),d=!0}else if(t===null){A=n.stateNode;var V=n.memoizedProps,J=Xr(s,V);A.props=J;var oe=A.context,fe=s.contextType;I=gs,typeof fe=="object"&&fe!==null&&(I=gn(fe));var pe=s.getDerivedStateFromProps;fe=typeof pe=="function"||typeof A.getSnapshotBeforeUpdate=="function",V=n.pendingProps!==V,fe||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(V||oe!==I)&&dp(n,A,d,I),fr=!1;var ce=n.memoizedState;A.state=ce,Aa(n,d,A,E),Da(),oe=n.memoizedState,V||ce!==oe||fr?(typeof pe=="function"&&(zu(n,s,pe,d),oe=n.memoizedState),(J=fr||hp(n,s,J,d,ce,oe,I))?(fe||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(n.flags|=4194308)):(typeof A.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=d,n.memoizedState=oe),A.props=d,A.state=oe,A.context=I,d=J):(typeof A.componentDidMount=="function"&&(n.flags|=4194308),d=!1)}else{A=n.stateNode,pu(t,n),I=n.memoizedProps,fe=Xr(s,I),A.props=fe,pe=n.pendingProps,ce=A.context,oe=s.contextType,J=gs,typeof oe=="object"&&oe!==null&&(J=gn(oe)),V=s.getDerivedStateFromProps,(oe=typeof V=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(I!==pe||ce!==J)&&dp(n,A,d,J),fr=!1,ce=n.memoizedState,A.state=ce,Aa(n,d,A,E),Da();var ue=n.memoizedState;I!==pe||ce!==ue||fr||t!==null&&t.dependencies!==null&&Qo(t.dependencies)?(typeof V=="function"&&(zu(n,s,V,d),ue=n.memoizedState),(fe=fr||hp(n,s,fe,d,ce,ue,J)||t!==null&&t.dependencies!==null&&Qo(t.dependencies))?(oe||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(d,ue,J),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(d,ue,J)),typeof A.componentDidUpdate=="function"&&(n.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof A.componentDidUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(n.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(n.flags|=1024),n.memoizedProps=d,n.memoizedState=ue),A.props=d,A.state=ue,A.context=J,d=fe):(typeof A.componentDidUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(n.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(n.flags|=1024),d=!1)}return A=d,_l(t,n),d=(n.flags&128)!==0,A||d?(A=n.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:A.render(),n.flags|=1,t!==null&&d?(n.child=Vr(n,t.child,null,E),n.child=Vr(n,null,s,E)):pn(t,n,s,E),n.memoizedState=A.state,t=n.child):t=$i(t,n,E),t}function Ap(t,n,s,d){return jr(),n.flags|=256,pn(t,n,s,d),n.child}var $u={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qu(t){return{baseLanes:t,cachePool:mg()}}function Wu(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=Qn),t}function kp(t,n,s){var d=n.pendingProps,E=!1,A=(n.flags&128)!==0,I;if((I=A)||(I=t!==null&&t.memoizedState===null?!1:(Yt.current&2)!==0),I&&(E=!0,n.flags&=-129),I=(n.flags&32)!==0,n.flags&=-33,t===null){if(ht){if(E?mr(n):_r(),(t=Pt)?(t=Im(t,li),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:cr!==null?{id:Ei,overflow:wi}:null,retryLane:536870912,hydrationErrors:null},s=og(t),s.return=n,n.child=s,fn=n,Pt=null)):t=null,t===null)throw hr(n);return Ah(t)?n.lanes=32:n.lanes=536870912,null}var V=d.children;return d=d.fallback,E?(_r(),E=n.mode,V=vl({mode:"hidden",children:V},E),d=Hr(d,E,s,null),V.return=n,d.return=n,V.sibling=d,n.child=V,d=n.child,d.memoizedState=qu(s),d.childLanes=Wu(t,I,s),n.memoizedState=$u,La(null,d)):(mr(n),Gu(n,V))}var J=t.memoizedState;if(J!==null&&(V=J.dehydrated,V!==null)){if(A)n.flags&256?(mr(n),n.flags&=-257,n=Ku(t,n,s)):n.memoizedState!==null?(_r(),n.child=t.child,n.flags|=128,n=null):(_r(),V=d.fallback,E=n.mode,d=vl({mode:"visible",children:d.children},E),V=Hr(V,E,s,null),V.flags|=2,d.return=n,V.return=n,d.sibling=V,n.child=d,Vr(n,t.child,null,s),d=n.child,d.memoizedState=qu(s),d.childLanes=Wu(t,I,s),n.memoizedState=$u,n=La(null,d));else if(mr(n),Ah(V)){if(I=V.nextSibling&&V.nextSibling.dataset,I)var oe=I.dgst;I=oe,d=Error(o(419)),d.stack="",d.digest=I,ya({value:d,source:null,stack:null}),n=Ku(t,n,s)}else if(nn||vs(t,n,s,!1),I=(s&t.childLanes)!==0,nn||I){if(I=Lt,I!==null&&(d=vt(I,s),d!==0&&d!==J.retryLane))throw J.retryLane=d,Ur(t,d),Un(I,t,d),Hu;Dh(V)||Al(),n=Ku(t,n,s)}else Dh(V)?(n.flags|=192,n.child=t.child,n=null):(t=J.treeContext,Pt=ui(V.nextSibling),fn=n,ht=!0,ur=null,li=!1,t!==null&&ug(n,t),n=Gu(n,d.children),n.flags|=4096);return n}return E?(_r(),V=d.fallback,E=n.mode,J=t.child,oe=J.sibling,d=Fi(J,{mode:"hidden",children:d.children}),d.subtreeFlags=J.subtreeFlags&65011712,oe!==null?V=Fi(oe,V):(V=Hr(V,E,s,null),V.flags|=2),V.return=n,d.return=n,d.sibling=V,n.child=d,La(null,d),d=n.child,V=t.child.memoizedState,V===null?V=qu(s):(E=V.cachePool,E!==null?(J=en._currentValue,E=E.parent!==J?{parent:J,pool:J}:E):E=mg(),V={baseLanes:V.baseLanes|s,cachePool:E}),d.memoizedState=V,d.childLanes=Wu(t,I,s),n.memoizedState=$u,La(t.child,d)):(mr(n),s=t.child,t=s.sibling,s=Fi(s,{mode:"visible",children:d.children}),s.return=n,s.sibling=null,t!==null&&(I=n.deletions,I===null?(n.deletions=[t],n.flags|=16):I.push(t)),n.child=s,n.memoizedState=null,s)}function Gu(t,n){return n=vl({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function vl(t,n){return t=Vn(22,t,null,n),t.lanes=0,t}function Ku(t,n,s){return Vr(n,t.child,null,s),t=Gu(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function Rp(t,n,s){t.lanes|=n;var d=t.alternate;d!==null&&(d.lanes|=n),lu(t.return,n,s)}function Vu(t,n,s,d,E,A){var I=t.memoizedState;I===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:E,treeForkCount:A}:(I.isBackwards=n,I.rendering=null,I.renderingStartTime=0,I.last=d,I.tail=s,I.tailMode=E,I.treeForkCount=A)}function Tp(t,n,s){var d=n.pendingProps,E=d.revealOrder,A=d.tail;d=d.children;var I=Yt.current,V=(I&2)!==0;if(V?(I=I&1|2,n.flags|=128):I&=1,H(Yt,I),pn(t,n,d,s),d=ht?ba:0,!V&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Rp(t,s,n);else if(t.tag===19)Rp(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(E){case"forwards":for(s=n.child,E=null;s!==null;)t=s.alternate,t!==null&&al(t)===null&&(E=s),s=s.sibling;s=E,s===null?(E=n.child,n.child=null):(E=s.sibling,s.sibling=null),Vu(n,!1,E,s,A,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,E=n.child,n.child=null;E!==null;){if(t=E.alternate,t!==null&&al(t)===null){n.child=E;break}t=E.sibling,E.sibling=s,s=E,E=t}Vu(n,!0,s,null,A,d);break;case"together":Vu(n,!1,null,null,void 0,d);break;default:n.memoizedState=null}return n.child}function $i(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),yr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(vs(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(o(153));if(n.child!==null){for(t=n.child,s=Fi(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Fi(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function Yu(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Qo(t)))}function Xy(t,n,s){switch(n.tag){case 3:G(n,n.stateNode.containerInfo),dr(n,en,t.memoizedState.cache),jr();break;case 27:case 5:ne(n);break;case 4:G(n,n.stateNode.containerInfo);break;case 10:dr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,yu(n),null;break;case 13:var d=n.memoizedState;if(d!==null)return d.dehydrated!==null?(mr(n),n.flags|=128,null):(s&n.child.childLanes)!==0?kp(t,n,s):(mr(n),t=$i(t,n,s),t!==null?t.sibling:null);mr(n);break;case 19:var E=(t.flags&128)!==0;if(d=(s&n.childLanes)!==0,d||(vs(t,n,s,!1),d=(s&n.childLanes)!==0),E){if(d)return Tp(t,n,s);n.flags|=128}if(E=n.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),H(Yt,Yt.current),d)break;return null;case 22:return n.lanes=0,Cp(t,n,s,n.pendingProps);case 24:dr(n,en,t.memoizedState.cache)}return $i(t,n,s)}function Mp(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)nn=!0;else{if(!Yu(t,s)&&(n.flags&128)===0)return nn=!1,Xy(t,n,s);nn=(t.flags&131072)!==0}else nn=!1,ht&&(n.flags&1048576)!==0&&cg(n,ba,n.index);switch(n.lanes=0,n.tag){case 16:e:{var d=n.pendingProps;if(t=Gr(n.elementType),n.type=t,typeof t=="function")eu(t)?(d=Xr(t,d),n.tag=1,n=Dp(null,n,t,d,s)):(n.tag=0,n=ju(null,n,t,d,s));else{if(t!=null){var E=t.$$typeof;if(E===D){n.tag=11,n=bp(null,n,t,d,s);break e}else if(E===M){n.tag=14,n=yp(null,n,t,d,s);break e}}throw n=$(t)||t,Error(o(306,n,""))}}return n;case 0:return ju(t,n,n.type,n.pendingProps,s);case 1:return d=n.type,E=Xr(d,n.pendingProps),Dp(t,n,d,E,s);case 3:e:{if(G(n,n.stateNode.containerInfo),t===null)throw Error(o(387));d=n.pendingProps;var A=n.memoizedState;E=A.element,pu(t,n),Aa(n,d,null,s);var I=n.memoizedState;if(d=I.cache,dr(n,en,d),d!==A.cache&&cu(n,[en],s,!0),Da(),d=I.element,A.isDehydrated)if(A={element:d,isDehydrated:!1,cache:I.cache},n.updateQueue.baseState=A,n.memoizedState=A,n.flags&256){n=Ap(t,n,d,s);break e}else if(d!==E){E=si(Error(o(424)),n),ya(E),n=Ap(t,n,d,s);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Pt=ui(t.firstChild),fn=n,ht=!0,ur=null,li=!0,s=Cg(n,null,d,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(jr(),d===E){n=$i(t,n,s);break e}pn(t,n,d,s)}n=n.child}return n;case 26:return _l(t,n),t===null?(s=jm(n.type,null,n.pendingProps,null))?n.memoizedState=s:ht||(s=n.type,t=n.pendingProps,d=Bl(se.current).createElement(s),d[Kt]=n,d[vn]=t,mn(d,s,t),Qt(d),n.stateNode=d):n.memoizedState=jm(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return ne(n),t===null&&ht&&(d=n.stateNode=Pm(n.type,n.pendingProps,se.current),fn=n,li=!0,E=Pt,xr(n.type)?(kh=E,Pt=ui(d.firstChild)):Pt=E),pn(t,n,n.pendingProps.children,s),_l(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&ht&&((E=d=Pt)&&(d=DS(d,n.type,n.pendingProps,li),d!==null?(n.stateNode=d,fn=n,Pt=ui(d.firstChild),li=!1,E=!0):E=!1),E||hr(n)),ne(n),E=n.type,A=n.pendingProps,I=t!==null?t.memoizedProps:null,d=A.children,Eh(E,A)?d=null:I!==null&&Eh(E,I)&&(n.flags|=32),n.memoizedState!==null&&(E=Cu(t,n,Hy,null,null,s),Ka._currentValue=E),_l(t,n),pn(t,n,d,s),n.child;case 6:return t===null&&ht&&((t=s=Pt)&&(s=AS(s,n.pendingProps,li),s!==null?(n.stateNode=s,fn=n,Pt=null,t=!0):t=!1),t||hr(n)),null;case 13:return kp(t,n,s);case 4:return G(n,n.stateNode.containerInfo),d=n.pendingProps,t===null?n.child=Vr(n,null,d,s):pn(t,n,d,s),n.child;case 11:return bp(t,n,n.type,n.pendingProps,s);case 7:return pn(t,n,n.pendingProps,s),n.child;case 8:return pn(t,n,n.pendingProps.children,s),n.child;case 12:return pn(t,n,n.pendingProps.children,s),n.child;case 10:return d=n.pendingProps,dr(n,n.type,d.value),pn(t,n,d.children,s),n.child;case 9:return E=n.type._context,d=n.pendingProps.children,qr(n),E=gn(E),d=d(E),n.flags|=1,pn(t,n,d,s),n.child;case 14:return yp(t,n,n.type,n.pendingProps,s);case 15:return Sp(t,n,n.type,n.pendingProps,s);case 19:return Tp(t,n,s);case 31:return Yy(t,n,s);case 22:return Cp(t,n,s,n.pendingProps);case 24:return qr(n),d=gn(en),t===null?(E=du(),E===null&&(E=Lt,A=uu(),E.pooledCache=A,A.refCount++,A!==null&&(E.pooledCacheLanes|=s),E=A),n.memoizedState={parent:d,cache:E},gu(n),dr(n,en,E)):((t.lanes&s)!==0&&(pu(t,n),Aa(n,null,null,s),Da()),E=t.memoizedState,A=n.memoizedState,E.parent!==d?(E={parent:d,cache:d},n.memoizedState=E,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=E),dr(n,en,d)):(d=A.cache,dr(n,en,d),d!==E.cache&&cu(n,[en],s,!0))),pn(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(o(156,n.tag))}function qi(t){t.flags|=4}function Xu(t,n,s,d,E){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(E&335544128)===E)if(t.stateNode.complete)t.flags|=8192;else if(rm())t.flags|=8192;else throw Kr=nl,fu}else t.flags&=-16777217}function Lp(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Km(n))if(rm())t.flags|=8192;else throw Kr=nl,fu}function bl(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Le():536870912,t.lanes|=n,Ts|=n)}function Oa(t,n){if(!ht)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:d.sibling=null}}function Ut(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,d=0;if(n)for(var E=t.child;E!==null;)s|=E.lanes|E.childLanes,d|=E.subtreeFlags&65011712,d|=E.flags&65011712,E.return=t,E=E.sibling;else for(E=t.child;E!==null;)s|=E.lanes|E.childLanes,d|=E.subtreeFlags,d|=E.flags,E.return=t,E=E.sibling;return t.subtreeFlags|=d,t.childLanes=s,n}function Zy(t,n,s){var d=n.pendingProps;switch(ru(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(n),null;case 1:return Ut(n),null;case 3:return s=n.stateNode,d=null,t!==null&&(d=t.memoizedState.cache),n.memoizedState.cache!==d&&(n.flags|=2048),Ui(en),re(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(_s(n)?qi(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,au())),Ut(n),null;case 26:var E=n.type,A=n.memoizedState;return t===null?(qi(n),A!==null?(Ut(n),Lp(n,A)):(Ut(n),Xu(n,E,null,d,s))):A?A!==t.memoizedState?(qi(n),Ut(n),Lp(n,A)):(Ut(n),n.flags&=-16777217):(t=t.memoizedProps,t!==d&&qi(n),Ut(n),Xu(n,E,t,d,s)),null;case 27:if(ve(n),s=se.current,E=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==d&&qi(n);else{if(!d){if(n.stateNode===null)throw Error(o(166));return Ut(n),null}t=ee.current,_s(n)?hg(n):(t=Pm(E,d,s),n.stateNode=t,qi(n))}return Ut(n),null;case 5:if(ve(n),E=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==d&&qi(n);else{if(!d){if(n.stateNode===null)throw Error(o(166));return Ut(n),null}if(A=ee.current,_s(n))hg(n);else{var I=Bl(se.current);switch(A){case 1:A=I.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:A=I.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":A=I.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":A=I.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":A=I.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof d.is=="string"?I.createElement("select",{is:d.is}):I.createElement("select"),d.multiple?A.multiple=!0:d.size&&(A.size=d.size);break;default:A=typeof d.is=="string"?I.createElement(E,{is:d.is}):I.createElement(E)}}A[Kt]=n,A[vn]=d;e:for(I=n.child;I!==null;){if(I.tag===5||I.tag===6)A.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===n)break e;for(;I.sibling===null;){if(I.return===null||I.return===n)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}n.stateNode=A;e:switch(mn(A,E,d),E){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&qi(n)}}return Ut(n),Xu(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==d&&qi(n);else{if(typeof d!="string"&&n.stateNode===null)throw Error(o(166));if(t=se.current,_s(n)){if(t=n.stateNode,s=n.memoizedProps,d=null,E=fn,E!==null)switch(E.tag){case 27:case 5:d=E.memoizedProps}t[Kt]=n,t=!!(t.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||km(t.nodeValue,s)),t||hr(n,!0)}else t=Bl(t).createTextNode(d),t[Kt]=n,n.stateNode=t}return Ut(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(d=_s(n),s!==null){if(t===null){if(!d)throw Error(o(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Kt]=n}else jr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ut(n),t=!1}else s=au(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(Xn(n),n):(Xn(n),null);if((n.flags&128)!==0)throw Error(o(558))}return Ut(n),null;case 13:if(d=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(E=_s(n),d!==null&&d.dehydrated!==null){if(t===null){if(!E)throw Error(o(318));if(E=n.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(o(317));E[Kt]=n}else jr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ut(n),E=!1}else E=au(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=E),E=!0;if(!E)return n.flags&256?(Xn(n),n):(Xn(n),null)}return Xn(n),(n.flags&128)!==0?(n.lanes=s,n):(s=d!==null,t=t!==null&&t.memoizedState!==null,s&&(d=n.child,E=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(E=d.alternate.memoizedState.cachePool.pool),A=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(A=d.memoizedState.cachePool.pool),A!==E&&(d.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),bl(n,n.updateQueue),Ut(n),null);case 4:return re(),t===null&&vh(n.stateNode.containerInfo),Ut(n),null;case 10:return Ui(n.type),Ut(n),null;case 19:if(j(Yt),d=n.memoizedState,d===null)return Ut(n),null;if(E=(n.flags&128)!==0,A=d.rendering,A===null)if(E)Oa(d,!1);else{if(Wt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(A=al(t),A!==null){for(n.flags|=128,Oa(d,!1),t=A.updateQueue,n.updateQueue=t,bl(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)ag(s,t),s=s.sibling;return H(Yt,Yt.current&1|2),ht&&zi(n,d.treeForkCount),n.child}t=t.sibling}d.tail!==null&&Ne()>wl&&(n.flags|=128,E=!0,Oa(d,!1),n.lanes=4194304)}else{if(!E)if(t=al(A),t!==null){if(n.flags|=128,E=!0,t=t.updateQueue,n.updateQueue=t,bl(n,t),Oa(d,!0),d.tail===null&&d.tailMode==="hidden"&&!A.alternate&&!ht)return Ut(n),null}else 2*Ne()-d.renderingStartTime>wl&&s!==536870912&&(n.flags|=128,E=!0,Oa(d,!1),n.lanes=4194304);d.isBackwards?(A.sibling=n.child,n.child=A):(t=d.last,t!==null?t.sibling=A:n.child=A,d.last=A)}return d.tail!==null?(t=d.tail,d.rendering=t,d.tail=t.sibling,d.renderingStartTime=Ne(),t.sibling=null,s=Yt.current,H(Yt,E?s&1|2:s&1),ht&&zi(n,d.treeForkCount),t):(Ut(n),null);case 22:case 23:return Xn(n),bu(),d=n.memoizedState!==null,t!==null?t.memoizedState!==null!==d&&(n.flags|=8192):d&&(n.flags|=8192),d?(s&536870912)!==0&&(n.flags&128)===0&&(Ut(n),n.subtreeFlags&6&&(n.flags|=8192)):Ut(n),s=n.updateQueue,s!==null&&bl(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),d=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(d=n.memoizedState.cachePool.pool),d!==s&&(n.flags|=2048),t!==null&&j(Wr),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Ui(en),Ut(n),null;case 25:return null;case 30:return null}throw Error(o(156,n.tag))}function Qy(t,n){switch(ru(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Ui(en),re(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return ve(n),null;case 31:if(n.memoizedState!==null){if(Xn(n),n.alternate===null)throw Error(o(340));jr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Xn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(o(340));jr()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return j(Yt),null;case 4:return re(),null;case 10:return Ui(n.type),null;case 22:case 23:return Xn(n),bu(),t!==null&&j(Wr),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Ui(en),null;case 25:return null;default:return null}}function Op(t,n){switch(ru(n),n.tag){case 3:Ui(en),re();break;case 26:case 27:case 5:ve(n);break;case 4:re();break;case 31:n.memoizedState!==null&&Xn(n);break;case 13:Xn(n);break;case 19:j(Yt);break;case 10:Ui(n.type);break;case 22:case 23:Xn(n),bu(),t!==null&&j(Wr);break;case 24:Ui(en)}}function Ba(t,n){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var E=d.next;s=E;do{if((s.tag&t)===t){d=void 0;var A=s.create,I=s.inst;d=A(),I.destroy=d}s=s.next}while(s!==E)}}catch(V){Dt(n,n.return,V)}}function vr(t,n,s){try{var d=n.updateQueue,E=d!==null?d.lastEffect:null;if(E!==null){var A=E.next;d=A;do{if((d.tag&t)===t){var I=d.inst,V=I.destroy;if(V!==void 0){I.destroy=void 0,E=n;var J=s,oe=V;try{oe()}catch(fe){Dt(E,J,fe)}}}d=d.next}while(d!==A)}}catch(fe){Dt(n,n.return,fe)}}function Bp(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{wg(n,s)}catch(d){Dt(t,t.return,d)}}}function Np(t,n,s){s.props=Xr(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(d){Dt(t,n,d)}}function Na(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var d=t.stateNode;break;case 30:d=t.stateNode;break;default:d=t.stateNode}typeof s=="function"?t.refCleanup=s(d):s.current=d}}catch(E){Dt(t,n,E)}}function xi(t,n){var s=t.ref,d=t.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(E){Dt(t,n,E)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(E){Dt(t,n,E)}else s.current=null}function Ip(t){var n=t.type,s=t.memoizedProps,d=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(E){Dt(t,t.return,E)}}function Zu(t,n,s){try{var d=t.stateNode;yS(d,t.type,s,n),d[vn]=n}catch(E){Dt(t,t.return,E)}}function Fp(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&xr(t.type)||t.tag===4}function Qu(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Fp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&xr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ju(t,n,s){var d=t.tag;if(d===5||d===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Ce));else if(d!==4&&(d===27&&xr(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(Ju(t,n,s),t=t.sibling;t!==null;)Ju(t,n,s),t=t.sibling}function yl(t,n,s){var d=t.tag;if(d===5||d===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(d!==4&&(d===27&&xr(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(yl(t,n,s),t=t.sibling;t!==null;)yl(t,n,s),t=t.sibling}function zp(t){var n=t.stateNode,s=t.memoizedProps;try{for(var d=t.type,E=n.attributes;E.length;)n.removeAttributeNode(E[0]);mn(n,d,s),n[Kt]=t,n[vn]=s}catch(A){Dt(t,t.return,A)}}var Wi=!1,rn=!1,eh=!1,Pp=typeof WeakSet=="function"?WeakSet:Set,ln=null;function Jy(t,n){if(t=t.containerInfo,Sh=Hl,t=Zf(t),Kc(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var E=d.anchorOffset,A=d.focusNode;d=d.focusOffset;try{s.nodeType,A.nodeType}catch{s=null;break e}var I=0,V=-1,J=-1,oe=0,fe=0,pe=t,ce=null;t:for(;;){for(var ue;pe!==s||E!==0&&pe.nodeType!==3||(V=I+E),pe!==A||d!==0&&pe.nodeType!==3||(J=I+d),pe.nodeType===3&&(I+=pe.nodeValue.length),(ue=pe.firstChild)!==null;)ce=pe,pe=ue;for(;;){if(pe===t)break t;if(ce===s&&++oe===E&&(V=I),ce===A&&++fe===d&&(J=I),(ue=pe.nextSibling)!==null)break;pe=ce,ce=pe.parentNode}pe=ue}s=V===-1||J===-1?null:{start:V,end:J}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ch={focusedElem:t,selectionRange:s},Hl=!1,ln=n;ln!==null;)if(n=ln,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,ln=t;else for(;ln!==null;){switch(n=ln,A=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)E=t[s],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&A!==null){t=void 0,s=n,E=A.memoizedProps,A=A.memoizedState,d=s.stateNode;try{var Re=Xr(s.type,E);t=d.getSnapshotBeforeUpdate(Re,A),d.__reactInternalSnapshotBeforeUpdate=t}catch(We){Dt(s,s.return,We)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)xh(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xh(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(o(163))}if(t=n.sibling,t!==null){t.return=n.return,ln=t;break}ln=n.return}}function Up(t,n,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:Ki(t,s),d&4&&Ba(5,s);break;case 1:if(Ki(t,s),d&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(I){Dt(s,s.return,I)}else{var E=Xr(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(E,n,t.__reactInternalSnapshotBeforeUpdate)}catch(I){Dt(s,s.return,I)}}d&64&&Bp(s),d&512&&Na(s,s.return);break;case 3:if(Ki(t,s),d&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{wg(t,n)}catch(I){Dt(s,s.return,I)}}break;case 27:n===null&&d&4&&zp(s);case 26:case 5:Ki(t,s),n===null&&d&4&&Ip(s),d&512&&Na(s,s.return);break;case 12:Ki(t,s);break;case 31:Ki(t,s),d&4&&$p(t,s);break;case 13:Ki(t,s),d&4&&qp(t,s),d&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=lS.bind(null,s),kS(t,s))));break;case 22:if(d=s.memoizedState!==null||Wi,!d){n=n!==null&&n.memoizedState!==null||rn,E=Wi;var A=rn;Wi=d,(rn=n)&&!A?Vi(t,s,(s.subtreeFlags&8772)!==0):Ki(t,s),Wi=E,rn=A}break;case 30:break;default:Ki(t,s)}}function Hp(t){var n=t.alternate;n!==null&&(t.alternate=null,Hp(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&sa(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Ht=null,In=!1;function Gi(t,n,s){for(s=s.child;s!==null;)jp(t,n,s),s=s.sibling}function jp(t,n,s){if(Ct&&typeof Ct.onCommitFiberUnmount=="function")try{Ct.onCommitFiberUnmount(Ft,s)}catch{}switch(s.tag){case 26:rn||xi(s,n),Gi(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:rn||xi(s,n);var d=Ht,E=In;xr(s.type)&&(Ht=s.stateNode,In=!1),Gi(t,n,s),qa(s.stateNode),Ht=d,In=E;break;case 5:rn||xi(s,n);case 6:if(d=Ht,E=In,Ht=null,Gi(t,n,s),Ht=d,In=E,Ht!==null)if(In)try{(Ht.nodeType===9?Ht.body:Ht.nodeName==="HTML"?Ht.ownerDocument.body:Ht).removeChild(s.stateNode)}catch(A){Dt(s,n,A)}else try{Ht.removeChild(s.stateNode)}catch(A){Dt(s,n,A)}break;case 18:Ht!==null&&(In?(t=Ht,Bm(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),zs(t)):Bm(Ht,s.stateNode));break;case 4:d=Ht,E=In,Ht=s.stateNode.containerInfo,In=!0,Gi(t,n,s),Ht=d,In=E;break;case 0:case 11:case 14:case 15:vr(2,s,n),rn||vr(4,s,n),Gi(t,n,s);break;case 1:rn||(xi(s,n),d=s.stateNode,typeof d.componentWillUnmount=="function"&&Np(s,n,d)),Gi(t,n,s);break;case 21:Gi(t,n,s);break;case 22:rn=(d=rn)||s.memoizedState!==null,Gi(t,n,s),rn=d;break;default:Gi(t,n,s)}}function $p(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{zs(t)}catch(s){Dt(n,n.return,s)}}}function qp(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{zs(t)}catch(s){Dt(n,n.return,s)}}function eS(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Pp),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Pp),n;default:throw Error(o(435,t.tag))}}function Sl(t,n){var s=eS(t);n.forEach(function(d){if(!s.has(d)){s.add(d);var E=cS.bind(null,t,d);d.then(E,E)}})}function Fn(t,n){var s=n.deletions;if(s!==null)for(var d=0;d<s.length;d++){var E=s[d],A=t,I=n,V=I;e:for(;V!==null;){switch(V.tag){case 27:if(xr(V.type)){Ht=V.stateNode,In=!1;break e}break;case 5:Ht=V.stateNode,In=!1;break e;case 3:case 4:Ht=V.stateNode.containerInfo,In=!0;break e}V=V.return}if(Ht===null)throw Error(o(160));jp(A,I,E),Ht=null,In=!1,A=E.alternate,A!==null&&(A.return=null),E.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Wp(n,t),n=n.sibling}var vi=null;function Wp(t,n){var s=t.alternate,d=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Fn(n,t),zn(t),d&4&&(vr(3,t,t.return),Ba(3,t),vr(5,t,t.return));break;case 1:Fn(n,t),zn(t),d&512&&(rn||s===null||xi(s,s.return)),d&64&&Wi&&(t=t.updateQueue,t!==null&&(d=t.callbacks,d!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var E=vi;if(Fn(n,t),zn(t),d&512&&(rn||s===null||xi(s,s.return)),d&4){var A=s!==null?s.memoizedState:null;if(d=t.memoizedState,s===null)if(d===null)if(t.stateNode===null){e:{d=t.type,s=t.memoizedProps,E=E.ownerDocument||E;t:switch(d){case"title":A=E.getElementsByTagName("title")[0],(!A||A[Br]||A[Kt]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=E.createElement(d),E.head.insertBefore(A,E.querySelector("head > title"))),mn(A,d,s),A[Kt]=t,Qt(A),d=A;break e;case"link":var I=Wm("link","href",E).get(d+(s.href||""));if(I){for(var V=0;V<I.length;V++)if(A=I[V],A.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&A.getAttribute("rel")===(s.rel==null?null:s.rel)&&A.getAttribute("title")===(s.title==null?null:s.title)&&A.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){I.splice(V,1);break t}}A=E.createElement(d),mn(A,d,s),E.head.appendChild(A);break;case"meta":if(I=Wm("meta","content",E).get(d+(s.content||""))){for(V=0;V<I.length;V++)if(A=I[V],A.getAttribute("content")===(s.content==null?null:""+s.content)&&A.getAttribute("name")===(s.name==null?null:s.name)&&A.getAttribute("property")===(s.property==null?null:s.property)&&A.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&A.getAttribute("charset")===(s.charSet==null?null:s.charSet)){I.splice(V,1);break t}}A=E.createElement(d),mn(A,d,s),E.head.appendChild(A);break;default:throw Error(o(468,d))}A[Kt]=t,Qt(A),d=A}t.stateNode=d}else Gm(E,t.type,t.stateNode);else t.stateNode=qm(E,d,t.memoizedProps);else A!==d?(A===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):A.count--,d===null?Gm(E,t.type,t.stateNode):qm(E,d,t.memoizedProps)):d===null&&t.stateNode!==null&&Zu(t,t.memoizedProps,s.memoizedProps)}break;case 27:Fn(n,t),zn(t),d&512&&(rn||s===null||xi(s,s.return)),s!==null&&d&4&&Zu(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Fn(n,t),zn(t),d&512&&(rn||s===null||xi(s,s.return)),t.flags&32){E=t.stateNode;try{Ge(E,"")}catch(Re){Dt(t,t.return,Re)}}d&4&&t.stateNode!=null&&(E=t.memoizedProps,Zu(t,E,s!==null?s.memoizedProps:E)),d&1024&&(eh=!0);break;case 6:if(Fn(n,t),zn(t),d&4){if(t.stateNode===null)throw Error(o(162));d=t.memoizedProps,s=t.stateNode;try{s.nodeValue=d}catch(Re){Dt(t,t.return,Re)}}break;case 3:if(Fl=null,E=vi,vi=Nl(n.containerInfo),Fn(n,t),vi=E,zn(t),d&4&&s!==null&&s.memoizedState.isDehydrated)try{zs(n.containerInfo)}catch(Re){Dt(t,t.return,Re)}eh&&(eh=!1,Gp(t));break;case 4:d=vi,vi=Nl(t.stateNode.containerInfo),Fn(n,t),zn(t),vi=d;break;case 12:Fn(n,t),zn(t);break;case 31:Fn(n,t),zn(t),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,Sl(t,d)));break;case 13:Fn(n,t),zn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(El=Ne()),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,Sl(t,d)));break;case 22:E=t.memoizedState!==null;var J=s!==null&&s.memoizedState!==null,oe=Wi,fe=rn;if(Wi=oe||E,rn=fe||J,Fn(n,t),rn=fe,Wi=oe,zn(t),d&8192)e:for(n=t.stateNode,n._visibility=E?n._visibility&-2:n._visibility|1,E&&(s===null||J||Wi||rn||Zr(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){J=s=n;try{if(A=J.stateNode,E)I=A.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{V=J.stateNode;var pe=J.memoizedProps.style,ce=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;V.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Re){Dt(J,J.return,Re)}}}else if(n.tag===6){if(s===null){J=n;try{J.stateNode.nodeValue=E?"":J.memoizedProps}catch(Re){Dt(J,J.return,Re)}}}else if(n.tag===18){if(s===null){J=n;try{var ue=J.stateNode;E?Nm(ue,!0):Nm(J.stateNode,!1)}catch(Re){Dt(J,J.return,Re)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}d&4&&(d=t.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,Sl(t,s))));break;case 19:Fn(n,t),zn(t),d&4&&(d=t.updateQueue,d!==null&&(t.updateQueue=null,Sl(t,d)));break;case 30:break;case 21:break;default:Fn(n,t),zn(t)}}function zn(t){var n=t.flags;if(n&2){try{for(var s,d=t.return;d!==null;){if(Fp(d)){s=d;break}d=d.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var E=s.stateNode,A=Qu(t);yl(t,A,E);break;case 5:var I=s.stateNode;s.flags&32&&(Ge(I,""),s.flags&=-33);var V=Qu(t);yl(t,V,I);break;case 3:case 4:var J=s.stateNode.containerInfo,oe=Qu(t);Ju(t,oe,J);break;default:throw Error(o(161))}}catch(fe){Dt(t,t.return,fe)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function Gp(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;Gp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Ki(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Up(t,n.alternate,n),n=n.sibling}function Zr(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:vr(4,n,n.return),Zr(n);break;case 1:xi(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&Np(n,n.return,s),Zr(n);break;case 27:qa(n.stateNode);case 26:case 5:xi(n,n.return),Zr(n);break;case 22:n.memoizedState===null&&Zr(n);break;case 30:Zr(n);break;default:Zr(n)}t=t.sibling}}function Vi(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var d=n.alternate,E=t,A=n,I=A.flags;switch(A.tag){case 0:case 11:case 15:Vi(E,A,s),Ba(4,A);break;case 1:if(Vi(E,A,s),d=A,E=d.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(oe){Dt(d,d.return,oe)}if(d=A,E=d.updateQueue,E!==null){var V=d.stateNode;try{var J=E.shared.hiddenCallbacks;if(J!==null)for(E.shared.hiddenCallbacks=null,E=0;E<J.length;E++)Eg(J[E],V)}catch(oe){Dt(d,d.return,oe)}}s&&I&64&&Bp(A),Na(A,A.return);break;case 27:zp(A);case 26:case 5:Vi(E,A,s),s&&d===null&&I&4&&Ip(A),Na(A,A.return);break;case 12:Vi(E,A,s);break;case 31:Vi(E,A,s),s&&I&4&&$p(E,A);break;case 13:Vi(E,A,s),s&&I&4&&qp(E,A);break;case 22:A.memoizedState===null&&Vi(E,A,s),Na(A,A.return);break;case 30:break;default:Vi(E,A,s)}n=n.sibling}}function th(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Sa(s))}function nh(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Sa(t))}function bi(t,n,s,d){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Kp(t,n,s,d),n=n.sibling}function Kp(t,n,s,d){var E=n.flags;switch(n.tag){case 0:case 11:case 15:bi(t,n,s,d),E&2048&&Ba(9,n);break;case 1:bi(t,n,s,d);break;case 3:bi(t,n,s,d),E&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Sa(t)));break;case 12:if(E&2048){bi(t,n,s,d),t=n.stateNode;try{var A=n.memoizedProps,I=A.id,V=A.onPostCommit;typeof V=="function"&&V(I,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(J){Dt(n,n.return,J)}}else bi(t,n,s,d);break;case 31:bi(t,n,s,d);break;case 13:bi(t,n,s,d);break;case 23:break;case 22:A=n.stateNode,I=n.alternate,n.memoizedState!==null?A._visibility&2?bi(t,n,s,d):Ia(t,n):A._visibility&2?bi(t,n,s,d):(A._visibility|=2,As(t,n,s,d,(n.subtreeFlags&10256)!==0||!1)),E&2048&&th(I,n);break;case 24:bi(t,n,s,d),E&2048&&nh(n.alternate,n);break;default:bi(t,n,s,d)}}function As(t,n,s,d,E){for(E=E&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var A=t,I=n,V=s,J=d,oe=I.flags;switch(I.tag){case 0:case 11:case 15:As(A,I,V,J,E),Ba(8,I);break;case 23:break;case 22:var fe=I.stateNode;I.memoizedState!==null?fe._visibility&2?As(A,I,V,J,E):Ia(A,I):(fe._visibility|=2,As(A,I,V,J,E)),E&&oe&2048&&th(I.alternate,I);break;case 24:As(A,I,V,J,E),E&&oe&2048&&nh(I.alternate,I);break;default:As(A,I,V,J,E)}n=n.sibling}}function Ia(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,d=n,E=d.flags;switch(d.tag){case 22:Ia(s,d),E&2048&&th(d.alternate,d);break;case 24:Ia(s,d),E&2048&&nh(d.alternate,d);break;default:Ia(s,d)}n=n.sibling}}var Fa=8192;function ks(t,n,s){if(t.subtreeFlags&Fa)for(t=t.child;t!==null;)Vp(t,n,s),t=t.sibling}function Vp(t,n,s){switch(t.tag){case 26:ks(t,n,s),t.flags&Fa&&t.memoizedState!==null&&US(s,vi,t.memoizedState,t.memoizedProps);break;case 5:ks(t,n,s);break;case 3:case 4:var d=vi;vi=Nl(t.stateNode.containerInfo),ks(t,n,s),vi=d;break;case 22:t.memoizedState===null&&(d=t.alternate,d!==null&&d.memoizedState!==null?(d=Fa,Fa=16777216,ks(t,n,s),Fa=d):ks(t,n,s));break;default:ks(t,n,s)}}function Yp(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function za(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var d=n[s];ln=d,Zp(d,t)}Yp(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Xp(t),t=t.sibling}function Xp(t){switch(t.tag){case 0:case 11:case 15:za(t),t.flags&2048&&vr(9,t,t.return);break;case 3:za(t);break;case 12:za(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Cl(t)):za(t);break;default:za(t)}}function Cl(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var d=n[s];ln=d,Zp(d,t)}Yp(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:vr(8,n,n.return),Cl(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Cl(n));break;default:Cl(n)}t=t.sibling}}function Zp(t,n){for(;ln!==null;){var s=ln;switch(s.tag){case 0:case 11:case 15:vr(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:Sa(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,ln=d;else e:for(s=t;ln!==null;){d=ln;var E=d.sibling,A=d.return;if(Hp(d),d===s){ln=null;break e}if(E!==null){E.return=A,ln=E;break e}ln=A}}}var tS={getCacheForType:function(t){var n=gn(en),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return gn(en).controller.signal}},nS=typeof WeakMap=="function"?WeakMap:Map,bt=0,Lt=null,nt=null,lt=0,xt=0,Zn=null,br=!1,Rs=!1,ih=!1,Yi=0,Wt=0,yr=0,Qr=0,rh=0,Qn=0,Ts=0,Pa=null,Pn=null,sh=!1,El=0,Qp=0,wl=1/0,xl=null,Sr=null,an=0,Cr=null,Ms=null,Xi=0,ah=0,oh=null,Jp=null,Ua=0,lh=null;function Jn(){return(bt&2)!==0&&lt!==0?lt&-lt:W.T!==null?gh():xn()}function em(){if(Qn===0)if((lt&536870912)===0||ht){var t=mi;mi<<=1,(mi&3932160)===0&&(mi=262144),Qn=t}else Qn=536870912;return t=Yn.current,t!==null&&(t.flags|=32),Qn}function Un(t,n,s){(t===Lt&&(xt===2||xt===9)||t.cancelPendingCommit!==null)&&(Ls(t,0),Er(t,lt,Qn,!1)),ft(t,s),((bt&2)===0||t!==Lt)&&(t===Lt&&((bt&2)===0&&(Qr|=s),Wt===4&&Er(t,lt,Qn,!1)),Di(t))}function tm(t,n,s){if((bt&6)!==0)throw Error(o(327));var d=!s&&(n&127)===0&&(n&t.expiredLanes)===0||de(t,n),E=d?sS(t,n):uh(t,n,!0),A=d;do{if(E===0){Rs&&!d&&Er(t,n,0,!1);break}else{if(s=t.current.alternate,A&&!iS(s)){E=uh(t,n,!1),A=!1;continue}if(E===2){if(A=n,t.errorRecoveryDisabledLanes&A)var I=0;else I=t.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){n=I;e:{var V=t;E=Pa;var J=V.current.memoizedState.isDehydrated;if(J&&(Ls(V,I).flags|=256),I=uh(V,I,!1),I!==2){if(ih&&!J){V.errorRecoveryDisabledLanes|=A,Qr|=A,E=4;break e}A=Pn,Pn=E,A!==null&&(Pn===null?Pn=A:Pn.push.apply(Pn,A))}E=I}if(A=!1,E!==2)continue}}if(E===1){Ls(t,0),Er(t,n,0,!0);break}e:{switch(d=t,A=E,A){case 0:case 1:throw Error(o(345));case 4:if((n&4194048)!==n)break;case 6:Er(d,n,Qn,!br);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((n&62914560)===n&&(E=El+300-Ne(),10<E)){if(Er(d,n,Qn,!br),Q(d,0,!0)!==0)break e;Xi=n,d.timeoutHandle=Lm(nm.bind(null,d,s,Pn,xl,sh,n,Qn,Qr,Ts,br,A,"Throttled",-0,0),E);break e}nm(d,s,Pn,xl,sh,n,Qn,Qr,Ts,br,A,null,-0,0)}}break}while(!0);Di(t)}function nm(t,n,s,d,E,A,I,V,J,oe,fe,pe,ce,ue){if(t.timeoutHandle=-1,pe=n.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ce},Vp(n,A,pe);var Re=(A&62914560)===A?El-Ne():(A&4194048)===A?Qp-Ne():0;if(Re=HS(pe,Re),Re!==null){Xi=A,t.cancelPendingCommit=Re(um.bind(null,t,n,A,s,d,E,I,V,J,fe,pe,null,ce,ue)),Er(t,A,I,!oe);return}}um(t,n,A,s,d,E,I,V,J)}function iS(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var E=s[d],A=E.getSnapshot;E=E.value;try{if(!Kn(A(),E))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Er(t,n,s,d){n&=~rh,n&=~Qr,t.suspendedLanes|=n,t.pingedLanes&=~n,d&&(t.warmLanes|=n),d=t.expirationTimes;for(var E=n;0<E;){var A=31-ut(E),I=1<<A;d[A]=-1,E&=~I}s!==0&&we(t,s,n)}function Dl(){return(bt&6)===0?(Ha(0),!1):!0}function ch(){if(nt!==null){if(xt===0)var t=nt.return;else t=nt,Pi=$r=null,xu(t),Cs=null,Ea=0,t=nt;for(;t!==null;)Op(t.alternate,t),t=t.return;nt=null}}function Ls(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,ES(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Xi=0,ch(),Lt=t,nt=s=Fi(t.current,null),lt=n,xt=0,Zn=null,br=!1,Rs=de(t,n),ih=!1,Ts=Qn=rh=Qr=yr=Wt=0,Pn=Pa=null,sh=!1,(n&8)!==0&&(n|=n&32);var d=t.entangledLanes;if(d!==0)for(t=t.entanglements,d&=n;0<d;){var E=31-ut(d),A=1<<E;n|=t[E],d&=~A}return Yi=n,Ko(),s}function im(t,n){Qe=null,W.H=Ma,n===Ss||n===tl?(n=bg(),xt=3):n===fu?(n=bg(),xt=4):xt=n===Hu?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Zn=n,nt===null&&(Wt=1,pl(t,si(n,t.current)))}function rm(){var t=Yn.current;return t===null?!0:(lt&4194048)===lt?ci===null:(lt&62914560)===lt||(lt&536870912)!==0?t===ci:!1}function sm(){var t=W.H;return W.H=Ma,t===null?Ma:t}function am(){var t=W.A;return W.A=tS,t}function Al(){Wt=4,br||(lt&4194048)!==lt&&Yn.current!==null||(Rs=!0),(yr&134217727)===0&&(Qr&134217727)===0||Lt===null||Er(Lt,lt,Qn,!1)}function uh(t,n,s){var d=bt;bt|=2;var E=sm(),A=am();(Lt!==t||lt!==n)&&(xl=null,Ls(t,n)),n=!1;var I=Wt;e:do try{if(xt!==0&&nt!==null){var V=nt,J=Zn;switch(xt){case 8:ch(),I=6;break e;case 3:case 2:case 9:case 6:Yn.current===null&&(n=!0);var oe=xt;if(xt=0,Zn=null,Os(t,V,J,oe),s&&Rs){I=0;break e}break;default:oe=xt,xt=0,Zn=null,Os(t,V,J,oe)}}rS(),I=Wt;break}catch(fe){im(t,fe)}while(!0);return n&&t.shellSuspendCounter++,Pi=$r=null,bt=d,W.H=E,W.A=A,nt===null&&(Lt=null,lt=0,Ko()),I}function rS(){for(;nt!==null;)om(nt)}function sS(t,n){var s=bt;bt|=2;var d=sm(),E=am();Lt!==t||lt!==n?(xl=null,wl=Ne()+500,Ls(t,n)):Rs=de(t,n);e:do try{if(xt!==0&&nt!==null){n=nt;var A=Zn;t:switch(xt){case 1:xt=0,Zn=null,Os(t,n,A,1);break;case 2:case 9:if(_g(A)){xt=0,Zn=null,lm(n);break}n=function(){xt!==2&&xt!==9||Lt!==t||(xt=7),Di(t)},A.then(n,n);break e;case 3:xt=7;break e;case 4:xt=5;break e;case 7:_g(A)?(xt=0,Zn=null,lm(n)):(xt=0,Zn=null,Os(t,n,A,7));break;case 5:var I=null;switch(nt.tag){case 26:I=nt.memoizedState;case 5:case 27:var V=nt;if(I?Km(I):V.stateNode.complete){xt=0,Zn=null;var J=V.sibling;if(J!==null)nt=J;else{var oe=V.return;oe!==null?(nt=oe,kl(oe)):nt=null}break t}}xt=0,Zn=null,Os(t,n,A,5);break;case 6:xt=0,Zn=null,Os(t,n,A,6);break;case 8:ch(),Wt=6;break e;default:throw Error(o(462))}}aS();break}catch(fe){im(t,fe)}while(!0);return Pi=$r=null,W.H=d,W.A=E,bt=s,nt!==null?0:(Lt=null,lt=0,Ko(),Wt)}function aS(){for(;nt!==null&&!Ye();)om(nt)}function om(t){var n=Mp(t.alternate,t,Yi);t.memoizedProps=t.pendingProps,n===null?kl(t):nt=n}function lm(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=xp(s,n,n.pendingProps,n.type,void 0,lt);break;case 11:n=xp(s,n,n.pendingProps,n.type.render,n.ref,lt);break;case 5:xu(n);default:Op(s,n),n=nt=ag(n,Yi),n=Mp(s,n,Yi)}t.memoizedProps=t.pendingProps,n===null?kl(t):nt=n}function Os(t,n,s,d){Pi=$r=null,xu(n),Cs=null,Ea=0;var E=n.return;try{if(Vy(t,E,n,s,lt)){Wt=1,pl(t,si(s,t.current)),nt=null;return}}catch(A){if(E!==null)throw nt=E,A;Wt=1,pl(t,si(s,t.current)),nt=null;return}n.flags&32768?(ht||d===1?t=!0:Rs||(lt&536870912)!==0?t=!1:(br=t=!0,(d===2||d===9||d===3||d===6)&&(d=Yn.current,d!==null&&d.tag===13&&(d.flags|=16384))),cm(n,t)):kl(n)}function kl(t){var n=t;do{if((n.flags&32768)!==0){cm(n,br);return}t=n.return;var s=Zy(n.alternate,n,Yi);if(s!==null){nt=s;return}if(n=n.sibling,n!==null){nt=n;return}nt=n=t}while(n!==null);Wt===0&&(Wt=5)}function cm(t,n){do{var s=Qy(t.alternate,t);if(s!==null){s.flags&=32767,nt=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){nt=t;return}nt=t=s}while(t!==null);Wt=6,nt=null}function um(t,n,s,d,E,A,I,V,J){t.cancelPendingCommit=null;do Rl();while(an!==0);if((bt&6)!==0)throw Error(o(327));if(n!==null){if(n===t.current)throw Error(o(177));if(A=n.lanes|n.childLanes,A|=Qc,Ee(t,s,A,I,V,J),t===Lt&&(nt=Lt=null,lt=0),Ms=n,Cr=t,Xi=s,ah=A,oh=E,Jp=d,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,uS(Ae,function(){return pm(),null})):(t.callbackNode=null,t.callbackPriority=0),d=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||d){d=W.T,W.T=null,E=K.p,K.p=2,I=bt,bt|=4;try{Jy(t,n,s)}finally{bt=I,K.p=E,W.T=d}}an=1,hm(),dm(),fm()}}function hm(){if(an===1){an=0;var t=Cr,n=Ms,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=W.T,W.T=null;var d=K.p;K.p=2;var E=bt;bt|=4;try{Wp(n,t);var A=Ch,I=Zf(t.containerInfo),V=A.focusedElem,J=A.selectionRange;if(I!==V&&V&&V.ownerDocument&&Xf(V.ownerDocument.documentElement,V)){if(J!==null&&Kc(V)){var oe=J.start,fe=J.end;if(fe===void 0&&(fe=oe),"selectionStart"in V)V.selectionStart=oe,V.selectionEnd=Math.min(fe,V.value.length);else{var pe=V.ownerDocument||document,ce=pe&&pe.defaultView||window;if(ce.getSelection){var ue=ce.getSelection(),Re=V.textContent.length,We=Math.min(J.start,Re),Rt=J.end===void 0?We:Math.min(J.end,Re);!ue.extend&&We>Rt&&(I=Rt,Rt=We,We=I);var ie=Yf(V,We),te=Yf(V,Rt);if(ie&&te&&(ue.rangeCount!==1||ue.anchorNode!==ie.node||ue.anchorOffset!==ie.offset||ue.focusNode!==te.node||ue.focusOffset!==te.offset)){var ae=pe.createRange();ae.setStart(ie.node,ie.offset),ue.removeAllRanges(),We>Rt?(ue.addRange(ae),ue.extend(te.node,te.offset)):(ae.setEnd(te.node,te.offset),ue.addRange(ae))}}}}for(pe=[],ue=V;ue=ue.parentNode;)ue.nodeType===1&&pe.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<pe.length;V++){var ge=pe[V];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Hl=!!Sh,Ch=Sh=null}finally{bt=E,K.p=d,W.T=s}}t.current=n,an=2}}function dm(){if(an===2){an=0;var t=Cr,n=Ms,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=W.T,W.T=null;var d=K.p;K.p=2;var E=bt;bt|=4;try{Up(t,n.alternate,n)}finally{bt=E,K.p=d,W.T=s}}an=3}}function fm(){if(an===4||an===3){an=0,De();var t=Cr,n=Ms,s=Xi,d=Jp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?an=5:(an=0,Ms=Cr=null,gm(t,t.pendingLanes));var E=t.pendingLanes;if(E===0&&(Sr=null),wn(s),n=n.stateNode,Ct&&typeof Ct.onCommitFiberRoot=="function")try{Ct.onCommitFiberRoot(Ft,n,void 0,(n.current.flags&128)===128)}catch{}if(d!==null){n=W.T,E=K.p,K.p=2,W.T=null;try{for(var A=t.onRecoverableError,I=0;I<d.length;I++){var V=d[I];A(V.value,{componentStack:V.stack})}}finally{W.T=n,K.p=E}}(Xi&3)!==0&&Rl(),Di(t),E=t.pendingLanes,(s&261930)!==0&&(E&42)!==0?t===lh?Ua++:(Ua=0,lh=t):Ua=0,Ha(0)}}function gm(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Sa(n)))}function Rl(){return hm(),dm(),fm(),pm()}function pm(){if(an!==5)return!1;var t=Cr,n=ah;ah=0;var s=wn(Xi),d=W.T,E=K.p;try{K.p=32>s?32:s,W.T=null,s=oh,oh=null;var A=Cr,I=Xi;if(an=0,Ms=Cr=null,Xi=0,(bt&6)!==0)throw Error(o(331));var V=bt;if(bt|=4,Xp(A.current),Kp(A,A.current,I,s),bt=V,Ha(0,!1),Ct&&typeof Ct.onPostCommitFiberRoot=="function")try{Ct.onPostCommitFiberRoot(Ft,A)}catch{}return!0}finally{K.p=E,W.T=d,gm(t,n)}}function mm(t,n,s){n=si(s,n),n=Uu(t.stateNode,n,2),t=pr(t,n,2),t!==null&&(ft(t,2),Di(t))}function Dt(t,n,s){if(t.tag===3)mm(t,t,s);else for(;n!==null;){if(n.tag===3){mm(n,t,s);break}else if(n.tag===1){var d=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Sr===null||!Sr.has(d))){t=si(s,t),s=_p(2),d=pr(n,s,2),d!==null&&(vp(s,d,n,t),ft(d,2),Di(d));break}}n=n.return}}function hh(t,n,s){var d=t.pingCache;if(d===null){d=t.pingCache=new nS;var E=new Set;d.set(n,E)}else E=d.get(n),E===void 0&&(E=new Set,d.set(n,E));E.has(s)||(ih=!0,E.add(s),t=oS.bind(null,t,n,s),n.then(t,t))}function oS(t,n,s){var d=t.pingCache;d!==null&&d.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Lt===t&&(lt&s)===s&&(Wt===4||Wt===3&&(lt&62914560)===lt&&300>Ne()-El?(bt&2)===0&&Ls(t,0):rh|=s,Ts===lt&&(Ts=0)),Di(t)}function _m(t,n){n===0&&(n=Le()),t=Ur(t,n),t!==null&&(ft(t,n),Di(t))}function lS(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),_m(t,s)}function cS(t,n){var s=0;switch(t.tag){case 31:case 13:var d=t.stateNode,E=t.memoizedState;E!==null&&(s=E.retryLane);break;case 19:d=t.stateNode;break;case 22:d=t.stateNode._retryCache;break;default:throw Error(o(314))}d!==null&&d.delete(n),_m(t,s)}function uS(t,n){return $e(t,n)}var Tl=null,Bs=null,dh=!1,Ml=!1,fh=!1,wr=0;function Di(t){t!==Bs&&t.next===null&&(Bs===null?Tl=Bs=t:Bs=Bs.next=t),Ml=!0,dh||(dh=!0,dS())}function Ha(t,n){if(!fh&&Ml){fh=!0;do for(var s=!1,d=Tl;d!==null;){if(t!==0){var E=d.pendingLanes;if(E===0)var A=0;else{var I=d.suspendedLanes,V=d.pingedLanes;A=(1<<31-ut(42|t)+1)-1,A&=E&~(I&~V),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(s=!0,Sm(d,A))}else A=lt,A=Q(d,d===Lt?A:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(A&3)===0||de(d,A)||(s=!0,Sm(d,A));d=d.next}while(s);fh=!1}}function hS(){vm()}function vm(){Ml=dh=!1;var t=0;wr!==0&&CS()&&(t=wr);for(var n=Ne(),s=null,d=Tl;d!==null;){var E=d.next,A=bm(d,n);A===0?(d.next=null,s===null?Tl=E:s.next=E,E===null&&(Bs=s)):(s=d,(t!==0||(A&3)!==0)&&(Ml=!0)),d=E}an!==0&&an!==5||Ha(t),wr!==0&&(wr=0)}function bm(t,n){for(var s=t.suspendedLanes,d=t.pingedLanes,E=t.expirationTimes,A=t.pendingLanes&-62914561;0<A;){var I=31-ut(A),V=1<<I,J=E[I];J===-1?((V&s)===0||(V&d)!==0)&&(E[I]=ye(V,n)):J<=n&&(t.expiredLanes|=V),A&=~V}if(n=Lt,s=lt,s=Q(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d=t.callbackNode,s===0||t===n&&(xt===2||xt===9)||t.cancelPendingCommit!==null)return d!==null&&d!==null&&Ke(d),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||de(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(d!==null&&Ke(d),wn(s)){case 2:case 8:s=_e;break;case 32:s=Ae;break;case 268435456:s=ze;break;default:s=Ae}return d=ym.bind(null,t),s=$e(s,d),t.callbackPriority=n,t.callbackNode=s,n}return d!==null&&d!==null&&Ke(d),t.callbackPriority=2,t.callbackNode=null,2}function ym(t,n){if(an!==0&&an!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Rl()&&t.callbackNode!==s)return null;var d=lt;return d=Q(t,t===Lt?d:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),d===0?null:(tm(t,d,n),bm(t,Ne()),t.callbackNode!=null&&t.callbackNode===s?ym.bind(null,t):null)}function Sm(t,n){if(Rl())return null;tm(t,n,!0)}function dS(){wS(function(){(bt&6)!==0?$e(le,hS):vm()})}function gh(){if(wr===0){var t=bs;t===0&&(t=qn,qn<<=1,(qn&261888)===0&&(qn=256)),wr=t}return wr}function Cm(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:or(""+t)}function Em(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function fS(t,n,s,d,E){if(n==="submit"&&s&&s.stateNode===E){var A=Cm((E[vn]||null).action),I=d.submitter;I&&(n=(n=I[vn]||null)?Cm(n.formAction):I.getAttribute("formAction"),n!==null&&(A=n,I=null));var V=new $o("action","action",null,d,E);t.push({event:V,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(wr!==0){var J=I?Em(E,I):new FormData(E);Bu(s,{pending:!0,data:J,method:E.method,action:A},null,J)}}else typeof A=="function"&&(V.preventDefault(),J=I?Em(E,I):new FormData(E),Bu(s,{pending:!0,data:J,method:E.method,action:A},A,J))},currentTarget:E}]})}}for(var ph=0;ph<Zc.length;ph++){var mh=Zc[ph],gS=mh.toLowerCase(),pS=mh[0].toUpperCase()+mh.slice(1);_i(gS,"on"+pS)}_i(eg,"onAnimationEnd"),_i(tg,"onAnimationIteration"),_i(ng,"onAnimationStart"),_i("dblclick","onDoubleClick"),_i("focusin","onFocus"),_i("focusout","onBlur"),_i(My,"onTransitionRun"),_i(Ly,"onTransitionStart"),_i(Oy,"onTransitionCancel"),_i(ig,"onTransitionEnd"),be("onMouseEnter",["mouseout","mouseover"]),be("onMouseLeave",["mouseout","mouseover"]),be("onPointerEnter",["pointerout","pointerover"]),be("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ja="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(" "),mS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ja));function wm(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var d=t[s],E=d.event;d=d.listeners;e:{var A=void 0;if(n)for(var I=d.length-1;0<=I;I--){var V=d[I],J=V.instance,oe=V.currentTarget;if(V=V.listener,J!==A&&E.isPropagationStopped())break e;A=V,E.currentTarget=oe;try{A(E)}catch(fe){Go(fe)}E.currentTarget=null,A=J}else for(I=0;I<d.length;I++){if(V=d[I],J=V.instance,oe=V.currentTarget,V=V.listener,J!==A&&E.isPropagationStopped())break e;A=V,E.currentTarget=oe;try{A(E)}catch(fe){Go(fe)}E.currentTarget=null,A=J}}}}function it(t,n){var s=n[ra];s===void 0&&(s=n[ra]=new Set);var d=t+"__bubble";s.has(d)||(xm(n,t,2,!1),s.add(d))}function _h(t,n,s){var d=0;n&&(d|=4),xm(s,t,d,n)}var Ll="_reactListening"+Math.random().toString(36).slice(2);function vh(t){if(!t[Ll]){t[Ll]=!0,No.forEach(function(s){s!=="selectionchange"&&(mS.has(s)||_h(s,!1,t),_h(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Ll]||(n[Ll]=!0,_h("selectionchange",!1,n))}}function xm(t,n,s,d){switch(e_(n)){case 2:var E=qS;break;case 8:E=WS;break;default:E=Oh}s=E.bind(null,n,s,t),E=void 0,!zc||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(E=!0),d?E!==void 0?t.addEventListener(n,s,{capture:!0,passive:E}):t.addEventListener(n,s,!0):E!==void 0?t.addEventListener(n,s,{passive:E}):t.addEventListener(n,s,!1)}function bh(t,n,s,d,E){var A=d;if((n&1)===0&&(n&2)===0&&d!==null)e:for(;;){if(d===null)return;var I=d.tag;if(I===3||I===4){var V=d.stateNode.containerInfo;if(V===E)break;if(I===4)for(I=d.return;I!==null;){var J=I.tag;if((J===3||J===4)&&I.stateNode.containerInfo===E)return;I=I.return}for(;V!==null;){if(I=Dn(V),I===null)return;if(J=I.tag,J===5||J===6||J===26||J===27){d=A=I;continue e}V=V.parentNode}}d=d.return}Po(function(){var oe=A,fe=Ze(s),pe=[];e:{var ce=rg.get(t);if(ce!==void 0){var ue=$o,Re=t;switch(t){case"keypress":if(Ho(s)===0)break e;case"keydown":case"keyup":ue=cy;break;case"focusin":Re="focus",ue=jc;break;case"focusout":Re="blur",ue=jc;break;case"beforeblur":case"afterblur":ue=jc;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Of;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=Z1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=dy;break;case eg:case tg:case ng:ue=ey;break;case ig:ue=gy;break;case"scroll":case"scrollend":ue=Y1;break;case"wheel":ue=my;break;case"copy":case"cut":case"paste":ue=ny;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Nf;break;case"toggle":case"beforetoggle":ue=vy}var We=(n&4)!==0,Rt=!We&&(t==="scroll"||t==="scrollend"),ie=We?ce!==null?ce+"Capture":null:ce;We=[];for(var te=oe,ae;te!==null;){var ge=te;if(ae=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||ae===null||ie===null||(ge=ua(te,ie),ge!=null&&We.push($a(te,ge,ae))),Rt)break;te=te.return}0<We.length&&(ce=new ue(ce,Re,null,s,fe),pe.push({event:ce,listeners:We}))}}if((n&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",ce&&s!==Oe&&(Re=s.relatedTarget||s.fromElement)&&(Dn(Re)||Re[ir]))break e;if((ue||ce)&&(ce=fe.window===fe?fe:(ce=fe.ownerDocument)?ce.defaultView||ce.parentWindow:window,ue?(Re=s.relatedTarget||s.toElement,ue=oe,Re=Re?Dn(Re):null,Re!==null&&(Rt=m(Re),We=Re.tag,Re!==Rt||We!==5&&We!==27&&We!==6)&&(Re=null)):(ue=null,Re=oe),ue!==Re)){if(We=Of,ge="onMouseLeave",ie="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(We=Nf,ge="onPointerLeave",ie="onPointerEnter",te="pointer"),Rt=ue==null?ce:rr(ue),ae=Re==null?ce:rr(Re),ce=new We(ge,te+"leave",ue,s,fe),ce.target=Rt,ce.relatedTarget=ae,ge=null,Dn(fe)===oe&&(We=new We(ie,te+"enter",Re,s,fe),We.target=ae,We.relatedTarget=Rt,ge=We),Rt=ge,ue&&Re)t:{for(We=_S,ie=ue,te=Re,ae=0,ge=ie;ge;ge=We(ge))ae++;ge=0;for(var Ue=te;Ue;Ue=We(Ue))ge++;for(;0<ae-ge;)ie=We(ie),ae--;for(;0<ge-ae;)te=We(te),ge--;for(;ae--;){if(ie===te||te!==null&&ie===te.alternate){We=ie;break t}ie=We(ie),te=We(te)}We=null}else We=null;ue!==null&&Dm(pe,ce,ue,We,!1),Re!==null&&Rt!==null&&Dm(pe,Rt,Re,We,!0)}}e:{if(ce=oe?rr(oe):window,ue=ce.nodeName&&ce.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ce.type==="file")var pt=$f;else if(Hf(ce))if(qf)pt=ky;else{pt=Dy;var Be=xy}else ue=ce.nodeName,!ue||ue.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&ar(oe.elementType)&&(pt=$f):pt=Ay;if(pt&&(pt=pt(t,oe))){jf(pe,pt,s,fe);break e}Be&&Be(t,ce,oe),t==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&ls(ce,"number",ce.value)}switch(Be=oe?rr(oe):window,t){case"focusin":(Hf(Be)||Be.contentEditable==="true")&&(hs=Be,Vc=oe,va=null);break;case"focusout":va=Vc=hs=null;break;case"mousedown":Yc=!0;break;case"contextmenu":case"mouseup":case"dragend":Yc=!1,Qf(pe,s,fe);break;case"selectionchange":if(Ty)break;case"keydown":case"keyup":Qf(pe,s,fe)}var Je;if(qc)e:{switch(t){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else us?Pf(t,s)&&(ct="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(ct="onCompositionStart");ct&&(If&&s.locale!=="ko"&&(us||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&us&&(Je=Mf()):(lr=fe,Pc="value"in lr?lr.value:lr.textContent,us=!0)),Be=Ol(oe,ct),0<Be.length&&(ct=new Bf(ct,t,null,s,fe),pe.push({event:ct,listeners:Be}),Je?ct.data=Je:(Je=Uf(s),Je!==null&&(ct.data=Je)))),(Je=yy?Sy(t,s):Cy(t,s))&&(ct=Ol(oe,"onBeforeInput"),0<ct.length&&(Be=new Bf("onBeforeInput","beforeinput",null,s,fe),pe.push({event:Be,listeners:ct}),Be.data=Je)),fS(pe,t,oe,s,fe)}wm(pe,n)})}function $a(t,n,s){return{instance:t,listener:n,currentTarget:s}}function Ol(t,n){for(var s=n+"Capture",d=[];t!==null;){var E=t,A=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||A===null||(E=ua(t,s),E!=null&&d.unshift($a(t,E,A)),E=ua(t,n),E!=null&&d.push($a(t,E,A))),t.tag===3)return d;t=t.return}return[]}function _S(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Dm(t,n,s,d,E){for(var A=n._reactName,I=[];s!==null&&s!==d;){var V=s,J=V.alternate,oe=V.stateNode;if(V=V.tag,J!==null&&J===d)break;V!==5&&V!==26&&V!==27||oe===null||(J=oe,E?(oe=ua(s,A),oe!=null&&I.unshift($a(s,oe,J))):E||(oe=ua(s,A),oe!=null&&I.push($a(s,oe,J)))),s=s.return}I.length!==0&&t.push({event:n,listeners:I})}var vS=/\r\n?/g,bS=/\u0000|\uFFFD/g;function Am(t){return(typeof t=="string"?t:""+t).replace(vS,`
49
- `).replace(bS,"")}function km(t,n){return n=Am(n),Am(t)===n}function kt(t,n,s,d,E,A){switch(s){case"children":typeof d=="string"?n==="body"||n==="textarea"&&d===""||Ge(t,d):(typeof d=="number"||typeof d=="bigint")&&n!=="body"&&Ge(t,""+d);break;case"className":Wn(t,"class",d);break;case"tabIndex":Wn(t,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Wn(t,s,d);break;case"style":wt(t,d,A);break;case"data":if(n!=="object"){Wn(t,"data",d);break}case"src":case"href":if(d===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(s);break}d=or(""+d),t.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="function"){t.setAttribute(s,"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 A=="function"&&(s==="formAction"?(n!=="input"&&kt(t,n,"name",E.name,E,null),kt(t,n,"formEncType",E.formEncType,E,null),kt(t,n,"formMethod",E.formMethod,E,null),kt(t,n,"formTarget",E.formTarget,E,null)):(kt(t,n,"encType",E.encType,E,null),kt(t,n,"method",E.method,E,null),kt(t,n,"target",E.target,E,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){t.removeAttribute(s);break}d=or(""+d),t.setAttribute(s,d);break;case"onClick":d!=null&&(t.onclick=Ce);break;case"onScroll":d!=null&&it("scroll",t);break;case"onScrollEnd":d!=null&&it("scrollend",t);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(o(61));if(s=d.__html,s!=null){if(E.children!=null)throw Error(o(60));t.innerHTML=s}}break;case"multiple":t.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":t.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){t.removeAttribute("xlink:href");break}s=or(""+d),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(s,""+d):t.removeAttribute(s);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":d&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":d===!0?t.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?t.setAttribute(s,d):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?t.setAttribute(s,d):t.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?t.removeAttribute(s):t.setAttribute(s,d);break;case"popover":it("beforetoggle",t),it("toggle",t),bn(t,"popover",d);break;case"xlinkActuate":On(t,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":On(t,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":On(t,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":On(t,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":On(t,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":On(t,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":On(t,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":On(t,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":On(t,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":bn(t,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ni.get(s)||s,bn(t,s,d))}}function yh(t,n,s,d,E,A){switch(s){case"style":wt(t,d,A);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(o(61));if(s=d.__html,s!=null){if(E.children!=null)throw Error(o(60));t.innerHTML=s}}break;case"children":typeof d=="string"?Ge(t,d):(typeof d=="number"||typeof d=="bigint")&&Ge(t,""+d);break;case"onScroll":d!=null&&it("scroll",t);break;case"onScrollEnd":d!=null&&it("scrollend",t);break;case"onClick":d!=null&&(t.onclick=Ce);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Nr.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(E=s.endsWith("Capture"),n=s.slice(2,E?s.length-7:void 0),A=t[vn]||null,A=A!=null?A[s]:null,typeof A=="function"&&t.removeEventListener(n,A,E),typeof d=="function")){typeof A!="function"&&A!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,d,E);break e}s in t?t[s]=d:d===!0?t.setAttribute(s,""):bn(t,s,d)}}}function mn(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":it("error",t),it("load",t);var d=!1,E=!1,A;for(A in s)if(s.hasOwnProperty(A)){var I=s[A];if(I!=null)switch(A){case"src":d=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,n));default:kt(t,n,A,I,s,null)}}E&&kt(t,n,"srcSet",s.srcSet,s,null),d&&kt(t,n,"src",s.src,s,null);return;case"input":it("invalid",t);var V=A=I=E=null,J=null,oe=null;for(d in s)if(s.hasOwnProperty(d)){var fe=s[d];if(fe!=null)switch(d){case"name":E=fe;break;case"type":I=fe;break;case"checked":J=fe;break;case"defaultChecked":oe=fe;break;case"value":A=fe;break;case"defaultValue":V=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,n));break;default:kt(t,n,d,fe,s,null)}}Ir(t,A,V,J,oe,I,E,!1);return;case"select":it("invalid",t),d=I=A=null;for(E in s)if(s.hasOwnProperty(E)&&(V=s[E],V!=null))switch(E){case"value":A=V;break;case"defaultValue":I=V;break;case"multiple":d=V;default:kt(t,n,E,V,s,null)}n=A,s=I,t.multiple=!!d,n!=null?dn(t,!!d,n,!1):s!=null&&dn(t,!!d,s,!0);return;case"textarea":it("invalid",t),A=E=d=null;for(I in s)if(s.hasOwnProperty(I)&&(V=s[I],V!=null))switch(I){case"value":d=V;break;case"defaultValue":E=V;break;case"children":A=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(91));break;default:kt(t,n,I,V,s,null)}cs(t,d,E,A);return;case"option":for(J in s)if(s.hasOwnProperty(J)&&(d=s[J],d!=null))switch(J){case"selected":t.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:kt(t,n,J,d,s,null)}return;case"dialog":it("beforetoggle",t),it("toggle",t),it("cancel",t),it("close",t);break;case"iframe":case"object":it("load",t);break;case"video":case"audio":for(d=0;d<ja.length;d++)it(ja[d],t);break;case"image":it("error",t),it("load",t);break;case"details":it("toggle",t);break;case"embed":case"source":case"link":it("error",t),it("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in s)if(s.hasOwnProperty(oe)&&(d=s[oe],d!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,n));default:kt(t,n,oe,d,s,null)}return;default:if(ar(n)){for(fe in s)s.hasOwnProperty(fe)&&(d=s[fe],d!==void 0&&yh(t,n,fe,d,s,void 0));return}}for(V in s)s.hasOwnProperty(V)&&(d=s[V],d!=null&&kt(t,n,V,d,s,null))}function yS(t,n,s,d){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,A=null,I=null,V=null,J=null,oe=null,fe=null;for(ue in s){var pe=s[ue];if(s.hasOwnProperty(ue)&&pe!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":J=pe;default:d.hasOwnProperty(ue)||kt(t,n,ue,null,d,pe)}}for(var ce in d){var ue=d[ce];if(pe=s[ce],d.hasOwnProperty(ce)&&(ue!=null||pe!=null))switch(ce){case"type":A=ue;break;case"name":E=ue;break;case"checked":oe=ue;break;case"defaultChecked":fe=ue;break;case"value":I=ue;break;case"defaultValue":V=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(o(137,n));break;default:ue!==pe&&kt(t,n,ce,ue,d,pe)}}oa(t,I,V,J,oe,fe,A,E);return;case"select":ue=I=V=ce=null;for(A in s)if(J=s[A],s.hasOwnProperty(A)&&J!=null)switch(A){case"value":break;case"multiple":ue=J;default:d.hasOwnProperty(A)||kt(t,n,A,null,d,J)}for(E in d)if(A=d[E],J=s[E],d.hasOwnProperty(E)&&(A!=null||J!=null))switch(E){case"value":ce=A;break;case"defaultValue":V=A;break;case"multiple":I=A;default:A!==J&&kt(t,n,E,A,d,J)}n=V,s=I,d=ue,ce!=null?dn(t,!!s,ce,!1):!!d!=!!s&&(n!=null?dn(t,!!s,n,!0):dn(t,!!s,s?[]:"",!1));return;case"textarea":ue=ce=null;for(V in s)if(E=s[V],s.hasOwnProperty(V)&&E!=null&&!d.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:kt(t,n,V,null,d,E)}for(I in d)if(E=d[I],A=s[I],d.hasOwnProperty(I)&&(E!=null||A!=null))switch(I){case"value":ce=E;break;case"defaultValue":ue=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(o(91));break;default:E!==A&&kt(t,n,I,E,d,A)}Fo(t,ce,ue);return;case"option":for(var Re in s)if(ce=s[Re],s.hasOwnProperty(Re)&&ce!=null&&!d.hasOwnProperty(Re))switch(Re){case"selected":t.selected=!1;break;default:kt(t,n,Re,null,d,ce)}for(J in d)if(ce=d[J],ue=s[J],d.hasOwnProperty(J)&&ce!==ue&&(ce!=null||ue!=null))switch(J){case"selected":t.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:kt(t,n,J,ce,d,ue)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var We in s)ce=s[We],s.hasOwnProperty(We)&&ce!=null&&!d.hasOwnProperty(We)&&kt(t,n,We,null,d,ce);for(oe in d)if(ce=d[oe],ue=s[oe],d.hasOwnProperty(oe)&&ce!==ue&&(ce!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,n));break;default:kt(t,n,oe,ce,d,ue)}return;default:if(ar(n)){for(var Rt in s)ce=s[Rt],s.hasOwnProperty(Rt)&&ce!==void 0&&!d.hasOwnProperty(Rt)&&yh(t,n,Rt,void 0,d,ce);for(fe in d)ce=d[fe],ue=s[fe],!d.hasOwnProperty(fe)||ce===ue||ce===void 0&&ue===void 0||yh(t,n,fe,ce,d,ue);return}}for(var ie in s)ce=s[ie],s.hasOwnProperty(ie)&&ce!=null&&!d.hasOwnProperty(ie)&&kt(t,n,ie,null,d,ce);for(pe in d)ce=d[pe],ue=s[pe],!d.hasOwnProperty(pe)||ce===ue||ce==null&&ue==null||kt(t,n,pe,ce,d,ue)}function Rm(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function SS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var E=s[d],A=E.transferSize,I=E.initiatorType,V=E.duration;if(A&&V&&Rm(I)){for(I=0,V=E.responseEnd,d+=1;d<s.length;d++){var J=s[d],oe=J.startTime;if(oe>V)break;var fe=J.transferSize,pe=J.initiatorType;fe&&Rm(pe)&&(J=J.responseEnd,I+=fe*(J<V?1:(V-oe)/(J-oe)))}if(--d,n+=8*(A+I)/(E.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Sh=null,Ch=null;function Bl(t){return t.nodeType===9?t:t.ownerDocument}function Tm(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Mm(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Eh(t,n){return t==="textarea"||t==="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 wh=null;function CS(){var t=window.event;return t&&t.type==="popstate"?t===wh?!1:(wh=t,!0):(wh=null,!1)}var Lm=typeof setTimeout=="function"?setTimeout:void 0,ES=typeof clearTimeout=="function"?clearTimeout:void 0,Om=typeof Promise=="function"?Promise:void 0,wS=typeof queueMicrotask=="function"?queueMicrotask:typeof Om<"u"?function(t){return Om.resolve(null).then(t).catch(xS)}:Lm;function xS(t){setTimeout(function(){throw t})}function xr(t){return t==="head"}function Bm(t,n){var s=n,d=0;do{var E=s.nextSibling;if(t.removeChild(s),E&&E.nodeType===8)if(s=E.data,s==="/$"||s==="/&"){if(d===0){t.removeChild(E),zs(n);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")qa(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,qa(s);for(var A=s.firstChild;A;){var I=A.nextSibling,V=A.nodeName;A[Br]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&A.rel.toLowerCase()==="stylesheet"||s.removeChild(A),A=I}}else s==="body"&&qa(t.ownerDocument.body);s=E}while(s);zs(n)}function Nm(t,n){var s=t;t=0;do{var d=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=d}while(s)}function xh(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":xh(s),sa(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function DS(t,n,s,d){for(;t.nodeType===1;){var E=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!d&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(d){if(!t[Br])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(A=t.getAttribute("rel"),A==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(A!==E.rel||t.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||t.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||t.getAttribute("title")!==(E.title==null?null:E.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(A=t.getAttribute("src"),(A!==(E.src==null?null:E.src)||t.getAttribute("type")!==(E.type==null?null:E.type)||t.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&A&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var A=E.name==null?null:""+E.name;if(E.type==="hidden"&&t.getAttribute("name")===A)return t}else return t;if(t=ui(t.nextSibling),t===null)break}return null}function AS(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=ui(t.nextSibling),t===null))return null;return t}function Im(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=ui(t.nextSibling),t===null))return null;return t}function Dh(t){return t.data==="$?"||t.data==="$~"}function Ah(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function kS(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var d=function(){n(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),t._reactRetry=d}}function ui(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var kh=null;function Fm(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return ui(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function zm(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function Pm(t,n,s){switch(n=Bl(s),t){case"html":if(t=n.documentElement,!t)throw Error(o(452));return t;case"head":if(t=n.head,!t)throw Error(o(453));return t;case"body":if(t=n.body,!t)throw Error(o(454));return t;default:throw Error(o(451))}}function qa(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);sa(t)}var hi=new Map,Um=new Set;function Nl(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Zi=K.d;K.d={f:RS,r:TS,D:MS,C:LS,L:OS,m:BS,X:IS,S:NS,M:FS};function RS(){var t=Zi.f(),n=Dl();return t||n}function TS(t){var n=Oi(t);n!==null&&n.tag===5&&n.type==="form"?ip(n):Zi.r(t)}var Ns=typeof document>"u"?null:document;function Hm(t,n,s){var d=Ns;if(d&&typeof n=="string"&&n){var E=Bn(n);E='link[rel="'+t+'"][href="'+E+'"]',typeof s=="string"&&(E+='[crossorigin="'+s+'"]'),Um.has(E)||(Um.add(E),t={rel:t,crossOrigin:s,href:n},d.querySelector(E)===null&&(n=d.createElement("link"),mn(n,"link",t),Qt(n),d.head.appendChild(n)))}}function MS(t){Zi.D(t),Hm("dns-prefetch",t,null)}function LS(t,n){Zi.C(t,n),Hm("preconnect",t,n)}function OS(t,n,s){Zi.L(t,n,s);var d=Ns;if(d&&t&&n){var E='link[rel="preload"][as="'+Bn(n)+'"]';n==="image"&&s&&s.imageSrcSet?(E+='[imagesrcset="'+Bn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(E+='[imagesizes="'+Bn(s.imageSizes)+'"]')):E+='[href="'+Bn(t)+'"]';var A=E;switch(n){case"style":A=Is(t);break;case"script":A=Fs(t)}hi.has(A)||(t=u({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),hi.set(A,t),d.querySelector(E)!==null||n==="style"&&d.querySelector(Wa(A))||n==="script"&&d.querySelector(Ga(A))||(n=d.createElement("link"),mn(n,"link",t),Qt(n),d.head.appendChild(n)))}}function BS(t,n){Zi.m(t,n);var s=Ns;if(s&&t){var d=n&&typeof n.as=="string"?n.as:"script",E='link[rel="modulepreload"][as="'+Bn(d)+'"][href="'+Bn(t)+'"]',A=E;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=Fs(t)}if(!hi.has(A)&&(t=u({rel:"modulepreload",href:t},n),hi.set(A,t),s.querySelector(E)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Ga(A)))return}d=s.createElement("link"),mn(d,"link",t),Qt(d),s.head.appendChild(d)}}}function NS(t,n,s){Zi.S(t,n,s);var d=Ns;if(d&&t){var E=sr(d).hoistableStyles,A=Is(t);n=n||"default";var I=E.get(A);if(!I){var V={loading:0,preload:null};if(I=d.querySelector(Wa(A)))V.loading=5;else{t=u({rel:"stylesheet",href:t,"data-precedence":n},s),(s=hi.get(A))&&Rh(t,s);var J=I=d.createElement("link");Qt(J),mn(J,"link",t),J._p=new Promise(function(oe,fe){J.onload=oe,J.onerror=fe}),J.addEventListener("load",function(){V.loading|=1}),J.addEventListener("error",function(){V.loading|=2}),V.loading|=4,Il(I,n,d)}I={type:"stylesheet",instance:I,count:1,state:V},E.set(A,I)}}}function IS(t,n){Zi.X(t,n);var s=Ns;if(s&&t){var d=sr(s).hoistableScripts,E=Fs(t),A=d.get(E);A||(A=s.querySelector(Ga(E)),A||(t=u({src:t,async:!0},n),(n=hi.get(E))&&Th(t,n),A=s.createElement("script"),Qt(A),mn(A,"link",t),s.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},d.set(E,A))}}function FS(t,n){Zi.M(t,n);var s=Ns;if(s&&t){var d=sr(s).hoistableScripts,E=Fs(t),A=d.get(E);A||(A=s.querySelector(Ga(E)),A||(t=u({src:t,async:!0,type:"module"},n),(n=hi.get(E))&&Th(t,n),A=s.createElement("script"),Qt(A),mn(A,"link",t),s.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},d.set(E,A))}}function jm(t,n,s,d){var E=(E=se.current)?Nl(E):null;if(!E)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=Is(s.href),s=sr(E).hoistableStyles,d=s.get(n),d||(d={type:"style",instance:null,count:0,state:null},s.set(n,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Is(s.href);var A=sr(E).hoistableStyles,I=A.get(t);if(I||(E=E.ownerDocument||E,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(t,I),(A=E.querySelector(Wa(t)))&&!A._p&&(I.instance=A,I.state.loading=5),hi.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},hi.set(t,s),A||zS(E,t,s,I.state))),n&&d===null)throw Error(o(528,""));return I}if(n&&d!==null)throw Error(o(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Fs(s),s=sr(E).hoistableScripts,d=s.get(n),d||(d={type:"script",instance:null,count:0,state:null},s.set(n,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function Is(t){return'href="'+Bn(t)+'"'}function Wa(t){return'link[rel="stylesheet"]['+t+"]"}function $m(t){return u({},t,{"data-precedence":t.precedence,precedence:null})}function zS(t,n,s,d){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?d.loading=1:(n=t.createElement("link"),d.preload=n,n.addEventListener("load",function(){return d.loading|=1}),n.addEventListener("error",function(){return d.loading|=2}),mn(n,"link",s),Qt(n),t.head.appendChild(n))}function Fs(t){return'[src="'+Bn(t)+'"]'}function Ga(t){return"script[async]"+t}function qm(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var d=t.querySelector('style[data-href~="'+Bn(s.href)+'"]');if(d)return n.instance=d,Qt(d),d;var E=u({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(t.ownerDocument||t).createElement("style"),Qt(d),mn(d,"style",E),Il(d,s.precedence,t),n.instance=d;case"stylesheet":E=Is(s.href);var A=t.querySelector(Wa(E));if(A)return n.state.loading|=4,n.instance=A,Qt(A),A;d=$m(s),(E=hi.get(E))&&Rh(d,E),A=(t.ownerDocument||t).createElement("link"),Qt(A);var I=A;return I._p=new Promise(function(V,J){I.onload=V,I.onerror=J}),mn(A,"link",d),n.state.loading|=4,Il(A,s.precedence,t),n.instance=A;case"script":return A=Fs(s.src),(E=t.querySelector(Ga(A)))?(n.instance=E,Qt(E),E):(d=s,(E=hi.get(A))&&(d=u({},s),Th(d,E)),t=t.ownerDocument||t,E=t.createElement("script"),Qt(E),mn(E,"link",d),t.head.appendChild(E),n.instance=E);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(d=n.instance,n.state.loading|=4,Il(d,s.precedence,t));return n.instance}function Il(t,n,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=d.length?d[d.length-1]:null,A=E,I=0;I<d.length;I++){var V=d[I];if(V.dataset.precedence===n)A=V;else if(A!==E)break}A?A.parentNode.insertBefore(t,A.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function Rh(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Th(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Fl=null;function Wm(t,n,s){if(Fl===null){var d=new Map,E=Fl=new Map;E.set(s,d)}else E=Fl,d=E.get(s),d||(d=new Map,E.set(s,d));if(d.has(t))return d;for(d.set(t,null),s=s.getElementsByTagName(t),E=0;E<s.length;E++){var A=s[E];if(!(A[Br]||A[Kt]||t==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var I=A.getAttribute(n)||"";I=t+I;var V=d.get(I);V?V.push(A):d.set(I,[A])}}return d}function Gm(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function PS(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){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 t=n.disabled,typeof n.precedence=="string"&&t==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 Km(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function US(t,n,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var E=Is(d.href),A=n.querySelector(Wa(E));if(A){n=A._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=zl.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=A,Qt(A);return}A=n.ownerDocument||n,d=$m(d),(E=hi.get(E))&&Rh(d,E),A=A.createElement("link"),Qt(A);var I=A;I._p=new Promise(function(V,J){I.onload=V,I.onerror=J}),mn(A,"link",d),s.instance=A}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=zl.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var Mh=0;function HS(t,n){return t.stylesheets&&t.count===0&&Ul(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var d=setTimeout(function(){if(t.stylesheets&&Ul(t,t.stylesheets),t.unsuspend){var A=t.unsuspend;t.unsuspend=null,A()}},6e4+n);0<t.imgBytes&&Mh===0&&(Mh=62500*SS());var E=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ul(t,t.stylesheets),t.unsuspend)){var A=t.unsuspend;t.unsuspend=null,A()}},(t.imgBytes>Mh?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(d),clearTimeout(E)}}:null}function zl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ul(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Pl=null;function Ul(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Pl=new Map,n.forEach(jS,t),Pl=null,zl.call(t))}function jS(t,n){if(!(n.state.loading&4)){var s=Pl.get(t);if(s)var d=s.get(null);else{s=new Map,Pl.set(t,s);for(var E=t.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<E.length;A++){var I=E[A];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(s.set(I.dataset.precedence,I),d=I)}d&&s.set(null,d)}E=n.instance,I=E.getAttribute("data-precedence"),A=s.get(I)||d,A===d&&s.set(null,E),s.set(I,E),this.count++,d=zl.bind(this),E.addEventListener("load",d),E.addEventListener("error",d),A?A.parentNode.insertBefore(E,A.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(E,t.firstChild)),n.state.loading|=4}}var Ka={$$typeof:S,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function $S(t,n,s,d,E,A,I,V,J){this.tag=1,this.containerInfo=t,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=at(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=at(0),this.hiddenUpdates=at(null),this.identifierPrefix=d,this.onUncaughtError=E,this.onCaughtError=A,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function Vm(t,n,s,d,E,A,I,V,J,oe,fe,pe){return t=new $S(t,n,s,I,J,oe,fe,pe,V),n=1,A===!0&&(n|=24),A=Vn(3,null,null,n),t.current=A,A.stateNode=t,n=uu(),n.refCount++,t.pooledCache=n,n.refCount++,A.memoizedState={element:d,isDehydrated:s,cache:n},gu(A),t}function Ym(t){return t?(t=gs,t):gs}function Xm(t,n,s,d,E,A){E=Ym(E),d.context===null?d.context=E:d.pendingContext=E,d=gr(n),d.payload={element:s},A=A===void 0?null:A,A!==null&&(d.callback=A),s=pr(t,d,n),s!==null&&(Un(s,t,n),xa(s,t,n))}function Zm(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Lh(t,n){Zm(t,n),(t=t.alternate)&&Zm(t,n)}function Qm(t){if(t.tag===13||t.tag===31){var n=Ur(t,67108864);n!==null&&Un(n,t,67108864),Lh(t,67108864)}}function Jm(t){if(t.tag===13||t.tag===31){var n=Jn();n=St(n);var s=Ur(t,n);s!==null&&Un(s,t,n),Lh(t,n)}}var Hl=!0;function qS(t,n,s,d){var E=W.T;W.T=null;var A=K.p;try{K.p=2,Oh(t,n,s,d)}finally{K.p=A,W.T=E}}function WS(t,n,s,d){var E=W.T;W.T=null;var A=K.p;try{K.p=8,Oh(t,n,s,d)}finally{K.p=A,W.T=E}}function Oh(t,n,s,d){if(Hl){var E=Bh(d);if(E===null)bh(t,n,d,jl,s),t_(t,d);else if(KS(E,t,n,s,d))d.stopPropagation();else if(t_(t,d),n&4&&-1<GS.indexOf(t)){for(;E!==null;){var A=Oi(E);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var I=yt(A.pendingLanes);if(I!==0){var V=A;for(V.pendingLanes|=2,V.entangledLanes|=2;I;){var J=1<<31-ut(I);V.entanglements[1]|=J,I&=~J}Di(A),(bt&6)===0&&(wl=Ne()+500,Ha(0))}}break;case 31:case 13:V=Ur(A,2),V!==null&&Un(V,A,2),Dl(),Lh(A,2)}if(A=Bh(d),A===null&&bh(t,n,d,jl,s),A===E)break;E=A}E!==null&&d.stopPropagation()}else bh(t,n,d,null,s)}}function Bh(t){return t=Ze(t),Nh(t)}var jl=null;function Nh(t){if(jl=null,t=Dn(t),t!==null){var n=m(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=p(n),t!==null)return t;t=null}else if(s===31){if(t=a(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return jl=t,null}function e_(t){switch(t){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(_t()){case le:return 2;case _e:return 8;case Ae:case Fe:return 32;case ze:return 268435456;default:return 32}default:return 32}}var Ih=!1,Dr=null,Ar=null,kr=null,Va=new Map,Ya=new Map,Rr=[],GS="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 t_(t,n){switch(t){case"focusin":case"focusout":Dr=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":kr=null;break;case"pointerover":case"pointerout":Va.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ya.delete(n.pointerId)}}function Xa(t,n,s,d,E,A){return t===null||t.nativeEvent!==A?(t={blockedOn:n,domEventName:s,eventSystemFlags:d,nativeEvent:A,targetContainers:[E]},n!==null&&(n=Oi(n),n!==null&&Qm(n)),t):(t.eventSystemFlags|=d,n=t.targetContainers,E!==null&&n.indexOf(E)===-1&&n.push(E),t)}function KS(t,n,s,d,E){switch(n){case"focusin":return Dr=Xa(Dr,t,n,s,d,E),!0;case"dragenter":return Ar=Xa(Ar,t,n,s,d,E),!0;case"mouseover":return kr=Xa(kr,t,n,s,d,E),!0;case"pointerover":var A=E.pointerId;return Va.set(A,Xa(Va.get(A)||null,t,n,s,d,E)),!0;case"gotpointercapture":return A=E.pointerId,Ya.set(A,Xa(Ya.get(A)||null,t,n,s,d,E)),!0}return!1}function n_(t){var n=Dn(t.target);if(n!==null){var s=m(n);if(s!==null){if(n=s.tag,n===13){if(n=p(s),n!==null){t.blockedOn=n,ni(t.priority,function(){Jm(s)});return}}else if(n===31){if(n=a(s),n!==null){t.blockedOn=n,ni(t.priority,function(){Jm(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function $l(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=Bh(t.nativeEvent);if(s===null){s=t.nativeEvent;var d=new s.constructor(s.type,s);Oe=d,s.target.dispatchEvent(d),Oe=null}else return n=Oi(s),n!==null&&Qm(n),t.blockedOn=s,!1;n.shift()}return!0}function i_(t,n,s){$l(t)&&s.delete(n)}function VS(){Ih=!1,Dr!==null&&$l(Dr)&&(Dr=null),Ar!==null&&$l(Ar)&&(Ar=null),kr!==null&&$l(kr)&&(kr=null),Va.forEach(i_),Ya.forEach(i_)}function ql(t,n){t.blockedOn===n&&(t.blockedOn=null,Ih||(Ih=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,VS)))}var Wl=null;function r_(t){Wl!==t&&(Wl=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wl===t&&(Wl=null);for(var n=0;n<t.length;n+=3){var s=t[n],d=t[n+1],E=t[n+2];if(typeof d!="function"){if(Nh(d||s)===null)continue;break}var A=Oi(s);A!==null&&(t.splice(n,3),n-=3,Bu(A,{pending:!0,data:E,method:s.method,action:d},d,E))}}))}function zs(t){function n(J){return ql(J,t)}Dr!==null&&ql(Dr,t),Ar!==null&&ql(Ar,t),kr!==null&&ql(kr,t),Va.forEach(n),Ya.forEach(n);for(var s=0;s<Rr.length;s++){var d=Rr[s];d.blockedOn===t&&(d.blockedOn=null)}for(;0<Rr.length&&(s=Rr[0],s.blockedOn===null);)n_(s),s.blockedOn===null&&Rr.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var E=s[d],A=s[d+1],I=E[vn]||null;if(typeof A=="function")I||r_(s);else if(I){var V=null;if(A&&A.hasAttribute("formAction")){if(E=A,I=A[vn]||null)V=I.formAction;else if(Nh(E)!==null)continue}else V=I.action;typeof V=="function"?s[d+1]=V:(s.splice(d,3),d-=3),r_(s)}}}function s_(){function t(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(I){return E=I})},focusReset:"manual",scroll:"manual"})}function n(){E!==null&&(E(),E=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,E=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),E!==null&&(E(),E=null)}}}function Fh(t){this._internalRoot=t}Gl.prototype.render=Fh.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(o(409));var s=n.current,d=Jn();Xm(s,d,t,n,null,null)},Gl.prototype.unmount=Fh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;Xm(t.current,2,null,t,null,null),Dl(),n[ir]=null}};function Gl(t){this._internalRoot=t}Gl.prototype.unstable_scheduleHydration=function(t){if(t){var n=xn();t={blockedOn:null,target:t,priority:n};for(var s=0;s<Rr.length&&n!==0&&n<Rr[s].priority;s++);Rr.splice(s,0,t),s===0&&n_(t)}};var a_=i.version;if(a_!=="19.2.4")throw Error(o(527,a_,"19.2.4"));K.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(o(188)):(t=Object.keys(t).join(","),Error(o(268,t)));return t=c(n),t=t!==null?f(t):null,t=t===null?null:t.stateNode,t};var YS={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kl.isDisabled&&Kl.supportsFiber)try{Ft=Kl.inject(YS),Ct=Kl}catch{}}return Qa.createRoot=function(t,n){if(!h(t))throw Error(o(299));var s=!1,d="",E=fp,A=gp,I=pp;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(d=n.identifierPrefix),n.onUncaughtError!==void 0&&(E=n.onUncaughtError),n.onCaughtError!==void 0&&(A=n.onCaughtError),n.onRecoverableError!==void 0&&(I=n.onRecoverableError)),n=Vm(t,1,!1,null,null,s,d,null,E,A,I,s_),t[ir]=n.current,vh(t),new Fh(n)},Qa.hydrateRoot=function(t,n,s){if(!h(t))throw Error(o(299));var d=!1,E="",A=fp,I=gp,V=pp,J=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(E=s.identifierPrefix),s.onUncaughtError!==void 0&&(A=s.onUncaughtError),s.onCaughtError!==void 0&&(I=s.onCaughtError),s.onRecoverableError!==void 0&&(V=s.onRecoverableError),s.formState!==void 0&&(J=s.formState)),n=Vm(t,1,!0,n,s??null,d,E,J,A,I,V,s_),n.context=Ym(null),s=n.current,d=Jn(),d=St(d),E=gr(d),E.callback=null,pr(s,E,d),s=d,n.current.lanes=s,ft(n,s),Di(n),t[ir]=n.current,vh(t),new Gl(n)},Qa.version="19.2.4",Qa}var m_;function rC(){if(m_)return Uh.exports;m_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),Uh.exports=iC(),Uh.exports}var sC=rC();/**
50
- * react-router v7.13.1
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var __="popstate";function v_(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function aC(e={}){function i(o,h){var c;let m=(c=h.state)==null?void 0:c.masked,{pathname:p,search:a,hash:l}=m||o.location;return Ed("",{pathname:p,search:a,hash:l},h.state&&h.state.usr||null,h.state&&h.state.key||"default",m?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function r(o,h){return typeof h=="string"?h:mo(h)}return lC(i,r,null,e)}function $t(e,i){if(e===!1||e===null||typeof e>"u")throw new Error(i)}function Si(e,i){if(!e){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function oC(){return Math.random().toString(36).substring(2,10)}function b_(e,i){return{usr:e.state,key:e.key,idx:i,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ed(e,i,r=null,o,h){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof i=="string"?Zs(i):i,state:r,key:i&&i.key||o||oC(),unstable_mask:h}}function mo({pathname:e="/",search:i="",hash:r=""}){return i&&i!=="?"&&(e+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Zs(e){let i={};if(e){let r=e.indexOf("#");r>=0&&(i.hash=e.substring(r),e=e.substring(0,r));let o=e.indexOf("?");o>=0&&(i.search=e.substring(o),e=e.substring(0,o)),e&&(i.pathname=e)}return i}function lC(e,i,r,o={}){let{window:h=document.defaultView,v5Compat:m=!1}=o,p=h.history,a="POP",l=null,c=f();c==null&&(c=0,p.replaceState({...p.state,idx:c},""));function f(){return(p.state||{idx:null}).idx}function u(){a="POP";let g=f(),_=g==null?null:g-c;c=g,l&&l({action:a,location:b.location,delta:_})}function y(g,_){a="PUSH";let v=v_(g)?g:Ed(b.location,g,_);c=f()+1;let S=b_(v,c),D=b.createHref(v.unstable_mask||v);try{p.pushState(S,"",D)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;h.location.assign(D)}m&&l&&l({action:a,location:b.location,delta:1})}function C(g,_){a="REPLACE";let v=v_(g)?g:Ed(b.location,g,_);c=f();let S=b_(v,c),D=b.createHref(v.unstable_mask||v);p.replaceState(S,"",D),m&&l&&l({action:a,location:b.location,delta:0})}function w(g){return cC(g)}let b={get action(){return a},get location(){return e(h,p)},listen(g){if(l)throw new Error("A history only accepts one active listener");return h.addEventListener(__,u),l=g,()=>{h.removeEventListener(__,u),l=null}},createHref(g){return i(h,g)},createURL:w,encodeLocation(g){let _=w(g);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:y,replace:C,go(g){return p.go(g)}};return b}function cC(e,i=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),$t(r,"No window.location.(origin|href) available to create URL");let o=typeof e=="string"?e:mo(e);return o=o.replace(/ $/,"%20"),!i&&o.startsWith("//")&&(o=r+o),new URL(o,r)}function c0(e,i,r="/"){return uC(e,i,r,!1)}function uC(e,i,r,o){let h=typeof i=="string"?Zs(i):i,m=Qi(h.pathname||"/",r);if(m==null)return null;let p=u0(e);hC(p);let a=null;for(let l=0;a==null&&l<p.length;++l){let c=CC(m);a=yC(p[l],c,o)}return a}function u0(e,i=[],r=[],o="",h=!1){let m=(p,a,l=h,c)=>{let f={relativePath:c===void 0?p.path||"":c,caseSensitive:p.caseSensitive===!0,childrenIndex:a,route:p};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(o)&&l)return;$t(f.relativePath.startsWith(o),`Absolute route path "${f.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(o.length)}let u=Ri([o,f.relativePath]),y=r.concat(f);p.children&&p.children.length>0&&($t(p.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),u0(p.children,i,y,u,l)),!(p.path==null&&!p.index)&&i.push({path:u,score:vC(u,p.index),routesMeta:y})};return e.forEach((p,a)=>{var l;if(p.path===""||!((l=p.path)!=null&&l.includes("?")))m(p,a);else for(let c of h0(p.path))m(p,a,!0,c)}),i}function h0(e){let i=e.split("/");if(i.length===0)return[];let[r,...o]=i,h=r.endsWith("?"),m=r.replace(/\?$/,"");if(o.length===0)return h?[m,""]:[m];let p=h0(o.join("/")),a=[];return a.push(...p.map(l=>l===""?m:[m,l].join("/"))),h&&a.push(...p),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function hC(e){e.sort((i,r)=>i.score!==r.score?r.score-i.score:bC(i.routesMeta.map(o=>o.childrenIndex),r.routesMeta.map(o=>o.childrenIndex)))}var dC=/^:[\w-]+$/,fC=3,gC=2,pC=1,mC=10,_C=-2,y_=e=>e==="*";function vC(e,i){let r=e.split("/"),o=r.length;return r.some(y_)&&(o+=_C),i&&(o+=gC),r.filter(h=>!y_(h)).reduce((h,m)=>h+(dC.test(m)?fC:m===""?pC:mC),o)}function bC(e,i){return e.length===i.length&&e.slice(0,-1).every((o,h)=>o===i[h])?e[e.length-1]-i[i.length-1]:0}function yC(e,i,r=!1){let{routesMeta:o}=e,h={},m="/",p=[];for(let a=0;a<o.length;++a){let l=o[a],c=a===o.length-1,f=m==="/"?i:i.slice(m.length)||"/",u=gc({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},f),y=l.route;if(!u&&c&&r&&!o[o.length-1].route.index&&(u=gc({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!u)return null;Object.assign(h,u.params),p.push({params:h,pathname:Ri([m,u.pathname]),pathnameBase:DC(Ri([m,u.pathnameBase])),route:y}),u.pathnameBase!=="/"&&(m=Ri([m,u.pathnameBase]))}return p}function gc(e,i){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,o]=SC(e.path,e.caseSensitive,e.end),h=i.match(r);if(!h)return null;let m=h[0],p=m.replace(/(.)\/+$/,"$1"),a=h.slice(1);return{params:o.reduce((c,{paramName:f,isOptional:u},y)=>{if(f==="*"){let w=a[y]||"";p=m.slice(0,m.length-w.length).replace(/(.)\/+$/,"$1")}const C=a[y];return u&&!C?c[f]=void 0:c[f]=(C||"").replace(/%2F/g,"/"),c},{}),pathname:m,pathnameBase:p,pattern:e}}function SC(e,i=!1,r=!0){Si(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],h="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(p,a,l,c,f)=>{if(o.push({paramName:a,isOptional:l!=null}),l){let u=f.charAt(c+p.length);return u&&u!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),h+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?h+="\\/*$":e!==""&&e!=="/"&&(h+="(?:(?=\\/|$))"),[new RegExp(h,i?void 0:"i"),o]}function CC(e){try{return e.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Si(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),e}}function Qi(e,i){if(i==="/")return e;if(!e.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,o=e.charAt(r);return o&&o!=="/"?null:e.slice(r)||"/"}var EC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function wC(e,i="/"){let{pathname:r,search:o="",hash:h=""}=typeof e=="string"?Zs(e):e,m;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?m=S_(r.substring(1),"/"):m=S_(r,i)):m=i,{pathname:m,search:AC(o),hash:kC(h)}}function S_(e,i){let r=i.replace(/\/+$/,"").split("/");return e.split("/").forEach(h=>{h===".."?r.length>1&&r.pop():h!=="."&&r.push(h)}),r.length>1?r.join("/"):"/"}function qh(e,i,r,o){return`Cannot include a '${e}' character in a manually specified \`to.${i}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function xC(e){return e.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function d0(e){let i=xC(e);return i.map((r,o)=>o===i.length-1?r.pathname:r.pathnameBase)}function Vd(e,i,r,o=!1){let h;typeof e=="string"?h=Zs(e):(h={...e},$t(!h.pathname||!h.pathname.includes("?"),qh("?","pathname","search",h)),$t(!h.pathname||!h.pathname.includes("#"),qh("#","pathname","hash",h)),$t(!h.search||!h.search.includes("#"),qh("#","search","hash",h)));let m=e===""||h.pathname==="",p=m?"/":h.pathname,a;if(p==null)a=r;else{let u=i.length-1;if(!o&&p.startsWith("..")){let y=p.split("/");for(;y[0]==="..";)y.shift(),u-=1;h.pathname=y.join("/")}a=u>=0?i[u]:"/"}let l=wC(h,a),c=p&&p!=="/"&&p.endsWith("/"),f=(m||p===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||f)&&(l.pathname+="/"),l}var Ri=e=>e.join("/").replace(/\/\/+/g,"/"),DC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),AC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,RC=class{constructor(e,i,r,o=!1){this.status=e,this.statusText=i||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function TC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function MC(e){return e.map(i=>i.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var f0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function g0(e,i){let r=e;if(typeof r!="string"||!EC.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let o=r,h=!1;if(f0)try{let m=new URL(window.location.href),p=r.startsWith("//")?new URL(m.protocol+r):new URL(r),a=Qi(p.pathname,i);p.origin===m.origin&&a!=null?r=a+p.search+p.hash:h=!0}catch{Si(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:h,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var p0=["POST","PUT","PATCH","DELETE"];new Set(p0);var LC=["GET",...p0];new Set(LC);var Qs=N.createContext(null);Qs.displayName="DataRouter";var Dc=N.createContext(null);Dc.displayName="DataRouterState";var OC=N.createContext(!1),m0=N.createContext({isTransitioning:!1});m0.displayName="ViewTransition";var BC=N.createContext(new Map);BC.displayName="Fetchers";var NC=N.createContext(null);NC.displayName="Await";var pi=N.createContext(null);pi.displayName="Navigation";var Eo=N.createContext(null);Eo.displayName="Location";var Ji=N.createContext({outlet:null,matches:[],isDataRoute:!1});Ji.displayName="Route";var Yd=N.createContext(null);Yd.displayName="RouteError";var _0="REACT_ROUTER_ERROR",IC="REDIRECT",FC="ROUTE_ERROR_RESPONSE";function zC(e){if(e.startsWith(`${_0}:${IC}:{`))try{let i=JSON.parse(e.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function PC(e){if(e.startsWith(`${_0}:${FC}:{`))try{let i=JSON.parse(e.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new RC(i.status,i.statusText,i.data)}catch{}}function UC(e,{relative:i}={}){$t(wo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=N.useContext(pi),{hash:h,pathname:m,search:p}=xo(e,{relative:i}),a=m;return r!=="/"&&(a=m==="/"?r:Ri([r,m])),o.createHref({pathname:a,search:p,hash:h})}function wo(){return N.useContext(Eo)!=null}function er(){return $t(wo(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Eo).location}var v0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function b0(e){N.useContext(pi).static||N.useLayoutEffect(e)}function Xd(){let{isDataRoute:e}=N.useContext(Ji);return e?JC():HC()}function HC(){$t(wo(),"useNavigate() may be used only in the context of a <Router> component.");let e=N.useContext(Qs),{basename:i,navigator:r}=N.useContext(pi),{matches:o}=N.useContext(Ji),{pathname:h}=er(),m=JSON.stringify(d0(o)),p=N.useRef(!1);return b0(()=>{p.current=!0}),N.useCallback((l,c={})=>{if(Si(p.current,v0),!p.current)return;if(typeof l=="number"){r.go(l);return}let f=Vd(l,JSON.parse(m),h,c.relative==="path");e==null&&i!=="/"&&(f.pathname=f.pathname==="/"?i:Ri([i,f.pathname])),(c.replace?r.replace:r.push)(f,c.state,c)},[i,r,m,h,e])}N.createContext(null);function xo(e,{relative:i}={}){let{matches:r}=N.useContext(Ji),{pathname:o}=er(),h=JSON.stringify(d0(r));return N.useMemo(()=>Vd(e,JSON.parse(h),o,i==="path"),[e,h,o,i])}function jC(e,i){return y0(e,i)}function y0(e,i,r){var g;$t(wo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=N.useContext(pi),{matches:h}=N.useContext(Ji),m=h[h.length-1],p=m?m.params:{},a=m?m.pathname:"/",l=m?m.pathnameBase:"/",c=m&&m.route;{let _=c&&c.path||"";C0(a,!c||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${a}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
-
60
- Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let f=er(),u;if(i){let _=typeof i=="string"?Zs(i):i;$t(l==="/"||((g=_.pathname)==null?void 0:g.startsWith(l)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${l}" but pathname "${_.pathname}" was given in the \`location\` prop.`),u=_}else u=f;let y=u.pathname||"/",C=y;if(l!=="/"){let _=l.replace(/^\//,"").split("/");C="/"+y.replace(/^\//,"").split("/").slice(_.length).join("/")}let w=c0(e,{pathname:C});Si(c||w!=null,`No routes matched location "${u.pathname}${u.search}${u.hash}" `),Si(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${u.pathname}${u.search}${u.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let b=KC(w&&w.map(_=>Object.assign({},_,{params:Object.assign({},p,_.params),pathname:Ri([l,o.encodeLocation?o.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:Ri([l,o.encodeLocation?o.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),h,r);return i&&b?N.createElement(Eo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...u},navigationType:"POP"}},b):b}function $C(){let e=QC(),i=TC(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",h={padding:"0.5rem",backgroundColor:o},m={padding:"2px 4px",backgroundColor:o},p=null;return console.error("Error handled by React Router default ErrorBoundary:",e),p=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:m},"ErrorBoundary")," or"," ",N.createElement("code",{style:m},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},i),r?N.createElement("pre",{style:h},r):null,p)}var qC=N.createElement($C,null),S0=class extends N.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,i){return i.location!==e.location||i.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:i.error,location:i.location,revalidation:e.revalidation||i.revalidation}}componentDidCatch(e,i){this.props.onError?this.props.onError(e,i):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=PC(e.digest);r&&(e=r)}let i=e!==void 0?N.createElement(Ji.Provider,{value:this.props.routeContext},N.createElement(Yd.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?N.createElement(WC,{error:e},i):i}};S0.contextType=OC;var Wh=new WeakMap;function WC({children:e,error:i}){let{basename:r}=N.useContext(pi);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let o=zC(i.digest);if(o){let h=Wh.get(i);if(h)throw h;let m=g0(o.location,r);if(f0&&!Wh.get(i))if(m.isExternal||o.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:o.replace}));throw Wh.set(i,p),p}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return e}function GC({routeContext:e,match:i,children:r}){let o=N.useContext(Qs);return o&&o.static&&o.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=i.route.id),N.createElement(Ji.Provider,{value:e},r)}function KC(e,i=[],r){let o=r==null?void 0:r.state;if(e==null){if(!o)return null;if(o.errors)e=o.matches;else if(i.length===0&&!o.initialized&&o.matches.length>0)e=o.matches;else return null}let h=e,m=o==null?void 0:o.errors;if(m!=null){let f=h.findIndex(u=>u.route.id&&(m==null?void 0:m[u.route.id])!==void 0);$t(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),h=h.slice(0,Math.min(h.length,f+1))}let p=!1,a=-1;if(r&&o){p=o.renderFallback;for(let f=0;f<h.length;f++){let u=h[f];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(a=f),u.route.id){let{loaderData:y,errors:C}=o,w=u.route.loader&&!y.hasOwnProperty(u.route.id)&&(!C||C[u.route.id]===void 0);if(u.route.lazy||w){r.isStatic&&(p=!0),a>=0?h=h.slice(0,a+1):h=[h[0]];break}}}}let l=r==null?void 0:r.onError,c=o&&l?(f,u)=>{var y,C;l(f,{location:o.location,params:((C=(y=o.matches)==null?void 0:y[0])==null?void 0:C.params)??{},unstable_pattern:MC(o.matches),errorInfo:u})}:void 0;return h.reduceRight((f,u,y)=>{let C,w=!1,b=null,g=null;o&&(C=m&&u.route.id?m[u.route.id]:void 0,b=u.route.errorElement||qC,p&&(a<0&&y===0?(C0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,g=null):a===y&&(w=!0,g=u.route.hydrateFallbackElement||null)));let _=i.concat(h.slice(0,y+1)),v=()=>{let S;return C?S=b:w?S=g:u.route.Component?S=N.createElement(u.route.Component,null):u.route.element?S=u.route.element:S=f,N.createElement(GC,{match:u,routeContext:{outlet:f,matches:_,isDataRoute:o!=null},children:S})};return o&&(u.route.ErrorBoundary||u.route.errorElement||y===0)?N.createElement(S0,{location:o.location,revalidation:o.revalidation,component:b,error:C,children:v(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:c}):v()},null)}function Zd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function VC(e){let i=N.useContext(Qs);return $t(i,Zd(e)),i}function YC(e){let i=N.useContext(Dc);return $t(i,Zd(e)),i}function XC(e){let i=N.useContext(Ji);return $t(i,Zd(e)),i}function Qd(e){let i=XC(e),r=i.matches[i.matches.length-1];return $t(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ZC(){return Qd("useRouteId")}function QC(){var o;let e=N.useContext(Yd),i=YC("useRouteError"),r=Qd("useRouteError");return e!==void 0?e:(o=i.errors)==null?void 0:o[r]}function JC(){let{router:e}=VC("useNavigate"),i=Qd("useNavigate"),r=N.useRef(!1);return b0(()=>{r.current=!0}),N.useCallback(async(h,m={})=>{Si(r.current,v0),r.current&&(typeof h=="number"?await e.navigate(h):await e.navigate(h,{fromRouteId:i,...m}))},[e,i])}var C_={};function C0(e,i,r){!i&&!C_[e]&&(C_[e]=!0,Si(!1,r))}N.memo(eE);function eE({routes:e,future:i,state:r,isStatic:o,onError:h}){return y0(e,void 0,{state:r,isStatic:o,onError:h})}function wd(e){$t(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function tE({basename:e="/",children:i=null,location:r,navigationType:o="POP",navigator:h,static:m=!1,unstable_useTransitions:p}){$t(!wo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=N.useMemo(()=>({basename:a,navigator:h,static:m,unstable_useTransitions:p,future:{}}),[a,h,m,p]);typeof r=="string"&&(r=Zs(r));let{pathname:c="/",search:f="",hash:u="",state:y=null,key:C="default",unstable_mask:w}=r,b=N.useMemo(()=>{let g=Qi(c,a);return g==null?null:{location:{pathname:g,search:f,hash:u,state:y,key:C,unstable_mask:w},navigationType:o}},[a,c,f,u,y,C,o,w]);return Si(b!=null,`<Router basename="${a}"> is not able to match the URL "${c}${f}${u}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:N.createElement(pi.Provider,{value:l},N.createElement(Eo.Provider,{children:i,value:b}))}function nE({children:e,location:i}){return jC(xd(e),i)}function xd(e,i=[]){let r=[];return N.Children.forEach(e,(o,h)=>{if(!N.isValidElement(o))return;let m=[...i,h];if(o.type===N.Fragment){r.push.apply(r,xd(o.props.children,m));return}$t(o.type===wd,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$t(!o.props.index||!o.props.children,"An index route cannot have child routes.");let p={id:o.props.id||m.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(p.children=xd(o.props.children,m)),r.push(p)}),r}var cc="get",uc="application/x-www-form-urlencoded";function Ac(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function iE(e){return Ac(e)&&e.tagName.toLowerCase()==="button"}function rE(e){return Ac(e)&&e.tagName.toLowerCase()==="form"}function sE(e){return Ac(e)&&e.tagName.toLowerCase()==="input"}function aE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oE(e,i){return e.button===0&&(!i||i==="_self")&&!aE(e)}function Dd(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((i,r)=>{let o=e[r];return i.concat(Array.isArray(o)?o.map(h=>[r,h]):[[r,o]])},[]))}function lE(e,i){let r=Dd(e);return i&&i.forEach((o,h)=>{r.has(h)||i.getAll(h).forEach(m=>{r.append(h,m)})}),r}var Vl=null;function cE(){if(Vl===null)try{new FormData(document.createElement("form"),0),Vl=!1}catch{Vl=!0}return Vl}var uE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gh(e){return e!=null&&!uE.has(e)?(Si(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${uc}"`),null):e}function hE(e,i){let r,o,h,m,p;if(rE(e)){let a=e.getAttribute("action");o=a?Qi(a,i):null,r=e.getAttribute("method")||cc,h=Gh(e.getAttribute("enctype"))||uc,m=new FormData(e)}else if(iE(e)||sE(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(o=l?Qi(l,i):null,r=e.getAttribute("formmethod")||a.getAttribute("method")||cc,h=Gh(e.getAttribute("formenctype"))||Gh(a.getAttribute("enctype"))||uc,m=new FormData(a,e),!cE()){let{name:c,type:f,value:u}=e;if(f==="image"){let y=c?`${c}.`:"";m.append(`${y}x`,"0"),m.append(`${y}y`,"0")}else c&&m.append(c,u)}}else{if(Ac(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=cc,o=null,h=uc,p=e}return m&&h==="text/plain"&&(p=m,m=void 0),{action:o,method:r.toLowerCase(),encType:h,formData:m,body:p}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Jd(e,i){if(e===!1||e===null||typeof e>"u")throw new Error(i)}function dE(e,i,r,o){let h=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?h.pathname.endsWith("/")?h.pathname=`${h.pathname}_.${o}`:h.pathname=`${h.pathname}.${o}`:h.pathname==="/"?h.pathname=`_root.${o}`:i&&Qi(h.pathname,i)==="/"?h.pathname=`${i.replace(/\/$/,"")}/_root.${o}`:h.pathname=`${h.pathname.replace(/\/$/,"")}.${o}`,h}async function fE(e,i){if(e.id in i)return i[e.id];try{let r=await import(e.module);return i[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gE(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function pE(e,i,r){let o=await Promise.all(e.map(async h=>{let m=i.routes[h.route.id];if(m){let p=await fE(m,r);return p.links?p.links():[]}return[]}));return bE(o.flat(1).filter(gE).filter(h=>h.rel==="stylesheet"||h.rel==="preload").map(h=>h.rel==="stylesheet"?{...h,rel:"prefetch",as:"style"}:{...h,rel:"prefetch"}))}function E_(e,i,r,o,h,m){let p=(l,c)=>r[c]?l.route.id!==r[c].route.id:!0,a=(l,c)=>{var f;return r[c].pathname!==l.pathname||((f=r[c].route.path)==null?void 0:f.endsWith("*"))&&r[c].params["*"]!==l.params["*"]};return m==="assets"?i.filter((l,c)=>p(l,c)||a(l,c)):m==="data"?i.filter((l,c)=>{var u;let f=o.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(p(l,c)||a(l,c))return!0;if(l.route.shouldRevalidate){let y=l.route.shouldRevalidate({currentUrl:new URL(h.pathname+h.search+h.hash,window.origin),currentParams:((u=r[0])==null?void 0:u.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function mE(e,i,{includeHydrateFallback:r}={}){return _E(e.map(o=>{let h=i.routes[o.route.id];if(!h)return[];let m=[h.module];return h.clientActionModule&&(m=m.concat(h.clientActionModule)),h.clientLoaderModule&&(m=m.concat(h.clientLoaderModule)),r&&h.hydrateFallbackModule&&(m=m.concat(h.hydrateFallbackModule)),h.imports&&(m=m.concat(h.imports)),m}).flat(1))}function _E(e){return[...new Set(e)]}function vE(e){let i={},r=Object.keys(e).sort();for(let o of r)i[o]=e[o];return i}function bE(e,i){let r=new Set;return new Set(i),e.reduce((o,h)=>{let m=JSON.stringify(vE(h));return r.has(m)||(r.add(m),o.push({key:m,link:h})),o},[])}function E0(){let e=N.useContext(Qs);return Jd(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function yE(){let e=N.useContext(Dc);return Jd(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ef=N.createContext(void 0);ef.displayName="FrameworkContext";function w0(){let e=N.useContext(ef);return Jd(e,"You must render this element inside a <HydratedRouter> element"),e}function SE(e,i){let r=N.useContext(ef),[o,h]=N.useState(!1),[m,p]=N.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:c,onMouseLeave:f,onTouchStart:u}=i,y=N.useRef(null);N.useEffect(()=>{if(e==="render"&&p(!0),e==="viewport"){let b=_=>{_.forEach(v=>{p(v.isIntersecting)})},g=new IntersectionObserver(b,{threshold:.5});return y.current&&g.observe(y.current),()=>{g.disconnect()}}},[e]),N.useEffect(()=>{if(o){let b=setTimeout(()=>{p(!0)},100);return()=>{clearTimeout(b)}}},[o]);let C=()=>{h(!0)},w=()=>{h(!1),p(!1)};return r?e!=="intent"?[m,y,{}]:[m,y,{onFocus:Ja(a,C),onBlur:Ja(l,w),onMouseEnter:Ja(c,C),onMouseLeave:Ja(f,w),onTouchStart:Ja(u,C)}]:[!1,y,{}]}function Ja(e,i){return r=>{e&&e(r),r.defaultPrevented||i(r)}}function CE({page:e,...i}){let{router:r}=E0(),o=N.useMemo(()=>c0(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?N.createElement(wE,{page:e,matches:o,...i}):null}function EE(e){let{manifest:i,routeModules:r}=w0(),[o,h]=N.useState([]);return N.useEffect(()=>{let m=!1;return pE(e,i,r).then(p=>{m||h(p)}),()=>{m=!0}},[e,i,r]),o}function wE({page:e,matches:i,...r}){let o=er(),{future:h,manifest:m,routeModules:p}=w0(),{basename:a}=E0(),{loaderData:l,matches:c}=yE(),f=N.useMemo(()=>E_(e,i,c,m,o,"data"),[e,i,c,m,o]),u=N.useMemo(()=>E_(e,i,c,m,o,"assets"),[e,i,c,m,o]),y=N.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let b=new Set,g=!1;if(i.forEach(v=>{var D;let S=m.routes[v.route.id];!S||!S.hasLoader||(!f.some(R=>R.route.id===v.route.id)&&v.route.id in l&&((D=p[v.route.id])!=null&&D.shouldRevalidate)||S.hasClientLoader?g=!0:b.add(v.route.id))}),b.size===0)return[];let _=dE(e,a,h.unstable_trailingSlashAwareDataRequests,"data");return g&&b.size>0&&_.searchParams.set("_routes",i.filter(v=>b.has(v.route.id)).map(v=>v.route.id).join(",")),[_.pathname+_.search]},[a,h.unstable_trailingSlashAwareDataRequests,l,o,m,f,i,e,p]),C=N.useMemo(()=>mE(u,m),[u,m]),w=EE(u);return N.createElement(N.Fragment,null,y.map(b=>N.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),C.map(b=>N.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),w.map(({key:b,link:g})=>N.createElement("link",{key:b,nonce:r.nonce,...g,crossOrigin:g.crossOrigin??r.crossOrigin})))}function xE(...e){return i=>{e.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var DE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{DE&&(window.__reactRouterVersion="7.13.1")}catch{}function AE({basename:e,children:i,unstable_useTransitions:r,window:o}){let h=N.useRef();h.current==null&&(h.current=aC({window:o,v5Compat:!0}));let m=h.current,[p,a]=N.useState({action:m.action,location:m.location}),l=N.useCallback(c=>{r===!1?a(c):N.startTransition(()=>a(c))},[r]);return N.useLayoutEffect(()=>m.listen(l),[m,l]),N.createElement(tE,{basename:e,children:i,location:p.location,navigationType:p.action,navigator:m,unstable_useTransitions:r})}var x0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lo=N.forwardRef(function({onClick:i,discover:r="render",prefetch:o="none",relative:h,reloadDocument:m,replace:p,unstable_mask:a,state:l,target:c,to:f,preventScrollReset:u,viewTransition:y,unstable_defaultShouldRevalidate:C,...w},b){let{basename:g,navigator:_,unstable_useTransitions:v}=N.useContext(pi),S=typeof f=="string"&&x0.test(f),D=g0(f,g);f=D.to;let R=UC(f,{relative:h}),x=er(),M=null;if(a){let q=Vd(a,[],x.unstable_mask?x.unstable_mask.pathname:"/",!0);g!=="/"&&(q.pathname=q.pathname==="/"?g:Ri([g,q.pathname])),M=_.createHref(q)}let[k,L,T]=SE(o,w),P=ME(f,{replace:p,unstable_mask:a,state:l,target:c,preventScrollReset:u,relative:h,viewTransition:y,unstable_defaultShouldRevalidate:C,unstable_useTransitions:v});function B(q){i&&i(q),q.defaultPrevented||P(q)}let F=!(D.isExternal||m),$=N.createElement("a",{...w,...T,href:(F?M:void 0)||D.absoluteURL||R,onClick:F?B:i,ref:xE(b,L),target:c,"data-discover":!S&&r==="render"?"true":void 0});return k&&!S?N.createElement(N.Fragment,null,$,N.createElement(CE,{page:R})):$});lo.displayName="Link";var kE=N.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:o="",end:h=!1,style:m,to:p,viewTransition:a,children:l,...c},f){let u=xo(p,{relative:c.relative}),y=er(),C=N.useContext(Dc),{navigator:w,basename:b}=N.useContext(pi),g=C!=null&&FE(u)&&a===!0,_=w.encodeLocation?w.encodeLocation(u).pathname:u.pathname,v=y.pathname,S=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;r||(v=v.toLowerCase(),S=S?S.toLowerCase():null,_=_.toLowerCase()),S&&b&&(S=Qi(S,b)||S);const D=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let R=v===_||!h&&v.startsWith(_)&&v.charAt(D)==="/",x=S!=null&&(S===_||!h&&S.startsWith(_)&&S.charAt(_.length)==="/"),M={isActive:R,isPending:x,isTransitioning:g},k=R?i:void 0,L;typeof o=="function"?L=o(M):L=[o,R?"active":null,x?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let T=typeof m=="function"?m(M):m;return N.createElement(lo,{...c,"aria-current":k,className:L,ref:f,style:T,to:p,viewTransition:a},typeof l=="function"?l(M):l)});kE.displayName="NavLink";var RE=N.forwardRef(({discover:e="render",fetcherKey:i,navigate:r,reloadDocument:o,replace:h,state:m,method:p=cc,action:a,onSubmit:l,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:y,...C},w)=>{let{unstable_useTransitions:b}=N.useContext(pi),g=NE(),_=IE(a,{relative:c}),v=p.toLowerCase()==="get"?"get":"post",S=typeof a=="string"&&x0.test(a),D=R=>{if(l&&l(R),R.defaultPrevented)return;R.preventDefault();let x=R.nativeEvent.submitter,M=(x==null?void 0:x.getAttribute("formmethod"))||p,k=()=>g(x||R.currentTarget,{fetcherKey:i,method:M,navigate:r,replace:h,state:m,relative:c,preventScrollReset:f,viewTransition:u,unstable_defaultShouldRevalidate:y});b&&r!==!1?N.startTransition(()=>k()):k()};return N.createElement("form",{ref:w,method:v,action:_,onSubmit:o?l:D,...C,"data-discover":!S&&e==="render"?"true":void 0})});RE.displayName="Form";function TE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function D0(e){let i=N.useContext(Qs);return $t(i,TE(e)),i}function ME(e,{target:i,replace:r,unstable_mask:o,state:h,preventScrollReset:m,relative:p,viewTransition:a,unstable_defaultShouldRevalidate:l,unstable_useTransitions:c}={}){let f=Xd(),u=er(),y=xo(e,{relative:p});return N.useCallback(C=>{if(oE(C,i)){C.preventDefault();let w=r!==void 0?r:mo(u)===mo(y),b=()=>f(e,{replace:w,unstable_mask:o,state:h,preventScrollReset:m,relative:p,viewTransition:a,unstable_defaultShouldRevalidate:l});c?N.startTransition(()=>b()):b()}},[u,f,y,r,o,h,i,e,m,p,a,l,c])}function LE(e){Si(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let i=N.useRef(Dd(e)),r=N.useRef(!1),o=er(),h=N.useMemo(()=>lE(o.search,r.current?null:i.current),[o.search]),m=Xd(),p=N.useCallback((a,l)=>{const c=Dd(typeof a=="function"?a(new URLSearchParams(h)):a);r.current=!0,m("?"+c,l)},[m,h]);return[h,p]}var OE=0,BE=()=>`__${String(++OE)}__`;function NE(){let{router:e}=D0("useSubmit"),{basename:i}=N.useContext(pi),r=ZC(),o=e.fetch,h=e.navigate;return N.useCallback(async(m,p={})=>{let{action:a,method:l,encType:c,formData:f,body:u}=hE(m,i);if(p.navigate===!1){let y=p.fetcherKey||BE();await o(y,r,p.action||a,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:f,body:u,formMethod:p.method||l,formEncType:p.encType||c,flushSync:p.flushSync})}else await h(p.action||a,{unstable_defaultShouldRevalidate:p.unstable_defaultShouldRevalidate,preventScrollReset:p.preventScrollReset,formData:f,body:u,formMethod:p.method||l,formEncType:p.encType||c,replace:p.replace,state:p.state,fromRouteId:r,flushSync:p.flushSync,viewTransition:p.viewTransition})},[o,h,i,r])}function IE(e,{relative:i}={}){let{basename:r}=N.useContext(pi),o=N.useContext(Ji);$t(o,"useFormAction must be used inside a RouteContext");let[h]=o.matches.slice(-1),m={...xo(e||".",{relative:i})},p=er();if(e==null){m.search=p.search;let a=new URLSearchParams(m.search),l=a.getAll("index");if(l.some(f=>f==="")){a.delete("index"),l.filter(u=>u).forEach(u=>a.append("index",u));let f=a.toString();m.search=f?`?${f}`:""}}return(!e||e===".")&&h.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(m.pathname=m.pathname==="/"?r:Ri([r,m.pathname])),mo(m)}function FE(e,{relative:i}={}){let r=N.useContext(m0);$t(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=D0("useViewTransitionState"),h=xo(e,{relative:i});if(!r.isTransitioning)return!1;let m=Qi(r.currentLocation.pathname,o)||r.currentLocation.pathname,p=Qi(r.nextLocation.pathname,o)||r.nextLocation.pathname;return gc(h.pathname,p)!=null||gc(h.pathname,m)!=null}var ao=l0();const w_=e=>{let i;const r=new Set,o=(c,f)=>{const u=typeof c=="function"?c(i):c;if(!Object.is(u,i)){const y=i;i=f??(typeof u!="object"||u===null)?u:Object.assign({},i,u),r.forEach(C=>C(i,y))}},h=()=>i,a={setState:o,getState:h,getInitialState:()=>l,subscribe:c=>(r.add(c),()=>r.delete(c))},l=i=e(o,h,a);return a},zE=(e=>e?w_(e):w_),PE=e=>e;function UE(e,i=PE){const r=un.useSyncExternalStore(e.subscribe,un.useCallback(()=>i(e.getState()),[e,i]),un.useCallback(()=>i(e.getInitialState()),[e,i]));return un.useDebugValue(r),r}const x_=e=>{const i=zE(e),r=o=>UE(i,o);return Object.assign(r,i),r},tf=(e=>e?x_(e):x_),rt=tf(e=>({isAuthenticated:!1,isCheckingAuth:!0,setAuthenticated:i=>e({isAuthenticated:i,isCheckingAuth:!1}),setCheckingAuth:i=>e({isCheckingAuth:i}),serverAvailable:null,setServerAvailable:i=>e({serverAvailable:i}),connectionStatus:"disconnected",instanceConnectionStatus:{},setConnectionStatus:i=>e({connectionStatus:i}),setInstanceConnectionStatus:(i,r)=>e(o=>({instanceConnectionStatus:{...o.instanceConnectionStatus,[i]:r}})),removeInstanceConnectionStatus:i=>e(r=>{const{[i]:o,...h}=r.instanceConnectionStatus;return{instanceConnectionStatus:h}}),sessionStatus:"idle",setSessionStatus:i=>e({sessionStatus:i}),cachedToken:null,setCachedToken:i=>e({cachedToken:i}),ipChangeInfo:null,setIpChangeInfo:i=>e({ipChangeInfo:i}),toastMessage:null,showToast:i=>e({toastMessage:i}),hideToast:()=>e({toastMessage:null}),showFloatingDocButton:!0,setShowFloatingDocButton:i=>e({showFloatingDocButton:i}),isDocButtonHiddenByLongPress:!1,setDocButtonHiddenByLongPress:i=>e({isDocButtonHiddenByLongPress:i})})),es="/api";async function Ti(e){const i=await fetch(`${es}/auth`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:e})});if(i.status===429)throw new Error("Too many attempts. Try again later.");return i.ok}async function HE(){const e=await fetch(`${es}/status`,{credentials:"include"});if(e.status===401)throw new Error("Unauthorized");return e.json()}async function A0(e){const i=e?`${es}/config?instanceId=${encodeURIComponent(e)}`:`${es}/config`,r=await fetch(i,{credentials:"include"});if(r.status===401)throw new Error("Unauthorized");if(!r.ok)throw new Error(`Config fetch failed: ${r.status}`);return r.json()}async function jE(e,i){const r=i?`${es}/config?instanceId=${encodeURIComponent(i)}`:`${es}/config`,o=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)});if(o.status===401)throw new Error("Unauthorized");return o.ok}async function $E(e,i){const r=await fetch(`${es}/config/notifications/${e}/enabled`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({enabled:i})});if(r.status===401)throw new Error("Unauthorized");if(!r.ok){const o=await r.json().catch(()=>({}));throw new Error(o.error||`Failed to update channel status: ${r.status}`)}return r.json()}const nf="claude_remote_token";function k0(e){sessionStorage.setItem(nf,e)}function ts(){return sessionStorage.getItem(nf)}function R0(){sessionStorage.removeItem(nf)}function qE(){const[e,i]=N.useState(null),[r,o]=N.useState(!1),h=rt(l=>l.setAuthenticated),m=rt(l=>l.setCachedToken),p=N.useCallback(async l=>{i(null),o(!0);try{await Ti(l)?(h(!0),m(l),k0(l)):i("Invalid token")}catch(c){i(c instanceof Error?c.message:"Authentication failed")}finally{o(!1)}},[h,m]),a=N.useCallback(()=>{h(!1),m(null),R0()},[h,m]);return{login:p,logout:a,error:e,loading:r}}function WE(){const[e,i]=N.useState(""),[r,o]=N.useState(!1),{login:h,error:m,loading:p}=qE();N.useEffect(()=>{const c=sessionStorage.getItem("prefill_token");c&&(i(c),sessionStorage.removeItem("prefill_token"))},[]);const a=c=>{c.preventDefault(),e.trim()&&h(e.trim())},l=c=>{c.key==="Enter"&&e.trim()&&h(e.trim())};return Y.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"var(--bg-primary)"},children:Y.jsxs("form",{onSubmit:a,autoComplete:"off",style:{width:"100%",maxWidth:400,display:"flex",flexDirection:"column",gap:16},children:[Y.jsxs("div",{style:{textAlign:"center",marginBottom:8},children:[Y.jsx("h1",{"data-testid":"auth--title",style:{fontSize:24,fontWeight:700,marginBottom:8},children:"Claude Code Remote"}),Y.jsx("p",{"data-testid":"auth--subtitle",style:{fontSize:14,color:"var(--text-secondary)"},children:"Enter the token shown on your PC terminal"})]}),Y.jsxs("div",{style:{position:"relative"},children:[Y.jsx("input",{type:"text",value:e,onChange:c=>i(c.target.value),onKeyDown:l,placeholder:"Paste token here…","aria-label":"Authentication token","data-testid":"auth--input--token",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",style:{width:"100%",height:48,padding:"0 48px 0 16px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",fontSize:16,lineHeight:"48px",boxSizing:"border-box",WebkitTextSecurity:r?"none":"disc"}}),Y.jsx("button",{type:"button",onClick:()=>o(!r),"aria-label":r?"Hide token":"Show token",style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",padding:8,cursor:"pointer",color:"var(--text-secondary)",display:"flex",alignItems:"center",justifyContent:"center"},children:r?Y.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Y.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),Y.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):Y.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Y.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),Y.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),m&&Y.jsx("div",{"data-testid":"auth--error",style:{color:"var(--status-error)",fontSize:14,textAlign:"center"},children:m}),Y.jsx("button",{type:"submit",disabled:p||!e.trim(),"data-testid":"auth--button--connect",style:{height:48,borderRadius:8,background:e.trim()?"var(--status-running)":"var(--bg-tertiary)",color:e.trim()?"#fff":"var(--text-muted)",fontWeight:600,fontSize:16,transition:"background 0.15s",opacity:p?.7:1},children:p?"Authenticating…":"Connect"})]})})}const Sn=tf(e=>({instances:[],activeInstanceId:null,setInstances:i=>e({instances:i}),setActiveInstanceId:i=>e({activeInstanceId:i})})),GE=[{label:"Esc",data:"\x1B",enabled:!0},{label:"Enter",data:"\r",enabled:!0},{label:"Tab",data:" ",enabled:!0},{label:"↑",data:"\x1B[A",enabled:!0},{label:"↓",data:"\x1B[B",enabled:!0},{label:"←",data:"\x1B[D",enabled:!0},{label:"→",data:"\x1B[C",enabled:!0},{label:"S-Tab",data:"\x1B[Z",enabled:!0,desc:"Shift+Tab, 向前切换"},{label:"Ctrl+O",data:"",enabled:!0},{label:"Ctrl+E",data:"",enabled:!0}],KE=[{label:"/clear",command:"/clear",enabled:!0},{label:"/compact",command:"/compact",enabled:!0},{label:"/resume",command:"/resume",enabled:!0},{label:"/stats",command:"/stats",enabled:!0},{label:"/exit",command:"/exit",enabled:!0}],VE={dingtalk:{displayName:"DingTalk",icon:"dingtalk",description:"Send notifications to DingTalk group via robot webhook",helpUrl:"https://open.dingtalk.com/document/robots/custom-robot-access",implemented:!0},email:{displayName:"Email",icon:"email",description:"Send notifications via email",implemented:!1},slack:{displayName:"Slack",icon:"slack",description:"Send notifications to Slack channel via webhook",implemented:!1},wechat_work:{displayName:"WeChat",icon:"wechat-work",description:"Send notifications to WeChat via Server酱³",helpUrl:"https://sct.ftqq.com/sendkey",implemented:!0}},T0=/^https:\/\/oapi\.dingtalk\.com\/robot\/send\?access_token=/,M0=/^SCT[a-zA-Z0-9]{10,}$/,L0=GE.map(({enabled:e,desc:i,...r})=>r),O0=KE.map(({enabled:e,desc:i,...r})=>r);function D_(e){return e.filter(i=>i.enabled).map(({enabled:i,desc:r,...o})=>o)}let B0=0;const Ad=new Set;function YE(e){return Ad.add(e),()=>Ad.delete(e)}function XE(){return B0}function N0(){B0++,Ad.forEach(e=>e())}function ZE(){const[e,i]=N.useState(null),[r,o]=N.useState(null),[h,m]=N.useState(!0),p=N.useSyncExternalStore(YE,XE),a=Sn(y=>y.activeInstanceId),l=N.useCallback(async()=>{m(!0);try{const y=await A0(a??void 0);i(y.config),o(y.configPath)}catch{i(null)}finally{m(!1)}},[a]);N.useEffect(()=>{l()},[l,p]);const c=e!=null&&e.shortcuts?D_(e.shortcuts):L0,f=e!=null&&e.commands?D_(e.commands):O0,u=N.useCallback(()=>{N0()},[]);return{shortcuts:c,commands:f,configPath:r,isLoading:h,reload:u}}function QE(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return N.useMemo(()=>o=>{i.forEach(h=>h(o))},i)}const kc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Js(e){const i=Object.prototype.toString.call(e);return i==="[object Window]"||i==="[object global]"}function rf(e){return"nodeType"in e}function jn(e){var i,r;return e?Js(e)?e:rf(e)&&(i=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?i:window:window}function sf(e){const{Document:i}=jn(e);return e instanceof i}function Do(e){return Js(e)?!1:e instanceof jn(e).HTMLElement}function I0(e){return e instanceof jn(e).SVGElement}function ea(e){return e?Js(e)?e.document:rf(e)?sf(e)?e:Do(e)||I0(e)?e.ownerDocument:document:document:document}const Mi=kc?N.useLayoutEffect:N.useEffect;function af(e){const i=N.useRef(e);return Mi(()=>{i.current=e}),N.useCallback(function(){for(var r=arguments.length,o=new Array(r),h=0;h<r;h++)o[h]=arguments[h];return i.current==null?void 0:i.current(...o)},[])}function JE(){const e=N.useRef(null),i=N.useCallback((o,h)=>{e.current=setInterval(o,h)},[]),r=N.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[i,r]}function _o(e,i){i===void 0&&(i=[e]);const r=N.useRef(e);return Mi(()=>{r.current!==e&&(r.current=e)},i),r}function Ao(e,i){const r=N.useRef();return N.useMemo(()=>{const o=e(r.current);return r.current=o,o},[...i])}function pc(e){const i=af(e),r=N.useRef(null),o=N.useCallback(h=>{h!==r.current&&(i==null||i(h,r.current)),r.current=h},[]);return[r,o]}function kd(e){const i=N.useRef();return N.useEffect(()=>{i.current=e},[e]),i.current}let Kh={};function ko(e,i){return N.useMemo(()=>{if(i)return i;const r=Kh[e]==null?0:Kh[e]+1;return Kh[e]=r,e+"-"+r},[e,i])}function F0(e){return function(i){for(var r=arguments.length,o=new Array(r>1?r-1:0),h=1;h<r;h++)o[h-1]=arguments[h];return o.reduce((m,p)=>{const a=Object.entries(p);for(const[l,c]of a){const f=m[l];f!=null&&(m[l]=f+e*c)}return m},{...i})}}const Ks=F0(1),vo=F0(-1);function ew(e){return"clientX"in e&&"clientY"in e}function of(e){if(!e)return!1;const{KeyboardEvent:i}=jn(e.target);return i&&e instanceof i}function tw(e){if(!e)return!1;const{TouchEvent:i}=jn(e.target);return i&&e instanceof i}function Rd(e){if(tw(e)){if(e.touches&&e.touches.length){const{clientX:i,clientY:r}=e.touches[0];return{x:i,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:i,clientY:r}=e.changedTouches[0];return{x:i,y:r}}}return ew(e)?{x:e.clientX,y:e.clientY}:null}const bo=Object.freeze({Translate:{toString(e){if(!e)return;const{x:i,y:r}=e;return"translate3d("+(i?Math.round(i):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:i,scaleY:r}=e;return"scaleX("+i+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[bo.Translate.toString(e),bo.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:i,duration:r,easing:o}=e;return i+" "+r+"ms "+o}}}),A_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function nw(e){return e.matches(A_)?e:e.querySelector(A_)}const iw={display:"none"};function rw(e){let{id:i,value:r}=e;return un.createElement("div",{id:i,style:iw},r)}function sw(e){let{id:i,announcement:r,ariaLiveType:o="assertive"}=e;const h={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return un.createElement("div",{id:i,style:h,role:"status","aria-live":o,"aria-atomic":!0},r)}function aw(){const[e,i]=N.useState("");return{announce:N.useCallback(o=>{o!=null&&i(o)},[]),announcement:e}}const z0=N.createContext(null);function ow(e){const i=N.useContext(z0);N.useEffect(()=>{if(!i)throw new Error("useDndMonitor must be used within a children of <DndContext>");return i(e)},[e,i])}function lw(){const[e]=N.useState(()=>new Set),i=N.useCallback(o=>(e.add(o),()=>e.delete(o)),[e]);return[N.useCallback(o=>{let{type:h,event:m}=o;e.forEach(p=>{var a;return(a=p[h])==null?void 0:a.call(p,m)})},[e]),i]}const cw={draggable:`
61
- To pick up a draggable item, press the space bar.
62
- While dragging, use the arrow keys to move the item.
63
- Press space again to drop the item in its new position, or press escape to cancel.
64
- `},uw={onDragStart(e){let{active:i}=e;return"Picked up draggable item "+i.id+"."},onDragOver(e){let{active:i,over:r}=e;return r?"Draggable item "+i.id+" was moved over droppable area "+r.id+".":"Draggable item "+i.id+" is no longer over a droppable area."},onDragEnd(e){let{active:i,over:r}=e;return r?"Draggable item "+i.id+" was dropped over droppable area "+r.id:"Draggable item "+i.id+" was dropped."},onDragCancel(e){let{active:i}=e;return"Dragging was cancelled. Draggable item "+i.id+" was dropped."}};function hw(e){let{announcements:i=uw,container:r,hiddenTextDescribedById:o,screenReaderInstructions:h=cw}=e;const{announce:m,announcement:p}=aw(),a=ko("DndLiveRegion"),[l,c]=N.useState(!1);if(N.useEffect(()=>{c(!0)},[]),ow(N.useMemo(()=>({onDragStart(u){let{active:y}=u;m(i.onDragStart({active:y}))},onDragMove(u){let{active:y,over:C}=u;i.onDragMove&&m(i.onDragMove({active:y,over:C}))},onDragOver(u){let{active:y,over:C}=u;m(i.onDragOver({active:y,over:C}))},onDragEnd(u){let{active:y,over:C}=u;m(i.onDragEnd({active:y,over:C}))},onDragCancel(u){let{active:y,over:C}=u;m(i.onDragCancel({active:y,over:C}))}}),[m,i])),!l)return null;const f=un.createElement(un.Fragment,null,un.createElement(rw,{id:o,value:h.draggable}),un.createElement(sw,{id:a,announcement:p}));return r?ao.createPortal(f,r):f}var on;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(on||(on={}));function mc(){}function k_(e,i){return N.useMemo(()=>({sensor:e,options:i??{}}),[e,i])}function dw(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return N.useMemo(()=>[...i].filter(o=>o!=null),[...i])}const Ci=Object.freeze({x:0,y:0});function P0(e,i){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function U0(e,i){let{data:{value:r}}=e,{data:{value:o}}=i;return r-o}function fw(e,i){let{data:{value:r}}=e,{data:{value:o}}=i;return o-r}function R_(e){let{left:i,top:r,height:o,width:h}=e;return[{x:i,y:r},{x:i+h,y:r},{x:i,y:r+o},{x:i+h,y:r+o}]}function H0(e,i){if(!e||e.length===0)return null;const[r]=e;return r[i]}function T_(e,i,r){return i===void 0&&(i=e.left),r===void 0&&(r=e.top),{x:i+e.width*.5,y:r+e.height*.5}}const j0=e=>{let{collisionRect:i,droppableRects:r,droppableContainers:o}=e;const h=T_(i,i.left,i.top),m=[];for(const p of o){const{id:a}=p,l=r.get(a);if(l){const c=P0(T_(l),h);m.push({id:a,data:{droppableContainer:p,value:c}})}}return m.sort(U0)},gw=e=>{let{collisionRect:i,droppableRects:r,droppableContainers:o}=e;const h=R_(i),m=[];for(const p of o){const{id:a}=p,l=r.get(a);if(l){const c=R_(l),f=h.reduce((y,C,w)=>y+P0(c[w],C),0),u=Number((f/4).toFixed(4));m.push({id:a,data:{droppableContainer:p,value:u}})}}return m.sort(U0)};function pw(e,i){const r=Math.max(i.top,e.top),o=Math.max(i.left,e.left),h=Math.min(i.left+i.width,e.left+e.width),m=Math.min(i.top+i.height,e.top+e.height),p=h-o,a=m-r;if(o<h&&r<m){const l=i.width*i.height,c=e.width*e.height,f=p*a,u=f/(l+c-f);return Number(u.toFixed(4))}return 0}const mw=e=>{let{collisionRect:i,droppableRects:r,droppableContainers:o}=e;const h=[];for(const m of o){const{id:p}=m,a=r.get(p);if(a){const l=pw(a,i);l>0&&h.push({id:p,data:{droppableContainer:m,value:l}})}}return h.sort(fw)};function _w(e,i,r){return{...e,scaleX:i&&r?i.width/r.width:1,scaleY:i&&r?i.height/r.height:1}}function $0(e,i){return e&&i?{x:e.left-i.left,y:e.top-i.top}:Ci}function vw(e){return function(r){for(var o=arguments.length,h=new Array(o>1?o-1:0),m=1;m<o;m++)h[m-1]=arguments[m];return h.reduce((p,a)=>({...p,top:p.top+e*a.y,bottom:p.bottom+e*a.y,left:p.left+e*a.x,right:p.right+e*a.x}),{...r})}}const bw=vw(1);function yw(e){if(e.startsWith("matrix3d(")){const i=e.slice(9,-1).split(/, /);return{x:+i[12],y:+i[13],scaleX:+i[0],scaleY:+i[5]}}else if(e.startsWith("matrix(")){const i=e.slice(7,-1).split(/, /);return{x:+i[4],y:+i[5],scaleX:+i[0],scaleY:+i[3]}}return null}function Sw(e,i,r){const o=yw(i);if(!o)return e;const{scaleX:h,scaleY:m,x:p,y:a}=o,l=e.left-p-(1-h)*parseFloat(r),c=e.top-a-(1-m)*parseFloat(r.slice(r.indexOf(" ")+1)),f=h?e.width/h:e.width,u=m?e.height/m:e.height;return{width:f,height:u,top:c,right:l+f,bottom:c+u,left:l}}const Cw={ignoreTransform:!1};function ta(e,i){i===void 0&&(i=Cw);let r=e.getBoundingClientRect();if(i.ignoreTransform){const{transform:c,transformOrigin:f}=jn(e).getComputedStyle(e);c&&(r=Sw(r,c,f))}const{top:o,left:h,width:m,height:p,bottom:a,right:l}=r;return{top:o,left:h,width:m,height:p,bottom:a,right:l}}function M_(e){return ta(e,{ignoreTransform:!0})}function Ew(e){const i=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:i,bottom:r,width:i,height:r}}function ww(e,i){return i===void 0&&(i=jn(e).getComputedStyle(e)),i.position==="fixed"}function xw(e,i){i===void 0&&(i=jn(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(h=>{const m=i[h];return typeof m=="string"?r.test(m):!1})}function Rc(e,i){const r=[];function o(h){if(i!=null&&r.length>=i||!h)return r;if(sf(h)&&h.scrollingElement!=null&&!r.includes(h.scrollingElement))return r.push(h.scrollingElement),r;if(!Do(h)||I0(h)||r.includes(h))return r;const m=jn(e).getComputedStyle(h);return h!==e&&xw(h,m)&&r.push(h),ww(h,m)?r:o(h.parentNode)}return e?o(e):r}function q0(e){const[i]=Rc(e,1);return i??null}function Vh(e){return!kc||!e?null:Js(e)?e:rf(e)?sf(e)||e===ea(e).scrollingElement?window:Do(e)?e:null:null}function W0(e){return Js(e)?e.scrollX:e.scrollLeft}function G0(e){return Js(e)?e.scrollY:e.scrollTop}function Td(e){return{x:W0(e),y:G0(e)}}var cn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(cn||(cn={}));function K0(e){return!kc||!e?!1:e===document.scrollingElement}function V0(e){const i={x:0,y:0},r=K0(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},h=e.scrollTop<=i.y,m=e.scrollLeft<=i.x,p=e.scrollTop>=o.y,a=e.scrollLeft>=o.x;return{isTop:h,isLeft:m,isBottom:p,isRight:a,maxScroll:o,minScroll:i}}const Dw={x:.2,y:.2};function Aw(e,i,r,o,h){let{top:m,left:p,right:a,bottom:l}=r;o===void 0&&(o=10),h===void 0&&(h=Dw);const{isTop:c,isBottom:f,isLeft:u,isRight:y}=V0(e),C={x:0,y:0},w={x:0,y:0},b={height:i.height*h.y,width:i.width*h.x};return!c&&m<=i.top+b.height?(C.y=cn.Backward,w.y=o*Math.abs((i.top+b.height-m)/b.height)):!f&&l>=i.bottom-b.height&&(C.y=cn.Forward,w.y=o*Math.abs((i.bottom-b.height-l)/b.height)),!y&&a>=i.right-b.width?(C.x=cn.Forward,w.x=o*Math.abs((i.right-b.width-a)/b.width)):!u&&p<=i.left+b.width&&(C.x=cn.Backward,w.x=o*Math.abs((i.left+b.width-p)/b.width)),{direction:C,speed:w}}function kw(e){if(e===document.scrollingElement){const{innerWidth:m,innerHeight:p}=window;return{top:0,left:0,right:m,bottom:p,width:m,height:p}}const{top:i,left:r,right:o,bottom:h}=e.getBoundingClientRect();return{top:i,left:r,right:o,bottom:h,width:e.clientWidth,height:e.clientHeight}}function Y0(e){return e.reduce((i,r)=>Ks(i,Td(r)),Ci)}function Rw(e){return e.reduce((i,r)=>i+W0(r),0)}function Tw(e){return e.reduce((i,r)=>i+G0(r),0)}function Mw(e,i){if(i===void 0&&(i=ta),!e)return;const{top:r,left:o,bottom:h,right:m}=i(e);q0(e)&&(h<=0||m<=0||r>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Lw=[["x",["left","right"],Rw],["y",["top","bottom"],Tw]];class lf{constructor(i,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Rc(r),h=Y0(o);this.rect={...i},this.width=i.width,this.height=i.height;for(const[m,p,a]of Lw)for(const l of p)Object.defineProperty(this,l,{get:()=>{const c=a(o),f=h[m]-c;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class co{constructor(i){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...r)})},this.target=i}add(i,r,o){var h;(h=this.target)==null||h.addEventListener(i,r,o),this.listeners.push([i,r,o])}}function Ow(e){const{EventTarget:i}=jn(e);return e instanceof i?e:ea(e)}function Yh(e,i){const r=Math.abs(e.x),o=Math.abs(e.y);return typeof i=="number"?Math.sqrt(r**2+o**2)>i:"x"in i&&"y"in i?r>i.x&&o>i.y:"x"in i?r>i.x:"y"in i?o>i.y:!1}var fi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fi||(fi={}));function L_(e){e.preventDefault()}function Bw(e){e.stopPropagation()}var dt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(dt||(dt={}));const X0={start:[dt.Space,dt.Enter],cancel:[dt.Esc],end:[dt.Space,dt.Enter,dt.Tab]},Nw=(e,i)=>{let{currentCoordinates:r}=i;switch(e.code){case dt.Right:return{...r,x:r.x+25};case dt.Left:return{...r,x:r.x-25};case dt.Down:return{...r,y:r.y+25};case dt.Up:return{...r,y:r.y-25}}};class cf{constructor(i){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=i;const{event:{target:r}}=i;this.props=i,this.listeners=new co(ea(r)),this.windowListeners=new co(jn(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fi.Resize,this.handleCancel),this.windowListeners.add(fi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:i,onStart:r}=this.props,o=i.node.current;o&&Mw(o),r(Ci)}handleKeyDown(i){if(of(i)){const{active:r,context:o,options:h}=this.props,{keyboardCodes:m=X0,coordinateGetter:p=Nw,scrollBehavior:a="smooth"}=h,{code:l}=i;if(m.end.includes(l)){this.handleEnd(i);return}if(m.cancel.includes(l)){this.handleCancel(i);return}const{collisionRect:c}=o.current,f=c?{x:c.left,y:c.top}:Ci;this.referenceCoordinates||(this.referenceCoordinates=f);const u=p(i,{active:r,context:o.current,currentCoordinates:f});if(u){const y=vo(u,f),C={x:0,y:0},{scrollableAncestors:w}=o.current;for(const b of w){const g=i.code,{isTop:_,isRight:v,isLeft:S,isBottom:D,maxScroll:R,minScroll:x}=V0(b),M=kw(b),k={x:Math.min(g===dt.Right?M.right-M.width/2:M.right,Math.max(g===dt.Right?M.left:M.left+M.width/2,u.x)),y:Math.min(g===dt.Down?M.bottom-M.height/2:M.bottom,Math.max(g===dt.Down?M.top:M.top+M.height/2,u.y))},L=g===dt.Right&&!v||g===dt.Left&&!S,T=g===dt.Down&&!D||g===dt.Up&&!_;if(L&&k.x!==u.x){const P=b.scrollLeft+y.x,B=g===dt.Right&&P<=R.x||g===dt.Left&&P>=x.x;if(B&&!y.y){b.scrollTo({left:P,behavior:a});return}B?C.x=b.scrollLeft-P:C.x=g===dt.Right?b.scrollLeft-R.x:b.scrollLeft-x.x,C.x&&b.scrollBy({left:-C.x,behavior:a});break}else if(T&&k.y!==u.y){const P=b.scrollTop+y.y,B=g===dt.Down&&P<=R.y||g===dt.Up&&P>=x.y;if(B&&!y.x){b.scrollTo({top:P,behavior:a});return}B?C.y=b.scrollTop-P:C.y=g===dt.Down?b.scrollTop-R.y:b.scrollTop-x.y,C.y&&b.scrollBy({top:-C.y,behavior:a});break}}this.handleMove(i,Ks(vo(u,this.referenceCoordinates),C))}}}handleMove(i,r){const{onMove:o}=this.props;i.preventDefault(),o(r)}handleEnd(i){const{onEnd:r}=this.props;i.preventDefault(),this.detach(),r()}handleCancel(i){const{onCancel:r}=this.props;i.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}cf.activators=[{eventName:"onKeyDown",handler:(e,i,r)=>{let{keyboardCodes:o=X0,onActivation:h}=i,{active:m}=r;const{code:p}=e.nativeEvent;if(o.start.includes(p)){const a=m.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),h==null||h({event:e.nativeEvent}),!0)}return!1}}];function O_(e){return!!(e&&"distance"in e)}function B_(e){return!!(e&&"delay"in e)}class uf{constructor(i,r,o){var h;o===void 0&&(o=Ow(i.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=i,this.events=r;const{event:m}=i,{target:p}=m;this.props=i,this.events=r,this.document=ea(p),this.documentListeners=new co(this.document),this.listeners=new co(o),this.windowListeners=new co(jn(p)),this.initialCoordinates=(h=Rd(m))!=null?h:Ci,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:i,props:{options:{activationConstraint:r,bypassActivationConstraint:o}}}=this;if(this.listeners.add(i.move.name,this.handleMove,{passive:!1}),this.listeners.add(i.end.name,this.handleEnd),i.cancel&&this.listeners.add(i.cancel.name,this.handleCancel),this.windowListeners.add(fi.Resize,this.handleCancel),this.windowListeners.add(fi.DragStart,L_),this.windowListeners.add(fi.VisibilityChange,this.handleCancel),this.windowListeners.add(fi.ContextMenu,L_),this.documentListeners.add(fi.Keydown,this.handleKeydown),r){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(B_(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(O_(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(i,r){const{active:o,onPending:h}=this.props;h(o,i,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:i}=this,{onStart:r}=this.props;i&&(this.activated=!0,this.documentListeners.add(fi.Click,Bw,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fi.SelectionChange,this.removeTextSelection),r(i))}handleMove(i){var r;const{activated:o,initialCoordinates:h,props:m}=this,{onMove:p,options:{activationConstraint:a}}=m;if(!h)return;const l=(r=Rd(i))!=null?r:Ci,c=vo(h,l);if(!o&&a){if(O_(a)){if(a.tolerance!=null&&Yh(c,a.tolerance))return this.handleCancel();if(Yh(c,a.distance))return this.handleStart()}if(B_(a)&&Yh(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}i.cancelable&&i.preventDefault(),p(l)}handleEnd(){const{onAbort:i,onEnd:r}=this.props;this.detach(),this.activated||i(this.props.active),r()}handleCancel(){const{onAbort:i,onCancel:r}=this.props;this.detach(),this.activated||i(this.props.active),r()}handleKeydown(i){i.code===dt.Esc&&this.handleCancel()}removeTextSelection(){var i;(i=this.document.getSelection())==null||i.removeAllRanges()}}const Iw={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class hf extends uf{constructor(i){const{event:r}=i,o=ea(r.target);super(i,Iw,o)}}hf.activators=[{eventName:"onPointerDown",handler:(e,i)=>{let{nativeEvent:r}=e,{onActivation:o}=i;return!r.isPrimary||r.button!==0?!1:(o==null||o({event:r}),!0)}}];const Fw={move:{name:"mousemove"},end:{name:"mouseup"}};var Md;(function(e){e[e.RightClick=2]="RightClick"})(Md||(Md={}));class zw extends uf{constructor(i){super(i,Fw,ea(i.event.target))}}zw.activators=[{eventName:"onMouseDown",handler:(e,i)=>{let{nativeEvent:r}=e,{onActivation:o}=i;return r.button===Md.RightClick?!1:(o==null||o({event:r}),!0)}}];const Xh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Pw extends uf{constructor(i){super(i,Xh)}static setup(){return window.addEventListener(Xh.move.name,i,{capture:!1,passive:!1}),function(){window.removeEventListener(Xh.move.name,i)};function i(){}}}Pw.activators=[{eventName:"onTouchStart",handler:(e,i)=>{let{nativeEvent:r}=e,{onActivation:o}=i;const{touches:h}=r;return h.length>1?!1:(o==null||o({event:r}),!0)}}];var uo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(uo||(uo={}));var _c;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(_c||(_c={}));function Uw(e){let{acceleration:i,activator:r=uo.Pointer,canScroll:o,draggingRect:h,enabled:m,interval:p=5,order:a=_c.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:f,delta:u,threshold:y}=e;const C=jw({delta:u,disabled:!m}),[w,b]=JE(),g=N.useRef({x:0,y:0}),_=N.useRef({x:0,y:0}),v=N.useMemo(()=>{switch(r){case uo.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case uo.DraggableRect:return h}},[r,h,l]),S=N.useRef(null),D=N.useCallback(()=>{const x=S.current;if(!x)return;const M=g.current.x*_.current.x,k=g.current.y*_.current.y;x.scrollBy(M,k)},[]),R=N.useMemo(()=>a===_c.TreeOrder?[...c].reverse():c,[a,c]);N.useEffect(()=>{if(!m||!c.length||!v){b();return}for(const x of R){if((o==null?void 0:o(x))===!1)continue;const M=c.indexOf(x),k=f[M];if(!k)continue;const{direction:L,speed:T}=Aw(x,k,v,i,y);for(const P of["x","y"])C[P][L[P]]||(T[P]=0,L[P]=0);if(T.x>0||T.y>0){b(),S.current=x,w(D,p),g.current=T,_.current=L;return}}g.current={x:0,y:0},_.current={x:0,y:0},b()},[i,D,o,b,m,p,JSON.stringify(v),JSON.stringify(C),w,c,R,f,JSON.stringify(y)])}const Hw={x:{[cn.Backward]:!1,[cn.Forward]:!1},y:{[cn.Backward]:!1,[cn.Forward]:!1}};function jw(e){let{delta:i,disabled:r}=e;const o=kd(i);return Ao(h=>{if(r||!o||!h)return Hw;const m={x:Math.sign(i.x-o.x),y:Math.sign(i.y-o.y)};return{x:{[cn.Backward]:h.x[cn.Backward]||m.x===-1,[cn.Forward]:h.x[cn.Forward]||m.x===1},y:{[cn.Backward]:h.y[cn.Backward]||m.y===-1,[cn.Forward]:h.y[cn.Forward]||m.y===1}}},[r,i,o])}function $w(e,i){const r=i!=null?e.get(i):void 0,o=r?r.node.current:null;return Ao(h=>{var m;return i==null?null:(m=o??h)!=null?m:null},[o,i])}function qw(e,i){return N.useMemo(()=>e.reduce((r,o)=>{const{sensor:h}=o,m=h.activators.map(p=>({eventName:p.eventName,handler:i(p.handler,o)}));return[...r,...m]},[]),[e,i])}var yo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(yo||(yo={}));var Ld;(function(e){e.Optimized="optimized"})(Ld||(Ld={}));const N_=new Map;function Ww(e,i){let{dragging:r,dependencies:o,config:h}=i;const[m,p]=N.useState(null),{frequency:a,measure:l,strategy:c}=h,f=N.useRef(e),u=g(),y=_o(u),C=N.useCallback(function(_){_===void 0&&(_=[]),!y.current&&p(v=>v===null?_:v.concat(_.filter(S=>!v.includes(S))))},[y]),w=N.useRef(null),b=Ao(_=>{if(u&&!r)return N_;if(!_||_===N_||f.current!==e||m!=null){const v=new Map;for(let S of e){if(!S)continue;if(m&&m.length>0&&!m.includes(S.id)&&S.rect.current){v.set(S.id,S.rect.current);continue}const D=S.node.current,R=D?new lf(l(D),D):null;S.rect.current=R,R&&v.set(S.id,R)}return v}return _},[e,m,r,u,l]);return N.useEffect(()=>{f.current=e},[e]),N.useEffect(()=>{u||C()},[r,u]),N.useEffect(()=>{m&&m.length>0&&p(null)},[JSON.stringify(m)]),N.useEffect(()=>{u||typeof a!="number"||w.current!==null||(w.current=setTimeout(()=>{C(),w.current=null},a))},[a,u,C,...o]),{droppableRects:b,measureDroppableContainers:C,measuringScheduled:m!=null};function g(){switch(c){case yo.Always:return!1;case yo.BeforeDragging:return r;default:return!r}}}function Z0(e,i){return Ao(r=>e?r||(typeof i=="function"?i(e):e):null,[i,e])}function Gw(e,i){return Z0(e,i)}function Kw(e){let{callback:i,disabled:r}=e;const o=af(i),h=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:m}=window;return new m(o)},[o,r]);return N.useEffect(()=>()=>h==null?void 0:h.disconnect(),[h]),h}function Tc(e){let{callback:i,disabled:r}=e;const o=af(i),h=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:m}=window;return new m(o)},[r]);return N.useEffect(()=>()=>h==null?void 0:h.disconnect(),[h]),h}function Vw(e){return new lf(ta(e),e)}function I_(e,i,r){i===void 0&&(i=Vw);const[o,h]=N.useState(null);function m(){h(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??r)!=null?c:null}const f=i(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const p=Kw({callback(l){if(e)for(const c of l){const{type:f,target:u}=c;if(f==="childList"&&u instanceof HTMLElement&&u.contains(e)){m();break}}}}),a=Tc({callback:m});return Mi(()=>{m(),e?(a==null||a.observe(e),p==null||p.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),p==null||p.disconnect())},[e]),o}function Yw(e){const i=Z0(e);return $0(e,i)}const F_=[];function Xw(e){const i=N.useRef(e),r=Ao(o=>e?o&&o!==F_&&e&&i.current&&e.parentNode===i.current.parentNode?o:Rc(e):F_,[e]);return N.useEffect(()=>{i.current=e},[e]),r}function Zw(e){const[i,r]=N.useState(null),o=N.useRef(e),h=N.useCallback(m=>{const p=Vh(m.target);p&&r(a=>a?(a.set(p,Td(p)),new Map(a)):null)},[]);return N.useEffect(()=>{const m=o.current;if(e!==m){p(m);const a=e.map(l=>{const c=Vh(l);return c?(c.addEventListener("scroll",h,{passive:!0}),[c,Td(c)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),o.current=e}return()=>{p(e),p(m)};function p(a){a.forEach(l=>{const c=Vh(l);c==null||c.removeEventListener("scroll",h)})}},[h,e]),N.useMemo(()=>e.length?i?Array.from(i.values()).reduce((m,p)=>Ks(m,p),Ci):Y0(e):Ci,[e,i])}function z_(e,i){i===void 0&&(i=[]);const r=N.useRef(null);return N.useEffect(()=>{r.current=null},i),N.useEffect(()=>{const o=e!==Ci;o&&!r.current&&(r.current=e),!o&&r.current&&(r.current=null)},[e]),r.current?vo(e,r.current):Ci}function Qw(e){N.useEffect(()=>{if(!kc)return;const i=e.map(r=>{let{sensor:o}=r;return o.setup==null?void 0:o.setup()});return()=>{for(const r of i)r==null||r()}},e.map(i=>{let{sensor:r}=i;return r}))}function Jw(e,i){return N.useMemo(()=>e.reduce((r,o)=>{let{eventName:h,handler:m}=o;return r[h]=p=>{m(p,i)},r},{}),[e,i])}function Q0(e){return N.useMemo(()=>e?Ew(e):null,[e])}const P_=[];function ex(e,i){i===void 0&&(i=ta);const[r]=e,o=Q0(r?jn(r):null),[h,m]=N.useState(P_);function p(){m(()=>e.length?e.map(l=>K0(l)?o:new lf(i(l),l)):P_)}const a=Tc({callback:p});return Mi(()=>{a==null||a.disconnect(),p(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),h}function tx(e){if(!e)return null;if(e.children.length>1)return e;const i=e.children[0];return Do(i)?i:e}function nx(e){let{measure:i}=e;const[r,o]=N.useState(null),h=N.useCallback(c=>{for(const{target:f}of c)if(Do(f)){o(u=>{const y=i(f);return u?{...u,width:y.width,height:y.height}:y});break}},[i]),m=Tc({callback:h}),p=N.useCallback(c=>{const f=tx(c);m==null||m.disconnect(),f&&(m==null||m.observe(f)),o(f?i(f):null)},[i,m]),[a,l]=pc(p);return N.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const ix=[{sensor:hf,options:{}},{sensor:cf,options:{}}],rx={current:{}},hc={draggable:{measure:M_},droppable:{measure:M_,strategy:yo.WhileDragging,frequency:Ld.Optimized},dragOverlay:{measure:ta}};class ho extends Map{get(i){var r;return i!=null&&(r=super.get(i))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(i=>{let{disabled:r}=i;return!r})}getNodeFor(i){var r,o;return(r=(o=this.get(i))==null?void 0:o.node.current)!=null?r:void 0}}const sx={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ho,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:mc},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:hc,measureDroppableContainers:mc,windowRect:null,measuringScheduled:!1},ax={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:mc,draggableNodes:new Map,over:null,measureDroppableContainers:mc},Mc=N.createContext(ax),J0=N.createContext(sx);function ox(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ho}}}function lx(e,i){switch(i.type){case on.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:i.initialCoordinates,active:i.active}};case on.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:i.coordinates.x-e.draggable.initialCoordinates.x,y:i.coordinates.y-e.draggable.initialCoordinates.y}}};case on.DragEnd:case on.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case on.RegisterDroppable:{const{element:r}=i,{id:o}=r,h=new ho(e.droppable.containers);return h.set(o,r),{...e,droppable:{...e.droppable,containers:h}}}case on.SetDroppableDisabled:{const{id:r,key:o,disabled:h}=i,m=e.droppable.containers.get(r);if(!m||o!==m.key)return e;const p=new ho(e.droppable.containers);return p.set(r,{...m,disabled:h}),{...e,droppable:{...e.droppable,containers:p}}}case on.UnregisterDroppable:{const{id:r,key:o}=i,h=e.droppable.containers.get(r);if(!h||o!==h.key)return e;const m=new ho(e.droppable.containers);return m.delete(r),{...e,droppable:{...e.droppable,containers:m}}}default:return e}}function cx(e){let{disabled:i}=e;const{active:r,activatorEvent:o,draggableNodes:h}=N.useContext(Mc),m=kd(o),p=kd(r==null?void 0:r.id);return N.useEffect(()=>{if(!i&&!o&&m&&p!=null){if(!of(m)||document.activeElement===m.target)return;const a=h.get(p);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const f of[l.current,c.current]){if(!f)continue;const u=nw(f);if(u){u.focus();break}}})}},[o,i,h,p,m]),null}function ux(e,i){let{transform:r,...o}=i;return e!=null&&e.length?e.reduce((h,m)=>m({transform:h,...o}),r):r}function hx(e){return N.useMemo(()=>({draggable:{...hc.draggable,...e==null?void 0:e.draggable},droppable:{...hc.droppable,...e==null?void 0:e.droppable},dragOverlay:{...hc.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function dx(e){let{activeNode:i,measure:r,initialRect:o,config:h=!0}=e;const m=N.useRef(!1),{x:p,y:a}=typeof h=="boolean"?{x:h,y:h}:h;Mi(()=>{if(!p&&!a||!i){m.current=!1;return}if(m.current||!o)return;const c=i==null?void 0:i.node.current;if(!c||c.isConnected===!1)return;const f=r(c),u=$0(f,o);if(p||(u.x=0),a||(u.y=0),m.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const y=q0(c);y&&y.scrollBy({top:u.y,left:u.x})}},[i,p,a,o,r])}const eb=N.createContext({...Ci,scaleX:1,scaleY:1});var Lr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Lr||(Lr={}));const tb=N.memo(function(i){var r,o,h,m;let{id:p,accessibility:a,autoScroll:l=!0,children:c,sensors:f=ix,collisionDetection:u=mw,measuring:y,modifiers:C,...w}=i;const b=N.useReducer(lx,void 0,ox),[g,_]=b,[v,S]=lw(),[D,R]=N.useState(Lr.Uninitialized),x=D===Lr.Initialized,{draggable:{active:M,nodes:k,translate:L},droppable:{containers:T}}=g,P=M!=null?k.get(M):null,B=N.useRef({initial:null,translated:null}),F=N.useMemo(()=>{var Mt;return M!=null?{id:M,data:(Mt=P==null?void 0:P.data)!=null?Mt:rx,rect:B}:null},[M,P]),$=N.useRef(null),[q,W]=N.useState(null),[K,X]=N.useState(null),U=_o(w,Object.values(w)),O=ko("DndDescribedBy",p),z=N.useMemo(()=>T.getEnabled(),[T]),j=hx(y),{droppableRects:H,measureDroppableContainers:ee,measuringScheduled:he}=Ww(z,{dragging:x,dependencies:[L.x,L.y],config:j.droppable}),se=$w(k,M),Z=N.useMemo(()=>K?Rd(K):null,[K]),G=mi(),re=Gw(se,j.draggable.measure);dx({activeNode:M!=null?k.get(M):null,config:G.layoutShiftCompensation,initialRect:re,measure:j.draggable.measure});const ne=I_(se,j.draggable.measure,re),ve=I_(se?se.parentElement:null),me=N.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=T.getNodeFor((r=me.current.over)==null?void 0:r.id),xe=nx({measure:j.dragOverlay.measure}),Ve=(o=xe.nodeRef.current)!=null?o:se,Me=x?(h=xe.rect)!=null?h:ne:null,ke=!!(xe.nodeRef.current&&xe.rect),Bt=Yw(ke?null:ne),Gt=Q0(Ve?jn(Ve):null),$e=Xw(x?Te??se:null),Ke=ex($e),Ye=ux(C,{transform:{x:L.x-Bt.x,y:L.y-Bt.y,scaleX:1,scaleY:1},activatorEvent:K,active:F,activeNodeRect:ne,containerNodeRect:ve,draggingNodeRect:Me,over:me.current.over,overlayNodeRect:xe.rect,scrollableAncestors:$e,scrollableAncestorRects:Ke,windowRect:Gt}),De=Z?Ks(Z,L):null,Ne=Zw($e),_t=z_(Ne),le=z_(Ne,[ne]),_e=Ks(Ye,_t),Ae=Me?bw(Me,Ye):null,Fe=F&&Ae?u({active:F,collisionRect:Ae,droppableRects:H,droppableContainers:z,pointerCoordinates:De}):null,ze=H0(Fe,"id"),[qe,He]=N.useState(null),Ft=ke?Ye:Ks(Ye,le),Ct=_w(Ft,(m=qe==null?void 0:qe.rect)!=null?m:null,ne),zt=N.useRef(null),ut=N.useCallback((Mt,yt)=>{let{sensor:Q,options:de}=yt;if($.current==null)return;const ye=k.get($.current);if(!ye)return;const Le=Mt.nativeEvent,at=new Q({active:$.current,activeNode:ye,event:Le,options:de,context:me,onAbort(Ee){if(!k.get(Ee))return;const{onDragAbort:Ie}=U.current,vt={id:Ee};Ie==null||Ie(vt),v({type:"onDragAbort",event:vt})},onPending(Ee,we,Ie,vt){if(!k.get(Ee))return;const{onDragPending:wn}=U.current,xn={id:Ee,constraint:we,initialCoordinates:Ie,offset:vt};wn==null||wn(xn),v({type:"onDragPending",event:xn})},onStart(Ee){const we=$.current;if(we==null)return;const Ie=k.get(we);if(!Ie)return;const{onDragStart:vt}=U.current,St={activatorEvent:Le,active:{id:we,data:Ie.data,rect:B}};ao.unstable_batchedUpdates(()=>{vt==null||vt(St),R(Lr.Initializing),_({type:on.DragStart,initialCoordinates:Ee,active:we}),v({type:"onDragStart",event:St}),W(zt.current),X(Le)})},onMove(Ee){_({type:on.DragMove,coordinates:Ee})},onEnd:ft(on.DragEnd),onCancel:ft(on.DragCancel)});zt.current=at;function ft(Ee){return async function(){const{active:Ie,collisions:vt,over:St,scrollAdjustedTranslate:wn}=me.current;let xn=null;if(Ie&&wn){const{cancelDrop:ni}=U.current;xn={activatorEvent:Le,active:Ie,collisions:vt,delta:wn,over:St},Ee===on.DragEnd&&typeof ni=="function"&&await Promise.resolve(ni(xn))&&(Ee=on.DragCancel)}$.current=null,ao.unstable_batchedUpdates(()=>{_({type:Ee}),R(Lr.Uninitialized),He(null),W(null),X(null),zt.current=null;const ni=Ee===on.DragEnd?"onDragEnd":"onDragCancel";if(xn){const Ln=U.current[ni];Ln==null||Ln(xn),v({type:ni,event:xn})}})}}},[k]),hn=N.useCallback((Mt,yt)=>(Q,de)=>{const ye=Q.nativeEvent,Le=k.get(de);if($.current!==null||!Le||ye.dndKit||ye.defaultPrevented)return;const at={active:Le};Mt(Q,yt.options,at)===!0&&(ye.dndKit={capturedBy:yt.sensor},$.current=de,ut(Q,yt))},[k,ut]),Zt=qw(f,hn);Qw(f),Mi(()=>{ne&&D===Lr.Initializing&&R(Lr.Initialized)},[ne,D]),N.useEffect(()=>{const{onDragMove:Mt}=U.current,{active:yt,activatorEvent:Q,collisions:de,over:ye}=me.current;if(!yt||!Q)return;const Le={active:yt,activatorEvent:Q,collisions:de,delta:{x:_e.x,y:_e.y},over:ye};ao.unstable_batchedUpdates(()=>{Mt==null||Mt(Le),v({type:"onDragMove",event:Le})})},[_e.x,_e.y]),N.useEffect(()=>{const{active:Mt,activatorEvent:yt,collisions:Q,droppableContainers:de,scrollAdjustedTranslate:ye}=me.current;if(!Mt||$.current==null||!yt||!ye)return;const{onDragOver:Le}=U.current,at=de.get(ze),ft=at&&at.rect.current?{id:at.id,rect:at.rect.current,data:at.data,disabled:at.disabled}:null,Ee={active:Mt,activatorEvent:yt,collisions:Q,delta:{x:ye.x,y:ye.y},over:ft};ao.unstable_batchedUpdates(()=>{He(ft),Le==null||Le(Ee),v({type:"onDragOver",event:Ee})})},[ze]),Mi(()=>{me.current={activatorEvent:K,active:F,activeNode:se,collisionRect:Ae,collisions:Fe,droppableRects:H,draggableNodes:k,draggingNode:Ve,draggingNodeRect:Me,droppableContainers:T,over:qe,scrollableAncestors:$e,scrollAdjustedTranslate:_e},B.current={initial:Me,translated:Ae}},[F,se,Fe,Ae,k,Ve,Me,H,T,qe,$e,_e]),Uw({...G,delta:L,draggingRect:Ae,pointerCoordinates:De,scrollableAncestors:$e,scrollableAncestorRects:Ke});const nr=N.useMemo(()=>({active:F,activeNode:se,activeNodeRect:ne,activatorEvent:K,collisions:Fe,containerNodeRect:ve,dragOverlay:xe,draggableNodes:k,droppableContainers:T,droppableRects:H,over:qe,measureDroppableContainers:ee,scrollableAncestors:$e,scrollableAncestorRects:Ke,measuringConfiguration:j,measuringScheduled:he,windowRect:Gt}),[F,se,ne,K,Fe,ve,xe,k,T,H,qe,ee,$e,Ke,j,he,Gt]),qn=N.useMemo(()=>({activatorEvent:K,activators:Zt,active:F,activeNodeRect:ne,ariaDescribedById:{draggable:O},dispatch:_,draggableNodes:k,over:qe,measureDroppableContainers:ee}),[K,Zt,F,ne,_,O,k,qe,ee]);return un.createElement(z0.Provider,{value:S},un.createElement(Mc.Provider,{value:qn},un.createElement(J0.Provider,{value:nr},un.createElement(eb.Provider,{value:Ct},c)),un.createElement(cx,{disabled:(a==null?void 0:a.restoreFocus)===!1})),un.createElement(hw,{...a,hiddenTextDescribedById:O}));function mi(){const Mt=(q==null?void 0:q.autoScrollEnabled)===!1,yt=typeof l=="object"?l.enabled===!1:l===!1,Q=x&&!Mt&&!yt;return typeof l=="object"?{...l,enabled:Q}:{enabled:Q}}}),fx=N.createContext(null),U_="button",gx="Draggable";function px(e){let{id:i,data:r,disabled:o=!1,attributes:h}=e;const m=ko(gx),{activators:p,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:f,draggableNodes:u,over:y}=N.useContext(Mc),{role:C=U_,roleDescription:w="draggable",tabIndex:b=0}=h??{},g=(l==null?void 0:l.id)===i,_=N.useContext(g?eb:fx),[v,S]=pc(),[D,R]=pc(),x=Jw(p,i),M=_o(r);Mi(()=>(u.set(i,{id:i,key:m,node:v,activatorNode:D,data:M}),()=>{const L=u.get(i);L&&L.key===m&&u.delete(i)}),[u,i]);const k=N.useMemo(()=>({role:C,tabIndex:b,"aria-disabled":o,"aria-pressed":g&&C===U_?!0:void 0,"aria-roledescription":w,"aria-describedby":f.draggable}),[o,C,b,g,w,f.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:k,isDragging:g,listeners:o?void 0:x,node:v,over:y,setNodeRef:S,setActivatorNodeRef:R,transform:_}}function mx(){return N.useContext(J0)}const _x="Droppable",vx={timeout:25};function bx(e){let{data:i,disabled:r=!1,id:o,resizeObserverConfig:h}=e;const m=ko(_x),{active:p,dispatch:a,over:l,measureDroppableContainers:c}=N.useContext(Mc),f=N.useRef({disabled:r}),u=N.useRef(!1),y=N.useRef(null),C=N.useRef(null),{disabled:w,updateMeasurementsFor:b,timeout:g}={...vx,...h},_=_o(b??o),v=N.useCallback(()=>{if(!u.current){u.current=!0;return}C.current!=null&&clearTimeout(C.current),C.current=setTimeout(()=>{c(Array.isArray(_.current)?_.current:[_.current]),C.current=null},g)},[g]),S=Tc({callback:v,disabled:w||!p}),D=N.useCallback((k,L)=>{S&&(L&&(S.unobserve(L),u.current=!1),k&&S.observe(k))},[S]),[R,x]=pc(D),M=_o(i);return N.useEffect(()=>{!S||!R.current||(S.disconnect(),u.current=!1,S.observe(R.current))},[R,S]),N.useEffect(()=>(a({type:on.RegisterDroppable,element:{id:o,key:m,disabled:r,node:R,rect:y,data:M}}),()=>a({type:on.UnregisterDroppable,key:m,id:o})),[o]),N.useEffect(()=>{r!==f.current.disabled&&(a({type:on.SetDroppableDisabled,id:o,key:m,disabled:r}),f.current.disabled=r)},[o,m,r,a]),{active:p,rect:y,isOver:(l==null?void 0:l.id)===o,node:R,over:l,setNodeRef:x}}function nb(e,i,r){const o=e.slice();return o.splice(r<0?o.length+r:r,0,o.splice(i,1)[0]),o}function yx(e,i){return e.reduce((r,o,h)=>{const m=i.get(o);return m&&(r[h]=m),r},Array(e.length))}function Yl(e){return e!==null&&e>=0}function Sx(e,i){if(e===i)return!0;if(e.length!==i.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==i[r])return!1;return!0}function Cx(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ib=e=>{let{rects:i,activeIndex:r,overIndex:o,index:h}=e;const m=nb(i,o,r),p=i[h],a=m[h];return!a||!p?null:{x:a.left-p.left,y:a.top-p.top,scaleX:a.width/p.width,scaleY:a.height/p.height}},Xl={scaleX:1,scaleY:1},rb=e=>{var i;let{activeIndex:r,activeNodeRect:o,index:h,rects:m,overIndex:p}=e;const a=(i=m[r])!=null?i:o;if(!a)return null;if(h===r){const c=m[p];return c?{x:0,y:r<p?c.top+c.height-(a.top+a.height):c.top-a.top,...Xl}:null}const l=Ex(m,h,r);return h>r&&h<=p?{x:0,y:-a.height-l,...Xl}:h<r&&h>=p?{x:0,y:a.height+l,...Xl}:{x:0,y:0,...Xl}};function Ex(e,i,r){const o=e[i],h=e[i-1],m=e[i+1];return o?r<i?h?o.top-(h.top+h.height):m?m.top-(o.top+o.height):0:m?m.top-(o.top+o.height):h?o.top-(h.top+h.height):0:0}const sb="Sortable",ab=un.createContext({activeIndex:-1,containerId:sb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ib,disabled:{draggable:!1,droppable:!1}});function ob(e){let{children:i,id:r,items:o,strategy:h=ib,disabled:m=!1}=e;const{active:p,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:f}=mx(),u=ko(sb,r),y=a.rect!==null,C=N.useMemo(()=>o.map(x=>typeof x=="object"&&"id"in x?x.id:x),[o]),w=p!=null,b=p?C.indexOf(p.id):-1,g=c?C.indexOf(c.id):-1,_=N.useRef(C),v=!Sx(C,_.current),S=g!==-1&&b===-1||v,D=Cx(m);Mi(()=>{v&&w&&f(C)},[v,C,w,f]),N.useEffect(()=>{_.current=C},[C]);const R=N.useMemo(()=>({activeIndex:b,containerId:u,disabled:D,disableTransforms:S,items:C,overIndex:g,useDragOverlay:y,sortedRects:yx(C,l),strategy:h}),[b,u,D.draggable,D.droppable,S,C,g,l,y,h]);return un.createElement(ab.Provider,{value:R},i)}const wx=e=>{let{id:i,items:r,activeIndex:o,overIndex:h}=e;return nb(r,o,h).indexOf(i)},xx=e=>{let{containerId:i,isSorting:r,wasDragging:o,index:h,items:m,newIndex:p,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!o||a!==m&&h===p?!1:r?!0:p!==h&&i===l},Dx={duration:200,easing:"ease"},lb="transform",Ax=bo.Transition.toString({property:lb,duration:0,easing:"linear"}),kx={roleDescription:"sortable"};function Rx(e){let{disabled:i,index:r,node:o,rect:h}=e;const[m,p]=N.useState(null),a=N.useRef(r);return Mi(()=>{if(!i&&r!==a.current&&o.current){const l=h.current;if(l){const c=ta(o.current,{ignoreTransform:!0}),f={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(f.x||f.y)&&p(f)}}r!==a.current&&(a.current=r)},[i,r,o,h]),N.useEffect(()=>{m&&p(null)},[m]),m}function Tx(e){let{animateLayoutChanges:i=xx,attributes:r,disabled:o,data:h,getNewIndex:m=wx,id:p,strategy:a,resizeObserverConfig:l,transition:c=Dx}=e;const{items:f,containerId:u,activeIndex:y,disabled:C,disableTransforms:w,sortedRects:b,overIndex:g,useDragOverlay:_,strategy:v}=N.useContext(ab),S=Mx(o,C),D=f.indexOf(p),R=N.useMemo(()=>({sortable:{containerId:u,index:D,items:f},...h}),[u,h,D,f]),x=N.useMemo(()=>f.slice(f.indexOf(p)),[f,p]),{rect:M,node:k,isOver:L,setNodeRef:T}=bx({id:p,data:R,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...l}}),{active:P,activatorEvent:B,activeNodeRect:F,attributes:$,setNodeRef:q,listeners:W,isDragging:K,over:X,setActivatorNodeRef:U,transform:O}=px({id:p,data:R,attributes:{...kx,...r},disabled:S.draggable}),z=QE(T,q),j=!!P,H=j&&!w&&Yl(y)&&Yl(g),ee=!_&&K,he=ee&&H?O:null,Z=H?he??(a??v)({rects:b,activeNodeRect:F,activeIndex:y,overIndex:g,index:D}):null,G=Yl(y)&&Yl(g)?m({id:p,items:f,activeIndex:y,overIndex:g}):D,re=P==null?void 0:P.id,ne=N.useRef({activeId:re,items:f,newIndex:G,containerId:u}),ve=f!==ne.current.items,me=i({active:P,containerId:u,isDragging:K,isSorting:j,id:p,index:D,items:f,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:c,wasDragging:ne.current.activeId!=null}),Te=Rx({disabled:!me,index:D,node:k,rect:M});return N.useEffect(()=>{j&&ne.current.newIndex!==G&&(ne.current.newIndex=G),u!==ne.current.containerId&&(ne.current.containerId=u),f!==ne.current.items&&(ne.current.items=f)},[j,G,u,f]),N.useEffect(()=>{if(re===ne.current.activeId)return;if(re&&!ne.current.activeId){ne.current.activeId=re;return}const Ve=setTimeout(()=>{ne.current.activeId=re},50);return()=>clearTimeout(Ve)},[re]),{active:P,activeIndex:y,attributes:$,data:R,rect:M,index:D,newIndex:G,items:f,isOver:L,isSorting:j,isDragging:K,listeners:W,node:k,overIndex:g,over:X,setNodeRef:z,setActivatorNodeRef:U,setDroppableNodeRef:T,setDraggableNodeRef:q,transform:Te??Z,transition:xe()};function xe(){if(Te||ve&&ne.current.newIndex===D)return Ax;if(!(ee&&!of(B)||!c)&&(j||me))return bo.Transition.toString({...c,property:lb})}}function Mx(e,i){var r,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:i.draggable,droppable:(o=e==null?void 0:e.droppable)!=null?o:i.droppable}}function vc(e){if(!e)return!1;const i=e.data.current;return!!(i&&"sortable"in i&&typeof i.sortable=="object"&&"containerId"in i.sortable&&"items"in i.sortable&&"index"in i.sortable)}const Lx=[dt.Down,dt.Right,dt.Up,dt.Left],Ox=(e,i)=>{let{context:{active:r,collisionRect:o,droppableRects:h,droppableContainers:m,over:p,scrollableAncestors:a}}=i;if(Lx.includes(e.code)){if(e.preventDefault(),!r||!o)return;const l=[];m.getEnabled().forEach(u=>{if(!u||u!=null&&u.disabled)return;const y=h.get(u.id);if(y)switch(e.code){case dt.Down:o.top<y.top&&l.push(u);break;case dt.Up:o.top>y.top&&l.push(u);break;case dt.Left:o.left>y.left&&l.push(u);break;case dt.Right:o.left<y.left&&l.push(u);break}});const c=gw({collisionRect:o,droppableRects:h,droppableContainers:l});let f=H0(c,"id");if(f===(p==null?void 0:p.id)&&c.length>1&&(f=c[1].id),f!=null){const u=m.get(r.id),y=m.get(f),C=y?h.get(y.id):null,w=y==null?void 0:y.node.current;if(w&&C&&u&&y){const g=Rc(w).some((x,M)=>a[M]!==x),_=cb(u,y),v=Bx(u,y),S=g||!_?{x:0,y:0}:{x:v?o.width-C.width:0,y:v?o.height-C.height:0},D={x:C.left,y:C.top};return S.x&&S.y?D:vo(D,S)}}}};function cb(e,i){return!vc(e)||!vc(i)?!1:e.data.current.sortable.containerId===i.data.current.sortable.containerId}function Bx(e,i){return!vc(e)||!vc(i)||!cb(e,i)?!1:e.data.current.sortable.index<i.data.current.sortable.index}function ub(){var e;return((e=crypto.randomUUID)==null?void 0:e.call(crypto))??`id-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function hb({id:e,enabled:i,onToggle:r,onDelete:o,children:h,extraAction:m,onMoveToFirst:p,onMoveToLast:a}){const{attributes:l,listeners:c,setNodeRef:f,transform:u,transition:y,isDragging:C}=Tx({id:e}),w={transform:bo.Transform.toString(u),opacity:C?.5:1};return Y.jsx("div",{ref:f,style:{...w,borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden"},children:Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"12px 12px",minHeight:"var(--min-touch-target, 44px)",overflow:"hidden"},children:[Y.jsx("div",{...l,...c,"aria-label":"Drag to reorder",style:{width:24,color:"var(--text-muted)",cursor:"grab",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,userSelect:"none",touchAction:"none"},children:"⋮⋮"}),Y.jsx("button",{role:"switch","aria-checked":i,"aria-label":i?"Enabled, click to disable":"Disabled, click to enable",onClick:r,style:{width:32,height:20,borderRadius:10,border:"none",background:i?"var(--status-running)":"var(--bg-primary)",cursor:"pointer",position:"relative",flexShrink:0},children:Y.jsx("span",{style:{position:"absolute",top:2,left:i?14:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 0.15s ease"}})}),h,m,(p||a)&&Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0},children:[p&&Y.jsx("button",{"aria-label":"Move to first",title:"Move to first",onClick:p,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"},children:"⤒"}),a&&Y.jsx("button",{"aria-label":"Move to last",title:"Move to last",onClick:a,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"},children:"⤓"})]}),Y.jsx("button",{"aria-label":"Delete",title:"Delete",onClick:o,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:18,flexShrink:0},children:"×"})]})})}function db(){return dw(k_(hf,{activationConstraint:{distance:8}}),k_(cf,{coordinateGetter:Ox}))}function fb(){const[e,i]=N.useState(!1);return N.useEffect(()=>{const r=()=>{const o=navigator.userAgent,h=/iPhone|iPad|iPod|Android/i.test(o),m=window.innerWidth<768;i(h||m)};return r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e}function Nx(e){if(["Control","Alt","Shift","Meta"].includes(e.key))return null;let i="",r="";if(e.ctrlKey||e.altKey||e.metaKey){const o=e.key.toUpperCase(),h=e.ctrlKey?"Ctrl":e.altKey?"Alt":"Meta";if(e.key.length===1)if(i=`${h}+${o}`,e.ctrlKey)r=String.fromCharCode(e.key.toUpperCase().charCodeAt(0)-64);else return null;else return null}else if(e.key.startsWith("Arrow")){const h={ArrowUp:{label:"↑",code:"A"},ArrowDown:{label:"↓",code:"B"},ArrowRight:{label:"→",code:"C"},ArrowLeft:{label:"←",code:"D"}}[e.key];if(h)i=h.label,r=`\x1B[${h.code}`;else return null}else if(e.key==="Escape")i="Esc",r="\x1B";else if(e.key==="Enter")i="Enter",r="\r";else if(e.key==="Tab")i=e.shiftKey?"Shift+Tab":"Tab",r=e.shiftKey?"\x1B[Z":" ";else if(e.key==="Backspace")i="Backspace",r="";else if(e.key==="Delete")i="Delete",r="\x1B[3~";else if(e.key==="Home")i="Home",r="\x1B[H";else if(e.key==="End")i="End",r="\x1B[F";else if(e.key==="PageUp")i="PageUp",r="\x1B[5~";else if(e.key==="PageDown")i="PageDown",r="\x1B[6~";else if(e.key.match(/^F([1-9]|1[0-2])$/)){const o={F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"};i=e.key,r=o[e.key]??""}else if(e.key.length===1)i=e.key.toUpperCase(),r=e.key;else return null;return{label:i,data:r}}function Ix({shortcuts:e,onChange:i}){const[r,o]=N.useState(null),[h,m]=N.useState(!1),p=db(),a=fb(),l=(b,g)=>{b.preventDefault(),b.stopPropagation();const _=Nx(b);if(_){const v=e.map(S=>S._id===g?{...S,label:_.label,data:_.data}:S);i(v),o(null)}},c=b=>{const g=[...e];g[b]={...g[b],enabled:!g[b].enabled},i(g)},f=()=>{if(a){m(!0),setTimeout(()=>m(!1),3e3);return}const b=ub(),g=[...e,{label:"New",data:"",enabled:!0,_id:b}];i(g),o(b)},u=b=>{const g=e.filter((_,v)=>v!==b);i(g)},y=b=>{const{active:g,over:_}=b;if(_&&g.id!==_.id){const v=e.findIndex(x=>x._id===g.id),S=e.findIndex(x=>x._id===_.id),D=[...e],[R]=D.splice(v,1);D.splice(S,0,R),i(D)}},C=b=>{const g=e.findIndex(S=>S._id===b);if(g<=0)return;const _=[...e],[v]=_.splice(g,1);_.unshift(v),i(_)},w=b=>{const g=e.findIndex(S=>S._id===b);if(g===-1||g===e.length-1)return;const _=[...e],[v]=_.splice(g,1);_.push(v),i(_)};return Y.jsxs("div",{"data-testid":"settings--shortcuts--container",style:{display:"flex",flexDirection:"column",gap:12},children:[Y.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[Y.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"Shortcuts"}),Y.jsx("button",{onClick:f,disabled:a,"data-testid":"settings--shortcuts--button--add",style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:a?"not-allowed":"pointer",opacity:a?.5:1},children:"+ Add"})]}),a&&Y.jsxs("div",{"data-testid":"settings--shortcuts--mobile-warning",style:{padding:"10px 12px",backgroundColor:"var(--bg-warning, #fff8e6)",border:"1px solid var(--border-warning, #ffd666)",borderRadius:6,fontSize:13,color:"var(--text-warning, #ad6800)",display:"flex",alignItems:"center",gap:8},children:[Y.jsx("span",{style:{fontSize:16},children:"⚠️"}),Y.jsx("span",{children:"移动端无法新增快捷键,请在PC端浏览器中添加"})]}),e.length===0&&Y.jsx("div",{"data-testid":"settings--shortcuts--empty",style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"No shortcuts yet. Click the button above to add one."}),Y.jsx(tb,{sensors:p,collisionDetection:j0,onDragEnd:y,children:Y.jsx(ob,{items:e.map(b=>b._id),strategy:rb,children:e.map(b=>Y.jsx(hb,{id:b._id,enabled:b.enabled,onToggle:()=>{const g=e.findIndex(_=>_._id===b._id);g!==-1&&c(g)},onDelete:()=>{const g=e.findIndex(_=>_._id===b._id);g!==-1&&u(g)},onMoveToFirst:()=>C(b._id),onMoveToLast:()=>w(b._id),children:Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[Y.jsx("input",{type:"text",value:b.label,readOnly:!0,autoComplete:"off",placeholder:"Press key to capture",onClick:()=>o(b._id),onKeyDown:g=>l(g,b._id),onBlur:()=>o(null),"aria-label":`Shortcut ${b.label}`,style:{flex:1,minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:r===b._id?"2px solid var(--status-running)":"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",textAlign:"center"}}),Y.jsx("span",{title:b.data?b.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(not set)",style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",fontSize:11,color:"var(--text-muted)",fontFamily:"monospace",flexShrink:0,width:35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b.data?b.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(not set)"})]})},b._id))})}),r!==null&&!a&&Y.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",textAlign:"center",marginTop:4},children:"Press a key to capture…"}),h&&Y.jsx("div",{style:{position:"fixed",bottom:80,left:"50%",transform:"translateX(-50%)",padding:"12px 20px",backgroundColor:"var(--bg-secondary, #333)",color:"var(--text-inverse, #fff)",borderRadius:8,fontSize:14,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",zIndex:1e3,whiteSpace:"nowrap",animation:"fadeInOut 3s ease"},children:"请在PC端浏览器中新增快捷键"})]})}const Fx={width:"100%",padding:"10px 12px",borderRadius:6,fontSize:14,resize:"none",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap",lineHeight:"20px",boxSizing:"border-box"};function Ys(e){return{...Fx,...e}}function zx({autoSend:e,onToggle:i}){const r=e??!0;return Y.jsx("button",{onClick:i,"aria-label":"Auto-send toggle",title:"Auto-send toggle",style:{width:32,height:32,padding:0,borderRadius:6,border:"none",background:r?"var(--status-running)":"var(--bg-primary)",color:r?"#fff":"var(--text-secondary)",cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:r?"↗":"✎"})}function Px({commands:e,onChange:i}){const[r,o]=N.useState(null),[h,m]=N.useState(""),p=db(),a=_=>{const v=e.find(S=>S._id===_);v&&(o(_),m(v.command))},l=_=>{if(!_){o(null),m("");return}let v=h.trim();if(!v){C(_);return}v.startsWith("/")||(v="/"+v);const S=e.map(D=>D._id===_?{...D,label:v,command:v}:D);i(S),o(null),m("")},c=_=>{const v=e.map(S=>S._id===_?{...S,enabled:!S.enabled}:S);i(v)},f=rt(_=>_.showToast),u=_=>{const v=e.find(R=>R._id===_);if(!v)return;const S=!(v.autoSend??!0),D=e.map(R=>R._id===_?{...R,autoSend:S}:R);i(D),f(S?"Commands will auto-send on tap":"Commands will be inserted for editing")},y=()=>{const _=ub(),v=[...e,{label:"/new",command:"/new",enabled:!0,autoSend:!0,_id:_}];i(v),o(_),m("/new")},C=_=>{const v=e.filter(S=>S._id!==_);i(v)},w=_=>{const{active:v,over:S}=_;if(S&&v.id!==S.id){const D=e.findIndex(k=>k._id===v.id),R=e.findIndex(k=>k._id===S.id),x=[...e],[M]=x.splice(D,1);x.splice(R,0,M),i(x)}},b=_=>{const v=e.findIndex(R=>R._id===_);if(v<=0)return;const S=[...e],[D]=S.splice(v,1);S.unshift(D),i(S)},g=_=>{const v=e.findIndex(R=>R._id===_);if(v===-1||v===e.length-1)return;const S=[...e],[D]=S.splice(v,1);S.push(D),i(S)};return Y.jsxs("div",{"data-testid":"settings--commands--container",style:{display:"flex",flexDirection:"column",gap:12},children:[Y.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[Y.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"Commands"}),Y.jsx("button",{onClick:y,"data-testid":"settings--commands--button--add",style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:"pointer"},children:"+ Add"})]}),e.length===0&&Y.jsx("div",{"data-testid":"settings--commands--empty",style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"No commands yet. Click the button above to add one."}),Y.jsx(tb,{sensors:p,collisionDetection:j0,onDragEnd:w,children:Y.jsx(ob,{items:e.map(_=>_._id),strategy:rb,children:e.map(_=>Y.jsx(hb,{id:_._id,enabled:_.enabled,onToggle:()=>c(_._id),onDelete:()=>C(_._id),onMoveToFirst:()=>b(_._id),onMoveToLast:()=>g(_._id),extraAction:Y.jsx(zx,{autoSend:_.autoSend??!0,onToggle:()=>u(_._id)}),children:r===_._id?Y.jsx("textarea",{value:h,onChange:v=>m(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),l(_._id)),v.key==="Escape"&&(m(""),l(null))},onBlur:()=>l(_._id),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Enter command…","aria-label":`Edit ${_.label}`,style:Ys({flex:"1 1 180px",minWidth:0,height:36,padding:"0 12px",border:"2px solid var(--status-running)",background:"var(--bg-primary)",color:"var(--text-primary)",lineHeight:"36px"})}):Y.jsx("button",{type:"button",onClick:()=>a(_._id),"aria-label":`Edit command ${_.label}`,style:{flex:"1 1 180px",minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,display:"flex",alignItems:"center",cursor:"pointer",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_.label})},_._id))})}),Y.jsx("div",{"data-testid":"settings--commands--tip",style:{fontSize:12,color:"var(--text-muted)",marginTop:8},children:"Tip: Commands are auto-prefixed with / (e.g., help → /help)"})]})}function gb({checked:e,onChange:i,disabled:r=!1,"aria-label":o,"data-testid":h}){return Y.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":o,disabled:r,"data-testid":h,onClick:()=>!r&&i(!e),style:{position:"relative",width:"44px",height:"24px",borderRadius:"12px",border:"none",padding:0,cursor:r?"not-allowed":"pointer",background:e?"var(--status-running)":"var(--bg-tertiary)",opacity:r?.5:1,transition:"background 150ms ease-out",touchAction:"manipulation",WebkitTapHighlightColor:"transparent"},children:Y.jsx("span",{style:{position:"absolute",top:"2px",left:e?"22px":"2px",width:"20px",height:"20px",borderRadius:"50%",background:"#ffffff",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3)",transition:"left 150ms ease-out"}})})}function Zl({channelType:e,status:i,isExpanded:r,onToggle:o,onEnabledChange:h,children:m}){const p=VE[e],a=(p==null?void 0:p.implemented)??!1,l=(i==null?void 0:i.configured)??!1,c=(i==null?void 0:i.enabled)??!0,f={dingtalk:"📱",email:"📧",slack:"💬",wechat_work:"💼"},u=y=>{y.stopPropagation()};return Y.jsxs("div",{"data-testid":`settings--channel--card--${e}`,style:{border:"1px solid var(--border-color)",borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden",opacity:a?1:.6},children:[Y.jsxs("button",{"data-testid":`settings--channel--header--${e}`,onClick:a?o:void 0,style:{width:"100%",padding:"16px",border:"none",background:r?"var(--bg-secondary)":"transparent",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:a?"pointer":"default",textAlign:"left"},children:[Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[Y.jsx("span",{style:{fontSize:24},children:f[e]??"🔔"}),Y.jsxs("div",{children:[Y.jsxs("div",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",display:"flex",alignItems:"center",gap:8},children:[(p==null?void 0:p.displayName)??e,l&&Y.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:c?"var(--status-running)":"var(--text-muted)"},title:c?"Enabled":"Disabled"})]}),Y.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:2},children:(p==null?void 0:p.description)??""})]})]}),Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[l&&h&&Y.jsx("div",{onClick:u,children:Y.jsx(gb,{checked:c,onChange:h,"aria-label":`Toggle ${(p==null?void 0:p.displayName)??e}`})}),!a&&Y.jsx("span",{"data-testid":`settings--channel--coming--${e}`,style:{fontSize:12,color:"var(--text-secondary)",background:"var(--bg-secondary)",padding:"4px 10px",borderRadius:12},children:"Coming"}),a&&Y.jsx("svg",{style:{width:16,height:16,transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:Y.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),a&&r&&Y.jsx("div",{style:{padding:"16px",borderTop:"1px solid var(--border-color)",background:"var(--bg-primary)"},children:m})]})}function Ux({webhookUrl:e,onChange:i,configured:r}){const[o,h]=N.useState(!1),m=e===""||T0.test(e),p=o&&!m&&e!=="";return Y.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[Y.jsxs("div",{children:[Y.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"Webhook URL"}),Y.jsx("textarea",{"data-testid":"settings--dingtalk--input--webhook",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",value:e,onChange:a=>{i(a.target.value)},onBlur:()=>h(!0),style:Ys({border:`1px solid ${p?"var(--status-error)":"var(--border-color)"}`,background:"var(--bg-secondary)",color:"var(--text-primary)"})}),p&&Y.jsx("div",{"data-testid":"settings--dingtalk--error",style:{marginTop:6,fontSize:12,color:"var(--status-error)"},children:"Please enter a valid DingTalk Webhook URL starting with https://oapi.dingtalk.com/robot/send?access_token="})]}),r&&!e&&Y.jsx("div",{"data-testid":"settings--dingtalk--configured",style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ Configured. Enter a new URL to update."}),Y.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:Y.jsx("a",{href:"https://open.dingtalk.com/document/robots/custom-robot-access",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"How to get DingTalk group bot Webhook?"})})]})}function Hx({sendKey:e,onChange:i,configured:r}){const[o,h]=N.useState(!1),m=e===""||M0.test(e),p=o&&!m&&e!=="";return Y.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[Y.jsxs("div",{children:[Y.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"SendKey"}),Y.jsx("textarea",{"data-testid":"settings--wechat--input--sendkey",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"SCTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",value:e,onChange:a=>{i(a.target.value)},onBlur:()=>h(!0),style:Ys({border:`1px solid ${p?"var(--status-error)":"var(--border-color)"}`,background:"var(--bg-secondary)",color:"var(--text-primary)"})}),p&&Y.jsx("div",{"data-testid":"settings--wechat--error",style:{marginTop:6,fontSize:12,color:"var(--status-error)"},children:"Please enter a valid SendKey (starts with SCT, at least 13 characters)"})]}),r&&!e&&Y.jsx("div",{"data-testid":"settings--wechat--configured",style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ Configured. Enter a new SendKey to update."}),Y.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:Y.jsx("a",{href:"https://sct.ftqq.com/sendkey",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"How to get SendKey?"})})]})}function jx({notificationStatus:e,dingtalkWebhookUrl:i,onDingtalkWebhookChange:r,wechatWorkSendKey:o,onWechatWorkSendKeyChange:h,onChannelEnabledChange:m}){var c,f,u,y;const[p,a]=N.useState("dingtalk"),l=C=>{a(w=>w===C?null:C)};return Y.jsxs("div",{"data-testid":"settings--notifications--container",style:{display:"flex",flexDirection:"column",gap:12},children:[Y.jsx("div",{"data-testid":"settings--notifications--description",style:{padding:12,background:"var(--bg-tertiary)",borderRadius:8,fontSize:13,color:"var(--text-secondary)"},children:"Configure notification channels to receive alerts when Claude needs your attention."}),Y.jsx(Zl,{channelType:"dingtalk",status:e==null?void 0:e.dingtalk,isExpanded:p==="dingtalk",onToggle:()=>l("dingtalk"),onEnabledChange:(c=e==null?void 0:e.dingtalk)!=null&&c.configured?C=>m==null?void 0:m("dingtalk",C):void 0,children:Y.jsx(Ux,{webhookUrl:i,onChange:r,configured:(f=e==null?void 0:e.dingtalk)==null?void 0:f.configured})}),Y.jsx(Zl,{channelType:"wechat_work",status:e==null?void 0:e.wechat_work,isExpanded:p==="wechat_work",onToggle:()=>l("wechat_work"),onEnabledChange:(u=e==null?void 0:e.wechat_work)!=null&&u.configured?C=>m==null?void 0:m("wechat_work",C):void 0,children:Y.jsx(Hx,{sendKey:o,onChange:h,configured:(y=e==null?void 0:e.wechat_work)==null?void 0:y.configured})}),Y.jsx(Zl,{channelType:"email",status:e==null?void 0:e.email,isExpanded:p==="email",onToggle:()=>l("email")}),Y.jsx(Zl,{channelType:"slack",status:e==null?void 0:e.slack,isExpanded:p==="slack",onToggle:()=>l("slack")})]})}function $x({showFloatingDocButton:e,onFloatingDocButtonChange:i,isHiddenByLongPress:r,onResetHiddenState:o}){const h=m=>{i(m),m&&r&&o()};return Y.jsxs("div",{style:{padding:"8px 0"},children:[Y.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0",borderBottom:"1px solid var(--border-color)"},children:[Y.jsxs("div",{style:{flex:1},children:[Y.jsx("div",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:"Show Floating Doc Button"}),Y.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:4},children:["Show the floating document button in the terminal area",r&&Y.jsx("span",{style:{color:"var(--status-waiting)",marginLeft:4},children:"(hidden by long press)"})]})]}),Y.jsx(gb,{checked:e,onChange:h,"data-testid":"settings--toggle--floating-doc-button"})]}),r&&e&&Y.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0",borderBottom:"1px solid var(--border-color)"},children:[Y.jsxs("div",{style:{flex:1},children:[Y.jsx("div",{style:{fontSize:14,fontWeight:500,color:"var(--text-primary)"},children:"Restore Hidden Button"}),Y.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:4},children:"The button was hidden by long press. Click to restore."})]}),Y.jsx("button",{onClick:o,"data-testid":"settings--button--restore-doc-button",style:{padding:"6px 12px",borderRadius:6,border:"1px solid var(--status-running)",background:"transparent",color:"var(--status-running)",fontSize:13,cursor:"pointer"},children:"Restore"})]})]})}const qx=100,Wx=300;var s0;const oo=typeof window<"u"&&((s0=window.matchMedia)==null?void 0:s0.call(window,"(prefers-reduced-motion: reduce)").matches),Zh=oo?0:300;function pb({isOpen:e,onClose:i,title:r,children:o,footer:h,"data-testid":m}){const[p,a]=N.useState(!1),[l,c]=N.useState(!1),[f,u]=N.useState(0),[y,C]=N.useState(!1),w=N.useRef(0),b=N.useRef(0);N.useEffect(()=>{if(e)a(!0),u(0),oo?c(!0):requestAnimationFrame(()=>{requestAnimationFrame(()=>c(!0))});else if(p)if(c(!1),oo)a(!1);else{const x=setTimeout(()=>a(!1),Zh);return()=>clearTimeout(x)}},[e,p]);const g=N.useCallback(x=>{C(!0),w.current=x,b.current=Date.now(),u(0)},[]),_=N.useCallback(x=>{if(!y)return;const M=x-w.current;M>0&&u(M)},[y]),v=N.useCallback(()=>{if(!y)return;const x=f,M=Date.now()-b.current,k=M>0?x/(M/1e3):0;x>qx||x>50&&k>Wx||x<5?i():u(0),C(!1)},[y,f,i]);if(!p)return null;const S=oo||y?"none":`transform ${Zh}ms ease-out`,D=oo?"none":`background ${Zh}ms ease-out`,R=y?`translateY(${f}px)`:l?"translateY(0)":"translateY(100%)";return Y.jsx("div",{onClick:i,style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:l?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transition:D,display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1e3},children:Y.jsxs("div",{"data-testid":m,onClick:x=>x.stopPropagation(),style:{width:"100%",maxWidth:480,maxHeight:"calc(85vh - env(safe-area-inset-bottom, 0px))",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",transform:R,transition:S,paddingBottom:"var(--safe-bottom)"},children:[Y.jsx("div",{style:{height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0},onTouchStart:x=>g(x.touches[0].clientY),onTouchMove:x=>_(x.touches[0].clientY),onTouchEnd:v,onMouseDown:x=>g(x.clientY),onMouseMove:x=>y&&_(x.clientY),onMouseUp:v,onMouseLeave:v,children:Y.jsx("div",{style:{width:36,height:4,background:"var(--text-secondary)",opacity:.5,borderRadius:2}})}),Y.jsx("div",{style:{padding:"0 20px 16px 20px",display:"flex",alignItems:"center",flexShrink:0},children:Y.jsx("h2",{"data-testid":m?`${m}--title`:void 0,style:{fontSize:18,fontWeight:600,margin:0},children:r})}),Y.jsx("div",{style:{flex:1,overflow:"auto",overscrollBehavior:"contain",padding:"0 16px"},children:o}),h&&Y.jsx("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--border-color)",flexShrink:0},children:h})]})})}function Gx({isOpen:e,onClose:i,onConfigSaved:r}){const[o,h]=N.useState("shortcuts"),[m,p]=N.useState([]),[a,l]=N.useState([]),[c,f]=N.useState(""),[u,y]=N.useState(""),[C,w]=N.useState({}),[b,g]=N.useState(!1),[_,v]=N.useState(null),[S,D]=N.useState(!1),R=Sn(K=>K.activeInstanceId),x=rt(K=>K.showToast),M=rt(K=>K.showFloatingDocButton),k=rt(K=>K.setShowFloatingDocButton),L=rt(K=>K.isDocButtonHiddenByLongPress),T=rt(K=>K.setDocButtonHiddenByLongPress),P=N.useRef(0);function B(){return String(++P.current)}function F(K){return{...K,_id:B()}}N.useEffect(()=>{e&&$()},[e]);const $=async()=>{try{const{config:K}=await A0(R??void 0);if(K){p(K.shortcuts.map(U=>F(U))),l(K.commands.map(U=>F(U)));const X=K.notifications||{};w(X),f("")}else p(L0.map(X=>F({...X,enabled:!0}))),l(O0.map(X=>F({...X,enabled:!0}))),w({}),f("")}catch(K){v("Failed to load configuration"),console.error(K)}},q=async(K,X)=>{const U=C;w(z=>({...z,[K]:{...z[K],configured:!0,enabled:X}}));const O=K==="dingtalk"?"DingTalk":"WeChat Work";try{await $E(K,X),x(`${O} notifications ${X?"enabled":"disabled"}`)}catch(z){w(U),console.error("Failed to update channel enabled status:",z),v(`Failed to update ${O.toLowerCase()}`),x(`Failed to update ${O.toLowerCase()}`),setTimeout(()=>v(null),2e3)}},W=async()=>{var K,X;g(!0),v(null),D(!1);try{const U={shortcuts:m.map(({_id:ee,...he})=>he),commands:a.map(({_id:ee,...he})=>he)},O={},z=c.trim();if(z){if(!T0.test(z)){v("Please enter a valid DingTalk Webhook URL (starting with https://oapi.dingtalk.com/robot/send?access_token=)"),g(!1);return}O.dingtalk={webhookUrl:z}}const j=u.trim();if(j){if(!M0.test(j)){v("Please enter a valid SendKey (starts with SCT, at least 13 characters)"),g(!1);return}O.wechat_work={sendKey:j}}if(Object.keys(O).length>0&&(U.notifications=O),await jE(U,R??void 0)){D(!0);const ee={...C};z&&(ee.dingtalk={...C==null?void 0:C.dingtalk,configured:!0,enabled:(K=C==null?void 0:C.dingtalk)==null?void 0:K.enabled},f("")),j&&(ee.wechat_work={...C==null?void 0:C.wechat_work,configured:!0,enabled:(X=C==null?void 0:C.wechat_work)==null?void 0:X.enabled},y("")),w(ee),r==null||r(),setTimeout(()=>D(!1),2e3)}else v("Failed to save")}catch(U){v("Failed to save"),console.error(U)}finally{g(!1)}};return Y.jsxs(pb,{isOpen:e,onClose:i,title:"Settings","data-testid":"settings--modal",footer:Y.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[Y.jsxs("div",{style:{fontSize:13},children:[_&&Y.jsx("span",{"data-testid":"settings--message--error",style:{color:"var(--status-error)"},children:_}),S&&Y.jsx("span",{"data-testid":"settings--message--success",style:{color:"var(--status-running)"},children:"Saved"})]}),Y.jsxs("div",{style:{display:"flex",gap:8},children:[Y.jsx("button",{onClick:i,"data-testid":"settings--button--close",style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"Cancel"}),Y.jsx("button",{onClick:W,disabled:b,"data-testid":"settings--button--save",style:{padding:"8px 20px",borderRadius:6,border:"none",background:b?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:b?"default":"pointer",opacity:b?.7:1},children:b?"Saving…":"Save"})]})]}),children:[Y.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border-color)",margin:"0 -16px",marginBottom:16},children:["shortcuts","commands","notifications","display"].map(K=>Y.jsx("button",{onClick:()=>h(K),"data-testid":`settings--tab--${K}`,style:{flex:1,padding:"12px 16px",border:"none",background:"transparent",color:o===K?"var(--text-primary)":"var(--text-secondary)",borderBottom:o===K?"2px solid var(--status-running)":"2px solid transparent",cursor:"pointer",fontSize:14,fontWeight:o===K?600:400},children:K==="shortcuts"?"Shortcuts":K==="commands"?"Commands":K==="notifications"?"Notifications":"Display"},K))}),o==="shortcuts"?Y.jsx(Ix,{shortcuts:m,onChange:p}):o==="commands"?Y.jsx(Px,{commands:a,onChange:l}):o==="notifications"?Y.jsx(jx,{notificationStatus:C,dingtalkWebhookUrl:c,onDingtalkWebhookChange:f,wechatWorkSendKey:u,onWechatWorkSendKeyChange:y,onChannelEnabledChange:q}):Y.jsx($x,{showFloatingDocButton:M,onFloatingDocButtonChange:k,isHiddenByLongPress:L,onResetHiddenState:()=>T(!1)})]})}const Kx={idle:{color:"var(--status-idle)",label:"Idle"},running:{color:"var(--status-running)",label:"Running"},waiting_input:{color:"var(--status-waiting)",label:"Waiting Input"}},Vx={connecting:{color:"var(--status-waiting)",label:"Connecting..."},connected:{color:"var(--status-idle)",label:"Connected"},disconnected:{color:"var(--status-error)",label:"Disconnected"}};function Yx(){const[e,i]=N.useState(!1),r=rt(a=>a.sessionStatus),o=Sn(a=>a.activeInstanceId),h=rt(a=>o?a.instanceConnectionStatus[o]??"disconnected":a.connectionStatus),m=Kx[r],p=Vx[h];return Y.jsxs(Y.Fragment,{children:[Y.jsxs("div",{"data-testid":"status-bar",style:{height:"var(--statusbar-height)",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",paddingTop:"var(--safe-top)",flexShrink:0},children:[Y.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,overflow:"hidden",flex:"1 1 auto"},children:Y.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:"Claude Remote"})}),Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[Y.jsx("span",{"data-testid":`status--indicator--${r}`,style:{width:8,height:8,borderRadius:"50%",background:m.color,display:"inline-block"}}),Y.jsx("span",{"data-testid":"status--label--session",style:{fontSize:12,color:"var(--text-secondary)"},children:m.label})]}),Y.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[Y.jsx("span",{"data-testid":`status--indicator--${h}`,style:{width:8,height:8,borderRadius:"50%",background:p.color,display:"inline-block"}}),Y.jsx("span",{"data-testid":"status--label--connection",style:{fontSize:12,color:"var(--text-secondary)"},children:p.label})]}),Y.jsx("button",{onClick:()=>i(!0),"aria-label":"Settings","data-testid":"status--button--settings",style:{width:44,height:44,marginRight:-12,borderRadius:8,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22},children:"⚙"})]})]}),Y.jsx(Gx,{isOpen:e,onClose:()=>i(!1),onConfigSaved:N0})]})}function Xx({containerRef:e,onFocusInput:i}){const r=()=>{i==null||i()};return Y.jsx("div",{ref:e,onClick:r,"data-testid":"terminal--container",style:{flex:1,overflow:"hidden",background:"var(--bg-primary)"}})}const Zx=N.forwardRef(function({onSend:i,disabled:r,isKeyboardOpen:o},h){const[m,p]=N.useState(""),a=N.useRef(null);N.useImperativeHandle(h,()=>({setText:f=>{p(f)},focus:()=>{var f;return(f=a.current)==null?void 0:f.focus()}}),[]);const l=N.useCallback(()=>{const f=m.trim();i(f),p("")},[m,i]),c=N.useCallback(f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),l())},[l]);return Y.jsxs("div",{"data-testid":"console--input-bar",style:{height:"var(--inputbar-height)",background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",display:"flex",alignItems:"center",padding:"8px 12px",paddingBottom:o?"8px":"calc(8px + var(--safe-bottom))",transition:"padding-bottom 0.25s ease-out",gap:8,flexShrink:0},children:[Y.jsx("textarea",{ref:a,"data-testid":"console--input--command",value:m,onChange:f=>p(f.target.value),onKeyDown:c,disabled:r,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Enter command or number to select…","aria-label":"Command input",style:Ys({flex:1,height:40,borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:16,fontFamily:"inherit"})}),Y.jsx("button",{"data-testid":"console--input--send-btn",onClick:l,disabled:r||!m.trim(),"aria-label":"Send message",style:{width:44,height:44,borderRadius:8,border:"none",background:m.trim()?"var(--accent-primary, #0066cc)":"var(--bg-tertiary)",color:m.trim()?"#fff":"var(--text-tertiary)",display:"flex",alignItems:"center",justifyContent:"center",cursor:m.trim()&&!r?"pointer":"not-allowed",flexShrink:0,transition:"background 0.2s, color 0.2s",padding:0},children:Y.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Y.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),Y.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})}),mb={height:36,borderRadius:6,border:"none",background:"var(--bg-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},Qx={...mb,minWidth:44,flexShrink:0,color:"var(--text-primary)",fontSize:13,padding:"0 12px"},Jx={...mb,minWidth:60,flexShrink:0,color:"var(--text-secondary)",fontSize:12,whiteSpace:"nowrap",padding:"0 12px"};function Ql(){document.activeElement instanceof HTMLElement&&document.activeElement.blur()}function Qh(e,i,r){e.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),i(r);const o=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};requestAnimationFrame(o),setTimeout(o,0)}function e2({onShortcut:e,onCommandSelect:i,onCommandSend:r,visible:o=!0}){const{shortcuts:h,commands:m,isLoading:p}=ZE();return!o||p?null:Y.jsxs("div",{"data-testid":"console--command-picker",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",flexShrink:0},children:[Y.jsx("div",{"data-testid":"console--shortcut-bar","data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:h.map(a=>Y.jsx("button",{type:"button","data-testid":`console--button--shortcut-${a.label.toLowerCase().replace(/\s+/g,"-")}`,className:"cmd-picker-btn",onClick:l=>Qh(l,e,a.data),onTouchStart:Ql,onMouseDown:l=>{l.preventDefault(),Ql()},style:Qx,children:a.label},a.label))}),Y.jsx("div",{"data-testid":"console--command-buttons","data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:m.map(a=>{const l=a.autoSend??!0;return Y.jsx("button",{type:"button","data-testid":`console--button--command-${a.label.toLowerCase().replace(/\s+/g,"-")}`,className:"cmd-picker-btn",onClick:c=>{l?Qh(c,r,a.command):Qh(c,i,a.command+" ")},onTouchStart:Ql,onMouseDown:c=>{c.preventDefault(),Ql()},style:Jx,children:a.label},a.label)})}),Y.jsx("style",{children:`
65
- [data-scrollable]::-webkit-scrollbar {
66
- display: none;
67
- }
68
- @media (prefers-reduced-motion: no-preference) {
69
- .cmd-picker-btn:hover {
70
- filter: brightness(1.2);
71
- }
72
- .cmd-picker-btn:active {
73
- transform: scale(0.95);
74
- filter: brightness(0.9);
75
- }
76
- }
77
- @media (prefers-reduced-motion: reduce) {
78
- .cmd-picker-btn:hover {
79
- filter: brightness(1.2);
80
- }
81
- .cmd-picker-btn:active {
82
- filter: brightness(0.9);
83
- }
84
- }
85
- `})]})}function t2(){const e=Sn(h=>h.activeInstanceId),i=Sn(h=>h.instances),r=rt(h=>h.serverAvailable),o=rt(h=>e?h.instanceConnectionStatus[e]??"disconnected":h.connectionStatus);return r===!0&&i.length===0?Y.jsx("div",{"data-testid":"connection--banner","data-connection-status":"no-instances",style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:"var(--status-waiting)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:"No instances available"}):r===!1?Y.jsx("div",{"data-testid":"connection--banner","data-connection-status":"unavailable",style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:"var(--status-error)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:"Server unavailable"}):o==="connected"?null:Y.jsx("div",{"data-testid":"connection--banner","data-connection-status":o,style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:o==="connecting"?"var(--status-waiting)":"var(--status-error)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:o==="connecting"?"Connecting…":"Disconnected. Reconnecting…"})}function n2(){const e=rt(m=>m.ipChangeInfo),i=rt(m=>m.setIpChangeInfo),r=rt(m=>m.showToast);if(!e)return null;const o=()=>{navigator.clipboard.writeText(e.newUrl),i(null),r("URL copied to clipboard")},h=()=>{i(null)};return Y.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:"calc(var(--safe-top) + 8px)",left:"50%",transform:"translateX(-50%)",zIndex:100,maxWidth:"calc(100% - 32px)",background:"var(--status-waiting)",color:"#fff",borderRadius:"8px",padding:"12px 16px",fontSize:"14px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column",gap:"8px"},children:[Y.jsx("div",{style:{fontWeight:500},children:"IP Address Changed"}),Y.jsxs("div",{style:{fontSize:"13px",opacity:.9},children:[e.oldIp," → ",e.newIp]}),Y.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"4px"},children:[Y.jsx("button",{onClick:o,style:{flex:1,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Copy New URL"}),Y.jsx("button",{onClick:h,style:{background:"transparent",border:"1px solid rgba(255,255,255,0.3)",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Close"})]})]})}async function _b(){const e=await fetch("/api/instances",{credentials:"include"});if(e.status===401){const i=ts();if(console.log("[fetchInstances] got 401, cachedToken =",i?"exists":"null"),i)try{console.log("[fetchInstances] attempting re-authentication...");const r=await Ti(i);if(console.log("[fetchInstances] re-auth result:",r),r){const o=await fetch("/api/instances",{credentials:"include"});if(o.ok)return console.log("[fetchInstances] retry succeeded"),o.json()}}catch(r){console.log("[fetchInstances] re-auth error:",r)}throw new Error("Unauthorized")}if(!e.ok)throw new Error(`Failed to fetch instances: ${e.status}`);return e.json()}function i2(e){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/${e}`}async function vb(e,i){const r=await fetch(e,i);if(r.status===401){const o=ts();if(o)try{if(await Ti(o))return fetch(e,i)}catch{}}return r}async function r2(){const e=await vb("/api/instances/config",{credentials:"include"});if(e.status===401)throw new Error("Unauthorized");if(!e.ok)throw new Error(`Failed to get instance config: ${e.status}`);return e.json()}async function s2(e){const i=await vb("/api/instances/create",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)});if(i.status===401)throw new Error("Unauthorized");if(!i.ok){const r=await i.json().catch(()=>({error:"Unknown error"}));throw new Error(r.error||`Failed to create instance: ${i.status}`)}return i.json()}const a2=100,o2=300;var a0;const eo=typeof window<"u"&&((a0=window.matchMedia)==null?void 0:a0.call(window,"(prefers-reduced-motion: reduce)").matches),Jl=300,Od=N.forwardRef(function({options:i,value:r,onChange:o,placeholder:h="Select…",disabled:m=!1,id:p,emptyMessage:a="No options available",triggerIcon:l,getDisplayLabel:c,onClose:f,hideTrigger:u=!1},y){const[C,w]=N.useState(!1),[b,g]=N.useState(!1),[_,v]=N.useState(-1),[S,D]=N.useState(0),[R,x]=N.useState(!1),M=N.useRef(null),k=N.useRef(0),L=N.useRef(0),T=N.useMemo(()=>i.find(j=>j.value===r)??null,[i,r]),P=N.useMemo(()=>c?c(r):(T==null?void 0:T.label)||h,[c,r,T,h]),B=N.useCallback(()=>{m||(w(!0),v(-1))},[m]),F=N.useCallback(()=>{g(!1),D(0),eo?w(!1):setTimeout(()=>w(!1),Jl),setTimeout(()=>{f==null||f()},eo?0:Jl)},[f]);N.useImperativeHandle(y,()=>({open:B,close:F}),[B,F]);const $=N.useCallback(j=>{x(!0),k.current=j,L.current=Date.now(),D(0)},[]),q=N.useCallback(j=>{if(!R)return;const H=j-k.current;H>0&&D(H)},[R]),W=N.useCallback(()=>{if(!R)return;const j=S,H=Date.now()-L.current,ee=H>0?j/(H/1e3):0;j>a2||j>50&&ee>o2||j<5?F():D(0),x(!1)},[R,S,F]),K=N.useCallback(j=>{o(j.value),F()},[o,F]);N.useEffect(()=>{if(C){const j=setTimeout(()=>{g(!0)},eo?0:10);return()=>clearTimeout(j)}},[C]);const X=N.useCallback(j=>{const H=i.length;switch(j.key){case"ArrowDown":j.preventDefault(),v(ee=>ee<H-1?ee+1:0);break;case"ArrowUp":j.preventDefault(),v(ee=>ee>0?ee-1:H-1);break;case"Enter":j.preventDefault(),_>=0&&_<H&&K(i[_]);break;case"Escape":j.preventDefault(),F();break}},[i,_,K,F]),U=eo||R?"none":`transform ${Jl}ms ease-out`,O=eo?"none":`background ${Jl}ms ease-out`,z=R?`translateY(${S}px)`:b?"translateY(0)":"translateY(100%)";return Y.jsxs(Y.Fragment,{children:[!u&&Y.jsxs("button",{ref:M,type:"button",onClick:B,onTouchStart:()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()},disabled:m,id:p,style:{...Rn.trigger,...m?Rn.triggerDisabled:{}},"aria-haspopup":"listbox","aria-expanded":C,children:[l,Y.jsx("span",{style:Rn.triggerText,children:P}),Y.jsx("span",{style:Rn.triggerArrow,children:"▼"})]}),C&&Y.jsx("div",{onClick:F,style:{...Rn.overlay,background:b?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transition:O},children:Y.jsxs("div",{"data-testid":"common--action-sheet",onClick:j=>j.stopPropagation(),style:{...Rn.sheet,transform:z,transition:U},children:[Y.jsx("div",{"data-testid":"common--drag-handle",style:Rn.handle,onTouchStart:j=>$(j.touches[0].clientY),onTouchMove:j=>q(j.touches[0].clientY),onTouchEnd:W,onMouseDown:j=>$(j.clientY),onMouseMove:j=>R&&q(j.clientY),onMouseUp:W,onMouseLeave:W}),Y.jsx("div",{style:Rn.listContainer,role:"listbox",tabIndex:0,onKeyDown:X,children:i.length===0?Y.jsx("div",{style:Rn.emptyList,children:a}):i.map((j,H)=>Y.jsxs("div",{role:"option","aria-selected":_===H,onClick:()=>K(j),onMouseEnter:()=>v(H),style:{...Rn.option,..._===H?Rn.optionHighlighted:{},...r===j.value?Rn.optionSelected:{}},children:[j.icon,Y.jsxs("span",{style:Rn.optionLabel,children:[j.label,j.description&&Y.jsxs("span",{style:Rn.optionDescriptionInline,children:[" (",j.description,")"]})]}),r===j.value&&Y.jsx(l2,{})]},H))})]})})]})});function l2(){return Y.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:Rn.checkIcon,children:Y.jsx("path",{d:"M3 8L6.5 11.5L13 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Rn={trigger:{width:"100%",padding:"10px 12px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:8,textAlign:"left",boxSizing:"border-box",transition:"border-color 0.15s ease"},triggerDisabled:{opacity:.6,cursor:"not-allowed"},triggerText:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)"},triggerArrow:{fontSize:10,color:"var(--text-secondary)",marginLeft:"auto"},overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1100},sheet:{width:"100%",maxWidth:480,maxHeight:"calc(80vh - env(safe-area-inset-bottom, 0px))",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",paddingBottom:"var(--safe-bottom)"},handle:{width:36,height:4,background:"var(--text-secondary)",opacity:.5,borderRadius:2,margin:"12px auto",flexShrink:0},listContainer:{flex:"1 1 auto",overflow:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",padding:"8px 0"},emptyList:{padding:"32px 16px",textAlign:"center",color:"var(--text-secondary)",fontSize:14},option:{display:"flex",alignItems:"center",gap:10,padding:"10px 16px",cursor:"pointer",transition:"background-color 0.1s ease"},optionHighlighted:{background:"rgba(88, 166, 255, 0.15)"},optionSelected:{background:"rgba(88, 166, 255, 0.08)"},optionLabel:{flex:1,minWidth:0,color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},optionDescriptionInline:{color:"var(--text-secondary)",fontSize:12},checkIcon:{marginLeft:"auto",flexShrink:0,color:"var(--status-running)"}};var o0;const c2=typeof window<"u"&&((o0=window.matchMedia)==null?void 0:o0.call(window,"(prefers-reduced-motion: reduce)").matches);function H_({options:e,value:i,onChange:r,disabled:o=!1,"aria-label":h}){const m=N.useRef(null),p=N.useRef([]),[a,l]=N.useState({}),c=e.findIndex(C=>C.value===i);N.useEffect(()=>{const C=m.current,w=p.current[c],b=()=>{if(w&&C){const g=C.getBoundingClientRect(),_=w.getBoundingClientRect(),v=_.left-g.left+C.scrollLeft-3,S=_.width;l({transform:`translateX(${v}px)`,width:`${S}px`})}};return b(),C==null||C.addEventListener("scroll",b),()=>{C==null||C.removeEventListener("scroll",b)}},[c,e]);const f=C=>{o||r(C)},u=(C,w)=>{var g;if(o)return;let b=w;switch(C.key){case"ArrowLeft":C.preventDefault(),b=w>0?w-1:e.length-1;break;case"ArrowRight":C.preventDefault(),b=w<e.length-1?w+1:0;break;case"Home":C.preventDefault(),b=0;break;case"End":C.preventDefault(),b=e.length-1;break;default:return}r(e[b].value),(g=p.current[b])==null||g.focus()},y={role:"radiogroup","aria-label":h};return Y.jsxs("div",{ref:m,style:{...di.container,...o?di.containerDisabled:{}},...y,children:[Y.jsx("div",{style:{...di.indicator,...a,...c2?{}:di.indicatorAnimated,...c===-1?di.indicatorHidden:{}},"aria-hidden":"true"}),e.map((C,w)=>{const b=w===c;return Y.jsxs("button",{ref:g=>{p.current[w]=g},type:"button",role:"radio",title:C.title,"aria-checked":b,disabled:o,onClick:()=>f(C.value),onKeyDown:g=>u(g,w),style:{...di.option,...b?di.optionSelected:{}},children:[C.icon&&Y.jsx("span",{style:di.icon,children:C.icon}),Y.jsx("span",{style:di.labelWrapper,children:Y.jsx("span",{style:di.label,children:C.label})}),C.description&&Y.jsx("span",{style:di.descriptionWrapper,children:Y.jsx("span",{style:di.description,children:C.description})})]},String(C.value))})]})}const di={container:{display:"flex",width:"100%",maxWidth:"100%",overflowX:"auto",background:"var(--bg-tertiary)",borderRadius:10,padding:3,position:"relative",gap:2,scrollbarWidth:"none",msOverflowStyle:"none"},containerDisabled:{opacity:.6,cursor:"not-allowed"},indicator:{position:"absolute",top:3,bottom:3,background:"var(--status-running)",borderRadius:7,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15)",zIndex:0},indicatorAnimated:{transition:"transform 0.2s ease, width 0.2s ease"},indicatorHidden:{opacity:0},option:{flex:1,flexShrink:1,minWidth:0,minHeight:44,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",zIndex:1,color:"var(--text-secondary)",background:"transparent",border:"none",borderRadius:7,padding:"6px 8px",cursor:"pointer",transition:"color 0.15s ease",fontFamily:"var(--font-sans)",fontSize:14,lineHeight:1.2,overflow:"visible"},optionSelected:{color:"#fff",fontWeight:500},icon:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:2,flexShrink:0},labelWrapper:{textAlign:"center",maxWidth:"100%",overflow:"hidden"},label:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"},descriptionWrapper:{textAlign:"center",maxWidth:"100%",overflow:"hidden"},description:{fontSize:11,opacity:.8,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block"}};function j_(e){const i=e.split("/").filter(Boolean);return i[i.length-1]||e}function u2(e){const i=e.split("/").filter(Boolean);return i.length<=1?e:".../"+i[i.length-2]}function $_(){return Y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:[Y.jsx("path",{d:"M2 4C2 3.44772 2.44772 3 3 3H6.17157C6.43678 3 6.69114 3.10536 6.87868 3.29289L7.58579 4H13C13.5523 4 14 4.44772 14 5V12C14 12.5523 13.5523 13 13 13H3C2.44772 13 2 12.5523 2 12V4Z",fill:"currentColor",opacity:"0.6"}),Y.jsx("path",{d:"M2 5.5V12C2 12.5523 2.44772 13 3 13H13C13.5523 13 14 12.5523 14 12V5.5C14 5.22386 13.7761 5 13.5 5H2.5C2.22386 5 2 5.22386 2 5.5Z",fill:"currentColor"})]})}function q_(){return Y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:[Y.jsx("path",{d:"M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),Y.jsx("path",{d:"M12.9247 8.99999C12.9692 8.66999 13 8.33749 13 7.99999C13 7.66249 12.9692 7.32999 12.9247 6.99999L14.3622 5.91249C14.4872 5.81249 14.5197 5.63749 14.4372 5.48749L13.0622 3.01249C12.9797 2.86249 12.8122 2.81249 12.6622 2.86249L10.9247 3.51249C10.4247 3.13749 9.87468 2.82499 9.28718 2.58749L9.01218 0.787487C8.98718 0.624987 8.84968 0.499987 8.68718 0.499987H5.93718C5.77468 0.499987 5.63718 0.624987 5.61218 0.787487L5.33718 2.58749C4.74968 2.82499 4.19968 3.14999 3.69968 3.51249L1.96218 2.86249C1.81218 2.81249 1.64468 2.86249 1.56218 3.01249L0.187178 5.49999C0.099678 5.64999 0.137178 5.82499 0.262178 5.92499L1.69968 6.99999C1.65518 7.32999 1.62468 7.66249 1.62468 7.99999C1.62468 8.33749 1.65518 8.66999 1.69968 8.99999L0.262178 10.0875C0.137178 10.1875 0.104678 10.3625 0.187178 10.5125L1.56218 12.9875C1.64468 13.1375 1.81218 13.1875 1.96218 13.1375L3.69968 12.4875C4.19968 12.8625 4.74968 13.175 5.33718 13.4125L5.61218 15.2125C5.63718 15.375 5.77468 15.5 5.93718 15.5H8.68718C8.84968 15.5 8.98718 15.375 9.01218 15.2125L9.28718 13.4125C9.87468 13.175 10.4247 12.85 10.9247 12.4875L12.6622 13.1375C12.8122 13.1875 12.9797 13.1375 13.0622 12.9875L14.4372 10.5C14.5197 10.35 14.4872 10.175 14.3622 10.075L12.9247 8.99999ZM8 10.5C6.62468 10.5 5.49968 9.37499 5.49968 7.99999C5.49968 6.62499 6.62468 5.49999 8 5.49999C9.37532 5.49999 10.5003 6.62499 10.5003 7.99999C10.5003 9.37499 9.37532 10.5 8 10.5Z",fill:"currentColor",opacity:"0.8"})]})}function h2(){return Y.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:Y.jsx("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.5"})})}function d2({isOpen:e,onClose:i,onSuccess:r,copySource:o}){const[h,m]=N.useState(null),[p,a]=N.useState(""),[l,c]=N.useState(""),[f,u]=N.useState(""),[y,C]=N.useState(""),[w,b]=N.useState(!1),[g,_]=N.useState(null),v=N.useRef(null),S=rt(F=>F.showToast),D=N.useMemo(()=>h?h.workspaces.map(F=>({value:F,label:j_(F),description:u2(F),icon:Y.jsx($_,{})})):[],[h]),R=N.useMemo(()=>h?h.workspaces.map(F=>({value:F,label:j_(F)})):[],[h]),x=h?h.workspaces.length<=2:!1,M=N.useMemo(()=>{if(!h)return[];const F=[{value:"",label:"None",title:"No settings file"}];return h.settingsFiles.forEach($=>{F.push({value:$.filename,label:$.displayName,title:`${$.directoryPath}/${$.filename}`})}),F},[h]),k=h?h.settingsFiles.length+1<=2:!1,L=N.useMemo(()=>{if(!h)return[];const F=[{value:"",label:"None",icon:Y.jsx(h2,{})}];return h.settingsFiles.forEach($=>{F.push({value:$.filename,label:$.displayName,description:$.directory,icon:Y.jsx(q_,{})})}),F},[h]);N.useEffect(()=>{if(e&&(T(!!o),a(""),c(""),u(""),C(""),_(null),v.current=null,o&&(a(o.cwd),c(`${o.name}-copy`),o.claudeArgs&&o.claudeArgs.length>0))){const F=[...o.claudeArgs],$=F.indexOf("--settings");$!==-1&&$+1<F.length&&(v.current=F[$+1],F.splice($,2)),C(F.join(" "))}},[e,o]),N.useEffect(()=>{if(h&&v.current){const F=h.settingsFiles.find($=>`${$.directoryPath}/${$.filename}`===v.current);F&&u(F.filename),v.current=null}},[h]),N.useEffect(()=>{h&&h.workspaces.length===1&&!p&&a(h.workspaces[0])},[h,p]);const T=async F=>{try{const $=await r2();m($),!F&&$.claudeArgs.length>0&&C($.claudeArgs.join(" "))}catch($){console.error("Failed to load instance config:",$),_("Failed to load configuration")}},P=async()=>{if(!p){_("Please select a working directory");return}b(!0),_(null),S(o?"Copying instance…":"Creating instance…");try{const F=[];if(f&&h){const q=h.settingsFiles.find(W=>W.filename===f);q&&F.push("--settings",`${q.directoryPath}/${q.filename}`)}y.trim()&&F.push(...y.trim().split(/\s+/).filter(Boolean));const $=await s2({cwd:p,name:l.trim()||void 0,claudeArgs:F.length>0?F:void 0});S("Instance created, starting…"),r({instanceId:$.instance.instanceId,name:$.instance.name}),i()}catch(F){console.error("Failed to create instance:",F),_(F instanceof Error?F.message:"Failed to create instance")}finally{b(!1)}},B=h&&h.workspaces.length>0;return Y.jsx(pb,{isOpen:e,onClose:i,title:o?"Copy Instance":"Create New Instance","data-testid":"instance--modal--create",footer:Y.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8},children:[Y.jsx("button",{onClick:i,"data-testid":"instance--button--cancel",style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"Cancel"}),Y.jsx("button",{onClick:P,disabled:w||!B,"data-testid":"instance--button--submit",style:{padding:"8px 20px",borderRadius:6,border:"none",background:w||!B?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:w||!B?"default":"pointer",opacity:w||!B?.7:1},children:w?o?"Copying…":"Creating…":o?"Copy":"Create"})]}),children:Y.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,paddingBottom:16},children:[Y.jsxs("div",{"data-testid":"instance--field--cwd",children:[Y.jsxs("label",{htmlFor:"cwd-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:["Working Directory ",Y.jsx("span",{"data-testid":"instance--label--cwd-required",children:"*"})]}),x?Y.jsx(H_,{options:R,value:p,onChange:a,disabled:!B,"aria-label":"Working directory"}):Y.jsx(Od,{id:"cwd-select",options:D,value:p||null,onChange:a,placeholder:"Select working directory…",emptyMessage:"No workspaces available",disabled:!B,triggerIcon:Y.jsx($_,{})}),!B&&Y.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:6,opacity:.8},children:"Please configure workspaces in the config file first, or start an instance via CLI."})]}),Y.jsxs("div",{"data-testid":"instance--field--name",children:[Y.jsx("label",{htmlFor:"instance-name",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Instance Name (optional)"}),Y.jsx("textarea",{id:"instance-name",value:l,onChange:F=>c(F.target.value),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Defaults to working directory name",style:Ys({borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)"})})]}),h&&h.settingsFiles.length>0&&Y.jsxs("div",{"data-testid":"instance--field--settings",children:[Y.jsx("label",{htmlFor:"settings-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Settings File (optional)"}),k?Y.jsx(H_,{options:M,value:f,onChange:u,"aria-label":"Settings file"}):Y.jsx(Od,{id:"settings-select",options:L,value:f||null,onChange:u,placeholder:"None",triggerIcon:Y.jsx(q_,{})}),Y.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"Custom Claude settings from ~/.claude/ or ~/.claude-remote/settings/"})]}),Y.jsxs("div",{"data-testid":"instance--field--claude-args",children:[Y.jsx("label",{htmlFor:"claude-args",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Claude Arguments (optional)"}),Y.jsx("textarea",{id:"claude-args",value:y,onChange:F=>C(F.target.value),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"e.g., chat --model claude-sonnet-4-6",style:Ys({borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)"})}),Y.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"Multiple arguments separated by spaces (quoted arguments with spaces not supported)"})]}),g&&Y.jsx("div",{"data-testid":"instance--message--error",style:{padding:"10px 12px",borderRadius:8,background:"rgba(255, 59, 48, 0.1)",color:"var(--status-error)",fontSize:13},children:g})]})})}function W_(e,i,r=140,o=44){const h=window.innerWidth-r-8,m=window.innerHeight-o-8;return{x:Math.max(8,Math.min(e,h)),y:Math.max(8,Math.min(i,m))}}function f2({onSwitch:e,onCreateSuccess:i}){const r=Sn(k=>k.instances),o=Sn(k=>k.setInstances),h=Sn(k=>k.activeInstanceId),[m,p]=N.useState(!1),[a,l]=N.useState(null),c=N.useRef(null),f=N.useRef(new Map),[u,y]=N.useState(null),[C,w]=N.useState({x:0,y:0}),b=N.useRef(null),g=N.useRef(!1);N.useEffect(()=>{if(!h)return;const k=f.current.get(h),L=c.current;k&&L&&k.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[h]),N.useEffect(()=>{const k=()=>{y(null)};if(u)return document.addEventListener("click",k),()=>document.removeEventListener("click",k)},[u]);const _=(k,L)=>{g.current=!1;const{clientX:T,clientY:P}=L.touches[0];b.current=setTimeout(()=>{g.current=!0,w(W_(T,P)),y(k)},500)},v=()=>{b.current&&(clearTimeout(b.current),b.current=null)},S=N.useCallback(k=>{if(g.current){g.current=!1;return}e(k)},[e]),D=(k,L)=>{L.preventDefault(),w(W_(L.clientX,L.clientY)),y(k)},R=()=>{u&&(l(u),p(!0),y(null))},x=async k=>{try{const L=await _b();o(L)}catch(L){console.error("[InstanceTabs] Failed to fetch instances:",L)}i&&i(k)},M=()=>{p(!1),l(null)};return Y.jsxs(Y.Fragment,{children:[Y.jsxs("div",{"data-testid":"instance--tabs",style:{display:"flex",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[Y.jsx("div",{ref:c,style:{display:"flex",overflowX:"auto",padding:"0 4px 0 16px",flex:1},children:r.map(k=>{const L=k.instanceId===h;return Y.jsxs("button",{ref:T=>{T?f.current.set(k.instanceId,T):f.current.delete(k.instanceId)},"data-testid":L?"instance--tab--active":"instance--tab",onClick:()=>S(k.instanceId),onTouchStart:T=>_(k,T),onTouchEnd:v,onTouchMove:v,onContextMenu:T=>D(k,T),style:{padding:"8px 16px",background:"transparent",border:"none",borderBottom:L?"2px solid var(--accent-color, #007aff)":"2px solid transparent",color:L?"var(--text-primary)":"var(--text-secondary)",fontSize:13,fontWeight:L?600:400,cursor:"pointer",whiteSpace:"nowrap",flexShrink:0},children:[k.name,Y.jsxs("span",{style:{marginLeft:6,fontSize:11,color:"var(--text-tertiary, var(--text-secondary))",opacity:.7},children:["#",k.instanceId.substring(0,6)]})]},k.instanceId)})}),Y.jsx("button",{onClick:()=>p(!0),"aria-label":"Create new instance","data-testid":"instance--button--create",style:{width:44,height:44,padding:0,background:"transparent",border:"none",borderLeft:"1px solid var(--border-color)",color:"var(--text-secondary)",fontSize:22,fontWeight:600,cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:"+"})]}),u&&Y.jsx("div",{"data-testid":"instance--context-menu",onClick:k=>k.stopPropagation(),style:{position:"fixed",left:C.x,top:C.y,zIndex:1100,background:"var(--bg-secondary)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.3)",overflow:"hidden",minWidth:140},children:Y.jsx("button",{"data-testid":"instance--button--copy",onClick:R,style:{display:"block",width:"100%",padding:"12px 16px",background:"transparent",border:"none",color:"var(--text-primary)",fontSize:14,textAlign:"left",cursor:"pointer"},children:"Copy Instance"})}),Y.jsx(d2,{isOpen:m,onClose:M,onSuccess:x,copySource:a})]})}function g2({visible:e,onClick:i}){const[r,o]=N.useState(!1);N.useEffect(()=>{e&&o(!0)},[e]);const h=()=>{e||o(!1)};return r?Y.jsx("button",{className:`scroll-to-bottom-btn ${e?"visible":"hidden"}`,onClick:i,onAnimationEnd:h,"aria-label":"Jump to latest output","data-testid":"terminal--button--scroll-to-bottom",children:"↓"}):null}const Ps=tf(e=>({files:[],cwd:"",isLoading:!1,error:null,lastUpdated:null,setFiles:i=>e({files:i.files,cwd:i.cwd,lastUpdated:new Date,error:null}),setLoading:i=>e({isLoading:i}),setError:i=>e({error:i}),clearFiles:()=>e({files:[],cwd:"",lastUpdated:null})}));async function p2(e){const i=new URLSearchParams;e!=null&&e.cwd&&i.set("cwd",e.cwd),e!=null&&e.instanceId&&i.set("instanceId",e.instanceId);const r=i.toString()?`/api/file/list?${i.toString()}`:"/api/file/list",o=await fetch(r,{credentials:"include"});if(o.status===401){const h=ts();if(h)try{if(await Ti(h)){const p=await fetch(r,{credentials:"include"});if(p.ok)return p.json()}}catch{}throw new Error("Unauthorized")}if(!o.ok)throw new Error(`Failed to fetch files: ${o.status}`);return o.json()}async function m2(e,i){const r=new URLSearchParams;r.set("path",e),i!=null&&i.instanceId&&r.set("instanceId",i.instanceId);const o=`/api/file/read?${r.toString()}`,h=await fetch(o,{credentials:"include"});if(h.status===401){const m=ts();if(m)try{if(await Ti(m)){const a=await fetch(o,{credentials:"include"});if(a.ok)return a.json()}}catch{}throw new Error("Unauthorized")}if(!h.ok)throw new Error(`Failed to read file: ${h.status}`);return h.json()}function _2(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function v2(e){const i=new Date(e),o=new Date().getTime()-i.getTime(),h=Math.floor(o/1e3),m=Math.floor(h/60),p=Math.floor(m/60),a=Math.floor(p/24);return h<60?"just now":m<60?`${m}m ago`:p<24?`${p}h ago`:a<7?`${a}d ago`:i.toLocaleDateString()}const b2=5e3,y2=N.forwardRef(function({onClose:i},r){const o=Ps(_=>_.files)??[],h=Ps(_=>_.isLoading),m=Ps(_=>_.error),p=Ps(_=>_.setFiles),a=Ps(_=>_.setLoading),l=Ps(_=>_.setError),c=fb(),f=N.useRef(null),u=Xd(),y=Sn(_=>_.activeInstanceId);N.useImperativeHandle(r,()=>({open:()=>{var _;(_=f.current)==null||_.open()}})),N.useEffect(()=>{var _;(_=f.current)==null||_.open()},[]);const C=N.useCallback(async()=>{try{a(!0);const _=await p2({instanceId:y??void 0});p(_)}catch(_){const v=_ instanceof Error?_.message:"Failed to load files";l(v)}finally{a(!1)}},[p,a,l,y]),w=N.useCallback(_=>{const v=new URLSearchParams({path:_.absolutePath});y&&v.set("instanceId",y),u(`/viewer?${v.toString()}`)},[u,y]);N.useEffect(()=>{C();const _=setInterval(C,b2);return()=>clearInterval(_)},[C]);const b=o.map(_=>({value:_,label:_.relativePath,description:`${_2(_.size)} · ${v2(_.modifiedAt)}`})),g=()=>c?"📄":h&&o.length===0?"📄 …":m&&o.length===0?"📄 !":`📄 ${o.length}`;return Y.jsx(Od,{ref:f,options:b,value:null,onChange:w,placeholder:"📄 0",disabled:h&&o.length===0,emptyMessage:m||"No Markdown files found",getDisplayLabel:g,onClose:i,hideTrigger:!0})}),S2=500,Us=44,bb="floating-doc-button-position",G_=44,K_=44,V_=8;function C2(){if(typeof document<"u"){const e=document.documentElement;return getComputedStyle(e).getPropertyValue("--safe-top").trim(),(CSS.supports("padding-top","env(safe-area-inset-top)")?20:0)+G_+K_+V_}return G_+K_+V_}const E2={right:16,top:0};function w2(){try{const e=localStorage.getItem(bb);if(e){const i=JSON.parse(e);if(typeof i.right=="number"&&typeof i.top=="number")return i}}catch{}return{...E2,top:C2()}}function x2(e){try{localStorage.setItem(bb,JSON.stringify(e))}catch{}}function D2(){const[e,i]=N.useState(w2),[r,o]=N.useState(!1),[h,m]=N.useState(!1),[p,a]=N.useState(!1),l=rt(T=>T.showFloatingDocButton),c=rt(T=>T.isDocButtonHiddenByLongPress),f=rt(T=>T.setDocButtonHiddenByLongPress),u=N.useRef(null),y=N.useRef(null),C=N.useRef({x:0,y:0,right:0,top:0}),w=N.useRef(null),b=N.useRef(!1),g=N.useCallback(()=>{w.current&&(clearTimeout(w.current),w.current=null),w.current=setTimeout(()=>{b.current||(w.current=null,f(!0),setTimeout(()=>m(!1),0))},S2)},[f]),_=N.useCallback(()=>{w.current&&(clearTimeout(w.current),w.current=null)},[]),v=N.useCallback((T,P)=>{m(!0),b.current=!1,C.current={x:T,y:P,right:e.right,top:e.top},g()},[e.right,e.top,g]),S=N.useCallback((T,P)=>{if(!h)return;const B=T-C.current.x,F=P-C.current.y;if(Math.sqrt(B*B+F*F)>10&&!b.current&&(b.current=!0,o(!0),_()),b.current){const q=Math.max(0,C.current.right-B),W=Math.max(0,C.current.top+F),K=window.innerWidth-Us,X=window.innerHeight-Us;i({right:Math.min(q,K),top:Math.min(W,X)})}},[h,_]),D=N.useCallback(()=>{a(!1)},[]),R=N.useCallback(()=>{m(!1),o(!1),_(),b.current?x2(e):a(!0),b.current=!1},[e,_]),x=N.useCallback(T=>{const P=T.touches[0];v(P.clientX,P.clientY)},[v]),M=N.useCallback(T=>{const P=T.touches[0];S(P.clientX,P.clientY)},[S]),k=N.useCallback(T=>{T.preventDefault(),R()},[R]),L=N.useCallback(T=>{T.preventDefault(),v(T.clientX,T.clientY)},[v]);return N.useEffect(()=>{if(!h)return;const T=B=>{S(B.clientX,B.clientY)},P=()=>{R()};return document.addEventListener("mousemove",T),document.addEventListener("mouseup",P),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",P)}},[h,S,R]),N.useEffect(()=>{const T=()=>{const P=window.innerWidth-Us,B=window.innerHeight-Us;i(F=>({right:Math.min(F.right,P),top:Math.min(F.top,B)}))};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]),N.useEffect(()=>()=>{_()},[_]),!l||c?null:Y.jsxs(Y.Fragment,{children:[Y.jsx("div",{ref:y,"data-testid":"floating-doc-button",onTouchStart:x,onTouchMove:M,onTouchEnd:k,onMouseDown:L,style:{position:"fixed",right:e.right,top:e.top,width:Us,height:Us,borderRadius:"50%",background:"linear-gradient(135deg, #21262d 0%, #161b22 100%)",border:"1px solid var(--border-color)",display:"flex",alignItems:"center",justifyContent:"center",cursor:r?"grabbing":"grab",zIndex:100,boxShadow:h?"0 2px 8px rgba(0, 0, 0, 0.5)":"0 4px 12px rgba(0, 0, 0, 0.4)",transform:h?"scale(0.95)":"scale(1)",transition:r?"none":"transform 0.1s ease, box-shadow 0.1s ease",userSelect:"none",WebkitUserSelect:"none",touchAction:"none"},children:Y.jsx("span",{style:{fontSize:20,lineHeight:1,filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.5))",display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:"📑"})}),p&&Y.jsx(y2,{ref:u,onClose:D})]})}const Y_="__default__",X_=[1e3,2e3,4e3,8e3,16e3,3e4],Jh=new Map;function A2(e,i,r=Y_){const o=N.useRef(null),h=N.useRef(0),m=N.useRef(void 0),p=N.useRef(e),a=N.useRef(0),l=N.useRef(!1),c=rt(D=>D.setConnectionStatus),f=N.useRef(c),u=rt(D=>D.setInstanceConnectionStatus),y=N.useRef(u),C=rt(D=>D.showToast),w=N.useCallback(D=>{r===Y_&&f.current(D),y.current(r,D)},[r]);N.useEffect(()=>{p.current=e},[e]),N.useEffect(()=>{f.current=c},[c]),N.useEffect(()=>{y.current=u},[u]);const b=N.useRef(void 0),g=N.useCallback(D=>{const R=X_[Math.min(h.current,X_.length-1)];h.current++,m.current=setTimeout(()=>{var x;l.current||D!==a.current||(x=b.current)==null||x.call(b)},R)},[]),_=N.useCallback(async()=>{if(!i){w("disconnected");return}if(o.current&&o.current.readyState===WebSocket.OPEN)return;const D=i;m.current&&(clearTimeout(m.current),m.current=void 0),l.current=!1;const R=++a.current;w("connecting");const x=new WebSocket(D);o.current=x,x.onopen=()=>{l.current||R!==a.current||o.current!==x||(w("connected"),h.current=0,Jh.set(r,!1),x.send(JSON.stringify({type:"activate"})))},x.onmessage=M=>{if(!(l.current||R!==a.current||o.current!==x))try{const k=JSON.parse(M.data);p.current(k)}catch{}},x.onclose=async()=>{if(l.current||R!==a.current||o.current!==x)return;o.current=null,w("disconnected"),Jh.get(r)||(C("Connection lost. Reconnecting…"),Jh.set(r,!0));const M=ts();if(M)try{await Ti(M)}catch{}g(R)},x.onerror=()=>{}},[g,w,i]);N.useEffect(()=>{b.current=_},[_]);const v=N.useCallback(D=>{var R;return((R=o.current)==null?void 0:R.readyState)===WebSocket.OPEN?(o.current.send(JSON.stringify(D)),!0):!1},[]),S=N.useCallback(()=>{l.current=!0,a.current++,m.current&&(clearTimeout(m.current),m.current=void 0);const D=o.current;o.current=null,D==null||D.close()},[]);return N.useEffect(()=>{const D=()=>{var x;(x=o.current)==null||x.close()},R=()=>{var x;if(document.visibilityState==="visible"){const M=o.current;(M==null?void 0:M.readyState)===WebSocket.OPEN?M.send(JSON.stringify({type:"activate"})):(!M||M.readyState===WebSocket.CLOSED)&&((x=b.current)==null||x.call(b))}};return window.addEventListener("offline",D),document.addEventListener("visibilitychange",R),()=>{l.current=!0,a.current++,window.removeEventListener("offline",D),document.removeEventListener("visibilitychange",R),m.current&&(clearTimeout(m.current),m.current=void 0);const x=o.current;o.current=null,x==null||x.close()}},[]),{connect:_,disconnect:S,send:v}}var ed={exports:{}},Z_;function k2(){return Z_||(Z_=1,(function(e,i){(function(r,o){e.exports=o()})(globalThis,(()=>(()=>{var r={4567:function(p,a,l){var c=this&&this.__decorate||function(v,S,D,R){var x,M=arguments.length,k=M<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,S,D,R);else for(var L=v.length-1;L>=0;L--)(x=v[L])&&(k=(M<3?x(k):M>3?x(S,D,k):x(S,D))||k);return M>3&&k&&Object.defineProperty(S,D,k),k},f=this&&this.__param||function(v,S){return function(D,R){S(D,R,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=l(9042),y=l(9924),C=l(844),w=l(4725),b=l(2585),g=l(3656);let _=a.AccessibilityManager=class extends C.Disposable{constructor(v,S,D,R){super(),this._terminal=v,this._coreBrowserService=D,this._renderService=R,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 x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new y.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((x=>this._handleResize(x.rows)))),this.register(this._terminal.onRender((x=>this._refreshRows(x.start,x.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((x=>this._handleChar(x)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
86
- `)))),this.register(this._terminal.onA11yTab((x=>this._handleTab(x)))),this.register(this._terminal.onKey((x=>this._handleKey(x.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,g.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let S=0;S<v;S++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
87
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,S){this._liveRegionDebouncer.refresh(v,S,this._terminal.rows)}_renderRows(v,S){const D=this._terminal.buffer,R=D.lines.length.toString();for(let x=v;x<=S;x++){const M=D.lines.get(D.ydisp+x),k=[],L=(M==null?void 0:M.translateToString(!0,void 0,void 0,k))||"",T=(D.ydisp+x+1).toString(),P=this._rowElements[x];P&&(L.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=L,this._rowColumns.set(P,k)),P.setAttribute("aria-posinset",T),P.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,S){const D=v.target,R=this._rowElements[S===0?1:this._rowElements.length-2];if(D.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==R)return;let x,M;if(S===0?(x=D,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(x=this._rowElements.shift(),M=D,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){var L;if(this._rowElements.length===0)return;const v=document.getSelection();if(!v)return;if(v.isCollapsed)return void(this._rowContainer.contains(v.anchorNode)&&this._terminal.clearSelection());if(!v.anchorNode||!v.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:v.anchorNode,offset:v.anchorOffset},D={node:v.focusNode,offset:v.focusOffset};if((S.node.compareDocumentPosition(D.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===D.node&&S.offset>D.offset)&&([S,D]=[D,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const R=this._rowElements.slice(-1)[0];if(D.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(D={node:R,offset:((L=R.textContent)==null?void 0:L.length)??0}),!this._rowContainer.contains(D.node))return;const x=({node:T,offset:P})=>{const B=T instanceof Text?T.parentNode:T;let F=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(B);if(!$)return console.warn("columns is null. Race condition?"),null;let q=P<$.length?$[P]:$.slice(-1)[0]+1;return q>=this._terminal.cols&&(++F,q=0),{row:F,column:q}},M=x(S),k=x(D);if(M&&k){if(M.row>k.row||M.row===k.row&&M.column>=k.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(k.row-M.row)*this._terminal.cols-M.column+k.column)}}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=this._coreBrowserService.mainDocument.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_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 v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=_=c([f(1,b.IInstantiationService),f(2,w.ICoreBrowserService),f(3,w.IRenderService)],_)},3614:(p,a)=>{function l(y){return y.replace(/\r?\n/g,"\r")}function c(y,C){return C?"\x1B[200~"+y+"\x1B[201~":y}function f(y,C,w,b){y=c(y=l(y),w.decPrivateModes.bracketedPasteMode&&b.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(y,!0),C.value=""}function u(y,C,w){const b=w.getBoundingClientRect(),g=y.clientX-b.left-10,_=y.clientY-b.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${g}px`,C.style.top=`${_}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=l,a.bracketTextForPaste=c,a.copyHandler=function(y,C){y.clipboardData&&y.clipboardData.setData("text/plain",C.selectionText),y.preventDefault()},a.handlePasteEvent=function(y,C,w,b){y.stopPropagation(),y.clipboardData&&f(y.clipboardData.getData("text/plain"),C,w,b)},a.paste=f,a.moveTextAreaUnderMouseCursor=u,a.rightClickHandler=function(y,C,w,b,g){u(y,C,w),g&&b.rightClickSelect(y),C.value=b.selectionText,C.select()}},7239:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const c=l(1505);a.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(f,u,y){this._css.set(f,u,y)}getCss(f,u){return this._css.get(f,u)}setColor(f,u,y){this._color.set(f,u,y)}getColor(f,u){return this._color.get(f,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(l,c,f,u){l.addEventListener(c,f,u);let y=!1;return{dispose:()=>{y||(y=!0,l.removeEventListener(c,f,u))}}}},3551:function(p,a,l){var c=this&&this.__decorate||function(_,v,S,D){var R,x=arguments.length,M=x<3?v:D===null?D=Object.getOwnPropertyDescriptor(v,S):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,v,S,D);else for(var k=_.length-1;k>=0;k--)(R=_[k])&&(M=(x<3?R(M):x>3?R(v,S,M):R(v,S))||M);return x>3&&M&&Object.defineProperty(v,S,M),M},f=this&&this.__param||function(_,v){return function(S,D){v(S,D,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const u=l(3656),y=l(8460),C=l(844),w=l(2585),b=l(4725);let g=a.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(_,v,S,D,R){super(),this._element=_,this._mouseService=v,this._renderService=S,this._bufferService=D,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var x;this._lastMouseEvent=void 0,(x=this._activeProviderReplies)==null||x.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const v=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const S=_.composedPath();for(let D=0;D<S.length;D++){const R=S[D];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_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(_,v){var D,R;this._activeProviderReplies&&v||((D=this._activeProviderReplies)==null||D.forEach((x=>{x==null||x.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let S=!1;for(const[x,M]of this._linkProviderService.linkProviders.entries())v?(R=this._activeProviderReplies)!=null&&R.get(x)&&(S=this._checkLinkProviderResult(x,_,S)):M.provideLinks(_.y,(k=>{var T,P;if(this._isMouseOut)return;const L=k==null?void 0:k.map((B=>({link:B})));(T=this._activeProviderReplies)==null||T.set(x,L),S=this._checkLinkProviderResult(x,_,S),((P=this._activeProviderReplies)==null?void 0:P.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,v){const S=new Set;for(let D=0;D<v.size;D++){const R=v.get(D);if(R)for(let x=0;x<R.length;x++){const M=R[x],k=M.link.range.start.y<_?0:M.link.range.start.x,L=M.link.range.end.y>_?this._bufferService.cols:M.link.range.end.x;for(let T=k;T<=L;T++){if(S.has(T)){R.splice(x--,1);break}S.add(T)}}}}_checkLinkProviderResult(_,v,S){var x;if(!this._activeProviderReplies)return S;const D=this._activeProviderReplies.get(_);let R=!1;for(let M=0;M<_;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(R=!0);if(!R&&D){const M=D.find((k=>this._linkAtPosition(k.link,v)));M&&(S=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let M=0;M<this._activeProviderReplies.size;M++){const k=(x=this._activeProviderReplies.get(M))==null?void 0:x.find((L=>this._linkAtPosition(L.link,v)));if(k){S=!0,this._handleNewLink(k);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const v=this._positionFromMouseEvent(_,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,v){this._currentLink&&this._lastMouseEvent&&(!_||!v||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(_.link,v)&&(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 S,D;return(D=(S=this._currentLink)==null?void 0:S.state)==null?void 0:D.decorations.pointerCursor},set:S=>{var D;(D=this._currentLink)!=null&&D.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>{var S,D;return(D=(S=this._currentLink)==null?void 0:S.state)==null?void 0:D.decorations.underline},set:S=>{var D,R,x;(D=this._currentLink)!=null&&D.state&&((x=(R=this._currentLink)==null?void 0:R.state)==null?void 0:x.decorations.underline)!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const D=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=D&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(D,R),this._lastMouseEvent)){const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._askForLink(x,!1)}}))))}_linkHover(_,v,S){var D;(D=this._currentLink)!=null&&D.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(S,v.text)}_fireUnderlineEvent(_,v){const S=_.range,D=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-D-1,S.end.x,S.end.y-D-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(_,v,S){var D;(D=this._currentLink)!=null&&D.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(S,v.text)}_linkAtPosition(_,v){const S=_.range.start.y*this._bufferService.cols+_.range.start.x,D=_.range.end.y*this._bufferService.cols+_.range.end.x,R=v.y*this._bufferService.cols+v.x;return S<=R&&R<=D}_positionFromMouseEvent(_,v,S){const D=S.getCoords(_,v,this._bufferService.cols,this._bufferService.rows);if(D)return{x:D[0],y:D[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,v,S,D,R){return{x1:_,y1:v,x2:S,y2:D,cols:this._bufferService.cols,fg:R}}};a.Linkifier=g=c([f(1,b.IMouseService),f(2,b.IRenderService),f(3,w.IBufferService),f(4,b.ILinkProviderService)],g)},9042:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(p,a,l){var c=this&&this.__decorate||function(b,g,_,v){var S,D=arguments.length,R=D<3?g:v===null?v=Object.getOwnPropertyDescriptor(g,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,g,_,v);else for(var x=b.length-1;x>=0;x--)(S=b[x])&&(R=(D<3?S(R):D>3?S(g,_,R):S(g,_))||R);return D>3&&R&&Object.defineProperty(g,_,R),R},f=this&&this.__param||function(b,g){return function(_,v){g(_,v,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const u=l(511),y=l(2585);let C=a.OscLinkProvider=class{constructor(b,g,_){this._bufferService=b,this._optionsService=g,this._oscLinkService=_}provideLinks(b,g){var L;const _=this._bufferService.buffer.lines.get(b-1);if(!_)return void g(void 0);const v=[],S=this._optionsService.rawOptions.linkHandler,D=new u.CellData,R=_.getTrimmedLength();let x=-1,M=-1,k=!1;for(let T=0;T<R;T++)if(M!==-1||_.hasContent(T)){if(_.loadCell(T,D),D.hasExtendedAttrs()&&D.extended.urlId){if(M===-1){M=T,x=D.extended.urlId;continue}k=D.extended.urlId!==x}else M!==-1&&(k=!0);if(k||M!==-1&&T===R-1){const P=(L=this._oscLinkService.getLinkData(x))==null?void 0:L.uri;if(P){const B={start:{x:M+1,y:b},end:{x:T+(k||T!==R-1?0:1),y:b}};let F=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const $=new URL(P);["http:","https:"].includes($.protocol)||(F=!0)}catch{F=!0}F||v.push({text:P,range:B,activate:($,q)=>S?S.activate($,q,B):w(0,q),hover:($,q)=>{var W;return(W=S==null?void 0:S.hover)==null?void 0:W.call(S,$,q,B)},leave:($,q)=>{var W;return(W=S==null?void 0:S.leave)==null?void 0:W.call(S,$,q,B)}})}k=!1,D.hasExtendedAttrs()&&D.extended.urlId?(M=T,x=D.extended.urlId):(M=-1,x=-1)}}g(v)}};function w(b,g){if(confirm(`Do you want to navigate to ${g}?
88
-
89
- WARNING: This link could potentially be dangerous`)){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=g}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=C=c([f(0,y.IBufferService),f(1,y.IOptionsService),f(2,y.IOscLinkService)],C)},6193:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(l){return this._refreshCallbacks.push(l),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(l,c,f){this._rowCount=f,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,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 l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const l of this._refreshCallbacks)l(0);this._refreshCallbacks=[]}}},3236:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const c=l(3614),f=l(3656),u=l(3551),y=l(9042),C=l(3730),w=l(1680),b=l(3107),g=l(5744),_=l(2950),v=l(1296),S=l(428),D=l(4269),R=l(5114),x=l(8934),M=l(3230),k=l(9312),L=l(4725),T=l(6731),P=l(8055),B=l(8969),F=l(8460),$=l(844),q=l(6114),W=l(8437),K=l(2584),X=l(7399),U=l(5941),O=l(9074),z=l(2585),j=l(5435),H=l(4567),ee=l(779);class he extends B.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(Z={}){super(Z),this.browser=q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(z.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((G,re)=>this.refresh(G,re)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((G=>this._reportWindowsOptions(G)))),this.register(this._inputHandler.onColor((G=>this._handleColorEvent(G)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((G=>this._afterResize(G.cols,G.rows)))),this.register((0,$.toDisposable)((()=>{var G,re;this._customKeyEventHandler=void 0,(re=(G=this.element)==null?void 0:G.parentNode)==null||re.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const G of Z){let re,ne="";switch(G.index){case 256:re="foreground",ne="10";break;case 257:re="background",ne="11";break;case 258:re="cursor",ne="12";break;default:re="ansi",ne="4;"+G.index}switch(G.type){case 0:const ve=P.color.toColorRGB(re==="ansi"?this._themeService.colors.ansi[G.index]:this._themeService.colors[re]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${ne};${(0,U.toRgbString)(ve)}${K.C1_ESCAPED.ST}`);break;case 1:if(re==="ansi")this._themeService.modifyColors((me=>me.ansi[G.index]=P.channels.toColor(...G.color)));else{const me=re;this._themeService.modifyColors((Te=>Te[me]=P.channels.toColor(...G.color)))}break;case 2:this._themeService.restoreColor(G.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Z;return(Z=this.textarea)==null?void 0:Z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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 Z=this.buffer.ybase+this.buffer.y,G=this.buffer.lines.get(Z);if(!G)return;const re=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,ve=G.getWidth(re),me=this._renderService.dimensions.css.cell.width*ve,Te=this.buffer.y*this._renderService.dimensions.css.cell.height,xe=re*this._renderService.dimensions.css.cell.width;this.textarea.style.left=xe+"px",this.textarea.style.top=Te+"px",this.textarea.style.width=me+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",(G=>{this.hasSelection()&&(0,c.copyHandler)(G,this._selectionService)})));const Z=G=>(0,c.handlePasteEvent)(G,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,f.addDisposableDomListener)(this.element,"paste",Z)),q.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(G=>{G.button===2&&(0,c.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",(G=>{(0,c.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),q.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",(G=>{G.button===1&&(0,c.moveTextAreaUnderMouseCursor)(G,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,f.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){var re;if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((re=this.element)==null?void 0:re.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.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"),Z.appendChild(this.element);const G=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.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,f.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.promptLabel),q.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(R.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(D.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.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(x.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(b.BufferDecorationRenderer,this.screenElement)),this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),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(H.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(v.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Z=this,G=this.element;function re(me){const Te=Z._mouseService.getMouseReportCoords(me,Z.screenElement);if(!Te)return!1;let xe,Ve;switch(me.overrideType||me.type){case"mousemove":Ve=32,me.buttons===void 0?(xe=3,me.button!==void 0&&(xe=me.button<3?me.button:3)):xe=1&me.buttons?0:4&me.buttons?1:2&me.buttons?2:3;break;case"mouseup":Ve=0,xe=me.button<3?me.button:3;break;case"mousedown":Ve=1,xe=me.button<3?me.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(me)===!1||Z.viewport.getLinesScrolled(me)===0)return!1;Ve=me.deltaY<0?0:1,xe=4;break;default:return!1}return!(Ve===void 0||xe===void 0||xe>4)&&Z.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:xe,action:Ve,ctrl:me.ctrlKey,alt:me.altKey,shift:me.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:me=>(re(me),me.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(me)),wheel:me=>(re(me),this.cancel(me,!0)),mousedrag:me=>{me.buttons&&re(me)},mousemove:me=>{me.buttons||re(me)}};this.register(this.coreMouseService.onProtocolChange((me=>{me?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(me)),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&me?ne.mousemove||(G.addEventListener("mousemove",ve.mousemove),ne.mousemove=ve.mousemove):(G.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&me?ne.wheel||(G.addEventListener("wheel",ve.wheel,{passive:!1}),ne.wheel=ve.wheel):(G.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&me?ne.mouseup||(ne.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&me?ne.mousedrag||(ne.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(G,"mousedown",(me=>{if(me.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(me))return re(me),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(me)}))),this.register((0,f.addDisposableDomListener)(G,"wheel",(me=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(me)===!1)return!1;if(!this.buffer.hasScrollback){const Te=this.viewport.getLinesScrolled(me);if(Te===0)return;const xe=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(me.deltaY<0?"A":"B");let Ve="";for(let Me=0;Me<Math.abs(Te);Me++)Ve+=xe;return this.coreService.triggerDataEvent(Ve,!0),this.cancel(me,!0)}return this.viewport.handleWheel(me)?this.cancel(me):void 0}}),{passive:!1})),this.register((0,f.addDisposableDomListener)(G,"touchstart",(me=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(me),this.cancel(me)}),{passive:!0})),this.register((0,f.addDisposableDomListener)(G,"touchmove",(me=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(me)?void 0:this.cancel(me)}),{passive:!1}))}refresh(Z,G){var re;(re=this._renderService)==null||re.refreshRows(Z,G)}updateCursorStyle(Z){var G;(G=this._selectionService)!=null&&G.shouldColumnSelect(Z)?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(Z,G,re=0){var ne;re===1?(super.scrollLines(Z,G,re),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(Z)}paste(Z){(0,c.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}attachCustomWheelEventHandler(Z){this._customWheelEventHandler=Z}registerLinkProvider(Z){return this._linkProviderService.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const G=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),G}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,G,re){this._selectionService.setSelection(Z,G,re)}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 Z;(Z=this._selectionService)==null||Z.clearSelection()}selectAll(){var Z;(Z=this._selectionService)==null||Z.selectAll()}selectLines(Z,G){var re;(re=this._selectionService)==null||re.selectLines(Z,G)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const G=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!G&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;G||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const re=(0,X.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),re.type===3||re.type===2){const ne=this.rows-1;return this.scrollLines(re.type===2?-ne:ne),this.cancel(Z,!0)}return re.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(re.cancel&&this.cancel(Z,!0),!re.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(re.key!==K.C0.ETX&&re.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:re.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(re.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,G){const re=Z.isMac&&!this.options.macOptionIsMeta&&G.altKey&&!G.ctrlKey&&!G.metaKey||Z.isWindows&&G.altKey&&G.ctrlKey&&!G.metaKey||Z.isWindows&&G.getModifierState("AltGraph");return G.type==="keypress"?re:re&&(!G.keyCode||G.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(G){return G.keyCode===16||G.keyCode===17||G.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let G;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)G=Z.charCode;else if(Z.which===null||Z.which===void 0)G=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;G=Z.which}return!(!G||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(G=String.fromCharCode(G),this._onKey.fire({key:G,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(G,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const G=Z.data;return this.coreService.triggerDataEvent(G,!0),this.cancel(Z),!0}return!1}resize(Z,G){Z!==this.cols||G!==this.rows?super.resize(Z,G):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,G){var re,ne;(re=this._charSizeService)==null||re.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var Z;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 G=1;G<this.rows;G++)this.buffer.lines.push(this.buffer.getBlankLine(W.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Z=this.viewport)==null||Z.reset(),this.refresh(0,this.rows-1)}}reset(){var G,re;this.options.rows=this.rows,this.options.cols=this.cols;const Z=this._customKeyEventHandler;this._setup(),super.reset(),(G=this._selectionService)==null||G.reset(),this._decorationService.reset(),(re=this.viewport)==null||re.reset(),this._customKeyEventHandler=Z,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Z;(Z=this._renderService)==null||Z.clearTextureAtlas()}_reportFocus(){var Z;(Z=this.element)!=null&&Z.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case j.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const G=this._renderService.dimensions.css.canvas.width.toFixed(0),re=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${re};${G}t`);break;case j.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ne=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${ve};${ne}t`)}}cancel(Z,G){if(this.options.cancelEvents||G)return Z.preventDefault(),Z.stopPropagation(),!1}}a.Terminal=he},9924:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(l,c=1e3){this._renderCallback=l,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(l,c,f){this._rowCount=f,l=l!==void 0?l:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,l):l,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=u-this._lastRefreshMs,C=this._debounceThresholdMS-y;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const l=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(l,c)}}},1680:function(p,a,l){var c=this&&this.__decorate||function(_,v,S,D){var R,x=arguments.length,M=x<3?v:D===null?D=Object.getOwnPropertyDescriptor(v,S):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,v,S,D);else for(var k=_.length-1;k>=0;k--)(R=_[k])&&(M=(x<3?R(M):x>3?R(v,S,M):R(v,S))||M);return x>3&&M&&Object.defineProperty(v,S,M),M},f=this&&this.__param||function(_,v){return function(S,D){v(S,D,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const u=l(3656),y=l(4725),C=l(8460),w=l(844),b=l(2585);let g=a.Viewport=class extends w.Disposable{constructor(_,v,S,D,R,x,M,k){super(),this._viewportElement=_,this._scrollArea=v,this._bufferService=S,this._optionsService=D,this._charSizeService=R,this._renderService=x,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((L=>this._handleThemeChange(L)))),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 v=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==v&&(this._lastRecordedBufferHeight=v,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 v=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:v,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(_,v){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&S<this._lastRecordedBufferHeight)||(_.cancelable&&_.preventDefault(),!1)}handleWheel(_){const v=this._getPixelsScrolled(_);return v!==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+v:this._smoothScrollState.target+=v,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=v,this._bubbleScroll(_,v))}scrollLines(_){if(_!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const v=_*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+v,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 v=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_LINE?v*=this._currentRowHeight:_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._currentRowHeight*this._bufferService.rows),v}getBufferElements(_,v){var k;let S,D="";const R=[],x=v??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let L=_;L<x;L++){const T=M.get(L);if(!T)continue;const P=(k=M.get(L+1))==null?void 0:k.isWrapped;if(D+=T.translateToString(!P),!P||L===M.length-1){const B=document.createElement("div");B.textContent=D,R.push(B),D.length>0&&(S=B),D=""}}return{bufferElements:R,cursorElement:S}}getLinesScrolled(_){if(_.deltaY===0||_.shiftKey)return 0;let v=this._applyScrollModifier(_.deltaY,_);return _.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(v/=this._currentRowHeight+0,this._wheelPartialScroll+=v,v=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):_.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._bufferService.rows),v}_applyScrollModifier(_,v){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&v.altKey||S==="ctrl"&&v.ctrlKey||S==="shift"&&v.shiftKey?_*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:_*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(_){this._lastTouchY=_.touches[0].pageY}handleTouchMove(_){const v=this._lastTouchY-_.touches[0].pageY;return this._lastTouchY=_.touches[0].pageY,v!==0&&(this._viewportElement.scrollTop+=v,this._bubbleScroll(_,v))}};a.Viewport=g=c([f(2,b.IBufferService),f(3,b.IOptionsService),f(4,y.ICharSizeService),f(5,y.IRenderService),f(6,y.ICoreBrowserService),f(7,y.IThemeService)],g)},3107:function(p,a,l){var c=this&&this.__decorate||function(b,g,_,v){var S,D=arguments.length,R=D<3?g:v===null?v=Object.getOwnPropertyDescriptor(g,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,g,_,v);else for(var x=b.length-1;x>=0;x--)(S=b[x])&&(R=(D<3?S(R):D>3?S(g,_,R):S(g,_))||R);return D>3&&R&&Object.defineProperty(g,_,R),R},f=this&&this.__param||function(b,g){return function(_,v){g(_,v,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const u=l(4725),y=l(844),C=l(2585);let w=a.BufferDecorationRenderer=class extends y.Disposable{constructor(b,g,_,v,S){super(),this._screenElement=b,this._bufferService=g,this._coreBrowserService=_,this._decorationService=v,this._renderService=S,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((D=>this._removeDecoration(D)))),this.register((0,y.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const b of this._decorationService.decorations)this._renderDecoration(b);this._dimensionsChanged=!1}_renderDecoration(b){this._refreshStyle(b),this._dimensionsChanged&&this._refreshXPosition(b)}_createElement(b){var v;const g=this._coreBrowserService.mainDocument.createElement("div");g.classList.add("xterm-decoration"),g.classList.toggle("xterm-decoration-top-layer",((v=b==null?void 0:b.options)==null?void 0:v.layer)==="top"),g.style.width=`${Math.round((b.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,g.style.height=(b.options.height||1)*this._renderService.dimensions.css.cell.height+"px",g.style.top=(b.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",g.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const _=b.options.x??0;return _&&_>this._bufferService.cols&&(g.style.display="none"),this._refreshXPosition(b,g),g}_refreshStyle(b){const g=b.marker.line-this._bufferService.buffers.active.ydisp;if(g<0||g>=this._bufferService.rows)b.element&&(b.element.style.display="none",b.onRenderEmitter.fire(b.element));else{let _=this._decorationElements.get(b);_||(_=this._createElement(b),b.element=_,this._decorationElements.set(b,_),this._container.appendChild(_),b.onDispose((()=>{this._decorationElements.delete(b),_.remove()}))),_.style.top=g*this._renderService.dimensions.css.cell.height+"px",_.style.display=this._altBufferIsActive?"none":"block",b.onRenderEmitter.fire(_)}}_refreshXPosition(b,g=b.element){if(!g)return;const _=b.options.x??0;(b.options.anchor||"left")==="right"?g.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":g.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(b){var g;(g=this._decorationElements.get(b))==null||g.remove(),this._decorationElements.delete(b),b.dispose()}};a.BufferDecorationRenderer=w=c([f(1,C.IBufferService),f(2,u.ICoreBrowserService),f(3,C.IDecorationService),f(4,u.IRenderService)],w)},5871:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.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(l){if(l.options.overviewRulerOptions){for(const c of this._zones)if(c.color===l.options.overviewRulerOptions.color&&c.position===l.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,l.marker.line))return;if(this._lineAdjacentToZone(c,l.marker.line,l.options.overviewRulerOptions.position))return void this._addLineToZone(c,l.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=l.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=l.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=l.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=l.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:l.options.overviewRulerOptions.color,position:l.options.overviewRulerOptions.position,startBufferLine:l.marker.line,endBufferLine:l.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(l){this._linePadding=l}_lineIntersectsZone(l,c){return c>=l.startBufferLine&&c<=l.endBufferLine}_lineAdjacentToZone(l,c,f){return c>=l.startBufferLine-this._linePadding[f||"full"]&&c<=l.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(l,c){l.startBufferLine=Math.min(l.startBufferLine,c),l.endBufferLine=Math.max(l.endBufferLine,c)}}},5744:function(p,a,l){var c=this&&this.__decorate||function(S,D,R,x){var M,k=arguments.length,L=k<3?D:x===null?x=Object.getOwnPropertyDescriptor(D,R):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,D,R,x);else for(var T=S.length-1;T>=0;T--)(M=S[T])&&(L=(k<3?M(L):k>3?M(D,R,L):M(D,R))||L);return k>3&&L&&Object.defineProperty(D,R,L),L},f=this&&this.__param||function(S,D){return function(R,x){D(R,x,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const u=l(5871),y=l(4725),C=l(844),w=l(2585),b={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0};let v=a.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,D,R,x,M,k,L){var P;super(),this._viewportElement=S,this._screenElement=D,this._bufferService=R,this._decorationService=x,this._renderService=M,this._optionsService=k,this._coreBrowserService=L,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(P=this._viewportElement.parentElement)==null||P.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.toDisposable)((()=>{var B;(B=this._canvas)==null||B.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const S=Math.floor(this._canvas.width/3),D=Math.ceil(this._canvas.width/3);g.full=this._canvas.width,g.left=S,g.center=D,g.right=S,this._refreshDrawHeightConstants(),_.full=0,_.left=0,_.center=g.left,_.right=g.left+g.center}_refreshDrawHeightConstants(){b.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,D=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);b.left=D,b.center=D,b.right=D}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*b.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 D of this._decorationService.decorations)this._colorZoneStore.addDecoration(D);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const D of S)D.position!=="full"&&this._renderColorZone(D);for(const D of S)D.position==="full"&&this._renderColorZone(D);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(_[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-b[S.position||"full"]/2),g[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+b[S.position||"full"]))}_queueRefresh(S,D){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=D||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=v=c([f(2,w.IBufferService),f(3,w.IDecorationService),f(4,y.IRenderService),f(5,w.IOptionsService),f(6,y.ICoreBrowserService)],v)},2950:function(p,a,l){var c=this&&this.__decorate||function(b,g,_,v){var S,D=arguments.length,R=D<3?g:v===null?v=Object.getOwnPropertyDescriptor(g,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,g,_,v);else for(var x=b.length-1;x>=0;x--)(S=b[x])&&(R=(D<3?S(R):D>3?S(g,_,R):S(g,_))||R);return D>3&&R&&Object.defineProperty(g,_,R),R},f=this&&this.__param||function(b,g){return function(_,v){g(_,v,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const u=l(4725),y=l(2585),C=l(2584);let w=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(b,g,_,v,S,D){this._textarea=b,this._compositionView=g,this._bufferService=_,this._optionsService=v,this._coreService=S,this._renderService=D,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(b){this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(b){if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){const g={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let _;this._isSendingComposition=!1,g.start+=this._dataAlreadySent.length,_=this._isComposing?this._textarea.value.substring(g.start,g.end):this._textarea.value.substring(g.start),_.length>0&&this._coreService.triggerDataEvent(_,!0)}}),0)}else{this._isSendingComposition=!1;const g=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(g,!0)}}_handleAnyTextareaChanges(){const b=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const g=this._textarea.value,_=g.replace(b,"");this._dataAlreadySent=_,g.length>b.length?this._coreService.triggerDataEvent(_,!0):g.length<b.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):g.length===b.length&&g!==b&&this._coreService.triggerDataEvent(g,!0)}}),0)}updateCompositionElements(b){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const g=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),_=this._renderService.dimensions.css.cell.height,v=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=g*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=v+"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 D=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=v+"px",this._textarea.style.width=Math.max(D.width,1)+"px",this._textarea.style.height=Math.max(D.height,1)+"px",this._textarea.style.lineHeight=D.height+"px"}b||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=w=c([f(2,y.IBufferService),f(3,y.IOptionsService),f(4,y.ICoreService),f(5,u.IRenderService)],w)},9806:(p,a)=>{function l(c,f,u){const y=u.getBoundingClientRect(),C=c.getComputedStyle(u),w=parseInt(C.getPropertyValue("padding-left")),b=parseInt(C.getPropertyValue("padding-top"));return[f.clientX-y.left-w,f.clientY-y.top-b]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=l,a.getCoords=function(c,f,u,y,C,w,b,g,_){if(!w)return;const v=l(c,f,u);return v?(v[0]=Math.ceil((v[0]+(_?b/2:0))/b),v[1]=Math.ceil(v[1]/g),v[0]=Math.min(Math.max(v[0],1),y+(_?1:0)),v[1]=Math.min(Math.max(v[1],1),C),v):void 0}},9504:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const c=l(2584);function f(g,_,v,S){const D=g-u(g,v),R=_-u(_,v),x=Math.abs(D-R)-(function(M,k,L){let T=0;const P=M-u(M,L),B=k-u(k,L);for(let F=0;F<Math.abs(P-B);F++){const $=y(M,k)==="A"?-1:1,q=L.buffer.lines.get(P+$*F);q!=null&&q.isWrapped&&T++}return T})(g,_,v);return b(x,w(y(g,_),S))}function u(g,_){let v=0,S=_.buffer.lines.get(g),D=S==null?void 0:S.isWrapped;for(;D&&g>=0&&g<_.rows;)v++,S=_.buffer.lines.get(--g),D=S==null?void 0:S.isWrapped;return v}function y(g,_){return g>_?"A":"B"}function C(g,_,v,S,D,R){let x=g,M=_,k="";for(;x!==v||M!==S;)x+=D?1:-1,D&&x>R.cols-1?(k+=R.buffer.translateBufferLineToString(M,!1,g,x),x=0,g=0,M++):!D&&x<0&&(k+=R.buffer.translateBufferLineToString(M,!1,0,g+1),x=R.cols-1,g=x,M--);return k+R.buffer.translateBufferLineToString(M,!1,g,x)}function w(g,_){const v=_?"O":"[";return c.C0.ESC+v+g}function b(g,_){g=Math.floor(g);let v="";for(let S=0;S<g;S++)v+=_;return v}a.moveToCellSequence=function(g,_,v,S){const D=v.buffer.x,R=v.buffer.y;if(!v.buffer.hasScrollback)return(function(k,L,T,P,B,F){return f(L,P,B,F).length===0?"":b(C(k,L,k,L-u(L,B),!1,B).length,w("D",F))})(D,R,0,_,v,S)+f(R,_,v,S)+(function(k,L,T,P,B,F){let $;$=f(L,P,B,F).length>0?P-u(P,B):L;const q=P,W=(function(K,X,U,O,z,j){let H;return H=f(U,O,z,j).length>0?O-u(O,z):X,K<U&&H<=O||K>=U&&H<O?"C":"D"})(k,L,T,P,B,F);return b(C(k,$,T,q,W==="C",B).length,w(W,F))})(D,R,g,_,v,S);let x;if(R===_)return x=D>g?"D":"C",b(Math.abs(D-g),w(x,S));x=R>_?"D":"C";const M=Math.abs(R-_);return b((function(k,L){return L.cols-k})(R>_?g:D,v)+(M-1)*v.cols+1+((R>_?D:g)-1),w(x,S))}},1296:function(p,a,l){var c=this&&this.__decorate||function(F,$,q,W){var K,X=arguments.length,U=X<3?$:W===null?W=Object.getOwnPropertyDescriptor($,q):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(F,$,q,W);else for(var O=F.length-1;O>=0;O--)(K=F[O])&&(U=(X<3?K(U):X>3?K($,q,U):K($,q))||U);return X>3&&U&&Object.defineProperty($,q,U),U},f=this&&this.__param||function(F,$){return function(q,W){$(q,W,F)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const u=l(3787),y=l(2550),C=l(2223),w=l(6171),b=l(6052),g=l(4725),_=l(8055),v=l(8460),S=l(844),D=l(2585),R="xterm-dom-renderer-owner-",x="xterm-rows",M="xterm-fg-",k="xterm-bg-",L="xterm-focus",T="xterm-selection";let P=1,B=a.DomRenderer=class extends S.Disposable{constructor(F,$,q,W,K,X,U,O,z,j,H,ee,he){super(),this._terminal=F,this._document=$,this._element=q,this._screenElement=W,this._viewportElement=K,this._helperContainer=X,this._linkifier2=U,this._charSizeService=z,this._optionsService=j,this._bufferService=H,this._coreBrowserService=ee,this._themeService=he,this._terminalClass=P++,this._rowElements=[],this._selectionRenderModel=(0,b.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new v.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(x),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((se=>this._injectCss(se)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((se=>this._handleLinkHover(se)))),this.register(this._linkifier2.onHideLinkUnderline((se=>this._handleLinkLeave(se)))),this.register((0,S.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const q of this._rowElements)q.style.width=`${this.dimensions.css.canvas.width}px`,q.style.height=`${this.dimensions.css.cell.height}px`,q.style.lineHeight=`${this.dimensions.css.cell.height}px`,q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${x} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${x} .xterm-dim { color: ${_.color.multiplyOpacity(F.foreground,.5).css};}`,$+=`${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 q=`blink_underline_${this._terminalClass}`,W=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;$+=`@keyframes ${q} { 50% { border-bottom-style: hidden; }}`,$+=`@keyframes ${W} { 50% { box-shadow: none; }}`,$+=`@keyframes ${K} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,$+=`${this._terminalSelector} .${x}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${x}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${x}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[X,U]of F.ansi.entries())$+=`${this._terminalSelector} .${M}${X} { color: ${U.css}; }${this._terminalSelector} .${M}${X}.xterm-dim { color: ${_.color.multiplyOpacity(U,.5).css}; }${this._terminalSelector} .${k}${X} { background-color: ${U.css}; }`;$+=`${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR} { color: ${_.color.opaque(F.background).css}; }${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${_.color.multiplyOpacity(_.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${k}${C.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,$){for(let q=this._rowElements.length;q<=$;q++){const W=this._document.createElement("div");this._rowContainer.appendChild(W),this._rowElements.push(W)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,$){this._refreshRowElements(F,$),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,$,q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,$,q),this.renderRows(0,this._bufferService.rows-1),!F||!$)return;this._selectionRenderModel.update(this._terminal,F,$,q);const W=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,U=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||U<0)return;const O=this._document.createDocumentFragment();if(q){const z=F[0]>$[0];O.appendChild(this._createSelectionElement(X,z?$[0]:F[0],z?F[0]:$[0],U-X+1))}else{const z=W===X?F[0]:0,j=X===K?$[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(X,z,j));const H=U-X-1;if(O.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,H)),X!==U){const ee=K===U?$[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(U,0,ee))}}this._selectionContainer.appendChild(O)}_createSelectionElement(F,$,q,W=1){const K=this._document.createElement("div"),X=$*this.dimensions.css.cell.width;let U=this.dimensions.css.cell.width*(q-$);return X+U>this.dimensions.css.canvas.width&&(U=this.dimensions.css.canvas.width-X),K.style.height=W*this.dimensions.css.cell.height+"px",K.style.top=F*this.dimensions.css.cell.height+"px",K.style.left=`${X}px`,K.style.width=`${U}px`,K}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const F of this._rowElements)F.replaceChildren()}renderRows(F,$){const q=this._bufferService.buffer,W=q.ybase+q.y,K=Math.min(q.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,U=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let z=F;z<=$;z++){const j=z+q.ydisp,H=this._rowElements[z],ee=q.lines.get(j);if(!H||!ee)break;H.replaceChildren(...this._rowFactory.createRow(ee,j,j===W,U,O,K,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,$,q,W,K,X){q<0&&(F=0),W<0&&($=0);const U=this._bufferService.rows-1;q=Math.max(Math.min(q,U),0),W=Math.max(Math.min(W,U),0),K=Math.min(K,this._bufferService.cols);const O=this._bufferService.buffer,z=O.ybase+O.y,j=Math.min(O.x,K-1),H=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=q;se<=W;++se){const Z=se+O.ydisp,G=this._rowElements[se],re=O.lines.get(Z);if(!G||!re)break;G.replaceChildren(...this._rowFactory.createRow(re,Z,Z===z,ee,he,j,H,this.dimensions.css.cell.width,this._widthCache,X?se===q?F:0:-1,X?(se===W?$:K)-1:-1))}}};a.DomRenderer=B=c([f(7,D.IInstantiationService),f(8,g.ICharSizeService),f(9,D.IOptionsService),f(10,D.IBufferService),f(11,g.ICoreBrowserService),f(12,g.IThemeService)],B)},3787:function(p,a,l){var c=this&&this.__decorate||function(x,M,k,L){var T,P=arguments.length,B=P<3?M:L===null?L=Object.getOwnPropertyDescriptor(M,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(x,M,k,L);else for(var F=x.length-1;F>=0;F--)(T=x[F])&&(B=(P<3?T(B):P>3?T(M,k,B):T(M,k))||B);return P>3&&B&&Object.defineProperty(M,k,B),B},f=this&&this.__param||function(x,M){return function(k,L){M(k,L,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const u=l(2223),y=l(643),C=l(511),w=l(2585),b=l(8055),g=l(4725),_=l(4269),v=l(6171),S=l(3734);let D=a.DomRendererRowFactory=class{constructor(x,M,k,L,T,P,B){this._document=x,this._characterJoinerService=M,this._optionsService=k,this._coreBrowserService=L,this._coreService=T,this._decorationService=P,this._themeService=B,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,M,k){this._selectionStart=x,this._selectionEnd=M,this._columnSelectMode=k}createRow(x,M,k,L,T,P,B,F,$,q,W){const K=[],X=this._characterJoinerService.getJoinedCharacters(M),U=this._themeService.colors;let O,z=x.getNoBgTrimmedLength();k&&z<P+1&&(z=P+1);let j=0,H="",ee=0,he=0,se=0,Z=!1,G=0,re=!1,ne=0;const ve=[],me=q!==-1&&W!==-1;for(let Te=0;Te<z;Te++){x.loadCell(Te,this._workCell);let xe=this._workCell.getWidth();if(xe===0)continue;let Ve=!1,Me=Te,ke=this._workCell;if(X.length>0&&Te===X[0][0]){Ve=!0;const He=X.shift();ke=new _.JoinedCellData(this._workCell,x.translateToString(!0,He[0],He[1]),He[1]-He[0]),Me=He[1]-1,xe=ke.getWidth()}const Bt=this._isCellInSelection(Te,M),Gt=k&&Te===P,$e=me&&Te>=q&&Te<=W;let Ke=!1;this._decorationService.forEachDecorationAtCell(Te,M,void 0,(He=>{Ke=!0}));let Ye=ke.getChars()||y.WHITESPACE_CELL_CHAR;if(Ye===" "&&(ke.isUnderline()||ke.isOverline())&&(Ye=" "),ne=xe*F-$.get(Ye,ke.isBold(),ke.isItalic()),O){if(j&&(Bt&&re||!Bt&&!re&&ke.bg===ee)&&(Bt&&re&&U.selectionForeground||ke.fg===he)&&ke.extended.ext===se&&$e===Z&&ne===G&&!Gt&&!Ve&&!Ke){ke.isInvisible()?H+=y.WHITESPACE_CELL_CHAR:H+=Ye,j++;continue}j&&(O.textContent=H),O=this._document.createElement("span"),j=0,H=""}else O=this._document.createElement("span");if(ee=ke.bg,he=ke.fg,se=ke.extended.ext,Z=$e,G=ne,re=Bt,Ve&&P>=Te&&P<=Me&&(P=Te),!this._coreService.isCursorHidden&&Gt&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&ve.push("xterm-cursor-blink"),ve.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(ke.isBold()&&ve.push("xterm-bold"),ke.isItalic()&&ve.push("xterm-italic"),ke.isDim()&&ve.push("xterm-dim"),H=ke.isInvisible()?y.WHITESPACE_CELL_CHAR:ke.getChars()||y.WHITESPACE_CELL_CHAR,ke.isUnderline()&&(ve.push(`xterm-underline-${ke.extended.underlineStyle}`),H===" "&&(H=" "),!ke.isUnderlineColorDefault()))if(ke.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(ke.getUnderlineColor()).join(",")})`;else{let He=ke.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ke.isBold()&&He<8&&(He+=8),O.style.textDecorationColor=U.ansi[He].css}ke.isOverline()&&(ve.push("xterm-overline"),H===" "&&(H=" ")),ke.isStrikethrough()&&ve.push("xterm-strikethrough"),$e&&(O.style.textDecoration="underline");let De=ke.getFgColor(),Ne=ke.getFgColorMode(),_t=ke.getBgColor(),le=ke.getBgColorMode();const _e=!!ke.isInverse();if(_e){const He=De;De=_t,_t=He;const Ft=Ne;Ne=le,le=Ft}let Ae,Fe,ze,qe=!1;switch(this._decorationService.forEachDecorationAtCell(Te,M,void 0,(He=>{He.options.layer!=="top"&&qe||(He.backgroundColorRGB&&(le=50331648,_t=He.backgroundColorRGB.rgba>>8&16777215,Ae=He.backgroundColorRGB),He.foregroundColorRGB&&(Ne=50331648,De=He.foregroundColorRGB.rgba>>8&16777215,Fe=He.foregroundColorRGB),qe=He.options.layer==="top")})),!qe&&Bt&&(Ae=this._coreBrowserService.isFocused?U.selectionBackgroundOpaque:U.selectionInactiveBackgroundOpaque,_t=Ae.rgba>>8&16777215,le=50331648,qe=!0,U.selectionForeground&&(Ne=50331648,De=U.selectionForeground.rgba>>8&16777215,Fe=U.selectionForeground)),qe&&ve.push("xterm-decoration-top"),le){case 16777216:case 33554432:ze=U.ansi[_t],ve.push(`xterm-bg-${_t}`);break;case 50331648:ze=b.channels.toColor(_t>>16,_t>>8&255,255&_t),this._addStyle(O,`background-color:#${R((_t>>>0).toString(16),"0",6)}`);break;default:_e?(ze=U.foreground,ve.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):ze=U.background}switch(Ae||ke.isDim()&&(Ae=b.color.multiplyOpacity(ze,.5)),Ne){case 16777216:case 33554432:ke.isBold()&&De<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(De+=8),this._applyMinimumContrast(O,ze,U.ansi[De],ke,Ae,void 0)||ve.push(`xterm-fg-${De}`);break;case 50331648:const He=b.channels.toColor(De>>16&255,De>>8&255,255&De);this._applyMinimumContrast(O,ze,He,ke,Ae,Fe)||this._addStyle(O,`color:#${R(De.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,ze,U.foreground,ke,Ae,Fe)||_e&&ve.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}ve.length&&(O.className=ve.join(" "),ve.length=0),Gt||Ve||Ke?O.textContent=H:j++,ne!==this.defaultSpacing&&(O.style.letterSpacing=`${ne}px`),K.push(O),Te=Me}return O&&j&&(O.textContent=H),K}_applyMinimumContrast(x,M,k,L,T,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const B=this._getContrastCache(L);let F;if(T||P||(F=B.getColor(M.rgba,k.rgba)),F===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);F=b.color.ensureContrastRatio(T||M,P||k,$),B.setColor((T||M).rgba,(P||k).rgba,F??null)}return!!F&&(this._addStyle(x,`color:${F.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,M){x.setAttribute("style",`${x.getAttribute("style")||""}${M};`)}_isCellInSelection(x,M){const k=this._selectionStart,L=this._selectionEnd;return!(!k||!L)&&(this._columnSelectMode?k[0]<=L[0]?x>=k[0]&&M>=k[1]&&x<L[0]&&M<=L[1]:x<k[0]&&M>=k[1]&&x>=L[0]&&M<=L[1]:M>k[1]&&M<L[1]||k[1]===L[1]&&M===k[1]&&x>=k[0]&&x<L[0]||k[1]<L[1]&&M===L[1]&&x<L[0]||k[1]<L[1]&&M===k[1]&&x>=k[0])}};function R(x,M,k){for(;x.length<k;)x=M+x;return x}a.DomRendererRowFactory=D=c([f(1,g.ICharacterJoinerService),f(2,w.IOptionsService),f(3,g.ICoreBrowserService),f(4,w.ICoreService),f(5,w.IDecorationService),f(6,g.IThemeService)],D)},2550:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(l,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=l.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 f=l.createElement("span");f.classList.add("xterm-char-measure-element");const u=l.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const y=l.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const C=l.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[f,u,y,C],this._container.appendChild(f),this._container.appendChild(u),this._container.appendChild(y),this._container.appendChild(C),c.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(l,c,f,u){l===this._font&&c===this._fontSize&&f===this._weight&&u===this._weightBold||(this._font=l,this._fontSize=c,this._weight=f,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(l,c,f){let u=0;if(!c&&!f&&l.length===1&&(u=l.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const w=this._measure(l,0);return w>0&&(this._flat[u]=w),w}let y=l;c&&(y+="B"),f&&(y+="I");let C=this._holey.get(y);if(C===void 0){let w=0;c&&(w|=1),f&&(w|=2),C=this._measure(l,w),C>0&&this._holey.set(y,C)}return C}_measure(l,c){const f=this._measureElements[c];return f.textContent=l.repeat(32),f.offsetWidth/32}}},2223:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const c=l(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(p,a)=>{function l(f){return 57508<=f&&f<=57558}function c(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},a.isPowerlineGlyph=l,a.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},a.isEmoji=c,a.allowRescaling=function(f,u,y,C){return u===1&&y>Math.ceil(1.5*C)&&f!==void 0&&f>255&&!c(f)&&!l(f)&&!(function(w){return 57344<=w&&w<=63743})(f)},a.treatGlyphAsBackgroundColor=function(f){return l(f)||(function(u){return 9472<=u&&u<=9631})(f)},a.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}}}},a.computeNextVariantOffset=function(f,u,y=0){return(f-(2*Math.round(u)-y))%(2*Math.round(u))}},6052:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class l{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(f,u,y,C=!1){if(this.selectionStart=u,this.selectionEnd=y,!u||!y||u[0]===y[0]&&u[1]===y[1])return void this.clear();const w=f.buffers.active.ydisp,b=u[1]-w,g=y[1]-w,_=Math.max(b,0),v=Math.min(g,f.rows-1);_>=f.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=b,this.viewportEndRow=g,this.viewportCappedStartRow=_,this.viewportCappedEndRow=v,this.startCol=u[0],this.endCol=y[0])}isCellSelected(f,u,y){return!!this.hasSelection&&(y-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&y>=this.viewportCappedStartRow&&u<this.endCol&&y<=this.viewportCappedEndRow:u<this.startCol&&y>=this.viewportCappedStartRow&&u>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol)}}a.createSelectionRenderModel=function(){return new l}},456:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(l){this._bufferService=l,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 l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?l%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)-1]:[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[l,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const l=this.selectionStart[0]+this.selectionStartLength;return l>this._bufferService.cols?[l%this._bufferService.cols,this.selectionStart[1]+Math.floor(l/this._bufferService.cols)]:[Math.max(l,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const l=this.selectionStart,c=this.selectionEnd;return!(!l||!c)&&(l[1]>c[1]||l[1]===c[1]&&l[0]>c[0])}handleTrim(l){return this.selectionStart&&(this.selectionStart[1]-=l),this.selectionEnd&&(this.selectionEnd[1]-=l),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(p,a,l){var c=this&&this.__decorate||function(v,S,D,R){var x,M=arguments.length,k=M<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,S,D,R);else for(var L=v.length-1;L>=0;L--)(x=v[L])&&(k=(M<3?x(k):M>3?x(S,D,k):x(S,D))||k);return M>3&&k&&Object.defineProperty(S,D,k),k},f=this&&this.__param||function(v,S){return function(D,R){S(D,R,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const u=l(2585),y=l(8460),C=l(844);let w=a.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(v,S,D){super(),this._optionsService=D,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new _(this._optionsService))}catch{this._measureStrategy=this.register(new g(v,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const v=this._measureStrategy.measure();v.width===this.width&&v.height===this.height||(this.width=v.width,this.height=v.height,this._onCharSizeChange.fire())}};a.CharSizeService=w=c([f(2,u.IOptionsService)],w);class b extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,D){S!==void 0&&S>0&&D!==void 0&&D>0&&(this._result.width=S,this._result.height=D)}}class g extends b{constructor(S,D,R){super(),this._document=S,this._parentElement=D,this._optionsService=R,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 b{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const D=this._ctx.measureText("W");if(!("width"in D&&"fontBoundingBoxAscent"in D&&"fontBoundingBoxDescent"in D))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(p,a,l){var c=this&&this.__decorate||function(_,v,S,D){var R,x=arguments.length,M=x<3?v:D===null?D=Object.getOwnPropertyDescriptor(v,S):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(_,v,S,D);else for(var k=_.length-1;k>=0;k--)(R=_[k])&&(M=(x<3?R(M):x>3?R(v,S,M):R(v,S))||M);return x>3&&M&&Object.defineProperty(v,S,M),M},f=this&&this.__param||function(_,v){return function(S,D){v(S,D,_)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const u=l(3734),y=l(643),C=l(511),w=l(2585);class b extends u.AttributeData{constructor(v,S,D){super(),this.content=0,this.combinedData="",this.fg=v.fg,this.bg=v.bg,this.combinedData=S,this._width=D}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(v){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=b;let g=a.CharacterJoinerService=class yb{constructor(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(v){const S={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(S),S.id}deregister(v){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===v)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(v){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(v);if(!S||S.length===0)return[];const D=[],R=S.translateToString(!0);let x=0,M=0,k=0,L=S.getFg(0),T=S.getBg(0);for(let P=0;P<S.getTrimmedLength();P++)if(S.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==T){if(P-x>1){const B=this._getJoinedRanges(R,k,M,S,x);for(let F=0;F<B.length;F++)D.push(B[F])}x=P,k=M,L=this._workCell.fg,T=this._workCell.bg}M+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const P=this._getJoinedRanges(R,k,M,S,x);for(let B=0;B<P.length;B++)D.push(P[B])}return D}_getJoinedRanges(v,S,D,R,x){const M=v.substring(S,D);let k=[];try{k=this._characterJoiners[0].handler(M)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const T=this._characterJoiners[L].handler(M);for(let P=0;P<T.length;P++)yb._mergeRanges(k,T[P])}catch(T){console.error(T)}return this._stringRangesToCellRanges(k,R,x),k}_stringRangesToCellRanges(v,S,D){let R=0,x=!1,M=0,k=v[R];if(k){for(let L=D;L<this._bufferService.cols;L++){const T=S.getWidth(L),P=S.getString(L).length||y.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!x&&k[0]<=M&&(k[0]=L,x=!0),k[1]<=M){if(k[1]=L,k=v[++R],!k)break;k[0]<=M?(k[0]=L,x=!0):x=!1}M+=P}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(v,S){let D=!1;for(let R=0;R<v.length;R++){const x=v[R];if(D){if(S[1]<=x[0])return v[R-1][1]=S[1],v;if(S[1]<=x[1])return v[R-1][1]=Math.max(S[1],x[1]),v.splice(R,1),v;v.splice(R,1),R--}else{if(S[1]<=x[0])return v.splice(R,0,S),v;if(S[1]<=x[1])return x[0]=Math.min(S[0],x[0]),v;S[0]<x[1]&&(x[0]=Math.min(S[0],x[0]),D=!0)}}return D?v[v.length-1][1]=S[1]:v.push(S),v}};a.CharacterJoinerService=g=c([f(0,w.IBufferService)],g)},5114:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const c=l(844),f=l(8460),u=l(3656);class y extends c.Disposable{constructor(b,g,_){super(),this._textarea=b,this._window=g,this.mainDocument=_,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((v=>this._screenDprMonitor.setWindow(v)))),this.register((0,f.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(b){this._window!==b&&(this._window=b,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}}a.CoreBrowserService=y;class C extends c.Disposable{constructor(b){super(),this._parentWindow=b,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(b){this._parentWindow=b,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var b;this._outerListener&&((b=this._resolutionMediaMatchList)==null||b.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:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const c=l(844);class f extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const C=this.linkProviders.indexOf(y);C!==-1&&this.linkProviders.splice(C,1)}}}}a.LinkProviderService=f},8934:function(p,a,l){var c=this&&this.__decorate||function(w,b,g,_){var v,S=arguments.length,D=S<3?b:_===null?_=Object.getOwnPropertyDescriptor(b,g):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,b,g,_);else for(var R=w.length-1;R>=0;R--)(v=w[R])&&(D=(S<3?v(D):S>3?v(b,g,D):v(b,g))||D);return S>3&&D&&Object.defineProperty(b,g,D),D},f=this&&this.__param||function(w,b){return function(g,_){b(g,_,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const u=l(4725),y=l(9806);let C=a.MouseService=class{constructor(w,b){this._renderService=w,this._charSizeService=b}getCoords(w,b,g,_,v){return(0,y.getCoords)(window,w,b,g,_,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,v)}getMouseReportCoords(w,b){const g=(0,y.getCoordsRelativeToElement)(window,w,b);if(this._charSizeService.hasValidSize)return g[0]=Math.min(Math.max(g[0],0),this._renderService.dimensions.css.canvas.width-1),g[1]=Math.min(Math.max(g[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(g[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(g[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(g[0]),y:Math.floor(g[1])}}};a.MouseService=C=c([f(0,u.IRenderService),f(1,u.ICharSizeService)],C)},3230:function(p,a,l){var c=this&&this.__decorate||function(v,S,D,R){var x,M=arguments.length,k=M<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,S,D,R);else for(var L=v.length-1;L>=0;L--)(x=v[L])&&(k=(M<3?x(k):M>3?x(S,D,k):x(S,D))||k);return M>3&&k&&Object.defineProperty(S,D,k),k},f=this&&this.__param||function(v,S){return function(D,R){S(D,R,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const u=l(6193),y=l(4725),C=l(8460),w=l(844),b=l(7226),g=l(2585);let _=a.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,S,D,R,x,M,k,L){super(),this._rowCount=v,this._charSizeService=R,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new b.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((T,P)=>this._renderRows(T,P)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(D.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(x.onDecorationRegistered((()=>this._fullRefresh()))),this.register(x.onDecorationRemoved((()=>this._fullRefresh()))),this.register(D.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(D.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,S),this.register(k.onWindowChange((T=>this._registerIntersectionObserver(T,S))))}_registerIntersectionObserver(v,S){if("IntersectionObserver"in v){const D=new v.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});D.observe(S),this._observerDisposable.value=(0,w.toDisposable)((()=>D.disconnect()))}}_handleIntersectionChange(v){this._isPaused=v.isIntersecting===void 0?v.intersectionRatio===0:!v.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(v,S,D=!1){this._isPaused?this._needsFullRefresh=!0:(D||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,S,this._rowCount))}_renderRows(v,S){this._renderer.value&&(v=Math.min(v,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(v,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:v,end:S}),this._onRender.fire({start:v,end:S}),this._isNextRenderRedrawOnly=!0)}resize(v,S){this._rowCount=S,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(v){this._renderer.value=v,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(v){return this._renderDebouncer.addRefreshCallback(v)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var v,S;this._renderer.value&&((S=(v=this._renderer.value).clearTextureAtlas)==null||S.call(v),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(v,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var D;return(D=this._renderer.value)==null?void 0:D.handleResize(v,S)})):this._renderer.value.handleResize(v,S),this._fullRefresh())}handleCharSizeChanged(){var v;(v=this._renderer.value)==null||v.handleCharSizeChanged()}handleBlur(){var v;(v=this._renderer.value)==null||v.handleBlur()}handleFocus(){var v;(v=this._renderer.value)==null||v.handleFocus()}handleSelectionChanged(v,S,D){var R;this._selectionState.start=v,this._selectionState.end=S,this._selectionState.columnSelectMode=D,(R=this._renderer.value)==null||R.handleSelectionChanged(v,S,D)}handleCursorMove(){var v;(v=this._renderer.value)==null||v.handleCursorMove()}clear(){var v;(v=this._renderer.value)==null||v.clear()}};a.RenderService=_=c([f(2,g.IOptionsService),f(3,y.ICharSizeService),f(4,g.IDecorationService),f(5,g.IBufferService),f(6,y.ICoreBrowserService),f(7,y.IThemeService)],_)},9312:function(p,a,l){var c=this&&this.__decorate||function(k,L,T,P){var B,F=arguments.length,$=F<3?L:P===null?P=Object.getOwnPropertyDescriptor(L,T):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(k,L,T,P);else for(var q=k.length-1;q>=0;q--)(B=k[q])&&($=(F<3?B($):F>3?B(L,T,$):B(L,T))||$);return F>3&&$&&Object.defineProperty(L,T,$),$},f=this&&this.__param||function(k,L){return function(T,P){L(T,P,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const u=l(9806),y=l(9504),C=l(456),w=l(4725),b=l(8460),g=l(844),_=l(6114),v=l(4841),S=l(511),D=l(2585),R=" ",x=new RegExp(R,"g");let M=a.SelectionService=class extends g.Disposable{constructor(k,L,T,P,B,F,$,q,W){super(),this._element=k,this._screenElement=L,this._linkifier=T,this._bufferService=P,this._coreService=B,this._mouseService=F,this._optionsService=$,this._renderService=q,this._coreBrowserService=W,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new b.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new b.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,g.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const k=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!k||!L||k[0]===L[0]&&k[1]===L[1])}get selectionText(){const k=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!k||!L)return"";const T=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(k[0]===L[0])return"";const B=k[0]<L[0]?k[0]:L[0],F=k[0]<L[0]?L[0]:k[0];for(let $=k[1];$<=L[1];$++){const q=T.translateBufferLineToString($,!0,B,F);P.push(q)}}else{const B=k[1]===L[1]?L[0]:void 0;P.push(T.translateBufferLineToString(k[1],!0,k[0],B));for(let F=k[1]+1;F<=L[1]-1;F++){const $=T.lines.get(F),q=T.translateBufferLineToString(F,!0);$!=null&&$.isWrapped?P[P.length-1]+=q:P.push(q)}if(k[1]!==L[1]){const F=T.lines.get(L[1]),$=T.translateBufferLineToString(L[1],!0,0,L[0]);F&&F.isWrapped?P[P.length-1]+=$:P.push($)}}return P.map((B=>B.replace(x," "))).join(_.isWindows?`\r
90
- `:`
91
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&k&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(k){const L=this._getMouseBufferCoords(k),T=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(T&&P&&L)&&this._areCoordsInSelection(L,T,P)}isCellInSelection(k,L){const T=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!T||!P)&&this._areCoordsInSelection([k,L],T,P)}_areCoordsInSelection(k,L,T){return k[1]>L[1]&&k[1]<T[1]||L[1]===T[1]&&k[1]===L[1]&&k[0]>=L[0]&&k[0]<T[0]||L[1]<T[1]&&k[1]===T[1]&&k[0]<T[0]||L[1]<T[1]&&k[1]===L[1]&&k[0]>=L[0]}_selectWordAtCursor(k,L){var B,F;const T=(F=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:F.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(k);return!!P&&(this._selectWordAt(P,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,L){this._model.clearSelection(),k=Math.max(k,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const L=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(k){let L=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=T?0:(L>T&&(L-=T),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(k){return _.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const L=this._getMouseBufferCoords(k);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(k){return k.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const P=T.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const L=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const P=(0,y.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,T=!(!k||!L||k[0]===L[0]&&k[1]===L[1]);T?k&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,L,T)):this._oldHasSelection&&this._fireOnSelectionChange(k,L,T)}_fireOnSelectionChange(k,L,T){this._oldSelectionStart=k,this._oldSelectionEnd=L,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(k,L){let T=L;for(let P=0;L>=P;P++){const B=k.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:B>1&&L!==P&&(T+=B-1)}return T}setSelection(k,L,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,L],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,L,T=!0,P=!0){if(k[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,F=B.lines.get(k[1]);if(!F)return;const $=B.translateBufferLineToString(k[1],!1);let q=this._convertViewportColToCharacterIndex(F,k[0]),W=q;const K=k[0]-q;let X=0,U=0,O=0,z=0;if($.charAt(q)===" "){for(;q>0&&$.charAt(q-1)===" ";)q--;for(;W<$.length&&$.charAt(W+1)===" ";)W++}else{let ee=k[0],he=k[0];F.getWidth(ee)===0&&(X++,ee--),F.getWidth(he)===2&&(U++,he++);const se=F.getString(he).length;for(se>1&&(z+=se-1,W+=se-1);ee>0&&q>0&&!this._isCharWordSeparator(F.loadCell(ee-1,this._workCell));){F.loadCell(ee-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,ee--):Z>1&&(O+=Z-1,q-=Z-1),q--,ee--}for(;he<F.length&&W+1<$.length&&!this._isCharWordSeparator(F.loadCell(he+1,this._workCell));){F.loadCell(he+1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===2?(U++,he++):Z>1&&(z+=Z-1,W+=Z-1),W++,he++}}W++;let j=q+K-X+O,H=Math.min(this._bufferService.cols,W-q+X+U-O-z);if(L||$.slice(q,W).trim()!==""){if(T&&j===0&&F.getCodePoint(0)!==32){const ee=B.lines.get(k[1]-1);if(ee&&F.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(he){const se=this._bufferService.cols-he.start;j-=se,H+=se}}}if(P&&j+H===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const ee=B.lines.get(k[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const he=this._getWordAt([0,k[1]+1],!1,!1,!0);he&&(H+=he.length)}}return{start:j,length:H}}}_selectWordAt(k,L){const T=this._getWordAt(k,L);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[T.start,k[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(k){const L=this._getWordAt(k,!0);if(L){let T=k[1];for(;L.start<0;)L.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,T]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const L=this._bufferService.buffer.getWrappedRangeForLine(k),T={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,v.getRangeLength)(T,this._bufferService.cols)}};a.SelectionService=M=c([f(3,D.IBufferService),f(4,D.ICoreService),f(5,w.IMouseService),f(6,D.IOptionsService),f(7,w.IRenderService),f(8,w.ICoreBrowserService)],M)},4725:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const c=l(8343);a.ICharSizeService=(0,c.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),a.IMouseService=(0,c.createDecorator)("MouseService"),a.IRenderService=(0,c.createDecorator)("RenderService"),a.ISelectionService=(0,c.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,c.createDecorator)("ThemeService"),a.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(p,a,l){var c=this&&this.__decorate||function(M,k,L,T){var P,B=arguments.length,F=B<3?k:T===null?T=Object.getOwnPropertyDescriptor(k,L):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(M,k,L,T);else for(var $=M.length-1;$>=0;$--)(P=M[$])&&(F=(B<3?P(F):B>3?P(k,L,F):P(k,L))||F);return B>3&&F&&Object.defineProperty(k,L,F),F},f=this&&this.__param||function(M,k){return function(L,T){k(L,T,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const u=l(7239),y=l(8055),C=l(8460),w=l(844),b=l(2585),g=y.css.toColor("#ffffff"),_=y.css.toColor("#000000"),v=y.css.toColor("#ffffff"),S=y.css.toColor("#000000"),D={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let L=0;L<216;L++){const T=k[L/36%6|0],P=k[L/6%6|0],B=k[L%6];M.push({css:y.channels.toCss(T,P,B),rgba:y.channels.toRgba(T,P,B)})}for(let L=0;L<24;L++){const T=8+10*L;M.push({css:y.channels.toCss(T,T,T),rgba:y.channels.toRgba(T,T,T)})}return M})());let R=a.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:g,background:_,cursor:v,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:D,selectionBackgroundOpaque:y.color.blend(_,D),selectionInactiveBackgroundTransparent:D,selectionInactiveBackgroundOpaque:y.color.blend(_,D),ansi:a.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(M={}){const k=this._colors;if(k.foreground=x(M.foreground,g),k.background=x(M.background,_),k.cursor=x(M.cursor,v),k.cursorAccent=x(M.cursorAccent,S),k.selectionBackgroundTransparent=x(M.selectionBackground,D),k.selectionBackgroundOpaque=y.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=x(M.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=y.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=M.selectionForeground?x(M.selectionForeground,y.NULL_COLOR):void 0,k.selectionForeground===y.NULL_COLOR&&(k.selectionForeground=void 0),y.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=y.color.opacity(k.selectionBackgroundTransparent,.3)),y.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=y.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=a.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=x(M.black,a.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=x(M.red,a.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=x(M.green,a.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=x(M.yellow,a.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=x(M.blue,a.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=x(M.magenta,a.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=x(M.cyan,a.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=x(M.white,a.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=x(M.brightBlack,a.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=x(M.brightRed,a.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=x(M.brightGreen,a.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=x(M.brightYellow,a.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=x(M.brightBlue,a.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=x(M.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=x(M.brightCyan,a.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=x(M.brightWhite,a.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const L=Math.min(k.ansi.length-16,M.extendedAnsi.length);for(let T=0;T<L;T++)k.ansi[T+16]=x(M.extendedAnsi[T],a.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(M){M(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 x(M,k){if(M!==void 0)try{return y.css.toColor(M)}catch{}return k}a.ThemeService=R=c([f(0,b.IOptionsService)],R)},6349:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const c=l(8460),f=l(844);class u extends f.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(C){if(this._maxLength===C)return;const w=new Array(C);for(let b=0;b<Math.min(C,this.length);b++)w[b]=this._array[this._getCyclicIndex(b)];this._array=w,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let w=this._length;w<C;w++)this._array[w]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,w){this._array[this._getCyclicIndex(C)]=w}push(C){this._array[this._getCyclicIndex(this._length)]=C,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(C,w,...b){if(w){for(let g=C;g<this._length-w;g++)this._array[this._getCyclicIndex(g)]=this._array[this._getCyclicIndex(g+w)];this._length-=w,this.onDeleteEmitter.fire({index:C,amount:w})}for(let g=this._length-1;g>=C;g--)this._array[this._getCyclicIndex(g+b.length)]=this._array[this._getCyclicIndex(g)];for(let g=0;g<b.length;g++)this._array[this._getCyclicIndex(C+g)]=b[g];if(b.length&&this.onInsertEmitter.fire({index:C,amount:b.length}),this._length+b.length>this._maxLength){const g=this._length+b.length-this._maxLength;this._startIndex+=g,this._length=this._maxLength,this.onTrimEmitter.fire(g)}else this._length+=b.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,w,b){if(!(w<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+b<0)throw new Error("Cannot shift elements in list beyond index 0");if(b>0){for(let _=w-1;_>=0;_--)this.set(C+_+b,this.get(C+_));const g=C+w+b-this._length;if(g>0)for(this._length+=g;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let g=0;g<w;g++)this.set(C+g+b,this.get(C+g))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}a.CircularList=u},1439:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function l(c,f=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const y in c)u[y]=f<=1?c[y]:c[y]&&l(c[y],f-1);return u}},8055:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let l=0,c=0,f=0,u=0;var y,C,w,b,g;function _(S){const D=S.toString(16);return D.length<2?"0"+D:D}function v(S,D){return S<D?(D+.05)/(S+.05):(S+.05)/(D+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(D,R,x,M){return M!==void 0?`#${_(D)}${_(R)}${_(x)}${_(M)}`:`#${_(D)}${_(R)}${_(x)}`},S.toRgba=function(D,R,x,M=255){return(D<<24|R<<16|x<<8|M)>>>0},S.toColor=function(D,R,x,M){return{css:S.toCss(D,R,x,M),rgba:S.toRgba(D,R,x,M)}}})(y||(a.channels=y={})),(function(S){function D(R,x){return u=Math.round(255*x),[l,c,f]=g.toChannels(R.rgba),{css:y.toCss(l,c,f,u),rgba:y.toRgba(l,c,f,u)}}S.blend=function(R,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const M=x.rgba>>24&255,k=x.rgba>>16&255,L=x.rgba>>8&255,T=R.rgba>>24&255,P=R.rgba>>16&255,B=R.rgba>>8&255;return l=T+Math.round((M-T)*u),c=P+Math.round((k-P)*u),f=B+Math.round((L-B)*u),{css:y.toCss(l,c,f),rgba:y.toRgba(l,c,f)}},S.isOpaque=function(R){return(255&R.rgba)==255},S.ensureContrastRatio=function(R,x,M){const k=g.ensureContrastRatio(R.rgba,x.rgba,M);if(k)return y.toColor(k>>24&255,k>>16&255,k>>8&255)},S.opaque=function(R){const x=(255|R.rgba)>>>0;return[l,c,f]=g.toChannels(x),{css:y.toCss(l,c,f),rgba:x}},S.opacity=D,S.multiplyOpacity=function(R,x){return u=255&R.rgba,D(R,u*x/255)},S.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(C||(a.color=C={})),(function(S){let D,R;try{const x=document.createElement("canvas");x.width=1,x.height=1;const M=x.getContext("2d",{willReadFrequently:!0});M&&(D=M,D.globalCompositeOperation="copy",R=D.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return l=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),y.toColor(l,c,f);case 5:return l=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),y.toColor(l,c,f,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const M=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return l=parseInt(M[1]),c=parseInt(M[2]),f=parseInt(M[3]),u=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),y.toColor(l,c,f,u);if(!D||!R)throw new Error("css.toColor: Unsupported css format");if(D.fillStyle=R,D.fillStyle=x,typeof D.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(D.fillRect(0,0,1,1),[l,c,f,u]=D.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(l,c,f,u),css:x}}})(w||(a.css=w={})),(function(S){function D(R,x,M){const k=R/255,L=x/255,T=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}S.relativeLuminance=function(R){return D(R>>16&255,R>>8&255,255&R)},S.relativeLuminance2=D})(b||(a.rgb=b={})),(function(S){function D(x,M,k){const L=x>>24&255,T=x>>16&255,P=x>>8&255;let B=M>>24&255,F=M>>16&255,$=M>>8&255,q=v(b.relativeLuminance2(B,F,$),b.relativeLuminance2(L,T,P));for(;q<k&&(B>0||F>0||$>0);)B-=Math.max(0,Math.ceil(.1*B)),F-=Math.max(0,Math.ceil(.1*F)),$-=Math.max(0,Math.ceil(.1*$)),q=v(b.relativeLuminance2(B,F,$),b.relativeLuminance2(L,T,P));return(B<<24|F<<16|$<<8|255)>>>0}function R(x,M,k){const L=x>>24&255,T=x>>16&255,P=x>>8&255;let B=M>>24&255,F=M>>16&255,$=M>>8&255,q=v(b.relativeLuminance2(B,F,$),b.relativeLuminance2(L,T,P));for(;q<k&&(B<255||F<255||$<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),F=Math.min(255,F+Math.ceil(.1*(255-F))),$=Math.min(255,$+Math.ceil(.1*(255-$))),q=v(b.relativeLuminance2(B,F,$),b.relativeLuminance2(L,T,P));return(B<<24|F<<16|$<<8|255)>>>0}S.blend=function(x,M){if(u=(255&M)/255,u===1)return M;const k=M>>24&255,L=M>>16&255,T=M>>8&255,P=x>>24&255,B=x>>16&255,F=x>>8&255;return l=P+Math.round((k-P)*u),c=B+Math.round((L-B)*u),f=F+Math.round((T-F)*u),y.toRgba(l,c,f)},S.ensureContrastRatio=function(x,M,k){const L=b.relativeLuminance(x>>8),T=b.relativeLuminance(M>>8);if(v(L,T)<k){if(T<L){const F=D(x,M,k),$=v(L,b.relativeLuminance(F>>8));if($<k){const q=R(x,M,k);return $>v(L,b.relativeLuminance(q>>8))?F:q}return F}const P=R(x,M,k),B=v(L,b.relativeLuminance(P>>8));if(B<k){const F=D(x,M,k);return B>v(L,b.relativeLuminance(F>>8))?P:F}return P}},S.reduceLuminance=D,S.increaseLuminance=R,S.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}})(g||(a.rgba=g={})),a.toPaddedHex=_,a.contrastRatio=v},8969:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const c=l(844),f=l(2585),u=l(4348),y=l(7866),C=l(744),w=l(7302),b=l(6975),g=l(8460),_=l(1753),v=l(1480),S=l(7994),D=l(9282),R=l(5435),x=l(5981),M=l(2660);let k=!1;class L extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new g.EventEmitter),this._onScroll.event((P=>{var B;(B=this._onScrollApi)==null||B.fire(P.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(P){for(const B in P)this.optionsService.options[B]=P[B]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new g.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new w.OptionsService(P)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(y.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(b.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,g.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,g.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,g.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,g.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((B=>{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((B=>{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 x.WriteBuffer(((B,F)=>this._inputHandler.parse(B,F)))),this.register((0,g.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,B){this._writeBuffer.write(P,B)}writeSync(P,B){this._logService.logLevel<=f.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(P,B)}input(P,B=!0){this.coreService.triggerDataEvent(P,B)}resize(P,B){isNaN(P)||isNaN(B)||(P=Math.max(P,C.MINIMUM_COLS),B=Math.max(B,C.MINIMUM_ROWS),this._bufferService.resize(P,B))}scroll(P,B=!1){this._bufferService.scroll(P,B)}scrollLines(P,B,F){this._bufferService.scrollLines(P,B,F)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const B=P-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(P,B){return this._inputHandler.registerEscHandler(P,B)}registerDcsHandler(P,B){return this._inputHandler.registerDcsHandler(P,B)}registerCsiHandler(P,B){return this._inputHandler.registerCsiHandler(P,B)}registerOscHandler(P,B){return this._inputHandler.registerOscHandler(P,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?P=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(D.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,D.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const B of P)B.dispose()}))}}}a.CoreTerminal=L},8460:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,c){return l((f=>c.fire(f)))},a.runAndSubscribe=function(l,c){return c(void 0),l((f=>c(f)))}},5435:function(p,a,l){var c=this&&this.__decorate||function(X,U,O,z){var j,H=arguments.length,ee=H<3?U:z===null?z=Object.getOwnPropertyDescriptor(U,O):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(X,U,O,z);else for(var he=X.length-1;he>=0;he--)(j=X[he])&&(ee=(H<3?j(ee):H>3?j(U,O,ee):j(U,O))||ee);return H>3&&ee&&Object.defineProperty(U,O,ee),ee},f=this&&this.__param||function(X,U){return function(O,z){U(O,z,X)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const u=l(2584),y=l(7116),C=l(2015),w=l(844),b=l(482),g=l(8437),_=l(8460),v=l(643),S=l(511),D=l(3734),R=l(2585),x=l(1480),M=l(6242),k=l(6351),L=l(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function B(X,U){if(X>24)return U.setWinLines||!1;switch(X){case 1:return!!U.restoreWin;case 2:return!!U.minimizeWin;case 3:return!!U.setWinPosition;case 4:return!!U.setWinSizePixels;case 5:return!!U.raiseWin;case 6:return!!U.lowerWin;case 7:return!!U.refreshWin;case 8:return!!U.setWinSizeChars;case 9:return!!U.maximizeWin;case 10:return!!U.fullscreenWin;case 11:return!!U.getWinState;case 13:return!!U.getWinPosition;case 14:return!!U.getWinSizePixels;case 15:return!!U.getScreenSizePixels;case 16:return!!U.getCellSizePixels;case 18:return!!U.getWinSizeChars;case 19:return!!U.getScreenSizeChars;case 20:return!!U.getIconTitle;case 21:return!!U.getWinTitle;case 22:return!!U.pushTitle;case 23:return!!U.popTitle;case 24:return!!U.setWinLines}return!1}var F;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(a.WindowsOptionsReportType=F={}));let $=0;class q extends w.Disposable{getAttrData(){return this._curAttrData}constructor(U,O,z,j,H,ee,he,se,Z=new C.EscapeSequenceParser){super(),this._bufferService=U,this._charsetService=O,this._coreService=z,this._logService=j,this._optionsService=H,this._oscLinkService=ee,this._coreMouseService=he,this._unicodeService=se,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new b.StringToUtf32,this._utf8Decoder=new b.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.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 W(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((G=>this._activeBuffer=G.activeBuffer))),this._parser.setCsiHandlerFallback(((G,re)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(G),params:re.toArray()})})),this._parser.setEscHandlerFallback((G=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(G)})})),this._parser.setExecuteHandlerFallback((G=>{this._logService.debug("Unknown EXECUTE code: ",{code:G})})),this._parser.setOscHandlerFallback(((G,re,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:G,action:re,data:ne})})),this._parser.setDcsHandlerFallback(((G,re,ne)=>{re==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(G),action:re,payload:ne})})),this._parser.setPrintHandler(((G,re,ne)=>this.print(G,re,ne))),this._parser.registerCsiHandler({final:"@"},(G=>this.insertChars(G))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(G=>this.scrollLeft(G))),this._parser.registerCsiHandler({final:"A"},(G=>this.cursorUp(G))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(G=>this.scrollRight(G))),this._parser.registerCsiHandler({final:"B"},(G=>this.cursorDown(G))),this._parser.registerCsiHandler({final:"C"},(G=>this.cursorForward(G))),this._parser.registerCsiHandler({final:"D"},(G=>this.cursorBackward(G))),this._parser.registerCsiHandler({final:"E"},(G=>this.cursorNextLine(G))),this._parser.registerCsiHandler({final:"F"},(G=>this.cursorPrecedingLine(G))),this._parser.registerCsiHandler({final:"G"},(G=>this.cursorCharAbsolute(G))),this._parser.registerCsiHandler({final:"H"},(G=>this.cursorPosition(G))),this._parser.registerCsiHandler({final:"I"},(G=>this.cursorForwardTab(G))),this._parser.registerCsiHandler({final:"J"},(G=>this.eraseInDisplay(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(G=>this.eraseInDisplay(G,!0))),this._parser.registerCsiHandler({final:"K"},(G=>this.eraseInLine(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(G=>this.eraseInLine(G,!0))),this._parser.registerCsiHandler({final:"L"},(G=>this.insertLines(G))),this._parser.registerCsiHandler({final:"M"},(G=>this.deleteLines(G))),this._parser.registerCsiHandler({final:"P"},(G=>this.deleteChars(G))),this._parser.registerCsiHandler({final:"S"},(G=>this.scrollUp(G))),this._parser.registerCsiHandler({final:"T"},(G=>this.scrollDown(G))),this._parser.registerCsiHandler({final:"X"},(G=>this.eraseChars(G))),this._parser.registerCsiHandler({final:"Z"},(G=>this.cursorBackwardTab(G))),this._parser.registerCsiHandler({final:"`"},(G=>this.charPosAbsolute(G))),this._parser.registerCsiHandler({final:"a"},(G=>this.hPositionRelative(G))),this._parser.registerCsiHandler({final:"b"},(G=>this.repeatPrecedingCharacter(G))),this._parser.registerCsiHandler({final:"c"},(G=>this.sendDeviceAttributesPrimary(G))),this._parser.registerCsiHandler({prefix:">",final:"c"},(G=>this.sendDeviceAttributesSecondary(G))),this._parser.registerCsiHandler({final:"d"},(G=>this.linePosAbsolute(G))),this._parser.registerCsiHandler({final:"e"},(G=>this.vPositionRelative(G))),this._parser.registerCsiHandler({final:"f"},(G=>this.hVPosition(G))),this._parser.registerCsiHandler({final:"g"},(G=>this.tabClear(G))),this._parser.registerCsiHandler({final:"h"},(G=>this.setMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(G=>this.setModePrivate(G))),this._parser.registerCsiHandler({final:"l"},(G=>this.resetMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(G=>this.resetModePrivate(G))),this._parser.registerCsiHandler({final:"m"},(G=>this.charAttributes(G))),this._parser.registerCsiHandler({final:"n"},(G=>this.deviceStatus(G))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(G=>this.deviceStatusPrivate(G))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(G=>this.softReset(G))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(G=>this.setCursorStyle(G))),this._parser.registerCsiHandler({final:"r"},(G=>this.setScrollRegion(G))),this._parser.registerCsiHandler({final:"s"},(G=>this.saveCursor(G))),this._parser.registerCsiHandler({final:"t"},(G=>this.windowOptions(G))),this._parser.registerCsiHandler({final:"u"},(G=>this.restoreCursor(G))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(G=>this.insertColumns(G))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(G=>this.deleteColumns(G))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(G=>this.selectProtected(G))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(G=>this.requestMode(G,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(G=>this.requestMode(G,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((G=>(this.setTitle(G),this.setIconName(G),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((G=>this.setIconName(G)))),this._parser.registerOscHandler(2,new M.OscHandler((G=>this.setTitle(G)))),this._parser.registerOscHandler(4,new M.OscHandler((G=>this.setOrReportIndexedColor(G)))),this._parser.registerOscHandler(8,new M.OscHandler((G=>this.setHyperlink(G)))),this._parser.registerOscHandler(10,new M.OscHandler((G=>this.setOrReportFgColor(G)))),this._parser.registerOscHandler(11,new M.OscHandler((G=>this.setOrReportBgColor(G)))),this._parser.registerOscHandler(12,new M.OscHandler((G=>this.setOrReportCursorColor(G)))),this._parser.registerOscHandler(104,new M.OscHandler((G=>this.restoreIndexedColor(G)))),this._parser.registerOscHandler(110,new M.OscHandler((G=>this.restoreFgColor(G)))),this._parser.registerOscHandler(111,new M.OscHandler((G=>this.restoreBgColor(G)))),this._parser.registerOscHandler(112,new M.OscHandler((G=>this.restoreCursorColor(G)))),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 G in y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:G},(()=>this.selectCharset("("+G))),this._parser.registerEscHandler({intermediates:")",final:G},(()=>this.selectCharset(")"+G))),this._parser.registerEscHandler({intermediates:"*",final:G},(()=>this.selectCharset("*"+G))),this._parser.registerEscHandler({intermediates:"+",final:G},(()=>this.selectCharset("+"+G))),this._parser.registerEscHandler({intermediates:"-",final:G},(()=>this.selectCharset("-"+G))),this._parser.registerEscHandler({intermediates:".",final:G},(()=>this.selectCharset("."+G))),this._parser.registerEscHandler({intermediates:"/",final:G},(()=>this.selectCharset("/"+G)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((G=>(this._logService.error("Parsing error: ",G),G))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(((G,re)=>this.requestStatusString(G,re))))}_preserveStack(U,O,z,j){this._parseStack.paused=!0,this._parseStack.cursorStartX=U,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=z,this._parseStack.position=j}_logSlowResolvingAsync(U){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([U,new Promise(((O,z)=>setTimeout((()=>z("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(U,O){let z,j=this._activeBuffer.x,H=this._activeBuffer.y,ee=0;const he=this._parseStack.paused;if(he){if(z=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(z),z;j=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,U.length>P&&(ee=this._parseStack.position+P)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof U=="string"?` "${U}"`:` "${Array.prototype.map.call(U,(G=>String.fromCharCode(G))).join("")}"`),typeof U=="string"?U.split("").map((G=>G.charCodeAt(0))):U),this._parseBuffer.length<U.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(U.length,P))),he||this._dirtyRowTracker.clearRange(),U.length>P)for(let G=ee;G<U.length;G+=P){const re=G+P<U.length?G+P:U.length,ne=typeof U=="string"?this._stringDecoder.decode(U.substring(G,re),this._parseBuffer):this._utf8Decoder.decode(U.subarray(G,re),this._parseBuffer);if(z=this._parser.parse(this._parseBuffer,ne))return this._preserveStack(j,H,ne,G),this._logSlowResolvingAsync(z),z}else if(!he){const G=typeof U=="string"?this._stringDecoder.decode(U,this._parseBuffer):this._utf8Decoder.decode(U,this._parseBuffer);if(z=this._parser.parse(this._parseBuffer,G))return this._preserveStack(j,H,G,0),this._logSlowResolvingAsync(z),z}this._activeBuffer.x===j&&this._activeBuffer.y===H||this._onCursorMove.fire();const se=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Z=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Z<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Z,this._bufferService.rows-1),Math.min(se,this._bufferService.rows-1))}print(U,O,z){let j,H;const ee=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,se=this._bufferService.cols,Z=this._coreService.decPrivateModes.wraparound,G=this._coreService.modes.insertMode,re=this._curAttrData;let ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&z-O>0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,re);let ve=this._parser.precedingJoinState;for(let me=O;me<z;++me){if(j=U[me],j<127&&ee){const Me=ee[String.fromCharCode(j)];Me&&(j=Me.charCodeAt(0))}const Te=this._unicodeService.charProperties(j,ve);H=x.UnicodeService.extractWidth(Te);const xe=x.UnicodeService.extractShouldJoin(Te),Ve=xe?x.UnicodeService.extractWidth(ve):0;if(ve=Te,he&&this._onA11yChar.fire((0,b.stringFromCodePoint)(j)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+H-Ve>se){if(Z){const Me=ne;let ke=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ve>0&&ne instanceof g.BufferLine&&ne.copyCellsFrom(Me,ke,0,Ve,!1);ke<se;)Me.setCellFromCodepoint(ke++,0,1,re)}else if(this._activeBuffer.x=se-1,H===2)continue}if(xe&&this._activeBuffer.x){const Me=ne.getWidth(this._activeBuffer.x-1)?1:2;ne.addCodepointToCell(this._activeBuffer.x-Me,j,H);for(let ke=H-Ve;--ke>=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}else if(G&&(ne.insertCells(this._activeBuffer.x,H-Ve,this._activeBuffer.getNullCell(re)),ne.getWidth(se-1)===2&&ne.setCellFromCodepoint(se-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,re)),ne.setCellFromCodepoint(this._activeBuffer.x++,j,H,re),H>0)for(;--H;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,re)}this._parser.precedingJoinState=ve,this._activeBuffer.x<se&&z-O>0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,re),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(U,O){return U.final!=="t"||U.prefix||U.intermediates?this._parser.registerCsiHandler(U,O):this._parser.registerCsiHandler(U,(z=>!B(z.params[0],this._optionsService.rawOptions.windowOptions)||O(z)))}registerDcsHandler(U,O){return this._parser.registerDcsHandler(U,new k.DcsHandler(O))}registerEscHandler(U,O){return this._parser.registerEscHandler(U,O)}registerOscHandler(U,O){return this._parser.registerOscHandler(U,new M.OscHandler(O))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var U;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&&((U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&U.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const U=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-U),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(U=this._bufferService.cols-1){this._activeBuffer.x=Math.min(U,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(U,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=U,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=U,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(U,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+U,this._activeBuffer.y+O)}cursorUp(U){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,U.params[0]||1)):this._moveCursor(0,-(U.params[0]||1)),!0}cursorDown(U){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,U.params[0]||1)):this._moveCursor(0,U.params[0]||1),!0}cursorForward(U){return this._moveCursor(U.params[0]||1,0),!0}cursorBackward(U){return this._moveCursor(-(U.params[0]||1),0),!0}cursorNextLine(U){return this.cursorDown(U),this._activeBuffer.x=0,!0}cursorPrecedingLine(U){return this.cursorUp(U),this._activeBuffer.x=0,!0}cursorCharAbsolute(U){return this._setCursor((U.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(U){return this._setCursor(U.length>=2?(U.params[1]||1)-1:0,(U.params[0]||1)-1),!0}charPosAbsolute(U){return this._setCursor((U.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(U){return this._moveCursor(U.params[0]||1,0),!0}linePosAbsolute(U){return this._setCursor(this._activeBuffer.x,(U.params[0]||1)-1),!0}vPositionRelative(U){return this._moveCursor(0,U.params[0]||1),!0}hVPosition(U){return this.cursorPosition(U),!0}tabClear(U){const O=U.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(U){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=U.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(U){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=U.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(U){const O=U.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(U,O,z,j=!1,H=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+U);ee.replaceCells(O,z,this._activeBuffer.getNullCell(this._eraseAttrData()),H),j&&(ee.isWrapped=!1)}_resetBufferLine(U,O=!1){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+U);z&&(z.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+U),z.isWrapped=!1)}eraseInDisplay(U,O=!1){let z;switch(this._restrictCursor(this._bufferService.cols),U.params[0]){case 0:for(z=this._activeBuffer.y,this._dirtyRowTracker.markDirty(z),this._eraseInBufferLine(z++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);z<this._bufferService.rows;z++)this._resetBufferLine(z,O);this._dirtyRowTracker.markDirty(z);break;case 1:for(z=this._activeBuffer.y,this._dirtyRowTracker.markDirty(z),this._eraseInBufferLine(z,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(z+1).isWrapped=!1);z--;)this._resetBufferLine(z,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(z=this._bufferService.rows,this._dirtyRowTracker.markDirty(z-1);z--;)this._resetBufferLine(z,O);this._dirtyRowTracker.markDirty(0);break;case 3:const j=this._activeBuffer.lines.length-this._bufferService.rows;j>0&&(this._activeBuffer.lines.trimStart(j),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-j,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-j,0),this._onScroll.fire(0))}return!0}eraseInLine(U,O=!1){switch(this._restrictCursor(this._bufferService.cols),U.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(U){this._restrictCursor();let O=U.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=this._activeBuffer.ybase+this._activeBuffer.y,j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-j+1;for(;O--;)this._activeBuffer.lines.splice(H-1,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(U){this._restrictCursor();let O=U.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=this._activeBuffer.ybase+this._activeBuffer.y;let j;for(j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-j;O--;)this._activeBuffer.lines.splice(z,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(U){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,U.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(U){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,U.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(U){let O=U.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(U){let O=U.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(g.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(U){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=U.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);j.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(U){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=U.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);j.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(U){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=U.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);j.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(U){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=U.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);j.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(U){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(U.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(U){const O=this._parser.precedingJoinState;if(!O)return!0;const z=U.params[0]||1,j=x.UnicodeService.extractWidth(O),H=this._activeBuffer.x-j,ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(H),he=new Uint32Array(ee.length*z);let se=0;for(let G=0;G<ee.length;){const re=ee.codePointAt(G)||0;he[se++]=re,G+=re>65535?2:1}let Z=se;for(let G=1;G<z;++G)he.copyWithin(Z,0,se),Z+=se;return this.print(he,0,Z),!0}sendDeviceAttributesPrimary(U){return U.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(U){return U.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(U.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(U){return(this._optionsService.rawOptions.termName+"").indexOf(U)===0}setMode(U){for(let O=0;O<U.length;O++)switch(U.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(U){for(let O=0;O<U.length;O++)switch(U.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(U){for(let O=0;O<U.length;O++)switch(U.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(U){for(let O=0;O<U.length;O++)switch(U.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),U.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(U,O){const z=this._coreService.decPrivateModes,{activeProtocol:j,activeEncoding:H}=this._coreMouseService,ee=this._coreService,{buffers:he,cols:se}=this._bufferService,{active:Z,alt:G}=he,re=this._optionsService.rawOptions,ne=xe=>xe?1:2,ve=U.params[0];return me=ve,Te=O?ve===2?4:ve===4?ne(ee.modes.insertMode):ve===12?3:ve===20?ne(re.convertEol):0:ve===1?ne(z.applicationCursorKeys):ve===3?re.windowOptions.setWinLines?se===80?2:se===132?1:0:0:ve===6?ne(z.origin):ve===7?ne(z.wraparound):ve===8?3:ve===9?ne(j==="X10"):ve===12?ne(re.cursorBlink):ve===25?ne(!ee.isCursorHidden):ve===45?ne(z.reverseWraparound):ve===66?ne(z.applicationKeypad):ve===67?4:ve===1e3?ne(j==="VT200"):ve===1002?ne(j==="DRAG"):ve===1003?ne(j==="ANY"):ve===1004?ne(z.sendFocus):ve===1005?4:ve===1006?ne(H==="SGR"):ve===1015?4:ve===1016?ne(H==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?ne(Z===G):ve===2004?ne(z.bracketedPasteMode):0,ee.triggerDataEvent(`${u.C0.ESC}[${O?"":"?"}${me};${Te}$y`),!0;var me,Te}_updateAttrColor(U,O,z,j,H){return O===2?(U|=50331648,U&=-16777216,U|=D.AttributeData.fromColorRGB([z,j,H])):O===5&&(U&=-50331904,U|=33554432|255&z),U}_extractColor(U,O,z){const j=[0,0,-1,0,0,0];let H=0,ee=0;do{if(j[ee+H]=U.params[O+ee],U.hasSubParams(O+ee)){const he=U.getSubParams(O+ee);let se=0;do j[1]===5&&(H=1),j[ee+se+1+H]=he[se];while(++se<he.length&&se+ee+1+H<j.length);break}if(j[1]===5&&ee+H>=2||j[1]===2&&ee+H>=5)break;j[1]&&(H=1)}while(++ee+O<U.length&&ee+H<j.length);for(let he=2;he<j.length;++he)j[he]===-1&&(j[he]=0);switch(j[0]){case 38:z.fg=this._updateAttrColor(z.fg,j[1],j[3],j[4],j[5]);break;case 48:z.bg=this._updateAttrColor(z.bg,j[1],j[3],j[4],j[5]);break;case 58:z.extended=z.extended.clone(),z.extended.underlineColor=this._updateAttrColor(z.extended.underlineColor,j[1],j[3],j[4],j[5])}return ee}_processUnderline(U,O){O.extended=O.extended.clone(),(!~U||U>5)&&(U=1),O.extended.underlineStyle=U,O.fg|=268435456,U===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(U){U.fg=g.DEFAULT_ATTR_DATA.fg,U.bg=g.DEFAULT_ATTR_DATA.bg,U.extended=U.extended.clone(),U.extended.underlineStyle=0,U.extended.underlineColor&=-67108864,U.updateExtended()}charAttributes(U){if(U.length===1&&U.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=U.length;let z;const j=this._curAttrData;for(let H=0;H<O;H++)z=U.params[H],z>=30&&z<=37?(j.fg&=-50331904,j.fg|=16777216|z-30):z>=40&&z<=47?(j.bg&=-50331904,j.bg|=16777216|z-40):z>=90&&z<=97?(j.fg&=-50331904,j.fg|=16777224|z-90):z>=100&&z<=107?(j.bg&=-50331904,j.bg|=16777224|z-100):z===0?this._processSGR0(j):z===1?j.fg|=134217728:z===3?j.bg|=67108864:z===4?(j.fg|=268435456,this._processUnderline(U.hasSubParams(H)?U.getSubParams(H)[0]:1,j)):z===5?j.fg|=536870912:z===7?j.fg|=67108864:z===8?j.fg|=1073741824:z===9?j.fg|=2147483648:z===2?j.bg|=134217728:z===21?this._processUnderline(2,j):z===22?(j.fg&=-134217729,j.bg&=-134217729):z===23?j.bg&=-67108865:z===24?(j.fg&=-268435457,this._processUnderline(0,j)):z===25?j.fg&=-536870913:z===27?j.fg&=-67108865:z===28?j.fg&=-1073741825:z===29?j.fg&=2147483647:z===39?(j.fg&=-67108864,j.fg|=16777215&g.DEFAULT_ATTR_DATA.fg):z===49?(j.bg&=-67108864,j.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):z===38||z===48||z===58?H+=this._extractColor(U,H,j):z===53?j.bg|=1073741824:z===55?j.bg&=-1073741825:z===59?(j.extended=j.extended.clone(),j.extended.underlineColor=-1,j.updateExtended()):z===100?(j.fg&=-67108864,j.fg|=16777215&g.DEFAULT_ATTR_DATA.fg,j.bg&=-67108864,j.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",z);return!0}deviceStatus(U){switch(U.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${O};${z}R`)}return!0}deviceStatusPrivate(U){if(U.params[0]===6){const O=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${O};${z}R`)}return!0}softReset(U){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=g.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(U){const O=U.params[0]||1;switch(O){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const z=O%2==1;return this._optionsService.options.cursorBlink=z,!0}setScrollRegion(U){const O=U.params[0]||1;let z;return(U.length<2||(z=U.params[1])>this._bufferService.rows||z===0)&&(z=this._bufferService.rows),z>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=z-1,this._setCursor(0,0)),!0}windowOptions(U){if(!B(U.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=U.length>1?U.params[1]:0;switch(U.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(U){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(U){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(U){return this._windowTitle=U,this._onTitleChange.fire(U),!0}setIconName(U){return this._iconName=U,!0}setOrReportIndexedColor(U){const O=[],z=U.split(";");for(;z.length>1;){const j=z.shift(),H=z.shift();if(/^\d+$/.exec(j)){const ee=parseInt(j);if(K(ee))if(H==="?")O.push({type:0,index:ee});else{const he=(0,L.parseColor)(H);he&&O.push({type:1,index:ee,color:he})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(U){const O=U.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(U,O){this._getCurrentLinkId()&&this._finishHyperlink();const z=U.split(":");let j;const H=z.findIndex((ee=>ee.startsWith("id=")));return H!==-1&&(j=z[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:j,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(U,O){const z=U.split(";");for(let j=0;j<z.length&&!(O>=this._specialColors.length);++j,++O)if(z[j]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const H=(0,L.parseColor)(z[j]);H&&this._onColor.fire([{type:1,index:this._specialColors[O],color:H}])}return!0}setOrReportFgColor(U){return this._setOrReportSpecialColor(U,0)}setOrReportBgColor(U){return this._setOrReportSpecialColor(U,1)}setOrReportCursorColor(U){return this._setOrReportSpecialColor(U,2)}restoreIndexedColor(U){if(!U)return this._onColor.fire([{type:2}]),!0;const O=[],z=U.split(";");for(let j=0;j<z.length;++j)if(/^\d+$/.exec(z[j])){const H=parseInt(z[j]);K(H)&&O.push({type:2,index:H})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(U){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(U){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(U){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),!0}selectCharset(U){return U.length!==2?(this.selectDefaultCharset(),!0):(U[0]==="/"||this._charsetService.setgCharset(T[U[0]],y.CHARSETS[U[1]]||y.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const U=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,U,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=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(U){return this._charsetService.setgLevel(U),!0}screenAlignmentPattern(){const U=new S.CellData;U.content=4194373,U.fg=this._curAttrData.fg,U.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const z=this._activeBuffer.ybase+this._activeBuffer.y+O,j=this._activeBuffer.lines.get(z);j&&(j.fill(U),j.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(U,O){const z=this._bufferService.buffer,j=this._optionsService.rawOptions;return(H=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${H}${u.C0.ESC}\\`),!0))(U==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:U==='"p'?'P1$r61;1"p':U==="r"?`P1$r${z.scrollTop+1};${z.scrollBottom+1}r`:U==="m"?"P1$r0m":U===" q"?`P1$r${{block:2,underline:4,bar:6}[j.cursorStyle]-(j.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(U,O){this._dirtyRowTracker.markRangeDirty(U,O)}}a.InputHandler=q;let W=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,U){X>U&&($=X,X=U,U=$),X<this.start&&(this.start=X),U>this.end&&(this.end=U)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(X){return 0<=X&&X<256}W=c([f(0,R.IBufferService)],W)},844:(p,a)=>{function l(c){for(const f of c)f.dispose();c.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const f=this._disposables.indexOf(c);f!==-1&&this._disposables.splice(f,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var f;this._isDisposed||c===this._value||((f=this._value)==null||f.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},a.toDisposable=function(c){return{dispose:c}},a.disposeArray=l,a.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},1505:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(f,u,y){this._data[f]||(this._data[f]={}),this._data[f][u]=y}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=l,a.FourKeyMap=class{constructor(){this._data=new l}set(c,f,u,y,C){this._data.get(c,f)||this._data.set(c,f,new l),this._data.get(c,f).set(u,y,C)}get(c,f,u,y){var C;return(C=this._data.get(c,f))==null?void 0:C.get(u,y)}clear(){this._data.clear()}}},6114:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const l=a.isNode?"node":navigator.userAgent,c=a.isNode?"node":navigator.platform;a.isFirefox=l.includes("Firefox"),a.isLegacyEdge=l.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(l),a.getSafariVersion=function(){if(!a.isSafari)return 0;const f=l.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),a.isIpad=c==="iPad",a.isIphone=c==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),a.isLinux=c.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(l)},6106:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let l=0;a.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(l=this._search(this._getKey(c)),this._array.splice(l,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const f=this._getKey(c);if(f===void 0||(l=this._search(f),l===-1)||this._getKey(this._array[l])!==f)return!1;do if(this._array[l]===c)return this._array.splice(l,1),!0;while(++l<this._array.length&&this._getKey(this._array[l])===f);return!1}*getKeyIterator(c){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do yield this._array[l];while(++l<this._array.length&&this._getKey(this._array[l])===c)}forEachByKey(c,f){if(this._array.length!==0&&(l=this._search(c),!(l<0||l>=this._array.length)&&this._getKey(this._array[l])===c))do f(this._array[l]);while(++l<this._array.length&&this._getKey(this._array[l])===c)}values(){return[...this._array].values()}_search(c){let f=0,u=this._array.length-1;for(;u>=f;){let y=f+u>>1;const C=this._getKey(this._array[y]);if(C>c)u=y-1;else{if(!(C<c)){for(;y>0&&this._getKey(this._array[y-1])===c;)y--;return y}f=y+1}}return f}}},7226:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const c=l(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let w=0,b=0,g=C.timeRemaining(),_=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),b=Math.max(w,b),_=C.timeRemaining(),1.5*b>_)return g-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-w))}ms`),void this._start();g=_}this.clear()}}class u extends f{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const w=Date.now()+C;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const c=l(643);a.updateWindowsModeWrappedState=function(f){const u=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),y=u==null?void 0:u.get(f.cols-1),C=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);C&&y&&(C.isWrapped=y[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&y[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,y=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=y}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=c},9092:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const c=l(6349),f=l(7226),u=l(3734),y=l(8437),C=l(4634),w=l(511),b=l(643),g=l(4863),_=l(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(v,S,D){this._hasScrollback=v,this._optionsService=S,this._bufferService=D,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,b.NULL_CELL_CHAR,b.NULL_CELL_WIDTH,b.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,b.WHITESPACE_CELL_CHAR,b.WHITESPACE_CELL_WIDTH,b.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(v){return v?(this._nullCell.fg=v.fg,this._nullCell.bg=v.bg,this._nullCell.extended=v.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(v){return v?(this._whitespaceCell.fg=v.fg,this._whitespaceCell.bg=v.bg,this._whitespaceCell.extended=v.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(v,S){return new y.BufferLine(this._bufferService.cols,this.getNullCell(v),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const v=this.ybase+this.y-this.ydisp;return v>=0&&v<this._rows}_getCorrectBufferLength(v){if(!this._hasScrollback)return v;const S=v+this._optionsService.rawOptions.scrollback;return S>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:S}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=y.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(v))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(v,S){const D=this.getNullCell(y.DEFAULT_ATTR_DATA);let R=0;const x=this._getCorrectBufferLength(S);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<v)for(let k=0;k<this.lines.length;k++)R+=+this.lines.get(k).resize(v,D);let M=0;if(this._rows<S)for(let k=this._rows;k<S;k++)this.lines.length<S+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new y.BufferLine(v,D)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(v,D)));else for(let k=this._rows;k>S;k--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const k=this.lines.length-x;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=x}this.x=Math.min(this.x,v-1),this.y=Math.min(this.y,S-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(v,S),this._cols>v))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(v,D);this._cols=v,this._rows=S,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let v=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,v=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return v}get _isReflowEnabled(){const v=this._optionsService.rawOptions.windowsPty;return v&&v.buildNumber?this._hasScrollback&&v.backend==="conpty"&&v.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(v,S){this._cols!==v&&(v>this._cols?this._reflowLarger(v,S):this._reflowSmaller(v,S))}_reflowLarger(v,S){const D=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(D.length>0){const R=(0,C.reflowLargerCreateNewLayout)(this.lines,D);(0,C.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(v,S,R.countRemoved)}}_reflowLargerAdjustViewport(v,S,D){const R=this.getNullCell(y.DEFAULT_ATTR_DATA);let x=D;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new y.BufferLine(v,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-D,0)}_reflowSmaller(v,S){const D=this.getNullCell(y.DEFAULT_ATTR_DATA),R=[];let x=0;for(let M=this.lines.length-1;M>=0;M--){let k=this.lines.get(M);if(!k||!k.isWrapped&&k.getTrimmedLength()<=v)continue;const L=[k];for(;k.isWrapped&&M>0;)k=this.lines.get(--M),L.unshift(k);const T=this.ybase+this.y;if(T>=M&&T<M+L.length)continue;const P=L[L.length-1].getTrimmedLength(),B=(0,C.reflowSmallerGetNewLineLengths)(L,this._cols,v),F=B.length-L.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const q=[];for(let z=0;z<F;z++){const j=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);q.push(j)}q.length>0&&(R.push({start:M+L.length+x,newLines:q}),x+=q.length),L.push(...q);let W=B.length-1,K=B[W];K===0&&(W--,K=B[W]);let X=L.length-F-1,U=P;for(;X>=0;){const z=Math.min(U,K);if(L[W]===void 0)break;if(L[W].copyCellsFrom(L[X],U-z,K-z,z,!0),K-=z,K===0&&(W--,K=B[W]),U-=z,U===0){X--;const j=Math.max(X,0);U=(0,C.getWrappedLineTrimmedLength)(L,j,this._cols)}}for(let z=0;z<L.length;z++)B[z]<v&&L[z].setCell(B[z],D);let O=F-$;for(;O-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+S-1)}if(R.length>0){const M=[],k=[];for(let W=0;W<this.lines.length;W++)k.push(this.lines.get(W));const L=this.lines.length;let T=L-1,P=0,B=R[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let F=0;for(let W=Math.min(this.lines.maxLength-1,L+x-1);W>=0;W--)if(B&&B.start>T+F){for(let K=B.newLines.length-1;K>=0;K--)this.lines.set(W--,B.newLines[K]);W++,M.push({index:T+1,amount:B.newLines.length}),F+=B.newLines.length,B=R[++P]}else this.lines.set(W,k[T--]);let $=0;for(let W=M.length-1;W>=0;W--)M[W].index+=$,this.lines.onInsertEmitter.fire(M[W]),$+=M[W].amount;const q=Math.max(0,L+x-this.lines.maxLength);q>0&&this.lines.onTrimEmitter.fire(q)}}translateBufferLineToString(v,S,D=0,R){const x=this.lines.get(v);return x?x.translateToString(S,D,R):""}getWrappedRangeForLine(v){let S=v,D=v;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;D+1<this.lines.length&&this.lines.get(D+1).isWrapped;)D++;return{first:S,last:D}}setupTabStops(v){for(v!=null?this.tabs[v]||(v=this.prevStop(v)):(this.tabs={},v=0);v<this._cols;v+=this._optionsService.rawOptions.tabStopWidth)this.tabs[v]=!0}prevStop(v){for(v==null&&(v=this.x);!this.tabs[--v]&&v>0;);return v>=this._cols?this._cols-1:v<0?0:v}nextStop(v){for(v==null&&(v=this.x);!this.tabs[++v]&&v<this._cols;);return v>=this._cols?this._cols-1:v<0?0:v}clearMarkers(v){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===v&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].dispose(),this.markers.splice(v--,1);this._isClearing=!1}addMarker(v){const S=new g.Marker(v);return this.markers.push(S),S.register(this.lines.onTrim((D=>{S.line-=D,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((D=>{S.line>=D.index&&(S.line+=D.amount)}))),S.register(this.lines.onDelete((D=>{S.line>=D.index&&S.line<D.index+D.amount&&S.dispose(),S.line>D.index&&(S.line-=D.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),1)}}},8437:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const c=l(3734),f=l(511),u=l(643),y=l(482);a.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let C=0;class w{constructor(g,_,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*g);const S=_||f.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let D=0;D<g;++D)this.setCell(D,S);this.length=g}get(g){const _=this._data[3*g+0],v=2097151&_;return[this._data[3*g+1],2097152&_?this._combined[g]:v?(0,y.stringFromCodePoint)(v):"",_>>22,2097152&_?this._combined[g].charCodeAt(this._combined[g].length-1):v]}set(g,_){this._data[3*g+1]=_[u.CHAR_DATA_ATTR_INDEX],_[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[g]=_[1],this._data[3*g+0]=2097152|g|_[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*g+0]=_[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(g){return this._data[3*g+0]>>22}hasWidth(g){return 12582912&this._data[3*g+0]}getFg(g){return this._data[3*g+1]}getBg(g){return this._data[3*g+2]}hasContent(g){return 4194303&this._data[3*g+0]}getCodePoint(g){const _=this._data[3*g+0];return 2097152&_?this._combined[g].charCodeAt(this._combined[g].length-1):2097151&_}isCombined(g){return 2097152&this._data[3*g+0]}getString(g){const _=this._data[3*g+0];return 2097152&_?this._combined[g]:2097151&_?(0,y.stringFromCodePoint)(2097151&_):""}isProtected(g){return 536870912&this._data[3*g+2]}loadCell(g,_){return C=3*g,_.content=this._data[C+0],_.fg=this._data[C+1],_.bg=this._data[C+2],2097152&_.content&&(_.combinedData=this._combined[g]),268435456&_.bg&&(_.extended=this._extendedAttrs[g]),_}setCell(g,_){2097152&_.content&&(this._combined[g]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[g]=_.extended),this._data[3*g+0]=_.content,this._data[3*g+1]=_.fg,this._data[3*g+2]=_.bg}setCellFromCodepoint(g,_,v,S){268435456&S.bg&&(this._extendedAttrs[g]=S.extended),this._data[3*g+0]=_|v<<22,this._data[3*g+1]=S.fg,this._data[3*g+2]=S.bg}addCodepointToCell(g,_,v){let S=this._data[3*g+0];2097152&S?this._combined[g]+=(0,y.stringFromCodePoint)(_):2097151&S?(this._combined[g]=(0,y.stringFromCodePoint)(2097151&S)+(0,y.stringFromCodePoint)(_),S&=-2097152,S|=2097152):S=_|4194304,v&&(S&=-12582913,S|=v<<22),this._data[3*g+0]=S}insertCells(g,_,v){if((g%=this.length)&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,v),_<this.length-g){const S=new f.CellData;for(let D=this.length-g-_-1;D>=0;--D)this.setCell(g+_+D,this.loadCell(g+D,S));for(let D=0;D<_;++D)this.setCell(g+D,v)}else for(let S=g;S<this.length;++S)this.setCell(S,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(g,_,v){if(g%=this.length,_<this.length-g){const S=new f.CellData;for(let D=0;D<this.length-g-_;++D)this.setCell(g+D,this.loadCell(g+_+D,S));for(let D=this.length-_;D<this.length;++D)this.setCell(D,v)}else for(let S=g;S<this.length;++S)this.setCell(S,v);g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,v),this.getWidth(g)!==0||this.hasContent(g)||this.setCellFromCodepoint(g,0,1,v)}replaceCells(g,_,v,S=!1){if(S)for(g&&this.getWidth(g-1)===2&&!this.isProtected(g-1)&&this.setCellFromCodepoint(g-1,0,1,v),_<this.length&&this.getWidth(_-1)===2&&!this.isProtected(_)&&this.setCellFromCodepoint(_,0,1,v);g<_&&g<this.length;)this.isProtected(g)||this.setCell(g,v),g++;else for(g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,v),_<this.length&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_,0,1,v);g<_&&g<this.length;)this.setCell(g++,v)}resize(g,_){if(g===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const v=3*g;if(g>this.length){if(this._data.buffer.byteLength>=4*v)this._data=new Uint32Array(this._data.buffer,0,v);else{const S=new Uint32Array(v);S.set(this._data),this._data=S}for(let S=this.length;S<g;++S)this.setCell(S,_)}else{this._data=this._data.subarray(0,v);const S=Object.keys(this._combined);for(let R=0;R<S.length;R++){const x=parseInt(S[R],10);x>=g&&delete this._combined[x]}const D=Object.keys(this._extendedAttrs);for(let R=0;R<D.length;R++){const x=parseInt(D[R],10);x>=g&&delete this._extendedAttrs[x]}}return this.length=g,4*v*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const g=new Uint32Array(this._data.length);return g.set(this._data),this._data=g,1}return 0}fill(g,_=!1){if(_)for(let v=0;v<this.length;++v)this.isProtected(v)||this.setCell(v,g);else{this._combined={},this._extendedAttrs={};for(let v=0;v<this.length;++v)this.setCell(v,g)}}copyFrom(g){this.length!==g.length?this._data=new Uint32Array(g._data):this._data.set(g._data),this.length=g.length,this._combined={};for(const _ in g._combined)this._combined[_]=g._combined[_];this._extendedAttrs={};for(const _ in g._extendedAttrs)this._extendedAttrs[_]=g._extendedAttrs[_];this.isWrapped=g.isWrapped}clone(){const g=new w(0);g._data=new Uint32Array(this._data),g.length=this.length;for(const _ in this._combined)g._combined[_]=this._combined[_];for(const _ in this._extendedAttrs)g._extendedAttrs[_]=this._extendedAttrs[_];return g.isWrapped=this.isWrapped,g}getTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0])return g+(this._data[3*g+0]>>22);return 0}getNoBgTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0]||50331648&this._data[3*g+2])return g+(this._data[3*g+0]>>22);return 0}copyCellsFrom(g,_,v,S,D){const R=g._data;if(D)for(let M=S-1;M>=0;M--){for(let k=0;k<3;k++)this._data[3*(v+M)+k]=R[3*(_+M)+k];268435456&R[3*(_+M)+2]&&(this._extendedAttrs[v+M]=g._extendedAttrs[_+M])}else for(let M=0;M<S;M++){for(let k=0;k<3;k++)this._data[3*(v+M)+k]=R[3*(_+M)+k];268435456&R[3*(_+M)+2]&&(this._extendedAttrs[v+M]=g._extendedAttrs[_+M])}const x=Object.keys(g._combined);for(let M=0;M<x.length;M++){const k=parseInt(x[M],10);k>=_&&(this._combined[k-_+v]=g._combined[k])}}translateToString(g,_,v,S){_=_??0,v=v??this.length,g&&(v=Math.min(v,this.getTrimmedLength())),S&&(S.length=0);let D="";for(;_<v;){const R=this._data[3*_+0],x=2097151&R,M=2097152&R?this._combined[_]:x?(0,y.stringFromCodePoint)(x):u.WHITESPACE_CELL_CHAR;if(D+=M,S)for(let k=0;k<M.length;++k)S.push(_);_+=R>>22||1}return S&&S.push(_),D}}a.BufferLine=w},4841:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(l,c){if(l.start.y>l.end.y)throw new Error(`Buffer range end (${l.end.x}, ${l.end.y}) cannot be before start (${l.start.x}, ${l.start.y})`);return c*(l.end.y-l.start.y)+(l.end.x-l.start.x+1)}},4634:(p,a)=>{function l(c,f,u){if(f===c.length-1)return c[f].getTrimmedLength();const y=!c[f].hasContent(u-1)&&c[f].getWidth(u-1)===1,C=c[f+1].getWidth(0)===2;return y&&C?u-1:u}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(c,f,u,y,C){const w=[];for(let b=0;b<c.length-1;b++){let g=b,_=c.get(++g);if(!_.isWrapped)continue;const v=[c.get(b)];for(;g<c.length&&_.isWrapped;)v.push(_),_=c.get(++g);if(y>=b&&y<g){b+=v.length-1;continue}let S=0,D=l(v,S,f),R=1,x=0;for(;R<v.length;){const k=l(v,R,f),L=k-x,T=u-D,P=Math.min(L,T);v[S].copyCellsFrom(v[R],x,D,P,!1),D+=P,D===u&&(S++,D=0),x+=P,x===k&&(R++,x=0),D===0&&S!==0&&v[S-1].getWidth(u-1)===2&&(v[S].copyCellsFrom(v[S-1],u-1,D++,1,!1),v[S-1].setCell(u-1,C))}v[S].replaceCells(D,u,C);let M=0;for(let k=v.length-1;k>0&&(k>S||v[k].getTrimmedLength()===0);k--)M++;M>0&&(w.push(b+v.length-M),w.push(M)),b+=v.length-1}return w},a.reflowLargerCreateNewLayout=function(c,f){const u=[];let y=0,C=f[y],w=0;for(let b=0;b<c.length;b++)if(C===b){const g=f[++y];c.onDeleteEmitter.fire({index:b-w,amount:g}),b+=g-1,w+=g,C=f[++y]}else u.push(b);return{layout:u,countRemoved:w}},a.reflowLargerApplyNewLayout=function(c,f){const u=[];for(let y=0;y<f.length;y++)u.push(c.get(f[y]));for(let y=0;y<u.length;y++)c.set(y,u[y]);c.length=f.length},a.reflowSmallerGetNewLineLengths=function(c,f,u){const y=[],C=c.map(((_,v)=>l(c,v,f))).reduce(((_,v)=>_+v));let w=0,b=0,g=0;for(;g<C;){if(C-g<u){y.push(C-g);break}w+=u;const _=l(c,b,f);w>_&&(w-=_,b++);const v=c[b].getWidth(w-1)===2;v&&w--;const S=v?u-1:u;y.push(S),g+=S}return y},a.getWrappedLineTrimmedLength=l},5295:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const c=l(8460),f=l(844),u=l(9092);class y extends f.Disposable{constructor(w,b){super(),this._optionsService=w,this._bufferService=b,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,b){this._normal.resize(w,b),this._alt.resize(w,b),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}a.BufferSet=y},511:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const c=l(482),f=l(643),u=l(3734);class y extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const b=new y;return b.setFromCharData(w),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(w[f.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(w[f.CHAR_DATA_CHAR_INDEX].length===2){const g=w[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const _=w[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(g-55296)+_-56320+65536|w[f.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=w[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[f.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=w[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=y},643:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const c=l(8460),f=l(844);class u{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}a.Marker=u,u._nextId=1},7116:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(p,a)=>{var l,c,f;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
92
- `,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(l||(a.C0=l={})),(function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"})(c||(a.C1=c={})),(function(u){u.ST=`${l.ESC}\\`})(f||(a.C1_ESCAPED=f={}))},7399:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const c=l(2584),f={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:["'",'"']};a.evaluateKeyboardEvent=function(u,y,C,w){const b={type:0,cancel:!1,key:void 0},g=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?b.key=y?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?b.key=y?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?b.key=y?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(b.key=y?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:b.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(b.key=c.C0.ESC+b.key);break;case 9:if(u.shiftKey){b.key=c.C0.ESC+"[Z";break}b.key=c.C0.HT,b.cancel=!0;break;case 13:b.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,b.cancel=!0;break;case 27:b.key=c.C0.ESC,u.altKey&&(b.key=c.C0.ESC+c.C0.ESC),b.cancel=!0;break;case 37:if(u.metaKey)break;g?(b.key=c.C0.ESC+"[1;"+(g+1)+"D",b.key===c.C0.ESC+"[1;3D"&&(b.key=c.C0.ESC+(C?"b":"[1;5D"))):b.key=y?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;g?(b.key=c.C0.ESC+"[1;"+(g+1)+"C",b.key===c.C0.ESC+"[1;3C"&&(b.key=c.C0.ESC+(C?"f":"[1;5C"))):b.key=y?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;g?(b.key=c.C0.ESC+"[1;"+(g+1)+"A",C||b.key!==c.C0.ESC+"[1;3A"||(b.key=c.C0.ESC+"[1;5A")):b.key=y?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;g?(b.key=c.C0.ESC+"[1;"+(g+1)+"B",C||b.key!==c.C0.ESC+"[1;3B"||(b.key=c.C0.ESC+"[1;5B")):b.key=y?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(b.key=c.C0.ESC+"[2~");break;case 46:b.key=g?c.C0.ESC+"[3;"+(g+1)+"~":c.C0.ESC+"[3~";break;case 36:b.key=g?c.C0.ESC+"[1;"+(g+1)+"H":y?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:b.key=g?c.C0.ESC+"[1;"+(g+1)+"F":y?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?b.type=2:u.ctrlKey?b.key=c.C0.ESC+"[5;"+(g+1)+"~":b.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?b.type=3:u.ctrlKey?b.key=c.C0.ESC+"[6;"+(g+1)+"~":b.key=c.C0.ESC+"[6~";break;case 112:b.key=g?c.C0.ESC+"[1;"+(g+1)+"P":c.C0.ESC+"OP";break;case 113:b.key=g?c.C0.ESC+"[1;"+(g+1)+"Q":c.C0.ESC+"OQ";break;case 114:b.key=g?c.C0.ESC+"[1;"+(g+1)+"R":c.C0.ESC+"OR";break;case 115:b.key=g?c.C0.ESC+"[1;"+(g+1)+"S":c.C0.ESC+"OS";break;case 116:b.key=g?c.C0.ESC+"[15;"+(g+1)+"~":c.C0.ESC+"[15~";break;case 117:b.key=g?c.C0.ESC+"[17;"+(g+1)+"~":c.C0.ESC+"[17~";break;case 118:b.key=g?c.C0.ESC+"[18;"+(g+1)+"~":c.C0.ESC+"[18~";break;case 119:b.key=g?c.C0.ESC+"[19;"+(g+1)+"~":c.C0.ESC+"[19~";break;case 120:b.key=g?c.C0.ESC+"[20;"+(g+1)+"~":c.C0.ESC+"[20~";break;case 121:b.key=g?c.C0.ESC+"[21;"+(g+1)+"~":c.C0.ESC+"[21~";break;case 122:b.key=g?c.C0.ESC+"[23;"+(g+1)+"~":c.C0.ESC+"[23~";break;case 123:b.key=g?c.C0.ESC+"[24;"+(g+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(C&&!w||!u.altKey||u.metaKey)!C||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?b.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(b.key=c.C0.US),u.key==="@"&&(b.key=c.C0.NUL)):u.keyCode===65&&(b.type=1);else{const _=f[u.keyCode],v=_==null?void 0:_[u.shiftKey?1:0];if(v)b.key=c.C0.ESC+v;else if(u.keyCode>=65&&u.keyCode<=90){const S=u.ctrlKey?u.keyCode-64:u.keyCode+32;let D=String.fromCharCode(S);u.shiftKey&&(D=D.toUpperCase()),b.key=c.C0.ESC+D}else if(u.keyCode===32)b.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let S=u.code.slice(3,4);u.shiftKey||(S=S.toLowerCase()),b.key=c.C0.ESC+S,b.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?b.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?b.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?b.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?b.key=c.C0.DEL:u.keyCode===219?b.key=c.C0.ESC:u.keyCode===220?b.key=c.C0.FS:u.keyCode===221&&(b.key=c.C0.GS)}return b}},482:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},a.utf32ToString=function(l,c=0,f=l.length){let u="";for(let y=c;y<f;++y){let C=l[y];C>65535?(C-=65536,u+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):u+=String.fromCharCode(C)}return u},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const f=l.length;if(!f)return 0;let u=0,y=0;if(this._interim){const C=l.charCodeAt(y++);56320<=C&&C<=57343?c[u++]=1024*(this._interim-55296)+C-56320+65536:(c[u++]=this._interim,c[u++]=C),this._interim=0}for(let C=y;C<f;++C){const w=l.charCodeAt(C);if(55296<=w&&w<=56319){if(++C>=f)return this._interim=w,u;const b=l.charCodeAt(C);56320<=b&&b<=57343?c[u++]=1024*(w-55296)+b-56320+65536:(c[u++]=w,c[u++]=b)}else w!==65279&&(c[u++]=w)}return u}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const f=l.length;if(!f)return 0;let u,y,C,w,b=0,g=0,_=0;if(this.interim[0]){let D=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let x,M=0;for(;(x=63&this.interim[++M])&&M<4;)R<<=6,R|=x;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=k-M;for(;_<L;){if(_>=f)return 0;if(x=l[_++],(192&x)!=128){_--,D=!0;break}this.interim[M++]=x,R<<=6,R|=63&x}D||(k===2?R<128?_--:c[b++]=R:k===3?R<2048||R>=55296&&R<=57343||R===65279||(c[b++]=R):R<65536||R>1114111||(c[b++]=R)),this.interim.fill(0)}const v=f-4;let S=_;for(;S<f;){for(;!(!(S<v)||128&(u=l[S])||128&(y=l[S+1])||128&(C=l[S+2])||128&(w=l[S+3]));)c[b++]=u,c[b++]=y,c[b++]=C,c[b++]=w,S+=4;if(u=l[S++],u<128)c[b++]=u;else if((224&u)==192){if(S>=f)return this.interim[0]=u,b;if(y=l[S++],(192&y)!=128){S--;continue}if(g=(31&u)<<6|63&y,g<128){S--;continue}c[b++]=g}else if((240&u)==224){if(S>=f)return this.interim[0]=u,b;if(y=l[S++],(192&y)!=128){S--;continue}if(S>=f)return this.interim[0]=u,this.interim[1]=y,b;if(C=l[S++],(192&C)!=128){S--;continue}if(g=(15&u)<<12|(63&y)<<6|63&C,g<2048||g>=55296&&g<=57343||g===65279)continue;c[b++]=g}else if((248&u)==240){if(S>=f)return this.interim[0]=u,b;if(y=l[S++],(192&y)!=128){S--;continue}if(S>=f)return this.interim[0]=u,this.interim[1]=y,b;if(C=l[S++],(192&C)!=128){S--;continue}if(S>=f)return this.interim[0]=u,this.interim[1]=y,this.interim[2]=C,b;if(w=l[S++],(192&w)!=128){S--;continue}if(g=(7&u)<<18|(63&y)<<12|(63&C)<<6|63&w,g<65536||g>1114111)continue;c[b++]=g}}return b}}},225:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const c=l(1480),f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;a.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let C=0;C<f.length;++C)y.fill(0,f[C][0],f[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?y[C]:(function(w,b){let g,_=0,v=b.length-1;if(w<b[0][0]||w>b[v][1])return!1;for(;v>=_;)if(g=_+v>>1,w>b[g][1])_=g+1;else{if(!(w<b[g][0]))return!0;v=g-1}return!1})(C,u)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,w){let b=this.wcwidth(C),g=b===0&&w!==0;if(g){const _=c.UnicodeService.extractWidth(w);_===0?g=!1:_>b&&(b=_)}return c.UnicodeService.createPropertyValue(0,b,g)}}},5981:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const c=l(8460),f=l(844);class u extends f.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let b;for(this._isSyncWriting=!0;b=this._writeBuffer.shift();){this._action(b);const g=this._callbacks.shift();g&&g()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(w)}_innerWrite(C=0,w=!0){const b=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const g=this._writeBuffer[this._bufferOffset],_=this._action(g,w);if(_){const S=D=>Date.now()-b>=12?setTimeout((()=>this._innerWrite(0,D))):this._innerWrite(b,D);return void _.catch((D=>(queueMicrotask((()=>{throw D})),Promise.resolve(!1)))).then(S)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=g.length,Date.now()-b>=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()}}a.WriteBuffer=u},5941:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const l=/^([\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})$/,c=/^[\da-f]+$/;function f(u,y){const C=u.toString(16),w=C.length<2?"0"+C:C;switch(y){case 4:return C[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}a.parseColor=function(u){if(!u)return;let y=u.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const C=l.exec(y);if(C){const w=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/w*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/w*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/w*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),c.exec(y)&&[3,6,9,12].includes(y.length))){const C=y.length/3,w=[0,0,0];for(let b=0;b<3;++b){const g=parseInt(y.slice(C*b,C*b+C),16);w[b]=C===1?g<<4:C===2?g:C===3?g>>4:g>>8}return w}},a.toRgbString=function(u,y=16){const[C,w,b]=u;return`rgb:${f(C,y)}/${f(w,y)}/${f(b,y)}`}},5770:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const c=l(482),f=l(8742),u=l(5770),y=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(w,b){this._handlers[w]===void 0&&(this._handlers[w]=[]);const g=this._handlers[w];return g.push(b),{dispose:()=>{const _=g.indexOf(b);_!==-1&&g.splice(_,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(w,b){if(this.reset(),this._ident=w,this._active=this._handlers[w]||y,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].hook(b);else this._handlerFb(this._ident,"HOOK",b)}put(w,b,g){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(w,b,g);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(w,b,g))}unhook(w,b=!0){if(this._active.length){let g=!1,_=this._active.length-1,v=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,g=b,v=this._stack.fallThrough,this._stack.paused=!1),!v&&g===!1){for(;_>=0&&(g=this._active[_].unhook(w),g!==!0);_--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,g;_--}for(;_>=0;_--)if(g=this._active[_].unhook(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,g}else this._handlerFb(this._ident,"UNHOOK",w);this._active=y,this._ident=0}};const C=new f.Params;C.addParam(0),a.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=C,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():C,this._data="",this._hitLimit=!1}put(w,b,g){this._hitLimit||(this._data+=(0,c.utf32ToString)(w,b,g),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let b=!1;if(this._hitLimit)b=!1;else if(w&&(b=this._handler(this._data,this._params),b instanceof Promise))return b.then((g=>(this._params=C,this._data="",this._hitLimit=!1,g)));return this._params=C,this._data="",this._hitLimit=!1,b}}},2015:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const c=l(844),f=l(8742),u=l(6242),y=l(6351);class C{constructor(_){this.table=new Uint8Array(_)}setDefault(_,v){this.table.fill(_<<4|v)}add(_,v,S,D){this.table[v<<8|_]=S<<4|D}addMany(_,v,S,D){for(let R=0;R<_.length;R++)this.table[v<<8|_[R]]=S<<4|D}}a.TransitionTable=C;const w=160;a.VT500_TRANSITION_TABLE=(function(){const g=new C(4095),_=Array.apply(null,Array(256)).map(((M,k)=>k)),v=(M,k)=>_.slice(M,k),S=v(32,127),D=v(0,24);D.push(25),D.push.apply(D,v(28,32));const R=v(0,14);let x;for(x in g.setDefault(1,0),g.addMany(S,0,2,0),R)g.addMany([24,26,153,154],x,3,0),g.addMany(v(128,144),x,3,0),g.addMany(v(144,152),x,3,0),g.add(156,x,0,0),g.add(27,x,11,1),g.add(157,x,4,8),g.addMany([152,158,159],x,0,7),g.add(155,x,11,3),g.add(144,x,11,9);return g.addMany(D,0,3,0),g.addMany(D,1,3,1),g.add(127,1,0,1),g.addMany(D,8,0,8),g.addMany(D,3,3,3),g.add(127,3,0,3),g.addMany(D,4,3,4),g.add(127,4,0,4),g.addMany(D,6,3,6),g.addMany(D,5,3,5),g.add(127,5,0,5),g.addMany(D,2,3,2),g.add(127,2,0,2),g.add(93,1,4,8),g.addMany(S,8,5,8),g.add(127,8,5,8),g.addMany([156,27,24,26,7],8,6,0),g.addMany(v(28,32),8,0,8),g.addMany([88,94,95],1,0,7),g.addMany(S,7,0,7),g.addMany(D,7,0,7),g.add(156,7,0,0),g.add(127,7,0,7),g.add(91,1,11,3),g.addMany(v(64,127),3,7,0),g.addMany(v(48,60),3,8,4),g.addMany([60,61,62,63],3,9,4),g.addMany(v(48,60),4,8,4),g.addMany(v(64,127),4,7,0),g.addMany([60,61,62,63],4,0,6),g.addMany(v(32,64),6,0,6),g.add(127,6,0,6),g.addMany(v(64,127),6,0,0),g.addMany(v(32,48),3,9,5),g.addMany(v(32,48),5,9,5),g.addMany(v(48,64),5,0,6),g.addMany(v(64,127),5,7,0),g.addMany(v(32,48),4,9,5),g.addMany(v(32,48),1,9,2),g.addMany(v(32,48),2,9,2),g.addMany(v(48,127),2,10,0),g.addMany(v(48,80),1,10,0),g.addMany(v(81,88),1,10,0),g.addMany([89,90,92],1,10,0),g.addMany(v(96,127),1,10,0),g.add(80,1,11,9),g.addMany(D,9,0,9),g.add(127,9,0,9),g.addMany(v(28,32),9,0,9),g.addMany(v(32,48),9,9,12),g.addMany(v(48,60),9,8,10),g.addMany([60,61,62,63],9,9,10),g.addMany(D,11,0,11),g.addMany(v(32,128),11,0,11),g.addMany(v(28,32),11,0,11),g.addMany(D,10,0,10),g.add(127,10,0,10),g.addMany(v(28,32),10,0,10),g.addMany(v(48,60),10,8,10),g.addMany([60,61,62,63],10,0,11),g.addMany(v(32,48),10,9,12),g.addMany(D,12,0,12),g.add(127,12,0,12),g.addMany(v(28,32),12,0,12),g.addMany(v(32,48),12,9,12),g.addMany(v(48,64),12,0,11),g.addMany(v(64,127),12,12,13),g.addMany(v(64,127),10,12,13),g.addMany(v(64,127),9,12,13),g.addMany(D,13,13,13),g.addMany(S,13,13,13),g.add(127,13,0,13),g.addMany([27,156,24,26],13,14,0),g.add(w,0,2,0),g.add(w,8,5,8),g.add(w,6,0,6),g.add(w,11,0,11),g.add(w,13,13,13),g})();class b extends c.Disposable{constructor(_=a.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 f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,S,D)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,S)=>{},this._escHandlerFb=v=>{},this._errorHandlerFb=v=>v,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,v=[64,126]){let S=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=_.prefix.charCodeAt(0),S&&60>S||S>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 R=0;R<_.intermediates.length;++R){const x=_.intermediates.charCodeAt(R);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=x}}if(_.final.length!==1)throw new Error("final must be a single byte");const D=_.final.charCodeAt(0);if(v[0]>D||D>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return S<<=8,S|=D,S}identToString(_){const v=[];for(;_;)v.push(String.fromCharCode(255&_)),_>>=8;return v.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,v){const S=this._identifier(_,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const D=this._escHandlers[S];return D.push(v),{dispose:()=>{const R=D.indexOf(v);R!==-1&&D.splice(R,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,v){this._executeHandlers[_.charCodeAt(0)]=v}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,v){const S=this._identifier(_);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const D=this._csiHandlers[S];return D.push(v),{dispose:()=>{const R=D.indexOf(v);R!==-1&&D.splice(R,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,v){return this._dcsParser.registerHandler(this._identifier(_),v)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,v){return this._oscParser.registerHandler(_,v)}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(_,v,S,D,R){this._parseStack.state=_,this._parseStack.handlers=v,this._parseStack.handlerPos=S,this._parseStack.transition=D,this._parseStack.chunkPos=R}parse(_,v,S){let D,R=0,x=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&L>-1){for(;L>=0&&(D=k[L](this._params),D!==!0);L--)if(D instanceof Promise)return this._parseStack.handlerPos=L,D}this._parseStack.handlers=[];break;case 4:if(S===!1&&L>-1){for(;L>=0&&(D=k[L](),D!==!0);L--)if(D instanceof Promise)return this._parseStack.handlerPos=L,D}this._parseStack.handlers=[];break;case 6:if(R=_[this._parseStack.chunkPos],D=this._dcsParser.unhook(R!==24&&R!==26,S),D)return D;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=_[this._parseStack.chunkPos],D=this._oscParser.end(R!==24&&R!==26,S),D)return D;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=M;k<v;++k){switch(R=_[k],x=this._transitions.table[this.currentState<<8|(R<160?R:w)],x>>4){case 2:for(let F=k+1;;++F){if(F>=v||(R=_[F])<32||R>126&&R<w){this._printHandler(_,k,F),k=F-1;break}if(++F>=v||(R=_[F])<32||R>126&&R<w){this._printHandler(_,k,F),k=F-1;break}if(++F>=v||(R=_[F])<32||R>126&&R<w){this._printHandler(_,k,F),k=F-1;break}if(++F>=v||(R=_[F])<32||R>126&&R<w){this._printHandler(_,k,F),k=F-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|R];let T=L?L.length-1:-1;for(;T>=0&&(D=L[T](this._params),D!==!0);T--)if(D instanceof Promise)return this._preserveStack(3,L,T,x,k),D;T<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++k<v&&(R=_[k])>47&&R<60);k--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const P=this._escHandlers[this._collect<<8|R];let B=P?P.length-1:-1;for(;B>=0&&(D=P[B](),D!==!0);B--)if(D instanceof Promise)return this._preserveStack(4,P,B,x,k),D;B<0&&this._escHandlerFb(this._collect<<8|R),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|R,this._params);break;case 13:for(let F=k+1;;++F)if(F>=v||(R=_[F])===24||R===26||R===27||R>127&&R<w){this._dcsParser.put(_,k,F),k=F-1;break}break;case 14:if(D=this._dcsParser.unhook(R!==24&&R!==26),D)return this._preserveStack(6,[],0,x,k),D;R===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let F=k+1;;F++)if(F>=v||(R=_[F])<32||R>127&&R<w){this._oscParser.put(_,k,F),k=F-1;break}break;case 6:if(D=this._oscParser.end(R!==24&&R!==26),D)return this._preserveStack(5,[],0,x,k),D;R===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&x}}}a.EscapeSequenceParser=b},6242:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const c=l(5770),f=l(482),u=[];a.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,C){this._handlers[y]===void 0&&(this._handlers[y]=[]);const w=this._handlers[y];return w.push(C),{dispose:()=>{const b=w.indexOf(C);b!==-1&&w.splice(b,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,C,w){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(y,C,w);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(y,C,w))}start(){this.reset(),this._state=1}put(y,C,w){if(this._state!==3){if(this._state===1)for(;C<w;){const b=y[C++];if(b===59){this._state=2,this._start();break}if(b<48||57<b)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+b-48}this._state===2&&w-C>0&&this._put(y,C,w)}}end(y,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,b=this._active.length-1,g=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,w=C,g=this._stack.fallThrough,this._stack.paused=!1),!g&&w===!1){for(;b>=0&&(w=this._active[b].end(y),w!==!0);b--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,w;b--}for(;b>=0;b--)if(w=this._active[b].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",y);this._active=u,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,C,w){this._hitLimit||(this._data+=(0,f.utf32ToString)(y,C,w),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let C=!1;if(this._hitLimit)C=!1;else if(y&&(C=this._handler(this._data),C instanceof Promise))return C.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,C}}},8742:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const l=2147483647;class c{static fromArray(u){const y=new c;if(!u.length)return y;for(let C=Array.isArray(u[0])?1:0;C<u.length;++C){const w=u[C];if(Array.isArray(w))for(let b=0;b<w.length;++b)y.addSubParam(w[b]);else y.addParam(w)}return y}constructor(u=32,y=32){if(this.maxLength=u,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(y),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let y=0;y<this.length;++y){u.push(this.params[y]);const C=this._subParamsIdx[y]>>8,w=255&this._subParamsIdx[y];w-C>0&&u.push(Array.prototype.slice.call(this._subParams,C,w))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>l?l:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>l?l:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const y=this._subParamsIdx[u]>>8,C=255&this._subParamsIdx[u];return C-y>0?this._subParams.subarray(y,C):null}getSubParamsAll(){const u={};for(let y=0;y<this.length;++y){const C=this._subParamsIdx[y]>>8,w=255&this._subParamsIdx[y];w-C>0&&(u[y]=this._subParams.slice(C,w))}return u}addDigit(u){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,w=C[y-1];C[y-1]=~w?Math.min(10*w+u,l):u}}a.Params=c},5741:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,c){const f={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(f),c.dispose=()=>this._wrappedAddonDispose(f),c.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let c=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===l){c=f;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(c,1)}}},8771:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const c=l(3785),f=l(511);a.BufferApiView=class{constructor(u,y){this._buffer=u,this.type=y}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const y=this._buffer.lines.get(u);if(y)return new c.BufferLineApiView(y)}getNullCell(){return new f.CellData}}},3785:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const c=l(511);a.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,u){if(!(f<0||f>=this._line.length))return u?(this._line.loadCell(f,u),u):this._line.loadCell(f,new c.CellData)}translateToString(f,u,y){return this._line.translateToString(f,u,y)}}},8285:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const c=l(8771),f=l(8460),u=l(844);class y extends u.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.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)}}a.BufferNamespaceApi=y},7975:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,c){return this._core.registerCsiHandler(l,(f=>c(f.toArray())))}addCsiHandler(l,c){return this.registerCsiHandler(l,c)}registerDcsHandler(l,c){return this._core.registerDcsHandler(l,((f,u)=>c(f,u.toArray())))}addDcsHandler(l,c){return this.registerDcsHandler(l,c)}registerEscHandler(l,c){return this._core.registerEscHandler(l,c)}addEscHandler(l,c){return this.registerEscHandler(l,c)}registerOscHandler(l,c){return this._core.registerOscHandler(l,c)}addOscHandler(l,c){return this.registerOscHandler(l,c)}}},7090:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(p,a,l){var c=this&&this.__decorate||function(g,_,v,S){var D,R=arguments.length,x=R<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,_,v,S);else for(var M=g.length-1;M>=0;M--)(D=g[M])&&(x=(R<3?D(x):R>3?D(_,v,x):D(_,v))||x);return R>3&&x&&Object.defineProperty(_,v,x),x},f=this&&this.__param||function(g,_){return function(v,S){_(v,S,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const u=l(8460),y=l(844),C=l(5295),w=l(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let b=a.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(g){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(g.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(g.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(g,this))}resize(g,_){this.cols=g,this.rows=_,this.buffers.resize(g,_),this._onResize.fire({cols:g,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(g,_=!1){const v=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===g.fg&&S.getBg(0)===g.bg||(S=v.getBlankLine(g,_),this._cachedBlankLine=S),S.isWrapped=_;const D=v.ybase+v.scrollTop,R=v.ybase+v.scrollBottom;if(v.scrollTop===0){const x=v.lines.isFull;R===v.lines.length-1?x?v.lines.recycle().copyFrom(S):v.lines.push(S.clone()):v.lines.splice(R+1,0,S.clone()),x?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const x=R-D+1;v.lines.shiftElements(D+1,x-1,-1),v.lines.set(R,S.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(g,_,v){const S=this.buffer;if(g<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else g+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const D=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+g,S.ybase),0),D!==S.ydisp&&(_||this._onScroll.fire(S.ydisp))}};a.BufferService=b=c([f(0,w.IOptionsService)],b)},7994:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,c){this._charsets[l]=c,this.glevel===l&&(this.charset=c)}}},1753:function(p,a,l){var c=this&&this.__decorate||function(S,D,R,x){var M,k=arguments.length,L=k<3?D:x===null?x=Object.getOwnPropertyDescriptor(D,R):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(S,D,R,x);else for(var T=S.length-1;T>=0;T--)(M=S[T])&&(L=(k<3?M(L):k>3?M(D,R,L):M(D,R))||L);return k>3&&L&&Object.defineProperty(D,R,L),L},f=this&&this.__param||function(S,D){return function(R,x){D(R,x,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const u=l(2585),y=l(8460),C=l(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function b(S,D){let R=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(R|=64,R|=S.action):(R|=3&S.button,4&S.button&&(R|=64),8&S.button&&(R|=128),S.action===32?R|=32:S.action!==0||D||(R|=3)),R}const g=String.fromCharCode,_={DEFAULT:S=>{const D=[b(S,!1)+32,S.col+32,S.row+32];return D[0]>255||D[1]>255||D[2]>255?"":`\x1B[M${g(D[0])}${g(D[1])}${g(D[2])}`},SGR:S=>{const D=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${b(S,!0)};${S.col};${S.row}${D}`},SGR_PIXELS:S=>{const D=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${b(S,!0)};${S.x};${S.y}${D}`}};let v=a.CoreMouseService=class extends C.Disposable{constructor(S,D){super(),this._bufferService=S,this._coreService=D,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(w))this.addProtocol(R,w[R]);for(const R of Object.keys(_))this.addEncoding(R,_[R]);this.reset()}addProtocol(S,D){this._protocols[S]=D}addEncoding(S,D){this._encodings[S]=D}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const D=this._encodings[this._activeEncoding](S);return D&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(D):this._coreService.triggerDataEvent(D,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,D,R){if(R){if(S.x!==D.x||S.y!==D.y)return!1}else if(S.col!==D.col||S.row!==D.row)return!1;return S.button===D.button&&S.action===D.action&&S.ctrl===D.ctrl&&S.alt===D.alt&&S.shift===D.shift}};a.CoreMouseService=v=c([f(0,u.IBufferService),f(1,u.ICoreService)],v)},6975:function(p,a,l){var c=this&&this.__decorate||function(v,S,D,R){var x,M=arguments.length,k=M<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,D):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,S,D,R);else for(var L=v.length-1;L>=0;L--)(x=v[L])&&(k=(M<3?x(k):M>3?x(S,D,k):x(S,D))||k);return M>3&&k&&Object.defineProperty(S,D,k),k},f=this&&this.__param||function(v,S){return function(D,R){S(D,R,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const u=l(1439),y=l(8460),C=l(844),w=l(2585),b=Object.freeze({insertMode:!1}),g=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=a.CoreService=class extends C.Disposable{constructor(v,S,D){super(),this._bufferService=v,this._logService=S,this._optionsService=D,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(b),this.decPrivateModes=(0,u.clone)(g)}reset(){this.modes=(0,u.clone)(b),this.decPrivateModes=(0,u.clone)(g)}triggerDataEvent(v,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const D=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&D.ybase!==D.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(v))}};a.CoreService=_=c([f(0,w.IBufferService),f(1,w.ILogService),f(2,w.IOptionsService)],_)},9074:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const c=l(8055),f=l(8460),u=l(844),y=l(6106);let C=0,w=0;class b extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((v=>v==null?void 0:v.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(v){if(v.marker.isDisposed)return;const S=new g(v);if(S){const D=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),D.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,S,D){let R=0,x=0;for(const M of this._decorations.getKeyIterator(S))R=M.options.x??0,x=R+(M.options.width??1),v>=R&&v<x&&(!D||(M.options.layer??"bottom")===D)&&(yield M)}forEachDecorationAtCell(v,S,D,R){this._decorations.forEachByKey(S,(x=>{C=x.options.x??0,w=C+(x.options.width??1),v>=C&&v<w&&(!D||(x.options.layer??"bottom")===D)&&R(x)}))}}a.DecorationService=b;class g extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(v){super(),this.options=v,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=v.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const c=l(2585),f=l(8343);class u{constructor(...C){this._entries=new Map;for(const[w,b]of C)this.set(w,b)}set(C,w){const b=this._entries.get(C);return this._entries.set(C,w),b}forEach(C){for(const[w,b]of this._entries.entries())C(w,b)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}a.ServiceCollection=u,a.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(y,C){this._services.set(y,C)}getService(y){return this._services.get(y)}createInstance(y,...C){const w=(0,f.getServiceDependencies)(y).sort(((_,v)=>_.index-v.index)),b=[];for(const _ of w){const v=this._services.get(_.id);if(!v)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${_.id}.`);b.push(v)}const g=w.length>0?w[0].index:C.length;if(C.length!==g)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${g+1} conflicts with ${C.length} static arguments`);return new y(...C,...b)}}},7866:function(p,a,l){var c=this&&this.__decorate||function(g,_,v,S){var D,R=arguments.length,x=R<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,_,v,S);else for(var M=g.length-1;M>=0;M--)(D=g[M])&&(x=(R<3?D(x):R>3?D(_,v,x):D(_,v))||x);return R>3&&x&&Object.defineProperty(_,v,x),x},f=this&&this.__param||function(g,_){return function(v,S){_(v,S,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const u=l(844),y=l(2585),C={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let w,b=a.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let _=0;_<g.length;_++)typeof g[_]=="function"&&(g[_]=g[_]())}_log(g,_,v){this._evalLazyOptionalParams(v),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+_,...v)}trace(g,..._){var v;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.trace.bind(this._optionsService.options.logger))??console.log,g,_)}debug(g,..._){var v;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.debug.bind(this._optionsService.options.logger))??console.log,g,_)}info(g,..._){var v;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.info.bind(this._optionsService.options.logger))??console.info,g,_)}warn(g,..._){var v;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.warn.bind(this._optionsService.options.logger))??console.warn,g,_)}error(g,..._){var v;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.error.bind(this._optionsService.options.logger))??console.error,g,_)}};a.LogService=b=c([f(0,y.IOptionsService)],b),a.setTraceLogger=function(g){w=g},a.traceCall=function(g,_,v){if(typeof v.value!="function")throw new Error("not supported");const S=v.value;v.value=function(...D){if(w.logLevel!==y.LogLevelEnum.TRACE)return S.apply(this,D);w.trace(`GlyphRenderer#${S.name}(${D.map((x=>JSON.stringify(x))).join(", ")})`);const R=S.apply(this,D);return w.trace(`GlyphRenderer#${S.name} return`,R),R}}},7302:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const c=l(8460),f=l(844),u=l(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const y=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends f.Disposable{constructor(b){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const g={...a.DEFAULT_OPTIONS};for(const _ in b)if(_ in g)try{const v=b[_];g[_]=this._sanitizeAndValidateOption(_,v)}catch(v){console.error(v)}this.rawOptions=g,this.options={...g},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(b,g){return this.onOptionChange((_=>{_===b&&g(this.rawOptions[b])}))}onMultipleOptionChange(b,g){return this.onOptionChange((_=>{b.indexOf(_)!==-1&&g()}))}_setupOptions(){const b=_=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},g=(_,v)=>{if(!(_ in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);v=this._sanitizeAndValidateOption(_,v),this.rawOptions[_]!==v&&(this.rawOptions[_]=v,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const v={get:b.bind(this,_),set:g.bind(this,_)};Object.defineProperty(this.options,_,v)}}_sanitizeAndValidateOption(b,g){switch(b){case"cursorStyle":if(g||(g=a.DEFAULT_OPTIONS[b]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(g))throw new Error(`"${g}" is not a valid value for ${b}`);break;case"wordSeparator":g||(g=a.DEFAULT_OPTIONS[b]);break;case"fontWeight":case"fontWeightBold":if(typeof g=="number"&&1<=g&&g<=1e3)break;g=y.includes(g)?g:a.DEFAULT_OPTIONS[b];break;case"cursorWidth":g=Math.floor(g);case"lineHeight":case"tabStopWidth":if(g<1)throw new Error(`${b} cannot be less than 1, value: ${g}`);break;case"minimumContrastRatio":g=Math.max(1,Math.min(21,Math.round(10*g)/10));break;case"scrollback":if((g=Math.min(g,4294967295))<0)throw new Error(`${b} cannot be less than 0, value: ${g}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(g<=0)throw new Error(`${b} cannot be less than or equal to 0, value: ${g}`);break;case"rows":case"cols":if(!g&&g!==0)throw new Error(`${b} must be numeric, value: ${g}`);break;case"windowsPty":g=g??{}}return g}}a.OptionsService=C},2660:function(p,a,l){var c=this&&this.__decorate||function(C,w,b,g){var _,v=arguments.length,S=v<3?w:g===null?g=Object.getOwnPropertyDescriptor(w,b):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,w,b,g);else for(var D=C.length-1;D>=0;D--)(_=C[D])&&(S=(v<3?_(S):v>3?_(w,b,S):_(w,b))||S);return v>3&&S&&Object.defineProperty(w,b,S),S},f=this&&this.__param||function(C,w){return function(b,g){w(b,g,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const u=l(2585);let y=a.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const w=this._bufferService.buffer;if(C.id===void 0){const D=w.addMarker(w.ybase+w.y),R={data:C,id:this._nextId++,lines:[D]};return D.onDispose((()=>this._removeMarkerFromLink(R,D))),this._dataByLinkId.set(R.id,R),R.id}const b=C,g=this._getEntryIdKey(b),_=this._entriesWithId.get(g);if(_)return this.addLineToLink(_.id,w.ybase+w.y),_.id;const v=w.addMarker(w.ybase+w.y),S={id:this._nextId++,key:this._getEntryIdKey(b),data:b,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(S,v))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(C,w){const b=this._dataByLinkId.get(C);if(b&&b.lines.every((g=>g.line!==w))){const g=this._bufferService.buffer.addMarker(w);b.lines.push(g),g.onDispose((()=>this._removeMarkerFromLink(b,g)))}}getLinkData(C){var w;return(w=this._dataByLinkId.get(C))==null?void 0:w.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,w){const b=C.lines.indexOf(w);b!==-1&&(C.lines.splice(b,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};a.OscLinkService=y=c([f(0,u.IBufferService)],y)},8343:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const l="di$target",c="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(f){return f[c]||[]},a.createDecorator=function(f){if(a.serviceRegistry.has(f))return a.serviceRegistry.get(f);const u=function(y,C,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,g,_){g[l]===g?g[c].push({id:b,index:_}):(g[c]=[{id:b,index:_}],g[l]=g)})(u,y,w)};return u.toString=()=>f,a.serviceRegistry.set(f,u),u}},2585:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const c=l(8343);var f;a.IBufferService=(0,c.createDecorator)("BufferService"),a.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),a.ICoreService=(0,c.createDecorator)("CoreService"),a.ICharsetService=(0,c.createDecorator)("CharsetService"),a.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(f||(a.LogLevelEnum=f={})),a.ILogService=(0,c.createDecorator)("LogService"),a.IOptionsService=(0,c.createDecorator)("OptionsService"),a.IOscLinkService=(0,c.createDecorator)("OscLinkService"),a.IUnicodeService=(0,c.createDecorator)("UnicodeService"),a.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const c=l(8460),f=l(225);class u{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,w,b=!1){return(16777215&C)<<3|(3&w)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const C=new f.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let w=0,b=0;const g=C.length;for(let _=0;_<g;++_){let v=C.charCodeAt(_);if(55296<=v&&v<=56319){if(++_>=g)return w+this.wcwidth(v);const R=C.charCodeAt(_);56320<=R&&R<=57343?v=1024*(v-55296)+R-56320+65536:w+=this.wcwidth(R)}const S=this.charProperties(v,b);let D=u.extractWidth(S);u.extractShouldJoin(S)&&(D-=u.extractWidth(b)),w+=D,b=S}return w}charProperties(C,w){return this._activeProvider.charProperties(C,w)}}a.UnicodeService=u}},o={};function h(p){var a=o[p];if(a!==void 0)return a.exports;var l=o[p]={exports:{}};return r[p].call(l.exports,l,l.exports,h),l.exports}var m={};return(()=>{var p=m;Object.defineProperty(p,"__esModule",{value:!0}),p.Terminal=void 0;const a=h(9042),l=h(3236),c=h(844),f=h(5741),u=h(8285),y=h(7975),C=h(7090),w=["cols","rows"];class b extends c.Disposable{constructor(_){super(),this._core=this.register(new l.Terminal(_)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const v=D=>this._core.options[D],S=(D,R)=>{this._checkReadonlyOptions(D),this._core.options[D]=R};for(const D in this._core.options){const R={get:v.bind(this,D),set:S.bind(this,D)};Object.defineProperty(this._publicOptions,D,R)}}_checkReadonlyOptions(_){if(w.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 y.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=this._core.coreService.decPrivateModes;let v="none";switch(this._core.coreMouseService.activeProtocol){case"X10":v="x10";break;case"VT200":v="vt200";break;case"DRAG":v="drag";break;case"ANY":v="any"}return{applicationCursorKeysMode:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const v in _)this._publicOptions[v]=_[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,v=!0){this._core.input(_,v)}resize(_,v){this._verifyIntegers(_,v),this._core.resize(_,v)}open(_){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(_,v,S){this._verifyIntegers(_,v,S),this._core.select(_,v,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,v){this._verifyIntegers(_,v),this._core.selectLines(_,v)}dispose(){super.dispose()}scrollLines(_){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(_,v){this._core.write(_,v)}writeln(_,v){this._core.write(_),this._core.write(`\r
93
- `,v)}paste(_){this._core.paste(_)}refresh(_,v){this._verifyIntegers(_,v),this._core.refresh(_,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return a}_verifyIntegers(..._){for(const v of _)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const v of _)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}p.Terminal=b})(),m})()))})(ed)),ed.exports}var R2=k2(),td={exports:{}},Q_;function T2(){return Q_||(Q_=1,(function(e,i){(function(r,o){e.exports=o()})(self,(()=>(()=>{var r={};return(()=>{var o=r;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(h){this._terminal=h}dispose(){}fit(){const h=this.proposeDimensions();if(!h||!this._terminal||isNaN(h.cols)||isNaN(h.rows))return;const m=this._terminal._core;this._terminal.rows===h.rows&&this._terminal.cols===h.cols||(m._renderService.clear(),this._terminal.resize(h.cols,h.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const h=this._terminal._core,m=h._renderService.dimensions;if(m.css.cell.width===0||m.css.cell.height===0)return;const p=this._terminal.options.scrollback===0?0:h.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(a.getPropertyValue("height")),c=Math.max(0,parseInt(a.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),u=l-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),y=c-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-p;return{cols:Math.max(2,Math.floor(y/m.css.cell.width)),rows:Math.max(1,Math.floor(u/m.css.cell.height))}}}})(),r})()))})(td)),td.exports}var M2=T2(),nd={exports:{}},J_;function L2(){return J_||(J_=1,(function(e,i){(function(r,o){e.exports=o()})(self,(()=>(()=>{var r={965:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GlyphRenderer=void 0;const c=l(374),f=l(509),u=l(855),y=l(859),C=l(381),w=11,b=w*Float32Array.BYTES_PER_ELEMENT;let g,_=0,v=0,S=0;class D extends y.Disposable{constructor(x,M,k,L){super(),this._terminal=x,this._gl=M,this._dimensions=k,this._optionsService=L,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const T=this._gl;f.TextureAtlas.maxAtlasPages===void 0&&(f.TextureAtlas.maxAtlasPages=Math.min(32,(0,c.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_IMAGE_UNITS))),f.TextureAtlas.maxTextureSize=(0,c.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_SIZE))),this._program=(0,c.throwIfFalsy)((0,C.createProgram)(T,`#version 300 es
94
- layout (location = 0) in vec2 a_unitquad;
95
- layout (location = 1) in vec2 a_cellpos;
96
- layout (location = 2) in vec2 a_offset;
97
- layout (location = 3) in vec2 a_size;
98
- layout (location = 4) in float a_texpage;
99
- layout (location = 5) in vec2 a_texcoord;
100
- layout (location = 6) in vec2 a_texsize;
101
-
102
- uniform mat4 u_projection;
103
- uniform vec2 u_resolution;
104
-
105
- out vec2 v_texcoord;
106
- flat out int v_texpage;
107
-
108
- void main() {
109
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
110
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
111
- v_texpage = int(a_texpage);
112
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
113
- }`,(function(W){let K="";for(let X=1;X<W;X++)K+=` else if (v_texpage == ${X}) { outColor = texture(u_texture[${X}], v_texcoord); }`;return`#version 300 es
114
- precision lowp float;
115
-
116
- in vec2 v_texcoord;
117
- flat in int v_texpage;
118
-
119
- uniform sampler2D u_texture[${W}];
120
-
121
- out vec4 outColor;
122
-
123
- void main() {
124
- if (v_texpage == 0) {
125
- outColor = texture(u_texture[0], v_texcoord);
126
- } ${K}
127
- }`})(f.TextureAtlas.maxAtlasPages))),this.register((0,y.toDisposable)((()=>T.deleteProgram(this._program)))),this._projectionLocation=(0,c.throwIfFalsy)(T.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,c.throwIfFalsy)(T.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,c.throwIfFalsy)(T.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);const P=new Float32Array([0,0,1,0,0,1,1,1]),B=T.createBuffer();this.register((0,y.toDisposable)((()=>T.deleteBuffer(B)))),T.bindBuffer(T.ARRAY_BUFFER,B),T.bufferData(T.ARRAY_BUFFER,P,T.STATIC_DRAW),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const F=new Uint8Array([0,1,2,3]),$=T.createBuffer();this.register((0,y.toDisposable)((()=>T.deleteBuffer($)))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,$),T.bufferData(T.ELEMENT_ARRAY_BUFFER,F,T.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(T.createBuffer()),this.register((0,y.toDisposable)((()=>T.deleteBuffer(this._attributesBuffer)))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,2,T.FLOAT,!1,b,0),T.vertexAttribDivisor(2,1),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,T.FLOAT,!1,b,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(3,1),T.enableVertexAttribArray(4),T.vertexAttribPointer(4,1,T.FLOAT,!1,b,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(4,1),T.enableVertexAttribArray(5),T.vertexAttribPointer(5,2,T.FLOAT,!1,b,5*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(5,1),T.enableVertexAttribArray(6),T.vertexAttribPointer(6,2,T.FLOAT,!1,b,7*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(6,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,b,9*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.useProgram(this._program);const q=new Int32Array(f.TextureAtlas.maxAtlasPages);for(let W=0;W<f.TextureAtlas.maxAtlasPages;W++)q[W]=W;T.uniform1iv(this._textureLocation,q),T.uniformMatrix4fv(this._projectionLocation,!1,C.PROJECTION_MATRIX),this._atlasTextures=[];for(let W=0;W<f.TextureAtlas.maxAtlasPages;W++){const K=new C.GLTexture((0,c.throwIfFalsy)(T.createTexture()));this.register((0,y.toDisposable)((()=>T.deleteTexture(K.texture)))),T.activeTexture(T.TEXTURE0+W),T.bindTexture(T.TEXTURE_2D,K.texture),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.texImage2D(T.TEXTURE_2D,0,T.RGBA,1,1,0,T.RGBA,T.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[W]=K}T.enable(T.BLEND),T.blendFunc(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(x,M,k,L,T,P,B,F,$){this._updateCell(this._vertices.attributes,x,M,k,L,T,P,B,F,$)}_updateCell(x,M,k,L,T,P,B,F,$,q){_=(k*this._terminal.cols+M)*w,L!==u.NULL_CELL_CODE&&L!==void 0?this._atlas&&(g=F&&F.length>1?this._atlas.getRasterizedGlyphCombinedChar(F,T,P,B,!1):this._atlas.getRasterizedGlyph(L,T,P,B,!1),v=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),T!==q&&g.offset.x>v?(S=g.offset.x-v,x[_]=-(g.offset.x-S)+this._dimensions.device.char.left,x[_+1]=-g.offset.y+this._dimensions.device.char.top,x[_+2]=(g.size.x-S)/this._dimensions.device.canvas.width,x[_+3]=g.size.y/this._dimensions.device.canvas.height,x[_+4]=g.texturePage,x[_+5]=g.texturePositionClipSpace.x+S/this._atlas.pages[g.texturePage].canvas.width,x[_+6]=g.texturePositionClipSpace.y,x[_+7]=g.sizeClipSpace.x-S/this._atlas.pages[g.texturePage].canvas.width,x[_+8]=g.sizeClipSpace.y):(x[_]=-g.offset.x+this._dimensions.device.char.left,x[_+1]=-g.offset.y+this._dimensions.device.char.top,x[_+2]=g.size.x/this._dimensions.device.canvas.width,x[_+3]=g.size.y/this._dimensions.device.canvas.height,x[_+4]=g.texturePage,x[_+5]=g.texturePositionClipSpace.x,x[_+6]=g.texturePositionClipSpace.y,x[_+7]=g.sizeClipSpace.x,x[_+8]=g.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,c.allowRescaling)(L,$,g.size.x,this._dimensions.device.cell.width)&&(x[_+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):x.fill(0,_,_+w-1-2)}clear(){const x=this._terminal,M=x.cols*x.rows*w;this._vertices.count!==M?this._vertices.attributes=new Float32Array(M):this._vertices.attributes.fill(0);let k=0;for(;k<this._vertices.attributesBuffers.length;k++)this._vertices.count!==M?this._vertices.attributesBuffers[k]=new Float32Array(M):this._vertices.attributesBuffers[k].fill(0);this._vertices.count=M,k=0;for(let L=0;L<x.rows;L++)for(let T=0;T<x.cols;T++)this._vertices.attributes[k+9]=T/x.cols,this._vertices.attributes[k+10]=L/x.rows,k+=w}handleResize(){const x=this._gl;x.useProgram(this._program),x.viewport(0,0,x.canvas.width,x.canvas.height),x.uniform2f(this._resolutionLocation,x.canvas.width,x.canvas.height),this.clear()}render(x){if(!this._atlas)return;const M=this._gl;M.useProgram(this._program),M.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const k=this._vertices.attributesBuffers[this._activeBuffer];let L=0;for(let T=0;T<x.lineLengths.length;T++){const P=T*this._terminal.cols*w,B=this._vertices.attributes.subarray(P,P+x.lineLengths[T]*w);k.set(B,L),L+=B.length}M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.bufferData(M.ARRAY_BUFFER,k.subarray(0,L),M.STREAM_DRAW);for(let T=0;T<this._atlas.pages.length;T++)this._atlas.pages[T].version!==this._atlasTextures[T].version&&this._bindAtlasPageTexture(M,this._atlas,T);M.drawElementsInstanced(M.TRIANGLE_STRIP,4,M.UNSIGNED_BYTE,0,L/w)}setAtlas(x){this._atlas=x;for(const M of this._atlasTextures)M.version=-1}_bindAtlasPageTexture(x,M,k){x.activeTexture(x.TEXTURE0+k),x.bindTexture(x.TEXTURE_2D,this._atlasTextures[k].texture),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_S,x.CLAMP_TO_EDGE),x.texParameteri(x.TEXTURE_2D,x.TEXTURE_WRAP_T,x.CLAMP_TO_EDGE),x.texImage2D(x.TEXTURE_2D,0,x.RGBA,x.RGBA,x.UNSIGNED_BYTE,M.pages[k].canvas),x.generateMipmap(x.TEXTURE_2D),this._atlasTextures[k].version=M.pages[k].version}setDimensions(x){this._dimensions=x}}a.GlyphRenderer=D},742:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RectangleRenderer=void 0;const c=l(374),f=l(859),u=l(310),y=l(381),C=8*Float32Array.BYTES_PER_ELEMENT;class w{constructor(){this.attributes=new Float32Array(160),this.count=0}}let b=0,g=0,_=0,v=0,S=0,D=0,R=0;class x extends f.Disposable{constructor(k,L,T,P){super(),this._terminal=k,this._gl=L,this._dimensions=T,this._themeService=P,this._vertices=new w,this._verticesCursor=new w;const B=this._gl;this._program=(0,c.throwIfFalsy)((0,y.createProgram)(B,`#version 300 es
128
- layout (location = 0) in vec2 a_position;
129
- layout (location = 1) in vec2 a_size;
130
- layout (location = 2) in vec4 a_color;
131
- layout (location = 3) in vec2 a_unitquad;
132
-
133
- uniform mat4 u_projection;
134
-
135
- out vec4 v_color;
136
-
137
- void main() {
138
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
139
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
140
- v_color = a_color;
141
- }`,`#version 300 es
142
- precision lowp float;
143
-
144
- in vec4 v_color;
145
-
146
- out vec4 outColor;
147
-
148
- void main() {
149
- outColor = v_color;
150
- }`)),this.register((0,f.toDisposable)((()=>B.deleteProgram(this._program)))),this._projectionLocation=(0,c.throwIfFalsy)(B.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=B.createVertexArray(),B.bindVertexArray(this._vertexArrayObject);const F=new Float32Array([0,0,1,0,0,1,1,1]),$=B.createBuffer();this.register((0,f.toDisposable)((()=>B.deleteBuffer($)))),B.bindBuffer(B.ARRAY_BUFFER,$),B.bufferData(B.ARRAY_BUFFER,F,B.STATIC_DRAW),B.enableVertexAttribArray(3),B.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const q=new Uint8Array([0,1,2,3]),W=B.createBuffer();this.register((0,f.toDisposable)((()=>B.deleteBuffer(W)))),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,W),B.bufferData(B.ELEMENT_ARRAY_BUFFER,q,B.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(B.createBuffer()),this.register((0,f.toDisposable)((()=>B.deleteBuffer(this._attributesBuffer)))),B.bindBuffer(B.ARRAY_BUFFER,this._attributesBuffer),B.enableVertexAttribArray(0),B.vertexAttribPointer(0,2,B.FLOAT,!1,C,0),B.vertexAttribDivisor(0,1),B.enableVertexAttribArray(1),B.vertexAttribPointer(1,2,B.FLOAT,!1,C,2*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(1,1),B.enableVertexAttribArray(2),B.vertexAttribPointer(2,4,B.FLOAT,!1,C,4*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(2,1),this._updateCachedColors(P.colors),this.register(this._themeService.onChangeColors((K=>{this._updateCachedColors(K),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(k){const L=this._gl;L.useProgram(this._program),L.bindVertexArray(this._vertexArrayObject),L.uniformMatrix4fv(this._projectionLocation,!1,y.PROJECTION_MATRIX),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.bufferData(L.ARRAY_BUFFER,k.attributes,L.DYNAMIC_DRAW),L.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,L.UNSIGNED_BYTE,0,k.count)}handleResize(){this._updateViewportRectangle()}setDimensions(k){this._dimensions=k}_updateCachedColors(k){this._bgFloat=this._colorToFloat32Array(k.background),this._cursorFloat=this._colorToFloat32Array(k.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(k){const L=this._terminal,T=this._vertices;let P,B,F,$,q,W,K,X,U,O,z,j=1;for(P=0;P<L.rows;P++){for(F=-1,$=0,q=0,W=!1,B=0;B<L.cols;B++)K=(P*L.cols+B)*u.RENDER_MODEL_INDICIES_PER_CELL,X=k.cells[K+u.RENDER_MODEL_BG_OFFSET],U=k.cells[K+u.RENDER_MODEL_FG_OFFSET],O=!!(67108864&U),(X!==$||U!==q&&(W||O))&&(($!==0||W&&q!==0)&&(z=8*j++,this._updateRectangle(T,z,q,$,F,B,P)),F=B,$=X,q=U,W=O);($!==0||W&&q!==0)&&(z=8*j++,this._updateRectangle(T,z,q,$,F,L.cols,P))}T.count=j}updateCursor(k){const L=this._verticesCursor,T=k.cursor;if(!T||T.style==="block")return void(L.count=0);let P,B=0;T.style!=="bar"&&T.style!=="outline"||(P=8*B++,this._addRectangleFloat(L.attributes,P,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.style==="bar"?T.dpr*T.cursorWidth:T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),T.style!=="underline"&&T.style!=="outline"||(P=8*B++,this._addRectangleFloat(L.attributes,P,T.x*this._dimensions.device.cell.width,(T.y+1)*this._dimensions.device.cell.height-T.dpr,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat)),T.style==="outline"&&(P=8*B++,this._addRectangleFloat(L.attributes,P,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat),P=8*B++,this._addRectangleFloat(L.attributes,P,(T.x+T.width)*this._dimensions.device.cell.width-T.dpr,T.y*this._dimensions.device.cell.height,T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.count=B}_updateRectangle(k,L,T,P,B,F,$){if(67108864&T)switch(50331648&T){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&T].rgba;break;case 50331648:b=(16777215&T)<<8;break;default:b=this._themeService.colors.foreground.rgba}else switch(50331648&P){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&P].rgba;break;case 50331648:b=(16777215&P)<<8;break;default:b=this._themeService.colors.background.rgba}k.attributes.length<L+4&&(k.attributes=(0,y.expandFloat32Array)(k.attributes,this._terminal.rows*this._terminal.cols*8)),g=B*this._dimensions.device.cell.width,_=$*this._dimensions.device.cell.height,v=(b>>24&255)/255,S=(b>>16&255)/255,D=(b>>8&255)/255,R=1,this._addRectangle(k.attributes,L,g,_,(F-B)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,v,S,D,R)}_addRectangle(k,L,T,P,B,F,$,q,W,K){k[L]=T/this._dimensions.device.canvas.width,k[L+1]=P/this._dimensions.device.canvas.height,k[L+2]=B/this._dimensions.device.canvas.width,k[L+3]=F/this._dimensions.device.canvas.height,k[L+4]=$,k[L+5]=q,k[L+6]=W,k[L+7]=K}_addRectangleFloat(k,L,T,P,B,F,$){k[L]=T/this._dimensions.device.canvas.width,k[L+1]=P/this._dimensions.device.canvas.height,k[L+2]=B/this._dimensions.device.canvas.width,k[L+3]=F/this._dimensions.device.canvas.height,k[L+4]=$[0],k[L+5]=$[1],k[L+6]=$[2],k[L+7]=$[3]}_colorToFloat32Array(k){return new Float32Array([(k.rgba>>24&255)/255,(k.rgba>>16&255)/255,(k.rgba>>8&255)/255,(255&k.rgba)/255])}}a.RectangleRenderer=x},310:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderModel=a.COMBINED_CHAR_BIT_MASK=a.RENDER_MODEL_EXT_OFFSET=a.RENDER_MODEL_FG_OFFSET=a.RENDER_MODEL_BG_OFFSET=a.RENDER_MODEL_INDICIES_PER_CELL=void 0;const c=l(296);a.RENDER_MODEL_INDICIES_PER_CELL=4,a.RENDER_MODEL_BG_OFFSET=1,a.RENDER_MODEL_FG_OFFSET=2,a.RENDER_MODEL_EXT_OFFSET=3,a.COMBINED_CHAR_BIT_MASK=2147483648,a.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,c.createSelectionRenderModel)()}resize(f,u){const y=f*u*a.RENDER_MODEL_INDICIES_PER_CELL;y!==this.cells.length&&(this.cells=new Uint32Array(y),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.JoinedCellData=a.WebglRenderer=void 0;const c=l(820),f=l(274),u=l(627),y=l(457),C=l(56),w=l(374),b=l(345),g=l(859),_=l(147),v=l(782),S=l(855),D=l(965),R=l(742),x=l(310),M=l(733);class k extends g.Disposable{constructor(B,F,$,q,W,K,X,U,O){super(),this._terminal=B,this._characterJoinerService=F,this._charSizeService=$,this._coreBrowserService=q,this._coreService=W,this._decorationService=K,this._optionsService=X,this._themeService=U,this._cursorBlinkStateManager=new g.MutableDisposable,this._charAtlasDisposable=this.register(new g.MutableDisposable),this._observerDisposable=this.register(new g.MutableDisposable),this._model=new x.RenderModel,this._workCell=new v.CellData,this._workCell2=new v.CellData,this._rectangleRenderer=this.register(new g.MutableDisposable),this._glyphRenderer=this.register(new g.MutableDisposable),this._onChangeTextureAtlas=this.register(new b.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new b.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new b.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new b.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new b.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new f.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new M.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,X,this._themeService)],this.dimensions=(0,w.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(X.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const z={antialias:!1,depth:!1,preserveDrawingBuffer:O};if(this._gl=this._canvas.getContext("webgl2",z),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,c.addDisposableDomListener)(this._canvas,"webglcontextlost",(j=>{console.log("webglcontextlost event received"),j.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(j)}),3e3)}))),this.register((0,c.addDisposableDomListener)(this._canvas,"webglcontextrestored",(j=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,u.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,C.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((j,H)=>this._setCanvasDevicePixelDimensions(j,H))),this.register(this._coreBrowserService.onWindowChange((j=>{this._observerDisposable.value=(0,C.observeDevicePixelDimensions)(this._canvas,j,((H,ee)=>this._setCanvasDevicePixelDimensions(H,ee)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,g.toDisposable)((()=>{var j;for(const H of this._renderLayers)H.dispose();(j=this._canvas.parentElement)==null||j.removeChild(this._canvas),(0,u.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var B;return(B=this._charAtlas)==null?void 0:B.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(B,F){var $,q,W,K;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const X of this._renderLayers)X.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,($=this._rectangleRenderer.value)==null||$.setDimensions(this.dimensions),(q=this._rectangleRenderer.value)==null||q.handleResize(),(W=this._glyphRenderer.value)==null||W.setDimensions(this.dimensions),(K=this._glyphRenderer.value)==null||K.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var B;for(const F of this._renderLayers)F.handleBlur(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.pause(),this._requestRedrawViewport()}handleFocus(){var B;for(const F of this._renderLayers)F.handleFocus(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.resume(),this._requestRedrawViewport()}handleSelectionChanged(B,F,$){for(const q of this._renderLayers)q.handleSelectionChanged(this._terminal,B,F,$);this._model.selection.update(this._core,B,F,$),this._requestRedrawViewport()}handleCursorMove(){var B;for(const F of this._renderLayers)F.handleCursorMove(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new R.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new D.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var F;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const B=(0,u.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==B&&(this._onChangeTextureAtlas.fire(B.pages[0].canvas),this._charAtlasDisposable.value=(0,g.getDisposeArrayDisposable)([(0,b.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,b.forwardEvent)(B.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=B,this._charAtlas.warmUp(),(F=this._glyphRenderer.value)==null||F.setAtlas(this._charAtlas)}_clearModel(B){var F;this._model.clear(),B&&((F=this._glyphRenderer.value)==null||F.clear())}clearTextureAtlas(){var B;(B=this._charAtlas)==null||B.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var B;this._clearModel(!0);for(const F of this._renderLayers)F.reset(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(B){return-1}deregisterCharacterJoiner(B){return!1}renderRows(B,F){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const $ of this._renderLayers)$.handleGridChanged(this._terminal,B,F);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(B,F),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new y.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(B,F){const $=this._core;let q,W,K,X,U,O,z,j,H,ee,he,se,Z,G,re=this._workCell;B=T(B,$.rows-1,0),F=T(F,$.rows-1,0);const ne=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ve=ne-$.buffer.ydisp,me=Math.min(this._terminal.buffer.active.cursorX,$.cols-1);let Te=-1;const xe=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Ve=!1;for(W=B;W<=F;W++)for(K=W+$.buffer.ydisp,X=$.buffer.lines.get(K),this._model.lineLengths[W]=0,U=this._characterJoinerService.getJoinedCharacters(K),Z=0;Z<$.cols;Z++)if(q=this._cellColorResolver.result.bg,X.loadCell(Z,re),Z===0&&(q=this._cellColorResolver.result.bg),O=!1,z=Z,U.length>0&&Z===U[0][0]&&(O=!0,j=U.shift(),re=new L(re,X.translateToString(!0,j[0],j[1]),j[1]-j[0]),z=j[1]-1),H=re.getChars(),ee=re.getCode(),se=(W*$.cols+Z)*x.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(re,Z,K,this.dimensions.device.cell.width),xe&&K===ne&&(Z===me&&(this._model.cursor={x:me,y:ve,width:re.getWidth(),style:this._coreBrowserService.isFocused?$.options.cursorStyle||"block":$.options.cursorInactiveStyle,cursorWidth:$.options.cursorWidth,dpr:this._devicePixelRatio},Te=me+re.getWidth()-1),Z>=me&&Z<=Te&&(this._coreBrowserService.isFocused&&($.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&$.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),ee!==S.NULL_CELL_CODE&&(this._model.lineLengths[W]=Z+1),(this._model.cells[se]!==ee||this._model.cells[se+x.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[se+x.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[se+x.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Ve=!0,H.length>1&&(ee|=x.COMBINED_CHAR_BIT_MASK),this._model.cells[se]=ee,this._model.cells[se+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[se+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[se+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,he=re.getWidth(),this._glyphRenderer.value.updateCell(Z,W,ee,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,H,he,q),O))for(re=this._workCell,Z++;Z<z;Z++)G=(W*$.cols+Z)*x.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(Z,W,S.NULL_CELL_CODE,0,0,0,S.NULL_CELL_CHAR,0,0),this._model.cells[G]=S.NULL_CELL_CODE,this._model.cells[G+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[G+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[G+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Ve&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(B,F){this._canvas.width===B&&this._canvas.height===F||(this._canvas.width=B,this._canvas.height=F,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const B=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:B,end:B})}}a.WebglRenderer=k;class L extends _.AttributeData{constructor(B,F,$){super(),this.content=0,this.combinedData="",this.fg=B.fg,this.bg=B.bg,this.combinedData=F,this._width=$}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(B){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function T(P,B,F=0){return Math.max(Math.min(P,B),F)}a.JoinedCellData=L},381:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GLTexture=a.expandFloat32Array=a.createShader=a.createProgram=a.PROJECTION_MATRIX=void 0;const c=l(374);function f(u,y,C){const w=(0,c.throwIfFalsy)(u.createShader(y));if(u.shaderSource(w,C),u.compileShader(w),u.getShaderParameter(w,u.COMPILE_STATUS))return w;console.error(u.getShaderInfoLog(w)),u.deleteShader(w)}a.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),a.createProgram=function(u,y,C){const w=(0,c.throwIfFalsy)(u.createProgram());if(u.attachShader(w,(0,c.throwIfFalsy)(f(u,u.VERTEX_SHADER,y))),u.attachShader(w,(0,c.throwIfFalsy)(f(u,u.FRAGMENT_SHADER,C))),u.linkProgram(w),u.getProgramParameter(w,u.LINK_STATUS))return w;console.error(u.getProgramInfoLog(w)),u.deleteProgram(w)},a.createShader=f,a.expandFloat32Array=function(u,y){const C=Math.min(2*u.length,y),w=new Float32Array(C);for(let b=0;b<u.length;b++)w[b]=u[b];return w},a.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BaseRenderLayer=void 0;const c=l(627),f=l(237),u=l(374),y=l(859);class C extends y.Disposable{constructor(b,g,_,v,S,D,R,x){super(),this._container=g,this._alpha=S,this._coreBrowserService=D,this._optionsService=R,this._themeService=x,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${_}-layer`),this._canvas.style.zIndex=v.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((M=>{this._refreshCharAtlas(b,M),this.reset(b)}))),this.register((0,y.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(b){}handleFocus(b){}handleCursorMove(b){}handleGridChanged(b,g,_){}handleSelectionChanged(b,g,_,v=!1){}_setTransparency(b,g){if(g===this._alpha)return;const _=this._canvas;this._alpha=g,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,_),this._refreshCharAtlas(b,this._themeService.colors),this.handleGridChanged(b,0,b.rows-1)}_refreshCharAtlas(b,g){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,c.acquireTextureAtlas)(b,this._optionsService.rawOptions,g,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(b,g){this._deviceCellWidth=g.device.cell.width,this._deviceCellHeight=g.device.cell.height,this._deviceCharWidth=g.device.char.width,this._deviceCharHeight=g.device.char.height,this._deviceCharLeft=g.device.char.left,this._deviceCharTop=g.device.char.top,this._canvas.width=g.device.canvas.width,this._canvas.height=g.device.canvas.height,this._canvas.style.width=`${g.css.canvas.width}px`,this._canvas.style.height=`${g.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(b,this._themeService.colors)}_fillBottomLineAtCells(b,g,_=1){this._ctx.fillRect(b*this._deviceCellWidth,(g+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,_*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(b,g,_,v){this._alpha?this._ctx.clearRect(b*this._deviceCellWidth,g*this._deviceCellHeight,_*this._deviceCellWidth,v*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(b*this._deviceCellWidth,g*this._deviceCellHeight,_*this._deviceCellWidth,v*this._deviceCellHeight))}_fillCharTrueColor(b,g,_,v){this._ctx.font=this._getFont(b,!1,!1),this._ctx.textBaseline=f.TEXT_BASELINE,this._clipCell(_,v,g.getWidth()),this._ctx.fillText(g.getChars(),_*this._deviceCellWidth+this._deviceCharLeft,v*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(b,g,_){this._ctx.beginPath(),this._ctx.rect(b*this._deviceCellWidth,g*this._deviceCellHeight,_*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(b,g,_){return`${_?"italic":""} ${g?b.options.fontWeightBold:b.options.fontWeight} ${b.options.fontSize*this._coreBrowserService.dpr}px ${b.options.fontFamily}`}}a.BaseRenderLayer=C},733:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkRenderLayer=void 0;const c=l(197),f=l(237),u=l(592);class y extends u.BaseRenderLayer{constructor(w,b,g,_,v,S,D){super(g,w,"link",b,!0,v,S,D),this.register(_.onShowLinkUnderline((R=>this._handleShowLinkUnderline(R)))),this.register(_.onHideLinkUnderline((R=>this._handleHideLinkUnderline(R))))}resize(w,b){super.resize(w,b),this._state=void 0}reset(w){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const w=this._state.y2-this._state.y1-1;w>0&&this._clearCells(0,this._state.y1+1,this._state.cols,w),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(w){if(w.fg===f.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:w.fg!==void 0&&(0,c.is256Color)(w.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[w.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,w.y1===w.y2)this._fillBottomLineAtCells(w.x1,w.y1,w.x2-w.x1);else{this._fillBottomLineAtCells(w.x1,w.y1,w.cols-w.x1);for(let b=w.y1+1;b<w.y2;b++)this._fillBottomLineAtCells(0,b,w.cols);this._fillBottomLineAtCells(0,w.y2,w.x2)}this._state=w}_handleHideLinkUnderline(w){this._clearCurrentLink()}}a.LinkRenderLayer=y},820:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(l,c,f,u){l.addEventListener(c,f,u);let y=!1;return{dispose:()=>{y||(y=!0,l.removeEventListener(c,f,u))}}}},274:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellColorResolver=void 0;const c=l(855),f=l(160),u=l(374);let y,C=0,w=0,b=!1,g=!1,_=!1,v=0;a.CellColorResolver=class{constructor(S,D,R,x,M,k){this._terminal=S,this._optionService=D,this._selectionRenderModel=R,this._decorationService=x,this._coreBrowserService=M,this._themeService=k,this.result={fg:0,bg:0,ext:0}}resolve(S,D,R,x){if(this.result.bg=S.bg,this.result.fg=S.fg,this.result.ext=268435456&S.bg?S.extended.ext:0,w=0,C=0,g=!1,b=!1,_=!1,y=this._themeService.colors,v=0,S.getCode()!==c.NULL_CELL_CODE&&S.extended.underlineStyle===4){const M=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));v=D*x%(2*Math.round(M))}if(this._decorationService.forEachDecorationAtCell(D,R,"bottom",(M=>{M.backgroundColorRGB&&(w=M.backgroundColorRGB.rgba>>8&16777215,g=!0),M.foregroundColorRGB&&(C=M.foregroundColorRGB.rgba>>8&16777215,b=!0)})),_=this._selectionRenderModel.isCellSelected(this._terminal,D,R),_){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}w=f.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else w=(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(g=!0,y.selectionForeground&&(C=y.selectionForeground.rgba>>8&16777215,b=!0),(0,u.treatGlyphAsBackgroundColor)(S.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)C=(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:C=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:C=(16777215&this.result.fg)<<8|255;break;default:C=this._themeService.colors.foreground.rgba}C=f.rgba.blend(C,4294967040&(this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}b=!0}}this._decorationService.forEachDecorationAtCell(D,R,"top",(M=>{M.backgroundColorRGB&&(w=M.backgroundColorRGB.rgba>>8&16777215,g=!0),M.foregroundColorRGB&&(C=M.foregroundColorRGB.rgba>>8&16777215,b=!0)})),g&&(w=_?-16777216&S.bg&-134217729|w|50331648:-16777216&S.bg|w|50331648),b&&(C=-16777216&S.fg&-67108865|C|50331648),67108864&this.result.fg&&(g&&!b&&(C=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&y.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,b=!0),!g&&b&&(w=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&y.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,g=!0)),y=void 0,this.result.bg=g?w:this.result.bg,this.result.fg=b?C:this.result.fg,this.result.ext&=536870911,this.result.ext|=v<<29&3758096384}}},627:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeTerminalFromCache=a.acquireTextureAtlas=void 0;const c=l(509),f=l(197),u=[];a.acquireTextureAtlas=function(y,C,w,b,g,_,v,S){const D=(0,f.generateConfig)(b,g,_,v,C,w,S);for(let M=0;M<u.length;M++){const k=u[M],L=k.ownedBy.indexOf(y);if(L>=0){if((0,f.configEquals)(k.config,D))return k.atlas;k.ownedBy.length===1?(k.atlas.dispose(),u.splice(M,1)):k.ownedBy.splice(L,1);break}}for(let M=0;M<u.length;M++){const k=u[M];if((0,f.configEquals)(k.config,D))return k.ownedBy.push(y),k.atlas}const R=y._core,x={atlas:new c.TextureAtlas(document,D,R.unicodeService),config:D,ownedBy:[y]};return u.push(x),x.atlas},a.removeTerminalFromCache=function(y){for(let C=0;C<u.length;C++){const w=u[C].ownedBy.indexOf(y);if(w!==-1){u[C].ownedBy.length===1?(u[C].atlas.dispose(),u.splice(C,1)):u[C].ownedBy.splice(w,1);break}}}},197:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.is256Color=a.configEquals=a.generateConfig=void 0;const c=l(160);a.generateConfig=function(f,u,y,C,w,b,g){const _={foreground:b.foreground,background:b.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:b.ansi.slice(),contrastCache:b.contrastCache,halfContrastCache:b.halfContrastCache};return{customGlyphs:w.customGlyphs,devicePixelRatio:g,letterSpacing:w.letterSpacing,lineHeight:w.lineHeight,deviceCellWidth:f,deviceCellHeight:u,deviceCharWidth:y,deviceCharHeight:C,fontFamily:w.fontFamily,fontSize:w.fontSize,fontWeight:w.fontWeight,fontWeightBold:w.fontWeightBold,allowTransparency:w.allowTransparency,drawBoldTextInBrightColors:w.drawBoldTextInBrightColors,minimumContrastRatio:w.minimumContrastRatio,colors:_}},a.configEquals=function(f,u){for(let y=0;y<f.colors.ansi.length;y++)if(f.colors.ansi[y].rgba!==u.colors.ansi[y].rgba)return!1;return f.devicePixelRatio===u.devicePixelRatio&&f.customGlyphs===u.customGlyphs&&f.lineHeight===u.lineHeight&&f.letterSpacing===u.letterSpacing&&f.fontFamily===u.fontFamily&&f.fontSize===u.fontSize&&f.fontWeight===u.fontWeight&&f.fontWeightBold===u.fontWeightBold&&f.allowTransparency===u.allowTransparency&&f.deviceCharWidth===u.deviceCharWidth&&f.deviceCharHeight===u.deviceCharHeight&&f.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&f.minimumContrastRatio===u.minimumContrastRatio&&f.colors.foreground.rgba===u.colors.foreground.rgba&&f.colors.background.rgba===u.colors.background.rgba},a.is256Color=function(f){return(50331648&f)==16777216||(50331648&f)==33554432}},237:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const c=l(399);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CursorBlinkStateManager=void 0,a.CursorBlinkStateManager=class{constructor(l,c){this._renderCallback=l,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(l=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),l)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tryDrawCustomChar=a.powerlineDefinitions=a.boxDrawingDefinitions=a.blockElementDefinitions=void 0;const c=l(374);a.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const f={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};a.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(b,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"║":{1:(b,g)=>`M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╒":{1:(b,g)=>`M.5,1 L.5,${.5-g} L1,${.5-g} M.5,${.5+g} L1,${.5+g}`},"╓":{1:(b,g)=>`M${.5-b},1 L${.5-b},.5 L1,.5 M${.5+b},.5 L${.5+b},1`},"╔":{1:(b,g)=>`M1,${.5-g} L${.5-b},${.5-g} L${.5-b},1 M1,${.5+g} L${.5+b},${.5+g} L${.5+b},1`},"╕":{1:(b,g)=>`M0,${.5-g} L.5,${.5-g} L.5,1 M0,${.5+g} L.5,${.5+g}`},"╖":{1:(b,g)=>`M${.5+b},1 L${.5+b},.5 L0,.5 M${.5-b},.5 L${.5-b},1`},"╗":{1:(b,g)=>`M0,${.5+g} L${.5-b},${.5+g} L${.5-b},1 M0,${.5-g} L${.5+b},${.5-g} L${.5+b},1`},"╘":{1:(b,g)=>`M.5,0 L.5,${.5+g} L1,${.5+g} M.5,${.5-g} L1,${.5-g}`},"╙":{1:(b,g)=>`M1,.5 L${.5-b},.5 L${.5-b},0 M${.5+b},.5 L${.5+b},0`},"╚":{1:(b,g)=>`M1,${.5-g} L${.5+b},${.5-g} L${.5+b},0 M1,${.5+g} L${.5-b},${.5+g} L${.5-b},0`},"╛":{1:(b,g)=>`M0,${.5+g} L.5,${.5+g} L.5,0 M0,${.5-g} L.5,${.5-g}`},"╜":{1:(b,g)=>`M0,.5 L${.5+b},.5 L${.5+b},0 M${.5-b},.5 L${.5-b},0`},"╝":{1:(b,g)=>`M0,${.5-g} L${.5-b},${.5-g} L${.5-b},0 M0,${.5+g} L${.5+b},${.5+g} L${.5+b},0`},"╞":{1:(b,g)=>`M.5,0 L.5,1 M.5,${.5-g} L1,${.5-g} M.5,${.5+g} L1,${.5+g}`},"╟":{1:(b,g)=>`M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1 M${.5+b},.5 L1,.5`},"╠":{1:(b,g)=>`M${.5-b},0 L${.5-b},1 M1,${.5+g} L${.5+b},${.5+g} L${.5+b},1 M1,${.5-g} L${.5+b},${.5-g} L${.5+b},0`},"╡":{1:(b,g)=>`M.5,0 L.5,1 M0,${.5-g} L.5,${.5-g} M0,${.5+g} L.5,${.5+g}`},"╢":{1:(b,g)=>`M0,.5 L${.5-b},.5 M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╣":{1:(b,g)=>`M${.5+b},0 L${.5+b},1 M0,${.5+g} L${.5-b},${.5+g} L${.5-b},1 M0,${.5-g} L${.5-b},${.5-g} L${.5-b},0`},"╤":{1:(b,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g} M.5,${.5+g} L.5,1`},"╥":{1:(b,g)=>`M0,.5 L1,.5 M${.5-b},.5 L${.5-b},1 M${.5+b},.5 L${.5+b},1`},"╦":{1:(b,g)=>`M0,${.5-g} L1,${.5-g} M0,${.5+g} L${.5-b},${.5+g} L${.5-b},1 M1,${.5+g} L${.5+b},${.5+g} L${.5+b},1`},"╧":{1:(b,g)=>`M.5,0 L.5,${.5-g} M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"╨":{1:(b,g)=>`M0,.5 L1,.5 M${.5-b},.5 L${.5-b},0 M${.5+b},.5 L${.5+b},0`},"╩":{1:(b,g)=>`M0,${.5+g} L1,${.5+g} M0,${.5-g} L${.5-b},${.5-g} L${.5-b},0 M1,${.5-g} L${.5+b},${.5-g} L${.5+b},0`},"╪":{1:(b,g)=>`M.5,0 L.5,1 M0,${.5-g} L1,${.5-g} M0,${.5+g} L1,${.5+g}`},"╫":{1:(b,g)=>`M0,.5 L1,.5 M${.5-b},0 L${.5-b},1 M${.5+b},0 L${.5+b},1`},"╬":{1:(b,g)=>`M0,${.5+g} L${.5-b},${.5+g} L${.5-b},1 M1,${.5+g} L${.5+b},${.5+g} L${.5+b},1 M0,${.5-g} L${.5-b},${.5-g} L${.5-b},0 M1,${.5-g} L${.5+b},${.5-g} L${.5+b},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(b,g)=>`M.5,1 L.5,${.5+g/.15*.5} C.5,${.5+g/.15*.5},.5,.5,1,.5`},"╮":{1:(b,g)=>`M.5,1 L.5,${.5+g/.15*.5} C.5,${.5+g/.15*.5},.5,.5,0,.5`},"╯":{1:(b,g)=>`M.5,0 L.5,${.5-g/.15*.5} C.5,${.5-g/.15*.5},.5,.5,0,.5`},"╰":{1:(b,g)=>`M.5,0 L.5,${.5-g/.15*.5} C.5,${.5-g/.15*.5},.5,.5,1,.5`}},a.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},a.powerlineDefinitions[""]=a.powerlineDefinitions[""],a.powerlineDefinitions[""]=a.powerlineDefinitions[""],a.tryDrawCustomChar=function(b,g,_,v,S,D,R,x){const M=a.blockElementDefinitions[g];if(M)return(function(P,B,F,$,q,W){for(let K=0;K<B.length;K++){const X=B[K],U=q/8,O=W/8;P.fillRect(F+X.x*U,$+X.y*O,X.w*U,X.h*O)}})(b,M,_,v,S,D),!0;const k=f[g];if(k)return(function(P,B,F,$,q,W){let K=u.get(B);K||(K=new Map,u.set(B,K));const X=P.fillStyle;if(typeof X!="string")throw new Error(`Unexpected fillStyle type "${X}"`);let U=K.get(X);if(!U){const O=B[0].length,z=B.length,j=P.canvas.ownerDocument.createElement("canvas");j.width=O,j.height=z;const H=(0,c.throwIfFalsy)(j.getContext("2d")),ee=new ImageData(O,z);let he,se,Z,G;if(X.startsWith("#"))he=parseInt(X.slice(1,3),16),se=parseInt(X.slice(3,5),16),Z=parseInt(X.slice(5,7),16),G=X.length>7&&parseInt(X.slice(7,9),16)||1;else{if(!X.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${X}" when drawing pattern glyph`);[he,se,Z,G]=X.substring(5,X.length-1).split(",").map((re=>parseFloat(re)))}for(let re=0;re<z;re++)for(let ne=0;ne<O;ne++)ee.data[4*(re*O+ne)]=he,ee.data[4*(re*O+ne)+1]=se,ee.data[4*(re*O+ne)+2]=Z,ee.data[4*(re*O+ne)+3]=B[re][ne]*(255*G);H.putImageData(ee,0,0),U=(0,c.throwIfFalsy)(P.createPattern(j,null)),K.set(X,U)}P.fillStyle=U,P.fillRect(F,$,q,W)})(b,k,_,v,S,D),!0;const L=a.boxDrawingDefinitions[g];if(L)return(function(P,B,F,$,q,W,K){P.strokeStyle=P.fillStyle;for(const[X,U]of Object.entries(B)){let O;P.beginPath(),P.lineWidth=K*Number.parseInt(X),O=typeof U=="function"?U(.15,.15/W*q):U;for(const z of O.split(" ")){const j=z[0],H=C[j];if(!H){console.error(`Could not find drawing instructions for "${j}"`);continue}const ee=z.substring(1).split(",");ee[0]&&ee[1]&&H(P,w(ee,q,W,F,$,!0,K))}P.stroke(),P.closePath()}})(b,L,_,v,S,D,x),!0;const T=a.powerlineDefinitions[g];return!!T&&((function(P,B,F,$,q,W,K,X){const U=new Path2D;U.rect(F,$,q,W),P.clip(U),P.beginPath();const O=K/12;P.lineWidth=X*O;for(const z of B.d.split(" ")){const j=z[0],H=C[j];if(!H){console.error(`Could not find drawing instructions for "${j}"`);continue}const ee=z.substring(1).split(",");ee[0]&&ee[1]&&H(P,w(ee,q,W,F,$,!1,X,(B.leftPadding??0)*(O/2),(B.rightPadding??0)*(O/2)))}B.type===1?(P.strokeStyle=P.fillStyle,P.stroke()):P.fill(),P.closePath()})(b,T,_,v,S,D,R,x),!0)};const u=new Map;function y(b,g,_=0){return Math.max(Math.min(b,g),_)}const C={C:(b,g)=>b.bezierCurveTo(g[0],g[1],g[2],g[3],g[4],g[5]),L:(b,g)=>b.lineTo(g[0],g[1]),M:(b,g)=>b.moveTo(g[0],g[1])};function w(b,g,_,v,S,D,R,x=0,M=0){const k=b.map((L=>parseFloat(L)||parseInt(L)));if(k.length<2)throw new Error("Too few arguments for instruction");for(let L=0;L<k.length;L+=2)k[L]*=g-x*R-M*R,D&&k[L]!==0&&(k[L]=y(Math.round(k[L]+.5)-.5,g,0)),k[L]+=v+x*R;for(let L=1;L<k.length;L+=2)k[L]*=_,D&&k[L]!==0&&(k[L]=y(Math.round(k[L]+.5)-.5,_,0)),k[L]+=S;return k}},56:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.observeDevicePixelDimensions=void 0;const c=l(859);a.observeDevicePixelDimensions=function(f,u,y){let C=new u.ResizeObserver((w=>{const b=w.find((v=>v.target===f));if(!b)return;if(!("devicePixelContentBoxSize"in b))return C==null||C.disconnect(),void(C=void 0);const g=b.devicePixelContentBoxSize[0].inlineSize,_=b.devicePixelContentBoxSize[0].blockSize;g>0&&_>0&&y(g,_)}));try{C.observe(f,{box:["device-pixel-content-box"]})}catch{C.disconnect(),C=void 0}return(0,c.toDisposable)((()=>C==null?void 0:C.disconnect()))}},374:(p,a)=>{function l(f){return 57508<=f&&f<=57558}function c(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},a.isPowerlineGlyph=l,a.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},a.isEmoji=c,a.allowRescaling=function(f,u,y,C){return u===1&&y>Math.ceil(1.5*C)&&f!==void 0&&f>255&&!c(f)&&!l(f)&&!(function(w){return 57344<=w&&w<=63743})(f)},a.treatGlyphAsBackgroundColor=function(f){return l(f)||(function(u){return 9472<=u&&u<=9631})(f)},a.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}}}},a.computeNextVariantOffset=function(f,u,y=0){return(f-(2*Math.round(u)-y))%(2*Math.round(u))}},296:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class l{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(f,u,y,C=!1){if(this.selectionStart=u,this.selectionEnd=y,!u||!y||u[0]===y[0]&&u[1]===y[1])return void this.clear();const w=f.buffers.active.ydisp,b=u[1]-w,g=y[1]-w,_=Math.max(b,0),v=Math.min(g,f.rows-1);_>=f.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=b,this.viewportEndRow=g,this.viewportCappedStartRow=_,this.viewportCappedEndRow=v,this.startCol=u[0],this.endCol=y[0])}isCellSelected(f,u,y){return!!this.hasSelection&&(y-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&y>=this.viewportCappedStartRow&&u<this.endCol&&y<=this.viewportCappedEndRow:u<this.startCol&&y>=this.viewportCappedStartRow&&u>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol)}}a.createSelectionRenderModel=function(){return new l}},509:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TextureAtlas=void 0;const c=l(237),f=l(860),u=l(374),y=l(160),C=l(345),w=l(485),b=l(385),g=l(147),_=l(855),v={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let S;class D{get pages(){return this._pages}constructor(L,T,P){this._document=L,this._config=T,this._unicodeService=P,this._didWarmUp=!1,this._cacheMap=new w.FourKeyMap,this._cacheMapCombined=new w.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new g.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new C.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new C.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=M(L,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const L of this.pages)L.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const L=new b.IdleTaskQueue;for(let T=33;T<126;T++)L.enqueue((()=>{if(!this._cacheMap.get(T,_.DEFAULT_COLOR,_.DEFAULT_COLOR,_.DEFAULT_EXT)){const P=this._drawToCache(T,_.DEFAULT_COLOR,_.DEFAULT_COLOR,_.DEFAULT_EXT);this._cacheMap.set(T,_.DEFAULT_COLOR,_.DEFAULT_COLOR,_.DEFAULT_EXT,P)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const L of this._pages)L.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(D.maxAtlasPages&&this._pages.length>=Math.max(4,D.maxAtlasPages)){const T=this._pages.filter((K=>2*K.canvas.width<=(D.maxTextureSize||4096))).sort(((K,X)=>X.canvas.width!==K.canvas.width?X.canvas.width-K.canvas.width:X.percentageUsed-K.percentageUsed));let P=-1,B=0;for(let K=0;K<T.length;K++)if(T[K].canvas.width!==B)P=K,B=T[K].canvas.width;else if(K-P==3)break;const F=T.slice(P,P+4),$=F.map((K=>K.glyphs[0].texturePage)).sort(((K,X)=>K>X?1:-1)),q=this.pages.length-F.length,W=this._mergePages(F,q);W.version++;for(let K=$.length-1;K>=0;K--)this._deletePage($[K]);this.pages.push(W),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(W.canvas)}const L=new R(this._document,this._textureSize);return this._pages.push(L),this._activePages.push(L),this._onAddTextureAtlasCanvas.fire(L.canvas),L}_mergePages(L,T){const P=2*L[0].canvas.width,B=new R(this._document,P,L);for(const[F,$]of L.entries()){const q=F*$.canvas.width%P,W=Math.floor(F/2)*$.canvas.height;B.ctx.drawImage($.canvas,q,W);for(const X of $.glyphs)X.texturePage=T,X.sizeClipSpace.x=X.size.x/P,X.sizeClipSpace.y=X.size.y/P,X.texturePosition.x+=q,X.texturePosition.y+=W,X.texturePositionClipSpace.x=X.texturePosition.x/P,X.texturePositionClipSpace.y=X.texturePosition.y/P;this._onRemoveTextureAtlasCanvas.fire($.canvas);const K=this._activePages.indexOf($);K!==-1&&this._activePages.splice(K,1)}return B}_deletePage(L){this._pages.splice(L,1);for(let T=L;T<this._pages.length;T++){const P=this._pages[T];for(const B of P.glyphs)B.texturePage--;P.version++}}getRasterizedGlyphCombinedChar(L,T,P,B,F){return this._getFromCacheMap(this._cacheMapCombined,L,T,P,B,F)}getRasterizedGlyph(L,T,P,B,F){return this._getFromCacheMap(this._cacheMap,L,T,P,B,F)}_getFromCacheMap(L,T,P,B,F,$=!1){return S=L.get(T,P,B,F),S||(S=this._drawToCache(T,P,B,F,$),L.set(T,P,B,F,S)),S}_getColorFromAnsiIndex(L){if(L>=this._config.colors.ansi.length)throw new Error("No color found for idx "+L);return this._config.colors.ansi[L]}_getBackgroundColor(L,T,P,B){if(this._config.allowTransparency)return y.NULL_COLOR;let F;switch(L){case 16777216:case 33554432:F=this._getColorFromAnsiIndex(T);break;case 50331648:const $=g.AttributeData.toColorRGB(T);F=y.channels.toColor($[0],$[1],$[2]);break;default:F=P?y.color.opaque(this._config.colors.foreground):this._config.colors.background}return F}_getForegroundColor(L,T,P,B,F,$,q,W,K,X){const U=this._getMinimumContrastColor(L,T,P,B,F,$,q,K,W,X);if(U)return U;let O;switch(F){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&K&&$<8&&($+=8),O=this._getColorFromAnsiIndex($);break;case 50331648:const z=g.AttributeData.toColorRGB($);O=y.channels.toColor(z[0],z[1],z[2]);break;default:O=q?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(O=y.color.opaque(O)),W&&(O=y.color.multiplyOpacity(O,c.DIM_OPACITY)),O}_resolveBackgroundRgba(L,T,P){switch(L){case 16777216:case 33554432:return this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return P?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(L,T,P,B){switch(L){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&B&&T<8&&(T+=8),this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return P?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(L,T,P,B,F,$,q,W,K,X){if(this._config.minimumContrastRatio===1||X)return;const U=this._getContrastCache(K),O=U.getColor(L,B);if(O!==void 0)return O||void 0;const z=this._resolveBackgroundRgba(T,P,q),j=this._resolveForegroundRgba(F,$,q,W),H=y.rgba.ensureContrastRatio(z,j,this._config.minimumContrastRatio/(K?2:1));if(!H)return void U.setColor(L,B,null);const ee=y.channels.toColor(H>>24&255,H>>16&255,H>>8&255);return U.setColor(L,B,ee),ee}_getContrastCache(L){return L?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(L,T,P,B,F=!1){const $=typeof L=="number"?String.fromCharCode(L):L,q=Math.min(this._config.deviceCellWidth*Math.max($.length,2)+4,this._textureSize);this._tmpCanvas.width<q&&(this._tmpCanvas.width=q);const W=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<W&&(this._tmpCanvas.height=W),this._tmpCtx.save(),this._workAttributeData.fg=P,this._workAttributeData.bg=T,this._workAttributeData.extended.ext=B,this._workAttributeData.isInvisible())return v;const K=!!this._workAttributeData.isBold(),X=!!this._workAttributeData.isInverse(),U=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),z=!!this._workAttributeData.isUnderline(),j=!!this._workAttributeData.isStrikethrough(),H=!!this._workAttributeData.isOverline();let ee=this._workAttributeData.getFgColor(),he=this._workAttributeData.getFgColorMode(),se=this._workAttributeData.getBgColor(),Z=this._workAttributeData.getBgColorMode();if(X){const De=ee;ee=se,se=De;const Ne=he;he=Z,Z=Ne}const G=this._getBackgroundColor(Z,se,X,U);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=G.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const re=K?this._config.fontWeightBold:this._config.fontWeight,ne=O?"italic":"";this._tmpCtx.font=`${ne} ${re} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const ve=$.length===1&&(0,u.isPowerlineGlyph)($.charCodeAt(0)),me=$.length===1&&(0,u.isRestrictedPowerlineGlyph)($.charCodeAt(0)),Te=this._getForegroundColor(T,Z,se,P,he,ee,X,U,K,(0,u.treatGlyphAsBackgroundColor)($.charCodeAt(0)));this._tmpCtx.fillStyle=Te.css;const xe=me?0:4;let Ve=!1;this._config.customGlyphs!==!1&&(Ve=(0,f.tryDrawCustomChar)(this._tmpCtx,$,xe,xe,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Me,ke=!ve;if(Me=typeof L=="number"?this._unicodeService.wcwidth(L):this._unicodeService.getStringCellWidth(L),z){this._tmpCtx.save();const De=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ne=De%2==1?.5:0;if(this._tmpCtx.lineWidth=De,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ke=!1,this._tmpCtx.strokeStyle=`rgb(${g.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ke=!1;let ze=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ze<8&&(ze+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ze).css}this._tmpCtx.beginPath();const _t=xe,le=Math.ceil(xe+this._config.deviceCharHeight)-Ne-(F?2*De:0),_e=le+De,Ae=le+2*De;let Fe=this._workAttributeData.getUnderlineVariantOffset();for(let ze=0;ze<Me;ze++){this._tmpCtx.save();const qe=_t+ze*this._config.deviceCellWidth,He=_t+(ze+1)*this._config.deviceCellWidth,Ft=qe+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(qe,le),this._tmpCtx.lineTo(He,le),this._tmpCtx.moveTo(qe,Ae),this._tmpCtx.lineTo(He,Ae);break;case 3:const Ct=De<=1?Ae:Math.ceil(xe+this._config.deviceCharHeight-De/2)-Ne,zt=De<=1?le:Math.ceil(xe+this._config.deviceCharHeight+De/2)-Ne,ut=new Path2D;ut.rect(qe,le,this._config.deviceCellWidth,Ae-le),this._tmpCtx.clip(ut),this._tmpCtx.moveTo(qe-this._config.deviceCellWidth/2,_e),this._tmpCtx.bezierCurveTo(qe-this._config.deviceCellWidth/2,zt,qe,zt,qe,_e),this._tmpCtx.bezierCurveTo(qe,Ct,Ft,Ct,Ft,_e),this._tmpCtx.bezierCurveTo(Ft,zt,He,zt,He,_e),this._tmpCtx.bezierCurveTo(He,Ct,He+this._config.deviceCellWidth/2,Ct,He+this._config.deviceCellWidth/2,_e);break;case 4:const hn=Fe===0?0:Fe>=De?2*De-Fe:De-Fe;Fe>=De||hn===0?(this._tmpCtx.setLineDash([Math.round(De),Math.round(De)]),this._tmpCtx.moveTo(qe+hn,le),this._tmpCtx.lineTo(He,le)):(this._tmpCtx.setLineDash([Math.round(De),Math.round(De)]),this._tmpCtx.moveTo(qe,le),this._tmpCtx.lineTo(qe+hn,le),this._tmpCtx.moveTo(qe+hn+De,le),this._tmpCtx.lineTo(He,le)),Fe=(0,u.computeNextVariantOffset)(He-qe,De,Fe);break;case 5:const Zt=.6,nr=.3,qn=He-qe,mi=Math.floor(Zt*qn),Mt=Math.floor(nr*qn),yt=qn-mi-Mt;this._tmpCtx.setLineDash([mi,Mt,yt]),this._tmpCtx.moveTo(qe,le),this._tmpCtx.lineTo(He,le);break;default:this._tmpCtx.moveTo(qe,le),this._tmpCtx.lineTo(He,le)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Ve&&this._config.fontSize>=12&&!this._config.allowTransparency&&$!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const ze=this._tmpCtx.measureText($);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ze&&ze.actualBoundingBoxDescent>0){this._tmpCtx.save();const qe=new Path2D;qe.rect(_t,le-Math.ceil(De/2),this._config.deviceCellWidth*Me,Ae-le+Math.ceil(De/2)),this._tmpCtx.clip(qe),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=G.css,this._tmpCtx.strokeText($,xe,xe+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(H){const De=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Ne=De%2==1?.5:0;this._tmpCtx.lineWidth=De,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(xe,xe+Ne),this._tmpCtx.lineTo(xe+this._config.deviceCharWidth*Me,xe+Ne),this._tmpCtx.stroke()}if(Ve||this._tmpCtx.fillText($,xe,xe+this._config.deviceCharHeight),$==="_"&&!this._config.allowTransparency){let De=x(this._tmpCtx.getImageData(xe,xe,this._config.deviceCellWidth,this._config.deviceCellHeight),G,Te,ke);if(De)for(let Ne=1;Ne<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=G.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText($,xe,xe+this._config.deviceCharHeight-Ne),De=x(this._tmpCtx.getImageData(xe,xe,this._config.deviceCellWidth,this._config.deviceCellHeight),G,Te,ke),De);Ne++);}if(j){const De=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Ne=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=De,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(xe,xe+Math.floor(this._config.deviceCharHeight/2)-Ne),this._tmpCtx.lineTo(xe+this._config.deviceCharWidth*Me,xe+Math.floor(this._config.deviceCharHeight/2)-Ne),this._tmpCtx.stroke()}this._tmpCtx.restore();const Bt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Gt;if(Gt=this._config.allowTransparency?(function(De){for(let Ne=0;Ne<De.data.length;Ne+=4)if(De.data[Ne+3]>0)return!1;return!0})(Bt):x(Bt,G,Te,ke),Gt)return v;const $e=this._findGlyphBoundingBox(Bt,this._workBoundingBox,q,me,Ve,xe);let Ke,Ye;for(;;){if(this._activePages.length===0){const De=this._createNewPage();Ke=De,Ye=De.currentRow,Ye.height=$e.size.y;break}Ke=this._activePages[this._activePages.length-1],Ye=Ke.currentRow;for(const De of this._activePages)$e.size.y<=De.currentRow.height&&(Ke=De,Ye=De.currentRow);for(let De=this._activePages.length-1;De>=0;De--)for(const Ne of this._activePages[De].fixedRows)Ne.height<=Ye.height&&$e.size.y<=Ne.height&&(Ke=this._activePages[De],Ye=Ne);if(Ye.y+$e.size.y>=Ke.canvas.height||Ye.height>$e.size.y+2){let De=!1;if(Ke.currentRow.y+Ke.currentRow.height+$e.size.y>=Ke.canvas.height){let Ne;for(const _t of this._activePages)if(_t.currentRow.y+_t.currentRow.height+$e.size.y<_t.canvas.height){Ne=_t;break}if(Ne)Ke=Ne;else if(D.maxAtlasPages&&this._pages.length>=D.maxAtlasPages&&Ye.y+$e.size.y<=Ke.canvas.height&&Ye.height>=$e.size.y&&Ye.x+$e.size.x<=Ke.canvas.width)De=!0;else{const _t=this._createNewPage();Ke=_t,Ye=_t.currentRow,Ye.height=$e.size.y,De=!0}}De||(Ke.currentRow.height>0&&Ke.fixedRows.push(Ke.currentRow),Ye={x:0,y:Ke.currentRow.y+Ke.currentRow.height,height:$e.size.y},Ke.fixedRows.push(Ye),Ke.currentRow={x:0,y:Ye.y+Ye.height,height:0})}if(Ye.x+$e.size.x<=Ke.canvas.width)break;Ye===Ke.currentRow?(Ye.x=0,Ye.y+=Ye.height,Ye.height=0):Ke.fixedRows.splice(Ke.fixedRows.indexOf(Ye),1)}return $e.texturePage=this._pages.indexOf(Ke),$e.texturePosition.x=Ye.x,$e.texturePosition.y=Ye.y,$e.texturePositionClipSpace.x=Ye.x/Ke.canvas.width,$e.texturePositionClipSpace.y=Ye.y/Ke.canvas.height,$e.sizeClipSpace.x/=Ke.canvas.width,$e.sizeClipSpace.y/=Ke.canvas.height,Ye.height=Math.max(Ye.height,$e.size.y),Ye.x+=$e.size.x,Ke.ctx.putImageData(Bt,$e.texturePosition.x-this._workBoundingBox.left,$e.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,$e.size.x,$e.size.y),Ke.addGlyph($e),Ke.version++,$e}_findGlyphBoundingBox(L,T,P,B,F,$){T.top=0;const q=B?this._config.deviceCellHeight:this._tmpCanvas.height,W=B?this._config.deviceCellWidth:P;let K=!1;for(let X=0;X<q;X++){for(let U=0;U<W;U++){const O=X*this._tmpCanvas.width*4+4*U+3;if(L.data[O]!==0){T.top=X,K=!0;break}}if(K)break}T.left=0,K=!1;for(let X=0;X<$+W;X++){for(let U=0;U<q;U++){const O=U*this._tmpCanvas.width*4+4*X+3;if(L.data[O]!==0){T.left=X,K=!0;break}}if(K)break}T.right=W,K=!1;for(let X=$+W-1;X>=$;X--){for(let U=0;U<q;U++){const O=U*this._tmpCanvas.width*4+4*X+3;if(L.data[O]!==0){T.right=X,K=!0;break}}if(K)break}T.bottom=q,K=!1;for(let X=q-1;X>=0;X--){for(let U=0;U<W;U++){const O=X*this._tmpCanvas.width*4+4*U+3;if(L.data[O]!==0){T.bottom=X,K=!0;break}}if(K)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:T.right-T.left+1,y:T.bottom-T.top+1},sizeClipSpace:{x:T.right-T.left+1,y:T.bottom-T.top+1},offset:{x:-T.left+$+(B||F?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-T.top+$+(B||F?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}a.TextureAtlas=D;class R{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(L){this._glyphs.push(L),this._usedPixels+=L.size.x*L.size.y}constructor(L,T,P){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],P)for(const B of P)this._glyphs.push(...B.glyphs),this._usedPixels+=B._usedPixels;this.canvas=M(L,T,T),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function x(k,L,T,P){const B=L.rgba>>>24,F=L.rgba>>>16&255,$=L.rgba>>>8&255,q=T.rgba>>>24,W=T.rgba>>>16&255,K=T.rgba>>>8&255,X=Math.floor((Math.abs(B-q)+Math.abs(F-W)+Math.abs($-K))/12);let U=!0;for(let O=0;O<k.data.length;O+=4)k.data[O]===B&&k.data[O+1]===F&&k.data[O+2]===$||P&&Math.abs(k.data[O]-B)+Math.abs(k.data[O+1]-F)+Math.abs(k.data[O+2]-$)<X?k.data[O+3]=0:U=!1;return U}function M(k,L,T){const P=k.createElement("canvas");return P.width=L,P.height=T,P}},160:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let l=0,c=0,f=0,u=0;var y,C,w,b,g;function _(S){const D=S.toString(16);return D.length<2?"0"+D:D}function v(S,D){return S<D?(D+.05)/(S+.05):(S+.05)/(D+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(D,R,x,M){return M!==void 0?`#${_(D)}${_(R)}${_(x)}${_(M)}`:`#${_(D)}${_(R)}${_(x)}`},S.toRgba=function(D,R,x,M=255){return(D<<24|R<<16|x<<8|M)>>>0},S.toColor=function(D,R,x,M){return{css:S.toCss(D,R,x,M),rgba:S.toRgba(D,R,x,M)}}})(y||(a.channels=y={})),(function(S){function D(R,x){return u=Math.round(255*x),[l,c,f]=g.toChannels(R.rgba),{css:y.toCss(l,c,f,u),rgba:y.toRgba(l,c,f,u)}}S.blend=function(R,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const M=x.rgba>>24&255,k=x.rgba>>16&255,L=x.rgba>>8&255,T=R.rgba>>24&255,P=R.rgba>>16&255,B=R.rgba>>8&255;return l=T+Math.round((M-T)*u),c=P+Math.round((k-P)*u),f=B+Math.round((L-B)*u),{css:y.toCss(l,c,f),rgba:y.toRgba(l,c,f)}},S.isOpaque=function(R){return(255&R.rgba)==255},S.ensureContrastRatio=function(R,x,M){const k=g.ensureContrastRatio(R.rgba,x.rgba,M);if(k)return y.toColor(k>>24&255,k>>16&255,k>>8&255)},S.opaque=function(R){const x=(255|R.rgba)>>>0;return[l,c,f]=g.toChannels(x),{css:y.toCss(l,c,f),rgba:x}},S.opacity=D,S.multiplyOpacity=function(R,x){return u=255&R.rgba,D(R,u*x/255)},S.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(C||(a.color=C={})),(function(S){let D,R;try{const x=document.createElement("canvas");x.width=1,x.height=1;const M=x.getContext("2d",{willReadFrequently:!0});M&&(D=M,D.globalCompositeOperation="copy",R=D.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return l=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),y.toColor(l,c,f);case 5:return l=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),y.toColor(l,c,f,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const M=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return l=parseInt(M[1]),c=parseInt(M[2]),f=parseInt(M[3]),u=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),y.toColor(l,c,f,u);if(!D||!R)throw new Error("css.toColor: Unsupported css format");if(D.fillStyle=R,D.fillStyle=x,typeof D.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(D.fillRect(0,0,1,1),[l,c,f,u]=D.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(l,c,f,u),css:x}}})(w||(a.css=w={})),(function(S){function D(R,x,M){const k=R/255,L=x/255,T=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}S.relativeLuminance=function(R){return D(R>>16&255,R>>8&255,255&R)},S.relativeLuminance2=D})(b||(a.rgb=b={})),(function(S){function D(x,M,k){const L=x>>24&255,T=x>>16&255,P=x>>8&255;let B=M>>24&255,F=M>>16&255,$=M>>8&255,q=v(b.relativeLuminance2(B,F,$),b.relativeLuminance2(L,T,P));for(;q<k&&(B>0||F>0||$>0);)B-=Math.max(0,Math.ceil(.1*B)),F-=Math.max(0,Math.ceil(.1*F)),$-=Math.max(0,Math.ceil(.1*$)),q=v(b.relativeLuminance2(B,F,$),b.relativeLuminance2(L,T,P));return(B<<24|F<<16|$<<8|255)>>>0}function R(x,M,k){const L=x>>24&255,T=x>>16&255,P=x>>8&255;let B=M>>24&255,F=M>>16&255,$=M>>8&255,q=v(b.relativeLuminance2(B,F,$),b.relativeLuminance2(L,T,P));for(;q<k&&(B<255||F<255||$<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),F=Math.min(255,F+Math.ceil(.1*(255-F))),$=Math.min(255,$+Math.ceil(.1*(255-$))),q=v(b.relativeLuminance2(B,F,$),b.relativeLuminance2(L,T,P));return(B<<24|F<<16|$<<8|255)>>>0}S.blend=function(x,M){if(u=(255&M)/255,u===1)return M;const k=M>>24&255,L=M>>16&255,T=M>>8&255,P=x>>24&255,B=x>>16&255,F=x>>8&255;return l=P+Math.round((k-P)*u),c=B+Math.round((L-B)*u),f=F+Math.round((T-F)*u),y.toRgba(l,c,f)},S.ensureContrastRatio=function(x,M,k){const L=b.relativeLuminance(x>>8),T=b.relativeLuminance(M>>8);if(v(L,T)<k){if(T<L){const F=D(x,M,k),$=v(L,b.relativeLuminance(F>>8));if($<k){const q=R(x,M,k);return $>v(L,b.relativeLuminance(q>>8))?F:q}return F}const P=R(x,M,k),B=v(L,b.relativeLuminance(P>>8));if(B<k){const F=D(x,M,k);return B>v(L,b.relativeLuminance(F>>8))?P:F}return P}},S.reduceLuminance=D,S.increaseLuminance=R,S.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}})(g||(a.rgba=g={})),a.toPaddedHex=_,a.contrastRatio=v},345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,c){return l((f=>c.fire(f)))},a.runAndSubscribe=function(l,c){return c(void 0),l((f=>c(f)))}},859:(p,a)=>{function l(c){for(const f of c)f.dispose();c.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const f=this._disposables.indexOf(c);f!==-1&&this._disposables.splice(f,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var f;this._isDisposed||c===this._value||((f=this._value)==null||f.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},a.toDisposable=function(c){return{dispose:c}},a.disposeArray=l,a.getDisposeArrayDisposable=function(c){return{dispose:()=>l(c)}}},485:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class l{constructor(){this._data={}}set(f,u,y){this._data[f]||(this._data[f]={}),this._data[f][u]=y}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=l,a.FourKeyMap=class{constructor(){this._data=new l}set(c,f,u,y,C){this._data.get(c,f)||this._data.set(c,f,new l),this._data.get(c,f).set(u,y,C)}get(c,f,u,y){var C;return(C=this._data.get(c,f))==null?void 0:C.get(u,y)}clear(){this._data.clear()}}},399:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const l=a.isNode?"node":navigator.userAgent,c=a.isNode?"node":navigator.platform;a.isFirefox=l.includes("Firefox"),a.isLegacyEdge=l.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(l),a.getSafariVersion=function(){if(!a.isSafari)return 0;const f=l.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),a.isIpad=c==="iPad",a.isIphone=c==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),a.isLinux=c.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(l)},385:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const c=l(399);class f{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let w=0,b=0,g=C.timeRemaining(),_=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),b=Math.max(w,b),_=C.timeRemaining(),1.5*b>_)return g-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-w))}ms`),void this._start();g=_}this.clear()}}class u extends f{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const w=Date.now()+C;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},147:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class l{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new l;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=l;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,y=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=y}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=c},782:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const c=l(133),f=l(855),u=l(147);class y extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const b=new y;return b.setFromCharData(w),b}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let b=!1;if(w[f.CHAR_DATA_CHAR_INDEX].length>2)b=!0;else if(w[f.CHAR_DATA_CHAR_INDEX].length===2){const g=w[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const _=w[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(g-55296)+_-56320+65536|w[f.CHAR_DATA_WIDTH_INDEX]<<22:b=!0}else b=!0}else this.content=w[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[f.CHAR_DATA_WIDTH_INDEX]<<22;b&&(this.combinedData=w[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=y},855:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},133:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},a.utf32ToString=function(l,c=0,f=l.length){let u="";for(let y=c;y<f;++y){let C=l[y];C>65535?(C-=65536,u+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):u+=String.fromCharCode(C)}return u},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const f=l.length;if(!f)return 0;let u=0,y=0;if(this._interim){const C=l.charCodeAt(y++);56320<=C&&C<=57343?c[u++]=1024*(this._interim-55296)+C-56320+65536:(c[u++]=this._interim,c[u++]=C),this._interim=0}for(let C=y;C<f;++C){const w=l.charCodeAt(C);if(55296<=w&&w<=56319){if(++C>=f)return this._interim=w,u;const b=l.charCodeAt(C);56320<=b&&b<=57343?c[u++]=1024*(w-55296)+b-56320+65536:(c[u++]=w,c[u++]=b)}else w!==65279&&(c[u++]=w)}return u}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const f=l.length;if(!f)return 0;let u,y,C,w,b=0,g=0,_=0;if(this.interim[0]){let D=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let x,M=0;for(;(x=63&this.interim[++M])&&M<4;)R<<=6,R|=x;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=k-M;for(;_<L;){if(_>=f)return 0;if(x=l[_++],(192&x)!=128){_--,D=!0;break}this.interim[M++]=x,R<<=6,R|=63&x}D||(k===2?R<128?_--:c[b++]=R:k===3?R<2048||R>=55296&&R<=57343||R===65279||(c[b++]=R):R<65536||R>1114111||(c[b++]=R)),this.interim.fill(0)}const v=f-4;let S=_;for(;S<f;){for(;!(!(S<v)||128&(u=l[S])||128&(y=l[S+1])||128&(C=l[S+2])||128&(w=l[S+3]));)c[b++]=u,c[b++]=y,c[b++]=C,c[b++]=w,S+=4;if(u=l[S++],u<128)c[b++]=u;else if((224&u)==192){if(S>=f)return this.interim[0]=u,b;if(y=l[S++],(192&y)!=128){S--;continue}if(g=(31&u)<<6|63&y,g<128){S--;continue}c[b++]=g}else if((240&u)==224){if(S>=f)return this.interim[0]=u,b;if(y=l[S++],(192&y)!=128){S--;continue}if(S>=f)return this.interim[0]=u,this.interim[1]=y,b;if(C=l[S++],(192&C)!=128){S--;continue}if(g=(15&u)<<12|(63&y)<<6|63&C,g<2048||g>=55296&&g<=57343||g===65279)continue;c[b++]=g}else if((248&u)==240){if(S>=f)return this.interim[0]=u,b;if(y=l[S++],(192&y)!=128){S--;continue}if(S>=f)return this.interim[0]=u,this.interim[1]=y,b;if(C=l[S++],(192&C)!=128){S--;continue}if(S>=f)return this.interim[0]=u,this.interim[1]=y,this.interim[2]=C,b;if(w=l[S++],(192&w)!=128){S--;continue}if(g=(7&u)<<18|(63&y)<<12|(63&C)<<6|63&w,g<65536||g>1114111)continue;c[b++]=g}}return b}}},776:function(p,a,l){var c=this&&this.__decorate||function(g,_,v,S){var D,R=arguments.length,x=R<3?_:S===null?S=Object.getOwnPropertyDescriptor(_,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(g,_,v,S);else for(var M=g.length-1;M>=0;M--)(D=g[M])&&(x=(R<3?D(x):R>3?D(_,v,x):D(_,v))||x);return R>3&&x&&Object.defineProperty(_,v,x),x},f=this&&this.__param||function(g,_){return function(v,S){_(v,S,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const u=l(859),y=l(97),C={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let w,b=a.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let _=0;_<g.length;_++)typeof g[_]=="function"&&(g[_]=g[_]())}_log(g,_,v){this._evalLazyOptionalParams(v),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+_,...v)}trace(g,..._){var v;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.trace.bind(this._optionsService.options.logger))??console.log,g,_)}debug(g,..._){var v;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.debug.bind(this._optionsService.options.logger))??console.log,g,_)}info(g,..._){var v;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.info.bind(this._optionsService.options.logger))??console.info,g,_)}warn(g,..._){var v;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.warn.bind(this._optionsService.options.logger))??console.warn,g,_)}error(g,..._){var v;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.error.bind(this._optionsService.options.logger))??console.error,g,_)}};a.LogService=b=c([f(0,y.IOptionsService)],b),a.setTraceLogger=function(g){w=g},a.traceCall=function(g,_,v){if(typeof v.value!="function")throw new Error("not supported");const S=v.value;v.value=function(...D){if(w.logLevel!==y.LogLevelEnum.TRACE)return S.apply(this,D);w.trace(`GlyphRenderer#${S.name}(${D.map((x=>JSON.stringify(x))).join(", ")})`);const R=S.apply(this,D);return w.trace(`GlyphRenderer#${S.name} return`,R),R}}},726:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const l="di$target",c="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(f){return f[c]||[]},a.createDecorator=function(f){if(a.serviceRegistry.has(f))return a.serviceRegistry.get(f);const u=function(y,C,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(b,g,_){g[l]===g?g[c].push({id:b,index:_}):(g[c]=[{id:b,index:_}],g[l]=g)})(u,y,w)};return u.toString=()=>f,a.serviceRegistry.set(f,u),u}},97:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const c=l(726);var f;a.IBufferService=(0,c.createDecorator)("BufferService"),a.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),a.ICoreService=(0,c.createDecorator)("CoreService"),a.ICharsetService=(0,c.createDecorator)("CharsetService"),a.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(f||(a.LogLevelEnum=f={})),a.ILogService=(0,c.createDecorator)("LogService"),a.IOptionsService=(0,c.createDecorator)("OptionsService"),a.IOscLinkService=(0,c.createDecorator)("OscLinkService"),a.IUnicodeService=(0,c.createDecorator)("UnicodeService"),a.IDecorationService=(0,c.createDecorator)("DecorationService")}},o={};function h(p){var a=o[p];if(a!==void 0)return a.exports;var l=o[p]={exports:{}};return r[p].call(l.exports,l,l.exports,h),l.exports}var m={};return(()=>{var p=m;Object.defineProperty(p,"__esModule",{value:!0}),p.WebglAddon=void 0;const a=h(345),l=h(859),c=h(399),f=h(666),u=h(776);class y extends l.Disposable{constructor(w){if(c.isSafari&&(0,c.getSafariVersion)()<16){const b={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",b))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=w,this._onChangeTextureAtlas=this.register(new a.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new a.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new a.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new a.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(w){const b=w._core;if(!w.element)return void this.register(b.onWillOpen((()=>this.activate(w))));this._terminal=w;const g=b.coreService,_=b.optionsService,v=b,S=v._renderService,D=v._characterJoinerService,R=v._charSizeService,x=v._coreBrowserService,M=v._decorationService,k=v._logService,L=v._themeService;(0,u.setTraceLogger)(k),this._renderer=this.register(new f.WebglRenderer(w,D,R,x,g,M,_,L,this._preserveDrawingBuffer)),this.register((0,a.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,a.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,a.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,a.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),S.setRenderer(this._renderer),this.register((0,l.toDisposable)((()=>{const T=this._terminal._core._renderService;T.setRenderer(this._terminal._core._createRenderer()),T.handleResize(w.cols,w.rows)})))}get textureAtlas(){var w;return(w=this._renderer)==null?void 0:w.textureAtlas}clearTextureAtlas(){var w;(w=this._renderer)==null||w.clearTextureAtlas()}}p.WebglAddon=y})(),m})()))})(nd)),nd.exports}var O2=L2(),dc={exports:{}},B2=dc.exports,ev;function N2(){return ev||(ev=1,(function(e,i){(function(r,o){e.exports=o()})(B2,(()=>(()=>{var r={433:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV11=void 0;const c=l(938),f=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],u=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],y=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],C=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let w;function b(g,_){let v,S=0,D=_.length-1;if(g<_[0][0]||g>_[D][1])return!1;for(;D>=S;)if(v=S+D>>1,g>_[v][1])S=v+1;else{if(!(g<_[v][0]))return!0;D=v-1}return!1}a.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let g=0;g<f.length;++g)w.fill(0,f[g][0],f[g][1]+1);for(let g=0;g<y.length;++g)w.fill(2,y[g][0],y[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?w[g]:b(g,u)?0:b(g,C)?2:1}charProperties(g,_){let v=this.wcwidth(g),S=v===0&&_!==0;if(S){const D=c.UnicodeService.extractWidth(_);D===0?S=!1:D>v&&(v=D)}return c.UnicodeService.createPropertyValue(0,v,S)}}},345:(p,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=l=>(this._listeners.push(l),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===l)return void this._listeners.splice(c,1)}}})),this._event}fire(l,c){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,l,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(l,c){return l((f=>c.fire(f)))},a.runAndSubscribe=function(l,c){return c(void 0),l((f=>c(f)))}},490:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const c=l(938),f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;a.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let C=0;C<f.length;++C)y.fill(0,f[C][0],f[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?y[C]:(function(w,b){let g,_=0,v=b.length-1;if(w<b[0][0]||w>b[v][1])return!1;for(;v>=_;)if(g=_+v>>1,w>b[g][1])_=g+1;else{if(!(w<b[g][0]))return!0;v=g-1}return!1})(C,u)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,w){let b=this.wcwidth(C),g=b===0&&w!==0;if(g){const _=c.UnicodeService.extractWidth(w);_===0?g=!1:_>b&&(b=_)}return c.UnicodeService.createPropertyValue(0,b,g)}}},938:(p,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const c=l(345),f=l(490);class u{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,w,b=!1){return(16777215&C)<<3|(3&w)<<1|(b?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const C=new f.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let w=0,b=0;const g=C.length;for(let _=0;_<g;++_){let v=C.charCodeAt(_);if(55296<=v&&v<=56319){if(++_>=g)return w+this.wcwidth(v);const R=C.charCodeAt(_);56320<=R&&R<=57343?v=1024*(v-55296)+R-56320+65536:w+=this.wcwidth(R)}const S=this.charProperties(v,b);let D=u.extractWidth(S);u.extractShouldJoin(S)&&(D-=u.extractWidth(b)),w+=D,b=S}return w}charProperties(C,w){return this._activeProvider.charProperties(C,w)}}a.UnicodeService=u}},o={};function h(p){var a=o[p];if(a!==void 0)return a.exports;var l=o[p]={exports:{}};return r[p](l,l.exports,h),l.exports}var m={};return(()=>{var p=m;Object.defineProperty(p,"__esModule",{value:!0}),p.Unicode11Addon=void 0;const a=h(433);p.Unicode11Addon=class{activate(l){l.unicode.register(new a.UnicodeV11)}dispose(){}}})(),m})()))})(dc)),dc.exports}var I2=N2();const F2=16,z2=256*1024,tv=50;function P2(e,i){const r=N.useRef(null),o=N.useRef(null),h=N.useRef(null),m=N.useRef(i);m.current=i;const p=N.useRef([]),a=N.useRef(0),l=N.useRef(null),c=N.useRef(null),f=N.useRef(null),u=N.useRef(0),y=N.useRef(null),C=N.useRef(null),w=N.useRef(null),b=N.useRef(!0),g=N.useRef(!0),[_,v]=N.useState(!1),S=N.useRef(!1),D=N.useRef(!1),R=N.useRef(0),x=20,M=N.useRef(0);N.useEffect(()=>{if(!e.current)return;const q=()=>{if(!r.current||p.current.length===0)return;const se=p.current.join("");p.current=[],a.current=0,r.current.write(se)};f.current=q;const W=(se,Z)=>{const G=w.current;if(G&&G.cols===se&&G.rows===Z)return;const ne=Date.now()-u.current,ve=()=>{var Te;u.current=Date.now(),((Te=m.current)==null?void 0:Te.call(m,se,Z))!==!1&&(w.current={cols:se,rows:Z})};if(ne>=tv){ve();return}C.current={cols:se,rows:Z},y.current||(y.current=setTimeout(()=>{var Te;y.current=null;const me=C.current;C.current=null,me&&(u.current=Date.now(),((Te=m.current)==null?void 0:Te.call(m,me.cols,me.rows))!==!1&&(w.current={cols:me.cols,rows:me.rows}))},tv-ne))},K=new R2.Terminal({disableStdin:!0,fontSize:14,fontFamily:"'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace",theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#e6edf3",selectionBackground:"#264f78",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},scrollback:1e4}),X=new M2.FitAddon;K.loadAddon(X);try{const se=new I2.Unicode11Addon;K.loadAddon(se),K.unicode.activeVersion="11"}catch{}K.open(e.current);try{const se=new O2.WebglAddon;K.loadAddon(se),se.onContextLoss(()=>{se.dispose()})}catch{}X.fit(),requestAnimationFrame(()=>{r.current&&W(r.current.cols,r.current.rows)}),r.current=K,o.current=X,M.current=K.buffer.active.viewportY;const U=(se,Z)=>{X.fit(),W(K.cols,K.rows)};h.current=U;const O=new ResizeObserver(()=>{X.fit(),W(K.cols,K.rows)});O.observe(e.current),K.onScroll(()=>{if(S.current)return;const se=K.buffer.active,Z=se.viewportY,G=Z>=se.length-K.rows;M.current-Z>0&&!G&&(b.current=!1),M.current=Z,g.current=G,G&&(b.current=!0),v(!b.current&&!G)});const z=e.current,j=se=>{var G;const Z=(G=se.touches)==null?void 0:G[0];Z&&(D.current=!0,R.current=Z.clientY)},H=se=>{var re;const Z=(re=se.touches)==null?void 0:re[0];if(!Z)return;if(Z.clientY-R.current>x){if(!(K.buffer.active.length>K.rows))return;b.current=!1,v(!0)}},ee=()=>{D.current=!1},he=se=>{if(se.deltaY<0){if(!(K.buffer.active.length>K.rows))return;b.current=!1,v(!0)}};return z.addEventListener("touchstart",j,{passive:!0}),z.addEventListener("touchmove",H,{passive:!0}),z.addEventListener("touchend",ee,{passive:!0}),z.addEventListener("wheel",he,{passive:!0}),()=>{z.removeEventListener("touchstart",j),z.removeEventListener("touchmove",H),z.removeEventListener("touchend",ee),z.removeEventListener("wheel",he),O.disconnect(),y.current&&(clearTimeout(y.current),y.current=null),l.current!==null&&(cancelAnimationFrame(l.current),l.current=null),c.current&&(clearTimeout(c.current),c.current=null),q(),K.dispose(),r.current=null,o.current=null,h.current=null,f.current=null}},[e]);const k=N.useCallback(()=>{const q=r.current;if(!q||D.current)return;if(b.current){S.current=!0,q.scrollToBottom(),S.current=!1,M.current=q.buffer.active.viewportY;return}const W=q.buffer.active,K=W.viewportY>=W.length-q.rows;K!==g.current&&(g.current=K,v(!K))},[]),L=N.useCallback((q,W)=>{var K;if(!q){W==null||W();return}if(p.current.push(q),a.current+=q.length,a.current>=z2){(K=f.current)==null||K.call(f),k(),W==null||W();return}l.current===null&&(l.current=requestAnimationFrame(()=>{var X;l.current=null,c.current&&(clearTimeout(c.current),c.current=null),(X=f.current)==null||X.call(f),k()})),c.current||(c.current=setTimeout(()=>{var X;c.current=null,(X=f.current)==null||X.call(f),k()},F2)),W==null||W()},[]),T=N.useCallback(()=>{var q;(q=r.current)==null||q.clear()},[]),P=N.useCallback(()=>{var q;(q=r.current)==null||q.reset()},[]),B=N.useCallback(()=>{const q=r.current;q&&(S.current=!0,q.scrollToBottom(),S.current=!1,M.current=q.buffer.active.viewportY)},[]),F=N.useCallback(q=>{b.current=q,q&&v(!1)},[]),$=N.useCallback((q,W)=>{var K;(K=h.current)==null||K.call(h,q,W)},[]);return{write:L,clear:T,reset:P,scrollToBottom:B,setAutoFollow:F,showScrollHint:_,adaptToPtyCols:$,terminal:r}}function U2(){const[e,i]=N.useState(0),[r,o]=N.useState(!1),h=N.useRef(null),m=N.useRef(!1);N.useEffect(()=>{const f=navigator.userAgent;m.current=/android/i.test(f)&&!/windows phone/i.test(f),console.log("[viewport] Device detection:",{isAndroid:m.current,ua:f})},[]);const p=N.useCallback(()=>{const f=document.activeElement;if((f==null?void 0:f.tagName)!=="INPUT"&&(f==null?void 0:f.tagName)!=="TEXTAREA")return!1;const u=window.visualViewport;if(!u)return!1;const y=f.getBoundingClientRect(),C=y.bottom>u.height+u.offsetTop-10;return console.log("[viewport] checkOcclusion",{elementTag:f.tagName,rectBottom:Math.round(y.bottom),vvHeight:Math.round(u.height),vvOffsetTop:Math.round(u.offsetTop),threshold:Math.round(u.height+u.offsetTop-10),occluded:C,isAndroid:m.current}),C},[]),a=N.useCallback(()=>{const f=window.visualViewport;if(!f){console.log("[viewport] updateViewport: no visualViewport"),i(0),o(!1);return}if(console.log("[viewport] updateViewport start",{vvOffsetTop:Math.round(f.offsetTop),vvHeight:Math.round(f.height),windowInnerHeight:window.innerHeight,isAndroid:m.current}),m.current){console.log("[viewport] updateViewport: Android detected, skipping JS compensation"),i(0),o(!1);return}const u=p();o(u),u?(console.log("[viewport] updateViewport: iOS setting offsetTop",Math.round(f.offsetTop)),i(f.offsetTop)):(console.log("[viewport] updateViewport: iOS clearing offsetTop (not occluded)"),i(0))},[p]),l=N.useCallback(()=>{var y;const f=window.visualViewport;if(!f)return;if(console.log("[viewport] updateViewportImmediate (focusin/focusout)",{vvOffsetTop:Math.round(f.offsetTop),vvHeight:Math.round(f.height),activeElement:(y=document.activeElement)==null?void 0:y.tagName,isAndroid:m.current}),m.current){console.log("[viewport] updateViewportImmediate: Android detected, skipping"),o(!1),i(0);return}const u=p();o(u),u?console.log("[viewport] updateViewportImmediate: focusin detected occlusion, waiting for resize"):(console.log("[viewport] updateViewportImmediate: clearing offsetTop (focusout/not occluded)"),i(0))},[p]),c=N.useCallback(()=>{console.log("[viewport] debouncedUpdate triggered (visualViewport resize/scroll)"),h.current&&clearTimeout(h.current),h.current=setTimeout(a,150)},[a]);return N.useEffect(()=>{const f=window.visualViewport;if(f)return i(0),f.addEventListener("resize",c),f.addEventListener("scroll",c),document.addEventListener("focusin",l,!0),document.addEventListener("focusout",l,!0),()=>{f.removeEventListener("resize",c),f.removeEventListener("scroll",c),document.removeEventListener("focusin",l,!0),document.removeEventListener("focusout",l,!0),h.current&&clearTimeout(h.current)}},[c,l]),{offsetTop:e,needsCompensation:r}}function H2(e){const i="=".repeat((4-e.length%4)%4),r=(e+i).replace(/-/g,"+").replace(/_/g,"/"),o=atob(r),h=new Uint8Array(o.length);for(let m=0;m<o.length;m++)h[m]=o.charCodeAt(m);return h}function j2(){const e=N.useRef(!1);N.useEffect(()=>{if(!e.current){if(e.current=!0,!("serviceWorker"in navigator)||!("PushManager"in window)){console.log("[Push] Service Worker or PushManager not supported");return}(async()=>{try{console.log("[Push] Registering service worker...");const i=await navigator.serviceWorker.register("/sw.js");console.log("[Push] Service worker registered:",i.scope);const r=await i.pushManager.getSubscription();if(r){console.log("[Push] Already subscribed, endpoint:",r.endpoint);return}console.log("[Push] Fetching VAPID key from server...");let o="";for(let l=0;l<8;l++){const c=await fetch("/api/push/vapid-key",{credentials:"include"});if(c.ok){const f=await c.json();if(f!=null&&f.vapidPublicKey){o=f.vapidPublicKey,console.log("[Push] Got VAPID key:",o.substring(0,20)+"...");break}}else console.log("[Push] VAPID key fetch failed, attempt",l+1,"status:",c.status);await new Promise(f=>setTimeout(f,Math.min(300*(l+1),1500)))}if(!o){console.warn("[Push] Failed to get VAPID key after retries");return}console.log("[Push] Requesting notification permission...");const h=await Notification.requestPermission();if(console.log("[Push] Permission result:",h),h!=="granted"){console.warn("[Push] Notification permission not granted");return}console.log("[Push] Creating push subscription...");const m=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:H2(o)});console.log("[Push] Subscription created:",m.endpoint);const p=m.toJSON();console.log("[Push] Sending subscription to server...");const a=await fetch("/api/push/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({endpoint:p.endpoint,keys:p.keys})});a.ok?console.log("[Push] Subscription sent to server successfully"):console.error("[Push] Failed to send subscription, status:",a.status)}catch(i){console.error("[Push] Setup failed:",i)}})()}},[])}function $2(){const e=N.useRef("default"),i=N.useRef(null);N.useEffect(()=>{"Notification"in window&&(e.current=Notification.permission)},[]);const r=N.useCallback(async()=>{if(!("Notification"in window))return console.log("[useLocalNotification] Notification API not supported"),!1;if(Notification.permission==="granted")return e.current="granted",!0;if(Notification.permission==="denied")return console.log("[useLocalNotification] Notification permission denied"),!1;const h=await Notification.requestPermission();return e.current=h,h==="granted"},[]);return{showNotification:N.useCallback(async h=>{if(h.tag&&h.tag===i.current)return console.log("[useLocalNotification] Skipping duplicate notification with tag:",h.tag),!1;if(e.current!=="granted"&&!await r())return console.log("[useLocalNotification] Permission not granted, cannot show notification"),!1;try{const m=new Notification(h.title,{body:h.body,tag:h.tag,icon:"/favicon.ico"});return m.onclick=()=>{window.focus(),m.close()},h.tag&&(i.current=h.tag),console.log("[useLocalNotification] Notification shown:",h.title),!0}catch(m){return console.error("[useLocalNotification] Failed to show notification:",m),!1}},[r]),requestPermission:r}}const q2=5e3;function W2(){const e=Sn(o=>o.setInstances),i=Sn(o=>o.setActiveInstanceId),r=rt(o=>o.setServerAvailable);return N.useRef(!1),N.useEffect(()=>{let o,h=!1;const m=async()=>{try{const a=await _b();if(h)return;r(!0),e(a);const l=Sn.getState().activeInstanceId,c=l&&a.some(f=>f.instanceId===l);if((!l||!c)&&a.length>0){const f=a.find(u=>u.isCurrent)??a[0];f&&i(f.instanceId)}}catch{if(h)return;document.visibilityState==="visible"&&(r(!1),e([]))}},p=()=>{document.visibilityState==="visible"&&m()};return m(),o=setInterval(m,q2),document.addEventListener("visibilitychange",p),()=>{h=!0,o&&clearInterval(o),document.removeEventListener("visibilitychange",p)}},[e,i,r]),{activeInstanceId:Sn(o=>o.activeInstanceId)}}function G2({wsUrl:e,instanceId:i,showCommandPicker:r,isKeyboardOpen:o}){const h=N.useRef(null),m=N.useRef(null),p=rt(q=>q.setSessionStatus),a=rt(q=>q.setIpChangeInfo),l=rt(q=>q.setInstanceConnectionStatus),{showNotification:c}=$2(),f=N.useRef(null),u=N.useRef((q,W)=>{}),y=N.useRef(()=>{}),C=N.useRef(()=>{}),w=N.useRef((q,W)=>{}),b=N.useCallback(q=>{switch(q.type){case"terminal_output":u.current(q.data);break;case"history_sync":y.current(),w.current(0,0),u.current(q.data),p(q.status);break;case"terminal_resize":q.cols&&q.cols>0&&w.current(q.cols,q.rows);break;case"status_update":p(q.status),q.status==="waiting_input"&&c({title:"Claude Code 需要输入",body:q.detail??"Claude 正在等待你的输入",tag:"claude-waiting-input",renotify:!1});break;case"session_ended":p("idle"),i&&l(i,"disconnected");break;case"error":u.current(`\r
151
- \x1B[31m[Error] ${q.message}\x1B[0m\r
152
- `);break;case"heartbeat":break;case"ip_changed":a({oldIp:q.oldIp,newIp:q.newIp,newUrl:q.newUrl});break}},[p,a,c]),{connect:g,send:_}=A2(b,e,i);f.current=_;const{write:v,reset:S,scrollToBottom:D,setAutoFollow:R,showScrollHint:x,adaptToPtyCols:M}=P2(h,N.useCallback((q,W)=>{var K;return((K=f.current)==null?void 0:K.call(f,{type:"resize",cols:q,rows:W}))??!1},[]));u.current=v,y.current=S,C.current=D,w.current=M;const k=N.useRef(!1);N.useEffect(()=>{k.current||(k.current=!0,g())},[g]);const L=N.useCallback(q=>{q?(_({type:"user_input",data:q}),setTimeout(()=>{_({type:"user_input",data:"\r"})},0)):_({type:"user_input",data:"\r"})},[_]),T=N.useCallback(q=>{_({type:"user_input",data:q})},[_]),P=N.useCallback(q=>{var W;(W=m.current)==null||W.setText(q)},[]),B=N.useCallback(q=>{_({type:"user_input",data:q}),_({type:"user_input",data:"\r"})},[_]),F=N.useCallback(()=>{D(),R(!0)},[D,R]),$=N.useCallback(()=>{var q;(q=m.current)==null||q.focus()},[]);return Y.jsxs(Y.Fragment,{children:[Y.jsx(t2,{}),Y.jsx(n2,{}),Y.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[Y.jsx(Xx,{containerRef:h,onFocusInput:$}),Y.jsx(g2,{visible:x,onClick:F})]}),Y.jsx(e2,{onShortcut:T,onCommandSelect:P,onCommandSend:B,visible:r}),Y.jsx(Zx,{ref:m,onSend:L,isKeyboardOpen:o})]})}function K2(e,i){return e.filter(r=>r.instanceId!==i).sort((r,o)=>r.startedAt.localeCompare(o.startedAt))}function V2(){const{offsetTop:e,needsCompensation:i}=U2(),r=i&&e>0,o=!r;j2(),W2();const h=Sn(S=>S.instances),m=Sn(S=>S.activeInstanceId),p=Sn(S=>S.setActiveInstanceId),a=rt(S=>S.cachedToken),l=rt(S=>S.serverAvailable),c=rt(S=>S.instanceConnectionStatus),f=rt(S=>S.toastMessage),u=rt(S=>S.showToast),y=rt(S=>S.hideToast),C=N.useRef(!1),w=N.useRef(null),b=h.find(S=>S.instanceId===m),g=m?i2(m):void 0;N.useEffect(()=>{if(!m||l===!1)return;const S=!b,D=c[m]==="disconnected";if(!(S||D)||C.current||w.current===m)return;const x=K2(h,m);if(x.length===0)return;C.current=!0,w.current=m,(async()=>{if(a)try{await Ti(a)}catch{}const k=x[0];p(k.instanceId),u(`Switched to ${k.name}`),C.current=!1})()},[b,m,a,c,h,l,p,u]),N.useEffect(()=>{if(!f)return;const S=setTimeout(()=>y(),3e3);return()=>clearTimeout(S)},[f,y]);const _=N.useCallback(async S=>{if(a)try{await Ti(a)}catch{}p(S);const D=h.find(R=>R.instanceId===S);D&&u(`Switched to ${D.name}`)},[a,p,h,u]),v=N.useCallback(async S=>{p(S.instanceId),u(`Created and switched to ${S.name}`)},[p,u]);return Y.jsxs("div",{"data-testid":"console--page",style:{position:"fixed",top:0,left:0,right:0,height:"100dvh",transform:i?`translateY(-${e}px)`:"none",transition:"transform 0.25s ease-out",willChange:i?"transform":"auto",display:"flex",flexDirection:"column"},children:[Y.jsx(Yx,{}),Y.jsx(f2,{onSwitch:_,onCreateSuccess:v}),Y.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:Y.jsx(G2,{wsUrl:g,instanceId:m??void 0,showCommandPicker:o,isKeyboardOpen:r},m??"default")}),f&&Y.jsx("div",{"data-testid":"toast--message",className:"app-toast app-toast-top",role:"status","aria-live":"polite",children:f}),Y.jsx(D2,{})]})}function Y2(e,i){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const X2=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Z2=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Q2={};function nv(e,i){return(Q2.jsx?Z2:X2).test(e)}const J2=/[ \t\n\f\r]/g;function eD(e){return typeof e=="object"?e.type==="text"?iv(e.value):!1:iv(e)}function iv(e){return e.replace(J2,"")===""}class Ro{constructor(i,r,o){this.normal=r,this.property=i,o&&(this.space=o)}}Ro.prototype.normal={};Ro.prototype.property={};Ro.prototype.space=void 0;function Sb(e,i){const r={},o={};for(const h of e)Object.assign(r,h.property),Object.assign(o,h.normal);return new Ro(r,o,i)}function Bd(e){return e.toLowerCase()}class $n{constructor(i,r){this.attribute=r,this.property=i}}$n.prototype.attribute="";$n.prototype.booleanish=!1;$n.prototype.boolean=!1;$n.prototype.commaOrSpaceSeparated=!1;$n.prototype.commaSeparated=!1;$n.prototype.defined=!1;$n.prototype.mustUseProperty=!1;$n.prototype.number=!1;$n.prototype.overloadedBoolean=!1;$n.prototype.property="";$n.prototype.spaceSeparated=!1;$n.prototype.space=void 0;let tD=0;const et=is(),sn=is(),Nd=is(),Se=is(),It=is(),Vs=is(),ei=is();function is(){return 2**++tD}const Id=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:sn,commaOrSpaceSeparated:ei,commaSeparated:Vs,number:Se,overloadedBoolean:Nd,spaceSeparated:It},Symbol.toStringTag,{value:"Module"})),id=Object.keys(Id);class df extends $n{constructor(i,r,o,h){let m=-1;if(super(i,r),rv(this,"space",h),typeof o=="number")for(;++m<id.length;){const p=id[m];rv(this,id[m],(o&Id[p])===Id[p])}}}df.prototype.defined=!0;function rv(e,i,r){r&&(e[i]=r)}function na(e){const i={},r={};for(const[o,h]of Object.entries(e.properties)){const m=new df(o,e.transform(e.attributes||{},o),h,e.space);e.mustUseProperty&&e.mustUseProperty.includes(o)&&(m.mustUseProperty=!0),i[o]=m,r[Bd(o)]=o,r[Bd(m.attribute)]=o}return new Ro(i,r,e.space)}const Cb=na({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:It,ariaCurrent:null,ariaDescribedBy:It,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:It,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:It,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:It,ariaLevel:Se,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:It,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:It,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:sn,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function Eb(e,i){return i in e?e[i]:i}function wb(e,i){return Eb(e,i.toLowerCase())}const nD=na({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vs,acceptCharset:It,accessKey:It,action:null,allow:null,allowFullScreen:et,allowPaymentRequest:et,allowUserMedia:et,alt:null,as:null,async:et,autoCapitalize:null,autoComplete:It,autoFocus:et,autoPlay:et,blocking:It,capture:null,charSet:null,checked:et,cite:null,className:It,cols:Se,colSpan:null,content:null,contentEditable:sn,controls:et,controlsList:It,coords:Se|Vs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:et,defer:et,dir:null,dirName:null,disabled:et,download:Nd,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:et,formTarget:null,headers:It,height:Se,hidden:Nd,high:Se,href:null,hrefLang:null,htmlFor:It,httpEquiv:It,id:null,imageSizes:null,imageSrcSet:null,inert:et,inputMode:null,integrity:null,is:null,isMap:et,itemId:null,itemProp:It,itemRef:It,itemScope:et,itemType:It,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:et,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:et,muted:et,name:null,nonce:null,noModule:et,noValidate:et,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:et,optimum:Se,pattern:null,ping:It,placeholder:null,playsInline:et,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:et,referrerPolicy:null,rel:It,required:et,reversed:et,rows:Se,rowSpan:Se,sandbox:It,scope:null,scoped:et,seamless:et,selected:et,shadowRootClonable:et,shadowRootDelegatesFocus:et,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Se,step:null,style:null,tabIndex:Se,target:null,title:null,translate:null,type:null,typeMustMatch:et,useMap:null,value:sn,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:It,axis:null,background:null,bgColor:null,border:Se,borderColor:null,bottomMargin:Se,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:et,declare:et,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:et,noHref:et,noShade:et,noWrap:et,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:Se,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Se,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:et,disableRemotePlayback:et,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:wb}),iD=na({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:ei,accentHeight:Se,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Se,amplitude:Se,arabicForm:null,ascent:Se,attributeName:null,attributeType:null,azimuth:Se,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Se,by:null,calcMode:null,capHeight:Se,className:It,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:Se,diffuseConstant:Se,direction:null,display:null,dur:null,divisor:Se,dominantBaseline:null,download:et,dx:null,dy:null,edgeMode:null,editable:null,elevation:Se,enableBackground:null,end:null,event:null,exponent:Se,externalResourcesRequired:null,fill:null,fillOpacity:Se,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:Vs,g2:Vs,glyphName:Vs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Se,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Se,horizOriginX:Se,horizOriginY:Se,id:null,ideographic:Se,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Se,k:Se,k1:Se,k2:Se,k3:Se,k4:Se,kernelMatrix:ei,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Se,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:Se,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:Se,overlineThickness:Se,paintOrder:null,panose1:null,path:null,pathLength:Se,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:It,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ei,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ei,rev:ei,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ei,requiredFeatures:ei,requiredFonts:ei,requiredFormats:ei,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:Se,specularExponent:Se,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Se,strikethroughThickness:Se,string:null,stroke:null,strokeDashArray:ei,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Se,strokeOpacity:Se,strokeWidth:null,style:null,surfaceScale:Se,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ei,tabIndex:Se,tableValues:null,target:null,targetX:Se,targetY:Se,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ei,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Se,underlineThickness:Se,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Se,values:null,vAlphabetic:Se,vMathematical:Se,vectorEffect:null,vHanging:Se,vIdeographic:Se,version:null,vertAdvY:Se,vertOriginX:Se,vertOriginY:Se,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Se,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Eb}),xb=na({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),Db=na({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:wb}),Ab=na({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),rD={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"},sD=/[A-Z]/g,sv=/-[a-z]/g,aD=/^data[-\w.:]+$/i;function oD(e,i){const r=Bd(i);let o=i,h=$n;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&aD.test(i)){if(i.charAt(4)==="-"){const m=i.slice(5).replace(sv,cD);o="data"+m.charAt(0).toUpperCase()+m.slice(1)}else{const m=i.slice(4);if(!sv.test(m)){let p=m.replace(sD,lD);p.charAt(0)!=="-"&&(p="-"+p),i="data"+p}}h=df}return new h(o,i)}function lD(e){return"-"+e.toLowerCase()}function cD(e){return e.charAt(1).toUpperCase()}const uD=Sb([Cb,nD,xb,Db,Ab],"html"),ff=Sb([Cb,iD,xb,Db,Ab],"svg");function hD(e){return e.join(" ").trim()}var Hs={},rd,av;function dD(){if(av)return rd;av=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,h=/^:\s*/,m=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
153
- `,c="/",f="*",u="",y="comment",C="declaration";function w(g,_){if(typeof g!="string")throw new TypeError("First argument must be a string");if(!g)return[];_=_||{};var v=1,S=1;function D($){var q=$.match(i);q&&(v+=q.length);var W=$.lastIndexOf(l);S=~W?$.length-W:S+$.length}function R(){var $={line:v,column:S};return function(q){return q.position=new x($),L(),q}}function x($){this.start=$,this.end={line:v,column:S},this.source=_.source}x.prototype.content=g;function M($){var q=new Error(_.source+":"+v+":"+S+": "+$);if(q.reason=$,q.filename=_.source,q.line=v,q.column=S,q.source=g,!_.silent)throw q}function k($){var q=$.exec(g);if(q){var W=q[0];return D(W),g=g.slice(W.length),q}}function L(){k(r)}function T($){var q;for($=$||[];q=P();)q!==!1&&$.push(q);return $}function P(){var $=R();if(!(c!=g.charAt(0)||f!=g.charAt(1))){for(var q=2;u!=g.charAt(q)&&(f!=g.charAt(q)||c!=g.charAt(q+1));)++q;if(q+=2,u===g.charAt(q-1))return M("End of comment missing");var W=g.slice(2,q-2);return S+=2,D(W),g=g.slice(q),S+=2,$({type:y,comment:W})}}function B(){var $=R(),q=k(o);if(q){if(P(),!k(h))return M("property missing ':'");var W=k(m),K=$({type:C,property:b(q[0].replace(e,u)),value:W?b(W[0].replace(e,u)):u});return k(p),K}}function F(){var $=[];T($);for(var q;q=B();)q!==!1&&($.push(q),T($));return $}return L(),F()}function b(g){return g?g.replace(a,u):u}return rd=w,rd}var ov;function fD(){if(ov)return Hs;ov=1;var e=Hs&&Hs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.default=r;const i=e(dD());function r(o,h){let m=null;if(!o||typeof o!="string")return m;const p=(0,i.default)(o),a=typeof h=="function";return p.forEach(l=>{if(l.type!=="declaration")return;const{property:c,value:f}=l;a?h(c,f,l):f&&(m=m||{},m[c]=f)}),m}return Hs}var to={},lv;function gD(){if(lv)return to;lv=1,Object.defineProperty(to,"__esModule",{value:!0}),to.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,r=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,h=/^-(ms)-/,m=function(c){return!c||r.test(c)||e.test(c)},p=function(c,f){return f.toUpperCase()},a=function(c,f){return"".concat(f,"-")},l=function(c,f){return f===void 0&&(f={}),m(c)?c:(c=c.toLowerCase(),f.reactCompat?c=c.replace(h,a):c=c.replace(o,a),c.replace(i,p))};return to.camelCase=l,to}var no,cv;function pD(){if(cv)return no;cv=1;var e=no&&no.__importDefault||function(h){return h&&h.__esModule?h:{default:h}},i=e(fD()),r=gD();function o(h,m){var p={};return!h||typeof h!="string"||(0,i.default)(h,function(a,l){a&&l&&(p[(0,r.camelCase)(a,m)]=l)}),p}return o.default=o,no=o,no}var mD=pD();const _D=xc(mD),kb=Rb("end"),gf=Rb("start");function Rb(e){return i;function i(r){const o=r&&r.position&&r.position[e]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function vD(e){const i=gf(e),r=kb(e);if(i&&r)return{start:i,end:r}}function fo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?uv(e.position):"start"in e||"end"in e?uv(e):"line"in e||"column"in e?Fd(e):""}function Fd(e){return hv(e&&e.line)+":"+hv(e&&e.column)}function uv(e){return Fd(e&&e.start)+"-"+Fd(e&&e.end)}function hv(e){return e&&typeof e=="number"?e:1}class En extends Error{constructor(i,r,o){super(),typeof r=="string"&&(o=r,r=void 0);let h="",m={},p=!1;if(r&&("line"in r&&"column"in r?m={place:r}:"start"in r&&"end"in r?m={place:r}:"type"in r?m={ancestors:[r],place:r.position}:m={...r}),typeof i=="string"?h=i:!m.cause&&i&&(p=!0,h=i.message,m.cause=i),!m.ruleId&&!m.source&&typeof o=="string"){const l=o.indexOf(":");l===-1?m.ruleId=o:(m.source=o.slice(0,l),m.ruleId=o.slice(l+1))}if(!m.place&&m.ancestors&&m.ancestors){const l=m.ancestors[m.ancestors.length-1];l&&(m.place=l.position)}const a=m.place&&"start"in m.place?m.place.start:m.place;this.ancestors=m.ancestors||void 0,this.cause=m.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=h,this.line=a?a.line:void 0,this.name=fo(m.place)||"1:1",this.place=m.place||void 0,this.reason=this.message,this.ruleId=m.ruleId||void 0,this.source=m.source||void 0,this.stack=p&&m.cause&&typeof m.cause.stack=="string"?m.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}En.prototype.file="";En.prototype.name="";En.prototype.reason="";En.prototype.message="";En.prototype.stack="";En.prototype.column=void 0;En.prototype.line=void 0;En.prototype.ancestors=void 0;En.prototype.cause=void 0;En.prototype.fatal=void 0;En.prototype.place=void 0;En.prototype.ruleId=void 0;En.prototype.source=void 0;const pf={}.hasOwnProperty,bD=new Map,yD=/[A-Z]/g,SD=new Set(["table","tbody","thead","tfoot","tr"]),CD=new Set(["td","th"]),Tb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ED(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=i.filePath||void 0;let o;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=MD(r,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=TD(r,i.jsx,i.jsxs)}const h={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:o,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?ff:uD,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},m=Mb(h,e,void 0);return m&&typeof m!="string"?m:h.create(e,h.Fragment,{children:m||void 0},void 0)}function Mb(e,i,r){if(i.type==="element")return wD(e,i,r);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return xD(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return AD(e,i,r);if(i.type==="mdxjsEsm")return DD(e,i);if(i.type==="root")return kD(e,i,r);if(i.type==="text")return RD(e,i)}function wD(e,i,r){const o=e.schema;let h=o;i.tagName.toLowerCase()==="svg"&&o.space==="html"&&(h=ff,e.schema=h),e.ancestors.push(i);const m=Ob(e,i.tagName,!1),p=LD(e,i);let a=_f(e,i);return SD.has(i.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!eD(l):!0})),Lb(e,p,m,i),mf(p,a),e.ancestors.pop(),e.schema=o,e.create(i,m,p,r)}function xD(e,i){if(i.data&&i.data.estree&&e.evaluater){const o=i.data.estree.body[0];return o.type,e.evaluater.evaluateExpression(o.expression)}So(e,i.position)}function DD(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);So(e,i.position)}function AD(e,i,r){const o=e.schema;let h=o;i.name==="svg"&&o.space==="html"&&(h=ff,e.schema=h),e.ancestors.push(i);const m=i.name===null?e.Fragment:Ob(e,i.name,!0),p=OD(e,i),a=_f(e,i);return Lb(e,p,m,i),mf(p,a),e.ancestors.pop(),e.schema=o,e.create(i,m,p,r)}function kD(e,i,r){const o={};return mf(o,_f(e,i)),e.create(i,e.Fragment,o,r)}function RD(e,i){return i.value}function Lb(e,i,r,o){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(i.node=o)}function mf(e,i){if(i.length>0){const r=i.length>1?i:i[0];r&&(e.children=r)}}function TD(e,i,r){return o;function o(h,m,p,a){const c=Array.isArray(p.children)?r:i;return a?c(m,p,a):c(m,p)}}function MD(e,i){return r;function r(o,h,m,p){const a=Array.isArray(m.children),l=gf(o);return i(h,m,p,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function LD(e,i){const r={};let o,h;for(h in i.properties)if(h!=="children"&&pf.call(i.properties,h)){const m=BD(e,h,i.properties[h]);if(m){const[p,a]=m;e.tableCellAlignToStyle&&p==="align"&&typeof a=="string"&&CD.has(i.tagName)?o=a:r[p]=a}}if(o){const m=r.style||(r.style={});m[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return r}function OD(e,i){const r={};for(const o of i.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&e.evaluater){const m=o.data.estree.body[0];m.type;const p=m.expression;p.type;const a=p.properties[0];a.type,Object.assign(r,e.evaluater.evaluateExpression(a.argument))}else So(e,i.position);else{const h=o.name;let m;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&e.evaluater){const a=o.value.data.estree.body[0];a.type,m=e.evaluater.evaluateExpression(a.expression)}else So(e,i.position);else m=o.value===null?!0:o.value;r[h]=m}return r}function _f(e,i){const r=[];let o=-1;const h=e.passKeys?new Map:bD;for(;++o<i.children.length;){const m=i.children[o];let p;if(e.passKeys){const l=m.type==="element"?m.tagName:m.type==="mdxJsxFlowElement"||m.type==="mdxJsxTextElement"?m.name:void 0;if(l){const c=h.get(l)||0;p=l+"-"+c,h.set(l,c+1)}}const a=Mb(e,m,p);a!==void 0&&r.push(a)}return r}function BD(e,i,r){const o=oD(e.schema,i);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=o.commaSeparated?Y2(r):hD(r)),o.property==="style"){let h=typeof r=="object"?r:ND(e,String(r));return e.stylePropertyNameCase==="css"&&(h=ID(h)),["style",h]}return[e.elementAttributeNameCase==="react"&&o.space?rD[o.property]||o.property:o.attribute,r]}}function ND(e,i){try{return _D(i,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const o=r,h=new En("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw h.file=e.filePath||void 0,h.url=Tb+"#cannot-parse-style-attribute",h}}function Ob(e,i,r){let o;if(!r)o={type:"Literal",value:i};else if(i.includes(".")){const h=i.split(".");let m=-1,p;for(;++m<h.length;){const a=nv(h[m])?{type:"Identifier",name:h[m]}:{type:"Literal",value:h[m]};p=p?{type:"MemberExpression",object:p,property:a,computed:!!(m&&a.type==="Literal"),optional:!1}:a}o=p}else o=nv(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(o.type==="Literal"){const h=o.value;return pf.call(e.components,h)?e.components[h]:h}if(e.evaluater)return e.evaluater.evaluateExpression(o);So(e)}function So(e,i){const r=new En("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Tb+"#cannot-handle-mdx-estrees-without-createevaluater",r}function ID(e){const i={};let r;for(r in e)pf.call(e,r)&&(i[FD(r)]=e[r]);return i}function FD(e){let i=e.replace(yD,zD);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function zD(e){return"-"+e.toLowerCase()}const sd={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"]},PD={};function vf(e,i){const r=PD,o=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,h=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Bb(e,o,h)}function Bb(e,i,r){if(UD(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dv(e.children,i,r)}return Array.isArray(e)?dv(e,i,r):""}function dv(e,i,r){const o=[];let h=-1;for(;++h<e.length;)o[h]=Bb(e[h],i,r);return o.join("")}function UD(e){return!!(e&&typeof e=="object")}const fv=document.createElement("i");function bf(e){const i="&"+e+";";fv.innerHTML=i;const r=fv.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===i?!1:r}function ti(e,i,r,o){const h=e.length;let m=0,p;if(i<0?i=-i>h?0:h+i:i=i>h?h:i,r=r>0?r:0,o.length<1e4)p=Array.from(o),p.unshift(i,r),e.splice(...p);else for(r&&e.splice(i,r);m<o.length;)p=o.slice(m,m+1e4),p.unshift(i,0),e.splice(...p),m+=1e4,i+=1e4}function gi(e,i){return e.length>0?(ti(e,e.length,0,i),e):i}const gv={}.hasOwnProperty;function Nb(e){const i={};let r=-1;for(;++r<e.length;)HD(i,e[r]);return i}function HD(e,i){let r;for(r in i){const h=(gv.call(e,r)?e[r]:void 0)||(e[r]={}),m=i[r];let p;if(m)for(p in m){gv.call(h,p)||(h[p]=[]);const a=m[p];jD(h[p],Array.isArray(a)?a:a?[a]:[])}}}function jD(e,i){let r=-1;const o=[];for(;++r<i.length;)(i[r].add==="after"?e:o).push(i[r]);ti(e,0,0,o)}function Ib(e,i){const r=Number.parseInt(e,i);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function yi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Mn=Or(/[A-Za-z]/),Cn=Or(/[\dA-Za-z]/),$D=Or(/[#-'*+\--9=?A-Z^-~]/);function bc(e){return e!==null&&(e<32||e===127)}const zd=Or(/\d/),qD=Or(/[\dA-Fa-f]/),WD=Or(/[!-/:-@[-`{-~]/);function je(e){return e!==null&&e<-2}function Ot(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const Lc=Or(new RegExp("\\p{P}|\\p{S}","u")),ns=Or(/\s/);function Or(e){return i;function i(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ia(e){const i=[];let r=-1,o=0,h=0;for(;++r<e.length;){const m=e.charCodeAt(r);let p="";if(m===37&&Cn(e.charCodeAt(r+1))&&Cn(e.charCodeAt(r+2)))h=2;else if(m<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(m))||(p=String.fromCharCode(m));else if(m>55295&&m<57344){const a=e.charCodeAt(r+1);m<56320&&a>56319&&a<57344?(p=String.fromCharCode(m,a),h=1):p="�"}else p=String.fromCharCode(m);p&&(i.push(e.slice(o,r),encodeURIComponent(p)),o=r+h+1,p=""),h&&(r+=h,h=0)}return i.join("")+e.slice(o)}function gt(e,i,r,o){const h=o?o-1:Number.POSITIVE_INFINITY;let m=0;return p;function p(l){return st(l)?(e.enter(r),a(l)):i(l)}function a(l){return st(l)&&m++<h?(e.consume(l),a):(e.exit(r),i(l))}}const GD={tokenize:KD};function KD(e){const i=e.attempt(this.parser.constructs.contentInitial,o,h);let r;return i;function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),gt(e,i,"linePrefix")}function h(a){return e.enter("paragraph"),m(a)}function m(a){const l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,p(a)}function p(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return je(a)?(e.consume(a),e.exit("chunkText"),m):(e.consume(a),p)}}const VD={tokenize:YD},pv={tokenize:XD};function YD(e){const i=this,r=[];let o=0,h,m,p;return a;function a(S){if(o<r.length){const D=r[o];return i.containerState=D[1],e.attempt(D[0].continuation,l,c)(S)}return c(S)}function l(S){if(o++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,h&&v();const D=i.events.length;let R=D,x;for(;R--;)if(i.events[R][0]==="exit"&&i.events[R][1].type==="chunkFlow"){x=i.events[R][1].end;break}_(o);let M=D;for(;M<i.events.length;)i.events[M][1].end={...x},M++;return ti(i.events,R+1,0,i.events.slice(D)),i.events.length=M,c(S)}return a(S)}function c(S){if(o===r.length){if(!h)return y(S);if(h.currentConstruct&&h.currentConstruct.concrete)return w(S);i.interrupt=!!(h.currentConstruct&&!h._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(pv,f,u)(S)}function f(S){return h&&v(),_(o),y(S)}function u(S){return i.parser.lazy[i.now().line]=o!==r.length,p=i.now().offset,w(S)}function y(S){return i.containerState={},e.attempt(pv,C,w)(S)}function C(S){return o++,r.push([i.currentConstruct,i.containerState]),y(S)}function w(S){if(S===null){h&&v(),_(0),e.consume(S);return}return h=h||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:h,contentType:"flow",previous:m}),b(S)}function b(S){if(S===null){g(e.exit("chunkFlow"),!0),_(0),e.consume(S);return}return je(S)?(e.consume(S),g(e.exit("chunkFlow")),o=0,i.interrupt=void 0,a):(e.consume(S),b)}function g(S,D){const R=i.sliceStream(S);if(D&&R.push(null),S.previous=m,m&&(m.next=S),m=S,h.defineSkip(S.start),h.write(R),i.parser.lazy[S.start.line]){let x=h.events.length;for(;x--;)if(h.events[x][1].start.offset<p&&(!h.events[x][1].end||h.events[x][1].end.offset>p))return;const M=i.events.length;let k=M,L,T;for(;k--;)if(i.events[k][0]==="exit"&&i.events[k][1].type==="chunkFlow"){if(L){T=i.events[k][1].end;break}L=!0}for(_(o),x=M;x<i.events.length;)i.events[x][1].end={...T},x++;ti(i.events,k+1,0,i.events.slice(M)),i.events.length=x}}function _(S){let D=r.length;for(;D-- >S;){const R=r[D];i.containerState=R[1],R[0].exit.call(i,e)}r.length=S}function v(){h.write([null]),m=void 0,h=void 0,i.containerState._closeFlow=void 0}}function XD(e,i,r){return gt(e,e.attempt(this.parser.constructs.document,i,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Xs(e){if(e===null||Ot(e)||ns(e))return 1;if(Lc(e))return 2}function Oc(e,i,r){const o=[];let h=-1;for(;++h<e.length;){const m=e[h].resolveAll;m&&!o.includes(m)&&(i=m(i,r),o.push(m))}return i}const Pd={name:"attention",resolveAll:ZD,tokenize:QD};function ZD(e,i){let r=-1,o,h,m,p,a,l,c,f;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(o=r;o--;)if(e[o][0]==="exit"&&e[o][1].type==="attentionSequence"&&e[o][1]._open&&i.sliceSerialize(e[o][1]).charCodeAt(0)===i.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[o][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[o][1].end.offset-e[o][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;l=e[o][1].end.offset-e[o][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const u={...e[o][1].end},y={...e[r][1].start};mv(u,-l),mv(y,l),p={type:l>1?"strongSequence":"emphasisSequence",start:u,end:{...e[o][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:y},m={type:l>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[r][1].start}},h={type:l>1?"strong":"emphasis",start:{...p.start},end:{...a.end}},e[o][1].end={...p.start},e[r][1].start={...a.end},c=[],e[o][1].end.offset-e[o][1].start.offset&&(c=gi(c,[["enter",e[o][1],i],["exit",e[o][1],i]])),c=gi(c,[["enter",h,i],["enter",p,i],["exit",p,i],["enter",m,i]]),c=gi(c,Oc(i.parser.constructs.insideSpan.null,e.slice(o+1,r),i)),c=gi(c,[["exit",m,i],["enter",a,i],["exit",a,i],["exit",h,i]]),e[r][1].end.offset-e[r][1].start.offset?(f=2,c=gi(c,[["enter",e[r][1],i],["exit",e[r][1],i]])):f=0,ti(e,o-1,r-o+3,c),r=o+c.length-f-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function QD(e,i){const r=this.parser.constructs.attentionMarkers.null,o=this.previous,h=Xs(o);let m;return p;function p(l){return m=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===m)return e.consume(l),a;const c=e.exit("attentionSequence"),f=Xs(l),u=!f||f===2&&h||r.includes(l),y=!h||h===2&&f||r.includes(o);return c._open=!!(m===42?u:u&&(h||!y)),c._close=!!(m===42?y:y&&(f||!u)),i(l)}}function mv(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const JD={name:"autolink",tokenize:eA};function eA(e,i,r){let o=0;return h;function h(C){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(C),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),m}function m(C){return Mn(C)?(e.consume(C),p):C===64?r(C):c(C)}function p(C){return C===43||C===45||C===46||Cn(C)?(o=1,a(C)):c(C)}function a(C){return C===58?(e.consume(C),o=0,l):(C===43||C===45||C===46||Cn(C))&&o++<32?(e.consume(C),a):(o=0,c(C))}function l(C){return C===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(C),e.exit("autolinkMarker"),e.exit("autolink"),i):C===null||C===32||C===60||bc(C)?r(C):(e.consume(C),l)}function c(C){return C===64?(e.consume(C),f):$D(C)?(e.consume(C),c):r(C)}function f(C){return Cn(C)?u(C):r(C)}function u(C){return C===46?(e.consume(C),o=0,f):C===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(C),e.exit("autolinkMarker"),e.exit("autolink"),i):y(C)}function y(C){if((C===45||Cn(C))&&o++<63){const w=C===45?y:u;return e.consume(C),w}return r(C)}}const To={partial:!0,tokenize:tA};function tA(e,i,r){return o;function o(m){return st(m)?gt(e,h,"linePrefix")(m):h(m)}function h(m){return m===null||je(m)?i(m):r(m)}}const Fb={continuation:{tokenize:iA},exit:rA,name:"blockQuote",tokenize:nA};function nA(e,i,r){const o=this;return h;function h(p){if(p===62){const a=o.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(p),e.exit("blockQuoteMarker"),m}return r(p)}function m(p){return st(p)?(e.enter("blockQuotePrefixWhitespace"),e.consume(p),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(p))}}function iA(e,i,r){const o=this;return h;function h(p){return st(p)?gt(e,m,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p):m(p)}function m(p){return e.attempt(Fb,i,r)(p)}}function rA(e){e.exit("blockQuote")}const zb={name:"characterEscape",tokenize:sA};function sA(e,i,r){return o;function o(m){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(m),e.exit("escapeMarker"),h}function h(m){return WD(m)?(e.enter("characterEscapeValue"),e.consume(m),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):r(m)}}const Pb={name:"characterReference",tokenize:aA};function aA(e,i,r){const o=this;let h=0,m,p;return a;function a(u){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),l}function l(u){return u===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(u),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),m=31,p=Cn,f(u))}function c(u){return u===88||u===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(u),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),m=6,p=qD,f):(e.enter("characterReferenceValue"),m=7,p=zd,f(u))}function f(u){if(u===59&&h){const y=e.exit("characterReferenceValue");return p===Cn&&!bf(o.sliceSerialize(y))?r(u):(e.enter("characterReferenceMarker"),e.consume(u),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return p(u)&&h++<m?(e.consume(u),f):r(u)}}const _v={partial:!0,tokenize:lA},vv={concrete:!0,name:"codeFenced",tokenize:oA};function oA(e,i,r){const o=this,h={partial:!0,tokenize:R};let m=0,p=0,a;return l;function l(x){return c(x)}function c(x){const M=o.events[o.events.length-1];return m=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,a=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(x)}function f(x){return x===a?(p++,e.consume(x),f):p<3?r(x):(e.exit("codeFencedFenceSequence"),st(x)?gt(e,u,"whitespace")(x):u(x))}function u(x){return x===null||je(x)?(e.exit("codeFencedFence"),o.interrupt?i(x):e.check(_v,b,D)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||je(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),u(x)):st(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),gt(e,C,"whitespace")(x)):x===96&&x===a?r(x):(e.consume(x),y)}function C(x){return x===null||je(x)?u(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(x))}function w(x){return x===null||je(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),u(x)):x===96&&x===a?r(x):(e.consume(x),w)}function b(x){return e.attempt(h,D,g)(x)}function g(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),_}function _(x){return m>0&&st(x)?gt(e,v,"linePrefix",m+1)(x):v(x)}function v(x){return x===null||je(x)?e.check(_v,b,D)(x):(e.enter("codeFlowValue"),S(x))}function S(x){return x===null||je(x)?(e.exit("codeFlowValue"),v(x)):(e.consume(x),S)}function D(x){return e.exit("codeFenced"),i(x)}function R(x,M,k){let L=0;return T;function T(q){return x.enter("lineEnding"),x.consume(q),x.exit("lineEnding"),P}function P(q){return x.enter("codeFencedFence"),st(q)?gt(x,B,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):B(q)}function B(q){return q===a?(x.enter("codeFencedFenceSequence"),F(q)):k(q)}function F(q){return q===a?(L++,x.consume(q),F):L>=p?(x.exit("codeFencedFenceSequence"),st(q)?gt(x,$,"whitespace")(q):$(q)):k(q)}function $(q){return q===null||je(q)?(x.exit("codeFencedFence"),M(q)):k(q)}}}function lA(e,i,r){const o=this;return h;function h(p){return p===null?r(p):(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),m)}function m(p){return o.parser.lazy[o.now().line]?r(p):i(p)}}const ad={name:"codeIndented",tokenize:uA},cA={partial:!0,tokenize:hA};function uA(e,i,r){const o=this;return h;function h(c){return e.enter("codeIndented"),gt(e,m,"linePrefix",5)(c)}function m(c){const f=o.events[o.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?p(c):r(c)}function p(c){return c===null?l(c):je(c)?e.attempt(cA,p,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||je(c)?(e.exit("codeFlowValue"),p(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),i(c)}}function hA(e,i,r){const o=this;return h;function h(p){return o.parser.lazy[o.now().line]?r(p):je(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):gt(e,m,"linePrefix",5)(p)}function m(p){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?i(p):je(p)?h(p):r(p)}}const dA={name:"codeText",previous:gA,resolve:fA,tokenize:pA};function fA(e){let i=e.length-4,r=3,o,h;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(o=r;++o<i;)if(e[o][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[i][1].type="codeTextPadding",r+=2,i-=2;break}}for(o=r-1,i++;++o<=i;)h===void 0?o!==i&&e[o][1].type!=="lineEnding"&&(h=o):(o===i||e[o][1].type==="lineEnding")&&(e[h][1].type="codeTextData",o!==h+2&&(e[h][1].end=e[o-1][1].end,e.splice(h+2,o-h-2),i-=o-h-2,o=h+2),h=void 0);return e}function gA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pA(e,i,r){let o=0,h,m;return p;function p(u){return e.enter("codeText"),e.enter("codeTextSequence"),a(u)}function a(u){return u===96?(e.consume(u),o++,a):(e.exit("codeTextSequence"),l(u))}function l(u){return u===null?r(u):u===32?(e.enter("space"),e.consume(u),e.exit("space"),l):u===96?(m=e.enter("codeTextSequence"),h=0,f(u)):je(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(u))}function c(u){return u===null||u===32||u===96||je(u)?(e.exit("codeTextData"),l(u)):(e.consume(u),c)}function f(u){return u===96?(e.consume(u),h++,f):h===o?(e.exit("codeTextSequence"),e.exit("codeText"),i(u)):(m.type="codeTextData",c(u))}}class mA{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,r){const o=r??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(i,o):i>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(i,r,o){const h=r||0;this.setCursor(Math.trunc(i));const m=this.right.splice(this.right.length-h,Number.POSITIVE_INFINITY);return o&&io(this.left,o),m.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),io(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),io(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const r=this.left.splice(i,Number.POSITIVE_INFINITY);io(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);io(this.left,r.reverse())}}}function io(e,i){let r=0;if(i.length<1e4)e.push(...i);else for(;r<i.length;)e.push(...i.slice(r,r+1e4)),r+=1e4}function Ub(e){const i={};let r=-1,o,h,m,p,a,l,c;const f=new mA(e);for(;++r<f.length;){for(;r in i;)r=i[r];if(o=f.get(r),r&&o[1].type==="chunkFlow"&&f.get(r-1)[1].type==="listItemPrefix"&&(l=o[1]._tokenizer.events,m=0,m<l.length&&l[m][1].type==="lineEndingBlank"&&(m+=2),m<l.length&&l[m][1].type==="content"))for(;++m<l.length&&l[m][1].type!=="content";)l[m][1].type==="chunkText"&&(l[m][1]._isInFirstContentOfListItem=!0,m++);if(o[0]==="enter")o[1].contentType&&(Object.assign(i,_A(f,r)),r=i[r],c=!0);else if(o[1]._container){for(m=r,h=void 0;m--;)if(p=f.get(m),p[1].type==="lineEnding"||p[1].type==="lineEndingBlank")p[0]==="enter"&&(h&&(f.get(h)[1].type="lineEndingBlank"),p[1].type="lineEnding",h=m);else if(!(p[1].type==="linePrefix"||p[1].type==="listItemIndent"))break;h&&(o[1].end={...f.get(h)[1].start},a=f.slice(h,r),a.unshift(o),f.splice(h,r-h+1,a))}}return ti(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!c}function _A(e,i){const r=e.get(i)[1],o=e.get(i)[2];let h=i-1;const m=[];let p=r._tokenizer;p||(p=o.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(p._contentTypeTextTrailing=!0));const a=p.events,l=[],c={};let f,u,y=-1,C=r,w=0,b=0;const g=[b];for(;C;){for(;e.get(++h)[1]!==C;);m.push(h),C._tokenizer||(f=o.sliceStream(C),C.next||f.push(null),u&&p.defineSkip(C.start),C._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=!0),p.write(f),C._isInFirstContentOfListItem&&(p._gfmTasklistFirstContentOfListItem=void 0)),u=C,C=C.next}for(C=r;++y<a.length;)a[y][0]==="exit"&&a[y-1][0]==="enter"&&a[y][1].type===a[y-1][1].type&&a[y][1].start.line!==a[y][1].end.line&&(b=y+1,g.push(b),C._tokenizer=void 0,C.previous=void 0,C=C.next);for(p.events=[],C?(C._tokenizer=void 0,C.previous=void 0):g.pop(),y=g.length;y--;){const _=a.slice(g[y],g[y+1]),v=m.pop();l.push([v,v+_.length-1]),e.splice(v,2,_)}for(l.reverse(),y=-1;++y<l.length;)c[w+l[y][0]]=w+l[y][1],w+=l[y][1]-l[y][0]-1;return c}const vA={resolve:yA,tokenize:SA},bA={partial:!0,tokenize:CA};function yA(e){return Ub(e),e}function SA(e,i){let r;return o;function o(a){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),h(a)}function h(a){return a===null?m(a):je(a)?e.check(bA,p,m)(a):(e.consume(a),h)}function m(a){return e.exit("chunkContent"),e.exit("content"),i(a)}function p(a){return e.consume(a),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,h}}function CA(e,i,r){const o=this;return h;function h(p){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),gt(e,m,"linePrefix")}function m(p){if(p===null||je(p))return r(p);const a=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?i(p):e.interrupt(o.parser.constructs.flow,r,i)(p)}}function Hb(e,i,r,o,h,m,p,a,l){const c=l||Number.POSITIVE_INFINITY;let f=0;return u;function u(_){return _===60?(e.enter(o),e.enter(h),e.enter(m),e.consume(_),e.exit(m),y):_===null||_===32||_===41||bc(_)?r(_):(e.enter(o),e.enter(p),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(_))}function y(_){return _===62?(e.enter(m),e.consume(_),e.exit(m),e.exit(h),e.exit(o),i):(e.enter(a),e.enter("chunkString",{contentType:"string"}),C(_))}function C(_){return _===62?(e.exit("chunkString"),e.exit(a),y(_)):_===null||_===60||je(_)?r(_):(e.consume(_),_===92?w:C)}function w(_){return _===60||_===62||_===92?(e.consume(_),C):C(_)}function b(_){return!f&&(_===null||_===41||Ot(_))?(e.exit("chunkString"),e.exit(a),e.exit(p),e.exit(o),i(_)):f<c&&_===40?(e.consume(_),f++,b):_===41?(e.consume(_),f--,b):_===null||_===32||_===40||bc(_)?r(_):(e.consume(_),_===92?g:b)}function g(_){return _===40||_===41||_===92?(e.consume(_),b):b(_)}}function jb(e,i,r,o,h,m){const p=this;let a=0,l;return c;function c(C){return e.enter(o),e.enter(h),e.consume(C),e.exit(h),e.enter(m),f}function f(C){return a>999||C===null||C===91||C===93&&!l||C===94&&!a&&"_hiddenFootnoteSupport"in p.parser.constructs?r(C):C===93?(e.exit(m),e.enter(h),e.consume(C),e.exit(h),e.exit(o),i):je(C)?(e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),u(C))}function u(C){return C===null||C===91||C===93||je(C)||a++>999?(e.exit("chunkString"),f(C)):(e.consume(C),l||(l=!st(C)),C===92?y:u)}function y(C){return C===91||C===92||C===93?(e.consume(C),a++,u):u(C)}}function $b(e,i,r,o,h,m){let p;return a;function a(y){return y===34||y===39||y===40?(e.enter(o),e.enter(h),e.consume(y),e.exit(h),p=y===40?41:y,l):r(y)}function l(y){return y===p?(e.enter(h),e.consume(y),e.exit(h),e.exit(o),i):(e.enter(m),c(y))}function c(y){return y===p?(e.exit(m),l(p)):y===null?r(y):je(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),gt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===p||y===null||je(y)?(e.exit("chunkString"),c(y)):(e.consume(y),y===92?u:f)}function u(y){return y===p||y===92?(e.consume(y),f):f(y)}}function go(e,i){let r;return o;function o(h){return je(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),r=!0,o):st(h)?gt(e,o,r?"linePrefix":"lineSuffix")(h):i(h)}}const EA={name:"definition",tokenize:xA},wA={partial:!0,tokenize:DA};function xA(e,i,r){const o=this;let h;return m;function m(C){return e.enter("definition"),p(C)}function p(C){return jb.call(o,e,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function a(C){return h=yi(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),l):r(C)}function l(C){return Ot(C)?go(e,c)(C):c(C)}function c(C){return Hb(e,f,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function f(C){return e.attempt(wA,u,u)(C)}function u(C){return st(C)?gt(e,y,"whitespace")(C):y(C)}function y(C){return C===null||je(C)?(e.exit("definition"),o.parser.defined.push(h),i(C)):r(C)}}function DA(e,i,r){return o;function o(a){return Ot(a)?go(e,h)(a):r(a)}function h(a){return $b(e,m,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function m(a){return st(a)?gt(e,p,"whitespace")(a):p(a)}function p(a){return a===null||je(a)?i(a):r(a)}}const AA={name:"hardBreakEscape",tokenize:kA};function kA(e,i,r){return o;function o(m){return e.enter("hardBreakEscape"),e.consume(m),h}function h(m){return je(m)?(e.exit("hardBreakEscape"),i(m)):r(m)}}const RA={name:"headingAtx",resolve:TA,tokenize:MA};function TA(e,i){let r=e.length-2,o=3,h,m;return e[o][1].type==="whitespace"&&(o+=2),r-2>o&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(o===r-1||r-4>o&&e[r-2][1].type==="whitespace")&&(r-=o+1===r?2:4),r>o&&(h={type:"atxHeadingText",start:e[o][1].start,end:e[r][1].end},m={type:"chunkText",start:e[o][1].start,end:e[r][1].end,contentType:"text"},ti(e,o,r-o+1,[["enter",h,i],["enter",m,i],["exit",m,i],["exit",h,i]])),e}function MA(e,i,r){let o=0;return h;function h(f){return e.enter("atxHeading"),m(f)}function m(f){return e.enter("atxHeadingSequence"),p(f)}function p(f){return f===35&&o++<6?(e.consume(f),p):f===null||Ot(f)?(e.exit("atxHeadingSequence"),a(f)):r(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||je(f)?(e.exit("atxHeading"),i(f)):st(f)?gt(e,a,"whitespace")(f):(e.enter("atxHeadingText"),c(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function c(f){return f===null||f===35||Ot(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),c)}}const LA=["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"],bv=["pre","script","style","textarea"],OA={concrete:!0,name:"htmlFlow",resolveTo:IA,tokenize:FA},BA={partial:!0,tokenize:PA},NA={partial:!0,tokenize:zA};function IA(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function FA(e,i,r){const o=this;let h,m,p,a,l;return c;function c(H){return f(H)}function f(H){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(H),u}function u(H){return H===33?(e.consume(H),y):H===47?(e.consume(H),m=!0,b):H===63?(e.consume(H),h=3,o.interrupt?i:O):Mn(H)?(e.consume(H),p=String.fromCharCode(H),g):r(H)}function y(H){return H===45?(e.consume(H),h=2,C):H===91?(e.consume(H),h=5,a=0,w):Mn(H)?(e.consume(H),h=4,o.interrupt?i:O):r(H)}function C(H){return H===45?(e.consume(H),o.interrupt?i:O):r(H)}function w(H){const ee="CDATA[";return H===ee.charCodeAt(a++)?(e.consume(H),a===ee.length?o.interrupt?i:B:w):r(H)}function b(H){return Mn(H)?(e.consume(H),p=String.fromCharCode(H),g):r(H)}function g(H){if(H===null||H===47||H===62||Ot(H)){const ee=H===47,he=p.toLowerCase();return!ee&&!m&&bv.includes(he)?(h=1,o.interrupt?i(H):B(H)):LA.includes(p.toLowerCase())?(h=6,ee?(e.consume(H),_):o.interrupt?i(H):B(H)):(h=7,o.interrupt&&!o.parser.lazy[o.now().line]?r(H):m?v(H):S(H))}return H===45||Cn(H)?(e.consume(H),p+=String.fromCharCode(H),g):r(H)}function _(H){return H===62?(e.consume(H),o.interrupt?i:B):r(H)}function v(H){return st(H)?(e.consume(H),v):T(H)}function S(H){return H===47?(e.consume(H),T):H===58||H===95||Mn(H)?(e.consume(H),D):st(H)?(e.consume(H),S):T(H)}function D(H){return H===45||H===46||H===58||H===95||Cn(H)?(e.consume(H),D):R(H)}function R(H){return H===61?(e.consume(H),x):st(H)?(e.consume(H),R):S(H)}function x(H){return H===null||H===60||H===61||H===62||H===96?r(H):H===34||H===39?(e.consume(H),l=H,M):st(H)?(e.consume(H),x):k(H)}function M(H){return H===l?(e.consume(H),l=null,L):H===null||je(H)?r(H):(e.consume(H),M)}function k(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||Ot(H)?R(H):(e.consume(H),k)}function L(H){return H===47||H===62||st(H)?S(H):r(H)}function T(H){return H===62?(e.consume(H),P):r(H)}function P(H){return H===null||je(H)?B(H):st(H)?(e.consume(H),P):r(H)}function B(H){return H===45&&h===2?(e.consume(H),W):H===60&&h===1?(e.consume(H),K):H===62&&h===4?(e.consume(H),z):H===63&&h===3?(e.consume(H),O):H===93&&h===5?(e.consume(H),U):je(H)&&(h===6||h===7)?(e.exit("htmlFlowData"),e.check(BA,j,F)(H)):H===null||je(H)?(e.exit("htmlFlowData"),F(H)):(e.consume(H),B)}function F(H){return e.check(NA,$,j)(H)}function $(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),q}function q(H){return H===null||je(H)?F(H):(e.enter("htmlFlowData"),B(H))}function W(H){return H===45?(e.consume(H),O):B(H)}function K(H){return H===47?(e.consume(H),p="",X):B(H)}function X(H){if(H===62){const ee=p.toLowerCase();return bv.includes(ee)?(e.consume(H),z):B(H)}return Mn(H)&&p.length<8?(e.consume(H),p+=String.fromCharCode(H),X):B(H)}function U(H){return H===93?(e.consume(H),O):B(H)}function O(H){return H===62?(e.consume(H),z):H===45&&h===2?(e.consume(H),O):B(H)}function z(H){return H===null||je(H)?(e.exit("htmlFlowData"),j(H)):(e.consume(H),z)}function j(H){return e.exit("htmlFlow"),i(H)}}function zA(e,i,r){const o=this;return h;function h(p){return je(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),m):r(p)}function m(p){return o.parser.lazy[o.now().line]?r(p):i(p)}}function PA(e,i,r){return o;function o(h){return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),e.attempt(To,i,r)}}const UA={name:"htmlText",tokenize:HA};function HA(e,i,r){const o=this;let h,m,p;return a;function a(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),l}function l(O){return O===33?(e.consume(O),c):O===47?(e.consume(O),R):O===63?(e.consume(O),S):Mn(O)?(e.consume(O),k):r(O)}function c(O){return O===45?(e.consume(O),f):O===91?(e.consume(O),m=0,w):Mn(O)?(e.consume(O),v):r(O)}function f(O){return O===45?(e.consume(O),C):r(O)}function u(O){return O===null?r(O):O===45?(e.consume(O),y):je(O)?(p=u,K(O)):(e.consume(O),u)}function y(O){return O===45?(e.consume(O),C):u(O)}function C(O){return O===62?W(O):O===45?y(O):u(O)}function w(O){const z="CDATA[";return O===z.charCodeAt(m++)?(e.consume(O),m===z.length?b:w):r(O)}function b(O){return O===null?r(O):O===93?(e.consume(O),g):je(O)?(p=b,K(O)):(e.consume(O),b)}function g(O){return O===93?(e.consume(O),_):b(O)}function _(O){return O===62?W(O):O===93?(e.consume(O),_):b(O)}function v(O){return O===null||O===62?W(O):je(O)?(p=v,K(O)):(e.consume(O),v)}function S(O){return O===null?r(O):O===63?(e.consume(O),D):je(O)?(p=S,K(O)):(e.consume(O),S)}function D(O){return O===62?W(O):S(O)}function R(O){return Mn(O)?(e.consume(O),x):r(O)}function x(O){return O===45||Cn(O)?(e.consume(O),x):M(O)}function M(O){return je(O)?(p=M,K(O)):st(O)?(e.consume(O),M):W(O)}function k(O){return O===45||Cn(O)?(e.consume(O),k):O===47||O===62||Ot(O)?L(O):r(O)}function L(O){return O===47?(e.consume(O),W):O===58||O===95||Mn(O)?(e.consume(O),T):je(O)?(p=L,K(O)):st(O)?(e.consume(O),L):W(O)}function T(O){return O===45||O===46||O===58||O===95||Cn(O)?(e.consume(O),T):P(O)}function P(O){return O===61?(e.consume(O),B):je(O)?(p=P,K(O)):st(O)?(e.consume(O),P):L(O)}function B(O){return O===null||O===60||O===61||O===62||O===96?r(O):O===34||O===39?(e.consume(O),h=O,F):je(O)?(p=B,K(O)):st(O)?(e.consume(O),B):(e.consume(O),$)}function F(O){return O===h?(e.consume(O),h=void 0,q):O===null?r(O):je(O)?(p=F,K(O)):(e.consume(O),F)}function $(O){return O===null||O===34||O===39||O===60||O===61||O===96?r(O):O===47||O===62||Ot(O)?L(O):(e.consume(O),$)}function q(O){return O===47||O===62||Ot(O)?L(O):r(O)}function W(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):r(O)}function K(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),X}function X(O){return st(O)?gt(e,U,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):U(O)}function U(O){return e.enter("htmlTextData"),p(O)}}const yf={name:"labelEnd",resolveAll:WA,resolveTo:GA,tokenize:KA},jA={tokenize:VA},$A={tokenize:YA},qA={tokenize:XA};function WA(e){let i=-1;const r=[];for(;++i<e.length;){const o=e[i][1];if(r.push(e[i]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const h=o.type==="labelImage"?4:2;o.type="data",i+=h}}return e.length!==r.length&&ti(e,0,e.length,r),e}function GA(e,i){let r=e.length,o=0,h,m,p,a;for(;r--;)if(h=e[r][1],m){if(h.type==="link"||h.type==="labelLink"&&h._inactive)break;e[r][0]==="enter"&&h.type==="labelLink"&&(h._inactive=!0)}else if(p){if(e[r][0]==="enter"&&(h.type==="labelImage"||h.type==="labelLink")&&!h._balanced&&(m=r,h.type!=="labelLink")){o=2;break}}else h.type==="labelEnd"&&(p=r);const l={type:e[m][1].type==="labelLink"?"link":"image",start:{...e[m][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[m][1].start},end:{...e[p][1].end}},f={type:"labelText",start:{...e[m+o+2][1].end},end:{...e[p-2][1].start}};return a=[["enter",l,i],["enter",c,i]],a=gi(a,e.slice(m+1,m+o+3)),a=gi(a,[["enter",f,i]]),a=gi(a,Oc(i.parser.constructs.insideSpan.null,e.slice(m+o+4,p-3),i)),a=gi(a,[["exit",f,i],e[p-2],e[p-1],["exit",c,i]]),a=gi(a,e.slice(p+1)),a=gi(a,[["exit",l,i]]),ti(e,m,e.length,a),e}function KA(e,i,r){const o=this;let h=o.events.length,m,p;for(;h--;)if((o.events[h][1].type==="labelImage"||o.events[h][1].type==="labelLink")&&!o.events[h][1]._balanced){m=o.events[h][1];break}return a;function a(y){return m?m._inactive?u(y):(p=o.parser.defined.includes(yi(o.sliceSerialize({start:m.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),l):r(y)}function l(y){return y===40?e.attempt(jA,f,p?f:u)(y):y===91?e.attempt($A,f,p?c:u)(y):p?f(y):u(y)}function c(y){return e.attempt(qA,f,u)(y)}function f(y){return i(y)}function u(y){return m._balanced=!0,r(y)}}function VA(e,i,r){return o;function o(u){return e.enter("resource"),e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),h}function h(u){return Ot(u)?go(e,m)(u):m(u)}function m(u){return u===41?f(u):Hb(e,p,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function p(u){return Ot(u)?go(e,l)(u):f(u)}function a(u){return r(u)}function l(u){return u===34||u===39||u===40?$b(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):f(u)}function c(u){return Ot(u)?go(e,f)(u):f(u)}function f(u){return u===41?(e.enter("resourceMarker"),e.consume(u),e.exit("resourceMarker"),e.exit("resource"),i):r(u)}}function YA(e,i,r){const o=this;return h;function h(a){return jb.call(o,e,m,p,"reference","referenceMarker","referenceString")(a)}function m(a){return o.parser.defined.includes(yi(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?i(a):r(a)}function p(a){return r(a)}}function XA(e,i,r){return o;function o(m){return e.enter("reference"),e.enter("referenceMarker"),e.consume(m),e.exit("referenceMarker"),h}function h(m){return m===93?(e.enter("referenceMarker"),e.consume(m),e.exit("referenceMarker"),e.exit("reference"),i):r(m)}}const ZA={name:"labelStartImage",resolveAll:yf.resolveAll,tokenize:QA};function QA(e,i,r){const o=this;return h;function h(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),m}function m(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),p):r(a)}function p(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(a):i(a)}}const JA={name:"labelStartLink",resolveAll:yf.resolveAll,tokenize:e5};function e5(e,i,r){const o=this;return h;function h(p){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelLink"),m}function m(p){return p===94&&"_hiddenFootnoteSupport"in o.parser.constructs?r(p):i(p)}}const od={name:"lineEnding",tokenize:t5};function t5(e,i){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),gt(e,i,"linePrefix")}}const fc={name:"thematicBreak",tokenize:n5};function n5(e,i,r){let o=0,h;return m;function m(c){return e.enter("thematicBreak"),p(c)}function p(c){return h=c,a(c)}function a(c){return c===h?(e.enter("thematicBreakSequence"),l(c)):o>=3&&(c===null||je(c))?(e.exit("thematicBreak"),i(c)):r(c)}function l(c){return c===h?(e.consume(c),o++,l):(e.exit("thematicBreakSequence"),st(c)?gt(e,a,"whitespace")(c):a(c))}}const Hn={continuation:{tokenize:a5},exit:l5,name:"list",tokenize:s5},i5={partial:!0,tokenize:c5},r5={partial:!0,tokenize:o5};function s5(e,i,r){const o=this,h=o.events[o.events.length-1];let m=h&&h[1].type==="linePrefix"?h[2].sliceSerialize(h[1],!0).length:0,p=0;return a;function a(C){const w=o.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!o.containerState.marker||C===o.containerState.marker:zd(C)){if(o.containerState.type||(o.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),C===42||C===45?e.check(fc,r,c)(C):c(C);if(!o.interrupt||C===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(C)}return r(C)}function l(C){return zd(C)&&++p<10?(e.consume(C),l):(!o.interrupt||p<2)&&(o.containerState.marker?C===o.containerState.marker:C===41||C===46)?(e.exit("listItemValue"),c(C)):r(C)}function c(C){return e.enter("listItemMarker"),e.consume(C),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||C,e.check(To,o.interrupt?r:f,e.attempt(i5,y,u))}function f(C){return o.containerState.initialBlankLine=!0,m++,y(C)}function u(C){return st(C)?(e.enter("listItemPrefixWhitespace"),e.consume(C),e.exit("listItemPrefixWhitespace"),y):r(C)}function y(C){return o.containerState.size=m+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(C)}}function a5(e,i,r){const o=this;return o.containerState._closeFlow=void 0,e.check(To,h,m);function h(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,gt(e,i,"listItemIndent",o.containerState.size+1)(a)}function m(a){return o.containerState.furtherBlankLines||!st(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,p(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(r5,i,p)(a))}function p(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,gt(e,e.attempt(Hn,i,r),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function o5(e,i,r){const o=this;return gt(e,h,"listItemIndent",o.containerState.size+1);function h(m){const p=o.events[o.events.length-1];return p&&p[1].type==="listItemIndent"&&p[2].sliceSerialize(p[1],!0).length===o.containerState.size?i(m):r(m)}}function l5(e){e.exit(this.containerState.type)}function c5(e,i,r){const o=this;return gt(e,h,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function h(m){const p=o.events[o.events.length-1];return!st(m)&&p&&p[1].type==="listItemPrefixWhitespace"?i(m):r(m)}}const yv={name:"setextUnderline",resolveTo:u5,tokenize:h5};function u5(e,i){let r=e.length,o,h,m;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){o=r;break}e[r][1].type==="paragraph"&&(h=r)}else e[r][1].type==="content"&&e.splice(r,1),!m&&e[r][1].type==="definition"&&(m=r);const p={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[h][1].type="setextHeadingText",m?(e.splice(h,0,["enter",p,i]),e.splice(m+1,0,["exit",e[o][1],i]),e[o][1].end={...e[m][1].end}):e[o][1]=p,e.push(["exit",p,i]),e}function h5(e,i,r){const o=this;let h;return m;function m(c){let f=o.events.length,u;for(;f--;)if(o.events[f][1].type!=="lineEnding"&&o.events[f][1].type!=="linePrefix"&&o.events[f][1].type!=="content"){u=o.events[f][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||u)?(e.enter("setextHeadingLine"),h=c,p(c)):r(c)}function p(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===h?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),st(c)?gt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||je(c)?(e.exit("setextHeadingLine"),i(c)):r(c)}}const d5={tokenize:f5};function f5(e){const i=this,r=e.attempt(To,o,e.attempt(this.parser.constructs.flowInitial,h,gt(e,e.attempt(this.parser.constructs.flow,h,e.attempt(vA,h)),"linePrefix")));return r;function o(m){if(m===null){e.consume(m);return}return e.enter("lineEndingBlank"),e.consume(m),e.exit("lineEndingBlank"),i.currentConstruct=void 0,r}function h(m){if(m===null){e.consume(m);return}return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),i.currentConstruct=void 0,r}}const g5={resolveAll:Wb()},p5=qb("string"),m5=qb("text");function qb(e){return{resolveAll:Wb(e==="text"?_5:void 0),tokenize:i};function i(r){const o=this,h=this.parser.constructs[e],m=r.attempt(h,p,a);return p;function p(f){return c(f)?m(f):a(f)}function a(f){if(f===null){r.consume(f);return}return r.enter("data"),r.consume(f),l}function l(f){return c(f)?(r.exit("data"),m(f)):(r.consume(f),l)}function c(f){if(f===null)return!0;const u=h[f];let y=-1;if(u)for(;++y<u.length;){const C=u[y];if(!C.previous||C.previous.call(o,o.previous))return!0}return!1}}}function Wb(e){return i;function i(r,o){let h=-1,m;for(;++h<=r.length;)m===void 0?r[h]&&r[h][1].type==="data"&&(m=h,h++):(!r[h]||r[h][1].type!=="data")&&(h!==m+2&&(r[m][1].end=r[h-1][1].end,r.splice(m+2,h-m-2),h=m+2),m=void 0);return e?e(r,o):r}}function _5(e,i){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const o=e[r-1][1],h=i.sliceStream(o);let m=h.length,p=-1,a=0,l;for(;m--;){const c=h[m];if(typeof c=="string"){for(p=c.length;c.charCodeAt(p-1)===32;)a++,p--;if(p)break;p=-1}else if(c===-2)l=!0,a++;else if(c!==-1){m++;break}}if(i._contentTypeTextTrailing&&r===e.length&&(a=0),a){const c={type:r===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:m?p:o.start._bufferIndex+p,_index:o.start._index+m,line:o.end.line,column:o.end.column-a,offset:o.end.offset-a},end:{...o.end}};o.end={...c.start},o.start.offset===o.end.offset?Object.assign(o,c):(e.splice(r,0,["enter",c,i],["exit",c,i]),r+=2)}r++}return e}const v5={42:Hn,43:Hn,45:Hn,48:Hn,49:Hn,50:Hn,51:Hn,52:Hn,53:Hn,54:Hn,55:Hn,56:Hn,57:Hn,62:Fb},b5={91:EA},y5={[-2]:ad,[-1]:ad,32:ad},S5={35:RA,42:fc,45:[yv,fc],60:OA,61:yv,95:fc,96:vv,126:vv},C5={38:Pb,92:zb},E5={[-5]:od,[-4]:od,[-3]:od,33:ZA,38:Pb,42:Pd,60:[JD,UA],91:JA,92:[AA,zb],93:yf,95:Pd,96:dA},w5={null:[Pd,g5]},x5={null:[42,95]},D5={null:[]},A5=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:x5,contentInitial:b5,disable:D5,document:v5,flow:S5,flowInitial:y5,insideSpan:w5,string:C5,text:E5},Symbol.toStringTag,{value:"Module"}));function k5(e,i,r){let o={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const h={},m=[];let p=[],a=[];const l={attempt:M(R),check:M(x),consume:v,enter:S,exit:D,interrupt:M(x,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:C,write:u};let f=i.tokenize.call(c,l);return i.resolveAll&&m.push(i),c;function u(P){return p=gi(p,P),g(),p[p.length-1]!==null?[]:(k(i,0),c.events=Oc(m,c.events,c),c.events)}function y(P,B){return T5(C(P),B)}function C(P){return R5(p,P)}function w(){const{_bufferIndex:P,_index:B,line:F,column:$,offset:q}=o;return{_bufferIndex:P,_index:B,line:F,column:$,offset:q}}function b(P){h[P.line]=P.column,T()}function g(){let P;for(;o._index<p.length;){const B=p[o._index];if(typeof B=="string")for(P=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===P&&o._bufferIndex<B.length;)_(B.charCodeAt(o._bufferIndex));else _(B)}}function _(P){f=f(P)}function v(P){je(P)?(o.line++,o.column=1,o.offset+=P===-3?2:1,T()):P!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===p[o._index].length&&(o._bufferIndex=-1,o._index++)),c.previous=P}function S(P,B){const F=B||{};return F.type=P,F.start=w(),c.events.push(["enter",F,c]),a.push(F),F}function D(P){const B=a.pop();return B.end=w(),c.events.push(["exit",B,c]),B}function R(P,B){k(P,B.from)}function x(P,B){B.restore()}function M(P,B){return F;function F($,q,W){let K,X,U,O;return Array.isArray($)?j($):"tokenize"in $?j([$]):z($);function z(se){return Z;function Z(G){const re=G!==null&&se[G],ne=G!==null&&se.null,ve=[...Array.isArray(re)?re:re?[re]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return j(ve)(G)}}function j(se){return K=se,X=0,se.length===0?W:H(se[X])}function H(se){return Z;function Z(G){return O=L(),U=se,se.partial||(c.currentConstruct=se),se.name&&c.parser.constructs.disable.null.includes(se.name)?he():se.tokenize.call(B?Object.assign(Object.create(c),B):c,l,ee,he)(G)}}function ee(se){return P(U,O),q}function he(se){return O.restore(),++X<K.length?H(K[X]):W}}}function k(P,B){P.resolveAll&&!m.includes(P)&&m.push(P),P.resolve&&ti(c.events,B,c.events.length-B,P.resolve(c.events.slice(B),c)),P.resolveTo&&(c.events=P.resolveTo(c.events,c))}function L(){const P=w(),B=c.previous,F=c.currentConstruct,$=c.events.length,q=Array.from(a);return{from:$,restore:W};function W(){o=P,c.previous=B,c.currentConstruct=F,c.events.length=$,a=q,T()}}function T(){o.line in h&&o.column<2&&(o.column=h[o.line],o.offset+=h[o.line]-1)}}function R5(e,i){const r=i.start._index,o=i.start._bufferIndex,h=i.end._index,m=i.end._bufferIndex;let p;if(r===h)p=[e[r].slice(o,m)];else{if(p=e.slice(r,h),o>-1){const a=p[0];typeof a=="string"?p[0]=a.slice(o):p.shift()}m>0&&p.push(e[h].slice(0,m))}return p}function T5(e,i){let r=-1;const o=[];let h;for(;++r<e.length;){const m=e[r];let p;if(typeof m=="string")p=m;else switch(m){case-5:{p="\r";break}case-4:{p=`
154
- `;break}case-3:{p=`\r
155
- `;break}case-2:{p=i?" ":" ";break}case-1:{if(!i&&h)continue;p=" ";break}default:p=String.fromCharCode(m)}h=m===-2,o.push(p)}return o.join("")}function M5(e){const o={constructs:Nb([A5,...(e||{}).extensions||[]]),content:h(GD),defined:[],document:h(VD),flow:h(d5),lazy:{},string:h(p5),text:h(m5)};return o;function h(m){return p;function p(a){return k5(o,m,a)}}}function L5(e){for(;!Ub(e););return e}const Sv=/[\0\t\n\r]/g;function O5(){let e=1,i="",r=!0,o;return h;function h(m,p,a){const l=[];let c,f,u,y,C;for(m=i+(typeof m=="string"?m.toString():new TextDecoder(p||void 0).decode(m)),u=0,i="",r&&(m.charCodeAt(0)===65279&&u++,r=void 0);u<m.length;){if(Sv.lastIndex=u,c=Sv.exec(m),y=c&&c.index!==void 0?c.index:m.length,C=m.charCodeAt(y),!c){i=m.slice(u);break}if(C===10&&u===y&&o)l.push(-3),o=void 0;else switch(o&&(l.push(-5),o=void 0),u<y&&(l.push(m.slice(u,y)),e+=y-u),C){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:o=!0,e=1}u=y+1}return a&&(o&&l.push(-5),i&&l.push(i),l.push(null)),l}}const B5=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function N5(e){return e.replace(B5,I5)}function I5(e,i,r){if(i)return i;if(r.charCodeAt(0)===35){const h=r.charCodeAt(1),m=h===120||h===88;return Ib(r.slice(m?2:1),m?16:10)}return bf(r)||e}const Gb={}.hasOwnProperty;function F5(e,i,r){return i&&typeof i=="object"&&(r=i,i=void 0),z5(r)(L5(M5(r).document().write(O5()(e,i,!0))))}function z5(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:m(Gt),autolinkProtocol:L,autolinkEmail:L,atxHeading:m(Ve),blockQuote:m(ne),characterEscape:L,characterReference:L,codeFenced:m(ve),codeFencedFenceInfo:p,codeFencedFenceMeta:p,codeIndented:m(ve,p),codeText:m(me,p),codeTextData:L,data:L,codeFlowValue:L,definition:m(Te),definitionDestinationString:p,definitionLabelString:p,definitionTitleString:p,emphasis:m(xe),hardBreakEscape:m(Me),hardBreakTrailing:m(Me),htmlFlow:m(ke,p),htmlFlowData:L,htmlText:m(ke,p),htmlTextData:L,image:m(Bt),label:p,link:m(Gt),listItem:m(Ke),listItemValue:y,listOrdered:m($e,u),listUnordered:m($e),paragraph:m(Ye),reference:H,referenceString:p,resourceDestinationString:p,resourceTitleString:p,setextHeading:m(Ve),strong:m(De),thematicBreak:m(_t)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:re,autolinkProtocol:G,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:se,characterReference:Z,codeFenced:l(g),codeFencedFence:b,codeFencedFenceInfo:C,codeFencedFenceMeta:w,codeFlowValue:T,codeIndented:l(_),codeText:l(q),codeTextData:T,data:T,definition:l(),definitionDestinationString:D,definitionLabelString:v,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(F),htmlFlowData:T,htmlText:l($),htmlTextData:T,image:l(K),label:U,labelText:X,lineEnding:P,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:O,resourceTitleString:z,resource:j,setextHeading:l(k),setextHeadingLineSequence:M,setextHeadingText:x,strong:l(),thematicBreak:l()}};Kb(i,(e||{}).mdastExtensions||[]);const r={};return o;function o(le){let _e={type:"root",children:[]};const Ae={stack:[_e],tokenStack:[],config:i,enter:a,exit:c,buffer:p,resume:f,data:r},Fe=[];let ze=-1;for(;++ze<le.length;)if(le[ze][1].type==="listOrdered"||le[ze][1].type==="listUnordered")if(le[ze][0]==="enter")Fe.push(ze);else{const qe=Fe.pop();ze=h(le,qe,ze)}for(ze=-1;++ze<le.length;){const qe=i[le[ze][0]];Gb.call(qe,le[ze][1].type)&&qe[le[ze][1].type].call(Object.assign({sliceSerialize:le[ze][2].sliceSerialize},Ae),le[ze][1])}if(Ae.tokenStack.length>0){const qe=Ae.tokenStack[Ae.tokenStack.length-1];(qe[1]||Cv).call(Ae,void 0,qe[0])}for(_e.position={start:Mr(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Mr(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},ze=-1;++ze<i.transforms.length;)_e=i.transforms[ze](_e)||_e;return _e}function h(le,_e,Ae){let Fe=_e-1,ze=-1,qe=!1,He,Ft,Ct,zt;for(;++Fe<=Ae;){const ut=le[Fe];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?ze++:ze--,zt=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(He&&!zt&&!ze&&!Ct&&(Ct=Fe),zt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:zt=void 0}if(!ze&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||ze===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(He){let hn=Fe;for(Ft=void 0;hn--;){const Zt=le[hn];if(Zt[1].type==="lineEnding"||Zt[1].type==="lineEndingBlank"){if(Zt[0]==="exit")continue;Ft&&(le[Ft][1].type="lineEndingBlank",qe=!0),Zt[1].type="lineEnding",Ft=hn}else if(!(Zt[1].type==="linePrefix"||Zt[1].type==="blockQuotePrefix"||Zt[1].type==="blockQuotePrefixWhitespace"||Zt[1].type==="blockQuoteMarker"||Zt[1].type==="listItemIndent"))break}Ct&&(!Ft||Ct<Ft)&&(He._spread=!0),He.end=Object.assign({},Ft?le[Ft][1].start:ut[1].end),le.splice(Ft||Fe,0,["exit",He,ut[2]]),Fe++,Ae++}if(ut[1].type==="listItemPrefix"){const hn={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};He=hn,le.splice(Fe,0,["enter",hn,ut[2]]),Fe++,Ae++,Ct=void 0,zt=!0}}}return le[_e][1]._spread=qe,Ae}function m(le,_e){return Ae;function Ae(Fe){a.call(this,le(Fe),Fe),_e&&_e.call(this,Fe)}}function p(){this.stack.push({type:"fragment",children:[]})}function a(le,_e,Ae){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([_e,Ae||void 0]),le.position={start:Mr(_e.start),end:void 0}}function l(le){return _e;function _e(Ae){le&&le.call(this,Ae),c.call(this,Ae)}}function c(le,_e){const Ae=this.stack.pop(),Fe=this.tokenStack.pop();if(Fe)Fe[0].type!==le.type&&(_e?_e.call(this,le,Fe[0]):(Fe[1]||Cv).call(this,le,Fe[0]));else throw new Error("Cannot close `"+le.type+"` ("+fo({start:le.start,end:le.end})+"): it’s not open");Ae.position.end=Mr(le.end)}function f(){return vf(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function y(le){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function C(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=le}function w(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=le}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.value=le.replace(/(\r?\n|\r)$/g,"")}function v(le){const _e=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=_e,Ae.identifier=yi(this.sliceSerialize(le)).toLowerCase()}function S(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.title=le}function D(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.url=le}function R(le){const _e=this.stack[this.stack.length-1];if(!_e.depth){const Ae=this.sliceSerialize(le).length;_e.depth=Ae}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function M(le){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function L(le){const Ae=this.stack[this.stack.length-1].children;let Fe=Ae[Ae.length-1];(!Fe||Fe.type!=="text")&&(Fe=Ne(),Fe.position={start:Mr(le.start),end:void 0},Ae.push(Fe)),this.stack.push(Fe)}function T(le){const _e=this.stack.pop();_e.value+=this.sliceSerialize(le),_e.position.end=Mr(le.end)}function P(le){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=_e.children[_e.children.length-1];Ae.position.end=Mr(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(_e.type)&&(L.call(this,le),T.call(this,le))}function B(){this.data.atHardBreak=!0}function F(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.value=le}function $(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.value=le}function q(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.value=le}function W(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=_e,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function K(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=_e,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function X(le){const _e=this.sliceSerialize(le),Ae=this.stack[this.stack.length-2];Ae.label=N5(_e),Ae.identifier=yi(_e).toLowerCase()}function U(){const le=this.stack[this.stack.length-1],_e=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Fe=le.children;Ae.children=Fe}else Ae.alt=_e}function O(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.url=le}function z(){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.title=le}function j(){this.data.inReference=void 0}function H(){this.data.referenceType="collapsed"}function ee(le){const _e=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=_e,Ae.identifier=yi(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function he(le){this.data.characterReferenceType=le.type}function se(le){const _e=this.sliceSerialize(le),Ae=this.data.characterReferenceType;let Fe;Ae?(Fe=Ib(_e,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Fe=bf(_e);const ze=this.stack[this.stack.length-1];ze.value+=Fe}function Z(le){const _e=this.stack.pop();_e.position.end=Mr(le.end)}function G(le){T.call(this,le);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(le)}function re(le){T.call(this,le);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(le)}function ne(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function Te(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xe(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function ke(){return{type:"html",value:""}}function Bt(){return{type:"image",title:null,url:"",alt:null}}function Gt(){return{type:"link",title:null,url:"",children:[]}}function $e(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Ke(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function Ye(){return{type:"paragraph",children:[]}}function De(){return{type:"strong",children:[]}}function Ne(){return{type:"text",value:""}}function _t(){return{type:"thematicBreak"}}}function Mr(e){return{line:e.line,column:e.column,offset:e.offset}}function Kb(e,i){let r=-1;for(;++r<i.length;){const o=i[r];Array.isArray(o)?Kb(e,o):P5(e,o)}}function P5(e,i){let r;for(r in i)if(Gb.call(i,r))switch(r){case"canContainEols":{const o=i[r];o&&e[r].push(...o);break}case"transforms":{const o=i[r];o&&e[r].push(...o);break}case"enter":case"exit":{const o=i[r];o&&Object.assign(e[r],o);break}}}function Cv(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+fo({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+fo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+fo({start:i.start,end:i.end})+") is still open")}function U5(e){const i=this;i.parser=r;function r(o){return F5(o,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function H5(e,i){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,r),e.applyData(i,r)}function j5(e,i){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,r),[e.applyData(i,r),{type:"text",value:`
156
- `}]}function $5(e,i){const r=i.value?i.value+`
157
- `:"",o={},h=i.lang?i.lang.split(/\s+/):[];h.length>0&&(o.className=["language-"+h[0]]);let m={type:"element",tagName:"code",properties:o,children:[{type:"text",value:r}]};return i.meta&&(m.data={meta:i.meta}),e.patch(i,m),m=e.applyData(i,m),m={type:"element",tagName:"pre",properties:{},children:[m]},e.patch(i,m),m}function q5(e,i){const r={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function W5(e,i){const r={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function G5(e,i){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",o=String(i.identifier).toUpperCase(),h=ia(o.toLowerCase()),m=e.footnoteOrder.indexOf(o);let p,a=e.footnoteCounts.get(o);a===void 0?(a=0,e.footnoteOrder.push(o),p=e.footnoteOrder.length):p=m+1,a+=1,e.footnoteCounts.set(o,a);const l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+h,id:r+"fnref-"+h+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(p)}]};e.patch(i,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(i,c),e.applyData(i,c)}function K5(e,i){const r={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function V5(e,i){if(e.options.allowDangerousHtml){const r={type:"raw",value:i.value};return e.patch(i,r),e.applyData(i,r)}}function Vb(e,i){const r=i.referenceType;let o="]";if(r==="collapsed"?o+="[]":r==="full"&&(o+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+o}];const h=e.all(i),m=h[0];m&&m.type==="text"?m.value="["+m.value:h.unshift({type:"text",value:"["});const p=h[h.length-1];return p&&p.type==="text"?p.value+=o:h.push({type:"text",value:o}),h}function Y5(e,i){const r=String(i.identifier).toUpperCase(),o=e.definitionById.get(r);if(!o)return Vb(e,i);const h={src:ia(o.url||""),alt:i.alt};o.title!==null&&o.title!==void 0&&(h.title=o.title);const m={type:"element",tagName:"img",properties:h,children:[]};return e.patch(i,m),e.applyData(i,m)}function X5(e,i){const r={src:ia(i.url)};i.alt!==null&&i.alt!==void 0&&(r.alt=i.alt),i.title!==null&&i.title!==void 0&&(r.title=i.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(i,o),e.applyData(i,o)}function Z5(e,i){const r={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,r);const o={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(i,o),e.applyData(i,o)}function Q5(e,i){const r=String(i.identifier).toUpperCase(),o=e.definitionById.get(r);if(!o)return Vb(e,i);const h={href:ia(o.url||"")};o.title!==null&&o.title!==void 0&&(h.title=o.title);const m={type:"element",tagName:"a",properties:h,children:e.all(i)};return e.patch(i,m),e.applyData(i,m)}function J5(e,i){const r={href:ia(i.url)};i.title!==null&&i.title!==void 0&&(r.title=i.title);const o={type:"element",tagName:"a",properties:r,children:e.all(i)};return e.patch(i,o),e.applyData(i,o)}function ek(e,i,r){const o=e.all(i),h=r?tk(r):Yb(i),m={},p=[];if(typeof i.checked=="boolean"){const f=o[0];let u;f&&f.type==="element"&&f.tagName==="p"?u=f:(u={type:"element",tagName:"p",properties:{},children:[]},o.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),m.className=["task-list-item"]}let a=-1;for(;++a<o.length;){const f=o[a];(h||a!==0||f.type!=="element"||f.tagName!=="p")&&p.push({type:"text",value:`
158
- `}),f.type==="element"&&f.tagName==="p"&&!h?p.push(...f.children):p.push(f)}const l=o[o.length-1];l&&(h||l.type!=="element"||l.tagName!=="p")&&p.push({type:"text",value:`
159
- `});const c={type:"element",tagName:"li",properties:m,children:p};return e.patch(i,c),e.applyData(i,c)}function tk(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const r=e.children;let o=-1;for(;!i&&++o<r.length;)i=Yb(r[o])}return i}function Yb(e){const i=e.spread;return i??e.children.length>1}function nk(e,i){const r={},o=e.all(i);let h=-1;for(typeof i.start=="number"&&i.start!==1&&(r.start=i.start);++h<o.length;){const p=o[h];if(p.type==="element"&&p.tagName==="li"&&p.properties&&Array.isArray(p.properties.className)&&p.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const m={type:"element",tagName:i.ordered?"ol":"ul",properties:r,children:e.wrap(o,!0)};return e.patch(i,m),e.applyData(i,m)}function ik(e,i){const r={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function rk(e,i){const r={type:"root",children:e.wrap(e.all(i))};return e.patch(i,r),e.applyData(i,r)}function sk(e,i){const r={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function ak(e,i){const r=e.all(i),o=r.shift(),h=[];if(o){const p={type:"element",tagName:"thead",properties:{},children:e.wrap([o],!0)};e.patch(i.children[0],p),h.push(p)}if(r.length>0){const p={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},a=gf(i.children[1]),l=kb(i.children[i.children.length-1]);a&&l&&(p.position={start:a,end:l}),h.push(p)}const m={type:"element",tagName:"table",properties:{},children:e.wrap(h,!0)};return e.patch(i,m),e.applyData(i,m)}function ok(e,i,r){const o=r?r.children:void 0,m=(o?o.indexOf(i):1)===0?"th":"td",p=r&&r.type==="table"?r.align:void 0,a=p?p.length:i.children.length;let l=-1;const c=[];for(;++l<a;){const u=i.children[l],y={},C=p?p[l]:void 0;C&&(y.align=C);let w={type:"element",tagName:m,properties:y,children:[]};u&&(w.children=e.all(u),e.patch(u,w),w=e.applyData(u,w)),c.push(w)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(i,f),e.applyData(i,f)}function lk(e,i){const r={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}const Ev=9,wv=32;function ck(e){const i=String(e),r=/\r?\n|\r/g;let o=r.exec(i),h=0;const m=[];for(;o;)m.push(xv(i.slice(h,o.index),h>0,!0),o[0]),h=o.index+o[0].length,o=r.exec(i);return m.push(xv(i.slice(h),h>0,!1)),m.join("")}function xv(e,i,r){let o=0,h=e.length;if(i){let m=e.codePointAt(o);for(;m===Ev||m===wv;)o++,m=e.codePointAt(o)}if(r){let m=e.codePointAt(h-1);for(;m===Ev||m===wv;)h--,m=e.codePointAt(h-1)}return h>o?e.slice(o,h):""}function uk(e,i){const r={type:"text",value:ck(String(i.value))};return e.patch(i,r),e.applyData(i,r)}function hk(e,i){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,r),e.applyData(i,r)}const dk={blockquote:H5,break:j5,code:$5,delete:q5,emphasis:W5,footnoteReference:G5,heading:K5,html:V5,imageReference:Y5,image:X5,inlineCode:Z5,linkReference:Q5,link:J5,listItem:ek,list:nk,paragraph:ik,root:rk,strong:sk,table:ak,tableCell:lk,tableRow:ok,text:uk,thematicBreak:hk,toml:ec,yaml:ec,definition:ec,footnoteDefinition:ec};function ec(){}const Xb=-1,Bc=0,po=1,yc=2,Sf=3,Cf=4,Ef=5,wf=6,Zb=7,Qb=8,Dv=typeof self=="object"?self:globalThis,fk=(e,i)=>{const r=(h,m)=>(e.set(m,h),h),o=h=>{if(e.has(h))return e.get(h);const[m,p]=i[h];switch(m){case Bc:case Xb:return r(p,h);case po:{const a=r([],h);for(const l of p)a.push(o(l));return a}case yc:{const a=r({},h);for(const[l,c]of p)a[o(l)]=o(c);return a}case Sf:return r(new Date(p),h);case Cf:{const{source:a,flags:l}=p;return r(new RegExp(a,l),h)}case Ef:{const a=r(new Map,h);for(const[l,c]of p)a.set(o(l),o(c));return a}case wf:{const a=r(new Set,h);for(const l of p)a.add(o(l));return a}case Zb:{const{name:a,message:l}=p;return r(new Dv[a](l),h)}case Qb:return r(BigInt(p),h);case"BigInt":return r(Object(BigInt(p)),h);case"ArrayBuffer":return r(new Uint8Array(p).buffer,p);case"DataView":{const{buffer:a}=new Uint8Array(p);return r(new DataView(a),p)}}return r(new Dv[m](p),h)};return o},Av=e=>fk(new Map,e)(0),js="",{toString:gk}={},{keys:pk}=Object,ro=e=>{const i=typeof e;if(i!=="object"||!e)return[Bc,i];const r=gk.call(e).slice(8,-1);switch(r){case"Array":return[po,js];case"Object":return[yc,js];case"Date":return[Sf,js];case"RegExp":return[Cf,js];case"Map":return[Ef,js];case"Set":return[wf,js];case"DataView":return[po,r]}return r.includes("Array")?[po,r]:r.includes("Error")?[Zb,r]:[yc,r]},tc=([e,i])=>e===Bc&&(i==="function"||i==="symbol"),mk=(e,i,r,o)=>{const h=(p,a)=>{const l=o.push(p)-1;return r.set(a,l),l},m=p=>{if(r.has(p))return r.get(p);let[a,l]=ro(p);switch(a){case Bc:{let f=p;switch(l){case"bigint":a=Qb,f=p.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return h([Xb],p)}return h([a,f],p)}case po:{if(l){let y=p;return l==="DataView"?y=new Uint8Array(p.buffer):l==="ArrayBuffer"&&(y=new Uint8Array(p)),h([l,[...y]],p)}const f=[],u=h([a,f],p);for(const y of p)f.push(m(y));return u}case yc:{if(l)switch(l){case"BigInt":return h([l,p.toString()],p);case"Boolean":case"Number":case"String":return h([l,p.valueOf()],p)}if(i&&"toJSON"in p)return m(p.toJSON());const f=[],u=h([a,f],p);for(const y of pk(p))(e||!tc(ro(p[y])))&&f.push([m(y),m(p[y])]);return u}case Sf:return h([a,p.toISOString()],p);case Cf:{const{source:f,flags:u}=p;return h([a,{source:f,flags:u}],p)}case Ef:{const f=[],u=h([a,f],p);for(const[y,C]of p)(e||!(tc(ro(y))||tc(ro(C))))&&f.push([m(y),m(C)]);return u}case wf:{const f=[],u=h([a,f],p);for(const y of p)(e||!tc(ro(y)))&&f.push(m(y));return u}}const{message:c}=p;return h([a,{name:l,message:c}],p)};return m},kv=(e,{json:i,lossy:r}={})=>{const o=[];return mk(!(i||r),!!i,new Map,o)(e),o},Sc=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?Av(kv(e,i)):structuredClone(e):(e,i)=>Av(kv(e,i));function _k(e,i){const r=[{type:"text",value:"↩"}];return i>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),r}function vk(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function bk(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||_k,o=e.options.footnoteBackLabel||vk,h=e.options.footnoteLabel||"Footnotes",m=e.options.footnoteLabelTagName||"h2",p=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const f=e.all(c),u=String(c.identifier).toUpperCase(),y=ia(u.toLowerCase());let C=0;const w=[],b=e.footnoteCounts.get(u);for(;b!==void 0&&++C<=b;){w.length>0&&w.push({type:"text",value:" "});let v=typeof r=="string"?r:r(l,C);typeof v=="string"&&(v={type:"text",value:v}),w.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+y+(C>1?"-"+C:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(l,C),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...w)}else f.push(...w);const _={type:"element",tagName:"li",properties:{id:i+"fn-"+y},children:e.wrap(f,!0)};e.patch(c,_),a.push(_)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:m,properties:{...Sc(p),id:"footnote-label"},children:[{type:"text",value:h}]},{type:"text",value:`
160
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
161
- `}]}}const Mo=(function(e){if(e==null)return Ek;if(typeof e=="function")return Nc(e);if(typeof e=="object")return Array.isArray(e)?yk(e):Sk(e);if(typeof e=="string")return Ck(e);throw new Error("Expected function, string, or object as test")});function yk(e){const i=[];let r=-1;for(;++r<e.length;)i[r]=Mo(e[r]);return Nc(o);function o(...h){let m=-1;for(;++m<i.length;)if(i[m].apply(this,h))return!0;return!1}}function Sk(e){const i=e;return Nc(r);function r(o){const h=o;let m;for(m in e)if(h[m]!==i[m])return!1;return!0}}function Ck(e){return Nc(i);function i(r){return r&&r.type===e}}function Nc(e){return i;function i(r,o,h){return!!(wk(r)&&e.call(this,r,typeof o=="number"?o:void 0,h||void 0))}}function Ek(){return!0}function wk(e){return e!==null&&typeof e=="object"&&"type"in e}const Jb=[],xk=!0,Ud=!1,Dk="skip";function e1(e,i,r,o){let h;typeof i=="function"&&typeof r!="function"?(o=r,r=i):h=i;const m=Mo(h),p=o?-1:1;a(e,void 0,[])();function a(l,c,f){const u=l&&typeof l=="object"?l:{};if(typeof u.type=="string"){const C=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(l.type+(C?"<"+C+">":""))+")"})}return y;function y(){let C=Jb,w,b,g;if((!i||m(l,c,f[f.length-1]||void 0))&&(C=Ak(r(l,f)),C[0]===Ud))return C;if("children"in l&&l.children){const _=l;if(_.children&&C[0]!==Dk)for(b=(o?_.children.length:-1)+p,g=f.concat(_);b>-1&&b<_.children.length;){const v=_.children[b];if(w=a(v,b,g)(),w[0]===Ud)return w;b=typeof w[1]=="number"?w[1]:b+p}}return C}}}function Ak(e){return Array.isArray(e)?e:typeof e=="number"?[xk,e]:e==null?Jb:[e]}function Ic(e,i,r,o){let h,m,p;typeof i=="function"&&typeof r!="function"?(m=void 0,p=i,h=r):(m=i,p=r,h=o),e1(e,m,a,h);function a(l,c){const f=c[c.length-1],u=f?f.children.indexOf(l):void 0;return p(l,u,f)}}const Hd={}.hasOwnProperty,kk={};function Rk(e,i){const r=i||kk,o=new Map,h=new Map,m=new Map,p={...dk,...r.handlers},a={all:c,applyData:Mk,definitionById:o,footnoteById:h,footnoteCounts:m,footnoteOrder:[],handlers:p,one:l,options:r,patch:Tk,wrap:Ok};return Ic(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const u=f.type==="definition"?o:h,y=String(f.identifier).toUpperCase();u.has(y)||u.set(y,f)}}),a;function l(f,u){const y=f.type,C=a.handlers[y];if(Hd.call(a.handlers,y)&&C)return C(a,f,u);if(a.options.passThrough&&a.options.passThrough.includes(y)){if("children"in f){const{children:b,...g}=f,_=Sc(g);return _.children=a.all(f),_}return Sc(f)}return(a.options.unknownHandler||Lk)(a,f,u)}function c(f){const u=[];if("children"in f){const y=f.children;let C=-1;for(;++C<y.length;){const w=a.one(y[C],f);if(w){if(C&&y[C-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Rv(w.value)),!Array.isArray(w)&&w.type==="element")){const b=w.children[0];b&&b.type==="text"&&(b.value=Rv(b.value))}Array.isArray(w)?u.push(...w):u.push(w)}}}return u}}function Tk(e,i){e.position&&(i.position=vD(e))}function Mk(e,i){let r=i;if(e&&e.data){const o=e.data.hName,h=e.data.hChildren,m=e.data.hProperties;if(typeof o=="string")if(r.type==="element")r.tagName=o;else{const p="children"in r?r.children:[r];r={type:"element",tagName:o,properties:{},children:p}}r.type==="element"&&m&&Object.assign(r.properties,Sc(m)),"children"in r&&r.children&&h!==null&&h!==void 0&&(r.children=h)}return r}function Lk(e,i){const r=i.data||{},o="value"in i&&!(Hd.call(r,"hProperties")||Hd.call(r,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,o),e.applyData(i,o)}function Ok(e,i){const r=[];let o=-1;for(i&&r.push({type:"text",value:`
162
- `});++o<e.length;)o&&r.push({type:"text",value:`
163
- `}),r.push(e[o]);return i&&e.length>0&&r.push({type:"text",value:`
164
- `}),r}function Rv(e){let i=0,r=e.charCodeAt(i);for(;r===9||r===32;)i++,r=e.charCodeAt(i);return e.slice(i)}function Tv(e,i){const r=Rk(e,i),o=r.one(e,void 0),h=bk(r),m=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return h&&m.children.push({type:"text",value:`
165
- `},h),m}function Bk(e,i){return e&&"run"in e?async function(r,o){const h=Tv(r,{file:o,...i});await e.run(h,o)}:function(r,o){return Tv(r,{file:o,...e||i})}}function Mv(e){if(e)throw e}var ld,Lv;function Nk(){if(Lv)return ld;Lv=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,h=function(c){return typeof Array.isArray=="function"?Array.isArray(c):i.call(c)==="[object Array]"},m=function(c){if(!c||i.call(c)!=="[object Object]")return!1;var f=e.call(c,"constructor"),u=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!f&&!u)return!1;var y;for(y in c);return typeof y>"u"||e.call(c,y)},p=function(c,f){r&&f.name==="__proto__"?r(c,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):c[f.name]=f.newValue},a=function(c,f){if(f==="__proto__")if(e.call(c,f)){if(o)return o(c,f).value}else return;return c[f]};return ld=function l(){var c,f,u,y,C,w,b=arguments[0],g=1,_=arguments.length,v=!1;for(typeof b=="boolean"&&(v=b,b=arguments[1]||{},g=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});g<_;++g)if(c=arguments[g],c!=null)for(f in c)u=a(b,f),y=a(c,f),b!==y&&(v&&y&&(m(y)||(C=h(y)))?(C?(C=!1,w=u&&h(u)?u:[]):w=u&&m(u)?u:{},p(b,{name:f,newValue:l(v,w,y)})):typeof y<"u"&&p(b,{name:f,newValue:y}));return b},ld}var Ik=Nk();const cd=xc(Ik);function jd(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Fk(){const e=[],i={run:r,use:o};return i;function r(...h){let m=-1;const p=h.pop();if(typeof p!="function")throw new TypeError("Expected function as last argument, not "+p);a(null,...h);function a(l,...c){const f=e[++m];let u=-1;if(l){p(l);return}for(;++u<h.length;)(c[u]===null||c[u]===void 0)&&(c[u]=h[u]);h=c,f?zk(f,a)(...c):p(null,...c)}}function o(h){if(typeof h!="function")throw new TypeError("Expected `middelware` to be a function, not "+h);return e.push(h),i}}function zk(e,i){let r;return o;function o(...p){const a=e.length>p.length;let l;a&&p.push(h);try{l=e.apply(this,p)}catch(c){const f=c;if(a&&r)throw f;return h(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(m,h):l instanceof Error?h(l):m(l))}function h(p,...a){r||(r=!0,i(p,...a))}function m(p){h(null,p)}}const ki={basename:Pk,dirname:Uk,extname:Hk,join:jk,sep:"/"};function Pk(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Lo(e);let r=0,o=-1,h=e.length,m;if(i===void 0||i.length===0||i.length>e.length){for(;h--;)if(e.codePointAt(h)===47){if(m){r=h+1;break}}else o<0&&(m=!0,o=h+1);return o<0?"":e.slice(r,o)}if(i===e)return"";let p=-1,a=i.length-1;for(;h--;)if(e.codePointAt(h)===47){if(m){r=h+1;break}}else p<0&&(m=!0,p=h+1),a>-1&&(e.codePointAt(h)===i.codePointAt(a--)?a<0&&(o=h):(a=-1,o=p));return r===o?o=p:o<0&&(o=e.length),e.slice(r,o)}function Uk(e){if(Lo(e),e.length===0)return".";let i=-1,r=e.length,o;for(;--r;)if(e.codePointAt(r)===47){if(o){i=r;break}}else o||(o=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function Hk(e){Lo(e);let i=e.length,r=-1,o=0,h=-1,m=0,p;for(;i--;){const a=e.codePointAt(i);if(a===47){if(p){o=i+1;break}continue}r<0&&(p=!0,r=i+1),a===46?h<0?h=i:m!==1&&(m=1):h>-1&&(m=-1)}return h<0||r<0||m===0||m===1&&h===r-1&&h===o+1?"":e.slice(h,r)}function jk(...e){let i=-1,r;for(;++i<e.length;)Lo(e[i]),e[i]&&(r=r===void 0?e[i]:r+"/"+e[i]);return r===void 0?".":$k(r)}function $k(e){Lo(e);const i=e.codePointAt(0)===47;let r=qk(e,!i);return r.length===0&&!i&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),i?"/"+r:r}function qk(e,i){let r="",o=0,h=-1,m=0,p=-1,a,l;for(;++p<=e.length;){if(p<e.length)a=e.codePointAt(p);else{if(a===47)break;a=47}if(a===47){if(!(h===p-1||m===1))if(h!==p-1&&m===2){if(r.length<2||o!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",o=0):(r=r.slice(0,l),o=r.length-1-r.lastIndexOf("/")),h=p,m=0;continue}}else if(r.length>0){r="",o=0,h=p,m=0;continue}}i&&(r=r.length>0?r+"/..":"..",o=2)}else r.length>0?r+="/"+e.slice(h+1,p):r=e.slice(h+1,p),o=p-h-1;h=p,m=0}else a===46&&m>-1?m++:m=-1}return r}function Lo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Wk={cwd:Gk};function Gk(){return"/"}function $d(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Kk(e){if(typeof e=="string")e=new URL(e);else if(!$d(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return Vk(e)}function Vk(e){if(e.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const i=e.pathname;let r=-1;for(;++r<i.length;)if(i.codePointAt(r)===37&&i.codePointAt(r+1)===50){const o=i.codePointAt(r+2);if(o===70||o===102){const h=new TypeError("File URL path must not include encoded / characters");throw h.code="ERR_INVALID_FILE_URL_PATH",h}}return decodeURIComponent(i)}const ud=["history","path","basename","stem","extname","dirname"];class t1{constructor(i){let r;i?$d(i)?r={path:i}:typeof i=="string"||Yk(i)?r={value:i}:r=i:r={},this.cwd="cwd"in r?"":Wk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<ud.length;){const m=ud[o];m in r&&r[m]!==void 0&&r[m]!==null&&(this[m]=m==="history"?[...r[m]]:r[m])}let h;for(h in r)ud.includes(h)||(this[h]=r[h])}get basename(){return typeof this.path=="string"?ki.basename(this.path):void 0}set basename(i){dd(i,"basename"),hd(i,"basename"),this.path=ki.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?ki.dirname(this.path):void 0}set dirname(i){Ov(this.basename,"dirname"),this.path=ki.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?ki.extname(this.path):void 0}set extname(i){if(hd(i,"extname"),Ov(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ki.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){$d(i)&&(i=Kk(i)),dd(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?ki.basename(this.path,this.extname):void 0}set stem(i){dd(i,"stem"),hd(i,"stem"),this.path=ki.join(this.dirname||"",i+(this.extname||""))}fail(i,r,o){const h=this.message(i,r,o);throw h.fatal=!0,h}info(i,r,o){const h=this.message(i,r,o);return h.fatal=void 0,h}message(i,r,o){const h=new En(i,r,o);return this.path&&(h.name=this.path+":"+h.name,h.file=this.path),h.fatal=!1,this.messages.push(h),h}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function hd(e,i){if(e&&e.includes(ki.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+ki.sep+"`")}function dd(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function Ov(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function Yk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xk=(function(e){const o=this.constructor.prototype,h=o[e],m=function(){return h.apply(m,arguments)};return Object.setPrototypeOf(m,o),m}),Zk={}.hasOwnProperty;class xf extends Xk{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=Fk()}copy(){const i=new xf;let r=-1;for(;++r<this.attachers.length;){const o=this.attachers[r];i.use(...o)}return i.data(cd(!0,{},this.namespace)),i}data(i,r){return typeof i=="string"?arguments.length===2?(pd("data",this.frozen),this.namespace[i]=r,this):Zk.call(this.namespace,i)&&this.namespace[i]||void 0:i?(pd("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const h=r.call(i,...o);typeof h=="function"&&this.transformers.use(h)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const r=nc(i),o=this.parser||this.Parser;return fd("parse",o),o(String(r),r)}process(i,r){const o=this;return this.freeze(),fd("process",this.parser||this.Parser),gd("process",this.compiler||this.Compiler),r?h(void 0,r):new Promise(h);function h(m,p){const a=nc(i),l=o.parse(a);o.run(l,a,function(f,u,y){if(f||!u||!y)return c(f);const C=u,w=o.stringify(C,y);eR(w)?y.value=w:y.result=w,c(f,y)});function c(f,u){f||!u?p(f):m?m(u):r(void 0,u)}}}processSync(i){let r=!1,o;return this.freeze(),fd("processSync",this.parser||this.Parser),gd("processSync",this.compiler||this.Compiler),this.process(i,h),Nv("processSync","process",r),o;function h(m,p){r=!0,Mv(m),o=p}}run(i,r,o){Bv(i),this.freeze();const h=this.transformers;return!o&&typeof r=="function"&&(o=r,r=void 0),o?m(void 0,o):new Promise(m);function m(p,a){const l=nc(r);h.run(i,l,c);function c(f,u,y){const C=u||i;f?a(f):p?p(C):o(void 0,C,y)}}}runSync(i,r){let o=!1,h;return this.run(i,r,m),Nv("runSync","run",o),h;function m(p,a){Mv(p),h=a,o=!0}}stringify(i,r){this.freeze();const o=nc(r),h=this.compiler||this.Compiler;return gd("stringify",h),Bv(i),h(i,o)}use(i,...r){const o=this.attachers,h=this.namespace;if(pd("use",this.frozen),i!=null)if(typeof i=="function")l(i,r);else if(typeof i=="object")Array.isArray(i)?a(i):p(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function m(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[f,...u]=c;l(f,u)}else p(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function p(c){if(!("plugins"in c)&&!("settings"in c))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");a(c.plugins),c.settings&&(h.settings=cd(!0,h.settings,c.settings))}function a(c){let f=-1;if(c!=null)if(Array.isArray(c))for(;++f<c.length;){const u=c[f];m(u)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,f){let u=-1,y=-1;for(;++u<o.length;)if(o[u][0]===c){y=u;break}if(y===-1)o.push([c,...f]);else if(f.length>0){let[C,...w]=f;const b=o[y][1];jd(b)&&jd(C)&&(C=cd(!0,b,C)),o[y]=[c,C,...w]}}}}const Qk=new xf().freeze();function fd(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function gd(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pd(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Bv(e){if(!jd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Nv(e,i,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function nc(e){return Jk(e)?e:new t1(e)}function Jk(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eR(e){return typeof e=="string"||tR(e)}function tR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Iv=[],Fv={allowDangerousHtml:!0},iR=/^(https?|ircs?|mailto|xmpp)$/i,rR=[{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 sR(e){const i=aR(e),r=oR(e);return lR(i.runSync(i.parse(r),r),e)}function aR(e){const i=e.rehypePlugins||Iv,r=e.remarkPlugins||Iv,o=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Fv}:Fv;return Qk().use(U5).use(r).use(Bk,o).use(i)}function oR(e){const i=e.children||"",r=new t1;return typeof i=="string"&&(r.value=i),r}function lR(e,i){const r=i.allowedElements,o=i.allowElement,h=i.components,m=i.disallowedElements,p=i.skipHtml,a=i.unwrapDisallowed,l=i.urlTransform||cR;for(const f of rR)Object.hasOwn(i,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+nR+f.id,void 0);return Ic(e,c),ED(e,{Fragment:Y.Fragment,components:h,ignoreInvalidStyle:!0,jsx:Y.jsx,jsxs:Y.jsxs,passKeys:!0,passNode:!0});function c(f,u,y){if(f.type==="raw"&&y&&typeof u=="number")return p?y.children.splice(u,1):y.children[u]={type:"text",value:f.value},u;if(f.type==="element"){let C;for(C in sd)if(Object.hasOwn(sd,C)&&Object.hasOwn(f.properties,C)){const w=f.properties[C],b=sd[C];(b===null||b.includes(f.tagName))&&(f.properties[C]=l(String(w||""),C,f))}}if(f.type==="element"){let C=r?!r.includes(f.tagName):m?m.includes(f.tagName):!1;if(!C&&o&&typeof u=="number"&&(C=!o(f,u,y)),C&&y&&typeof u=="number")return a&&f.children?y.children.splice(u,1,...f.children):y.children.splice(u,1),u}}}function cR(e){const i=e.indexOf(":"),r=e.indexOf("?"),o=e.indexOf("#"),h=e.indexOf("/");return i===-1||h!==-1&&i>h||r!==-1&&i>r||o!==-1&&i>o||iR.test(e.slice(0,i))?e:""}function zv(e,i){const r=String(e);if(typeof i!="string")throw new TypeError("Expected character");let o=0,h=r.indexOf(i);for(;h!==-1;)o++,h=r.indexOf(i,h+i.length);return o}function uR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hR(e,i,r){const h=Mo((r||{}).ignore||[]),m=dR(i);let p=-1;for(;++p<m.length;)e1(e,"text",a);function a(c,f){let u=-1,y;for(;++u<f.length;){const C=f[u],w=y?y.children:void 0;if(h(C,w?w.indexOf(C):void 0,y))return;y=C}if(y)return l(c,f)}function l(c,f){const u=f[f.length-1],y=m[p][0],C=m[p][1];let w=0;const g=u.children.indexOf(c);let _=!1,v=[];y.lastIndex=0;let S=y.exec(c.value);for(;S;){const D=S.index,R={index:S.index,input:S.input,stack:[...f,c]};let x=C(...S,R);if(typeof x=="string"&&(x=x.length>0?{type:"text",value:x}:void 0),x===!1?y.lastIndex=D+1:(w!==D&&v.push({type:"text",value:c.value.slice(w,D)}),Array.isArray(x)?v.push(...x):x&&v.push(x),w=D+S[0].length,_=!0),!y.global)break;S=y.exec(c.value)}return _?(w<c.value.length&&v.push({type:"text",value:c.value.slice(w)}),u.children.splice(g,1,...v)):v=[c],g+v.length}}function dR(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let o=-1;for(;++o<r.length;){const h=r[o];i.push([fR(h[0]),gR(h[1])])}return i}function fR(e){return typeof e=="string"?new RegExp(uR(e),"g"):e}function gR(e){return typeof e=="function"?e:function(){return e}}const md="phrasing",_d=["autolink","link","image","label"];function pR(){return{transforms:[CR],enter:{literalAutolink:_R,literalAutolinkEmail:vd,literalAutolinkHttp:vd,literalAutolinkWww:vd},exit:{literalAutolink:SR,literalAutolinkEmail:yR,literalAutolinkHttp:vR,literalAutolinkWww:bR}}}function mR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:md,notInConstruct:_d},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:md,notInConstruct:_d},{character:":",before:"[ps]",after:"\\/",inConstruct:md,notInConstruct:_d}]}}function _R(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vd(e){this.config.enter.autolinkProtocol.call(this,e)}function vR(e){this.config.exit.autolinkProtocol.call(this,e)}function bR(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function yR(e){this.config.exit.autolinkEmail.call(this,e)}function SR(e){this.exit(e)}function CR(e){hR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ER],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),wR]],{ignore:["link","linkReference"]})}function ER(e,i,r,o,h){let m="";if(!n1(h)||(/^w/i.test(i)&&(r=i+r,i="",m="http://"),!xR(r)))return!1;const p=DR(r+o);if(!p[0])return!1;const a={type:"link",title:null,url:m+i+p[0],children:[{type:"text",value:i+p[0]}]};return p[1]?[a,{type:"text",value:p[1]}]:a}function wR(e,i,r,o){return!n1(o,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+r,children:[{type:"text",value:i+"@"+r}]}}function xR(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function DR(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let r=i[0],o=r.indexOf(")");const h=zv(e,"(");let m=zv(e,")");for(;o!==-1&&h>m;)e+=r.slice(0,o+1),r=r.slice(o+1),o=r.indexOf(")"),m++;return[e,r]}function n1(e,i){const r=e.input.charCodeAt(e.index-1);return(e.index===0||ns(r)||Lc(r))&&(!i||r!==47)}i1.peek=NR;function AR(){this.buffer()}function kR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function RR(){this.buffer()}function TR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function MR(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=yi(this.sliceSerialize(e)).toLowerCase(),r.label=i}function LR(e){this.exit(e)}function OR(e){const i=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=yi(this.sliceSerialize(e)).toLowerCase(),r.label=i}function BR(e){this.exit(e)}function NR(){return"["}function i1(e,i,r,o){const h=r.createTracker(o);let m=h.move("[^");const p=r.enter("footnoteReference"),a=r.enter("reference");return m+=h.move(r.safe(r.associationId(e),{after:"]",before:m})),a(),p(),m+=h.move("]"),m}function IR(){return{enter:{gfmFootnoteCallString:AR,gfmFootnoteCall:kR,gfmFootnoteDefinitionLabelString:RR,gfmFootnoteDefinition:TR},exit:{gfmFootnoteCallString:MR,gfmFootnoteCall:LR,gfmFootnoteDefinitionLabelString:OR,gfmFootnoteDefinition:BR}}}function FR(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:r,footnoteReference:i1},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(o,h,m,p){const a=m.createTracker(p);let l=a.move("[^");const c=m.enter("footnoteDefinition"),f=m.enter("label");return l+=a.move(m.safe(m.associationId(o),{before:l,after:"]"})),f(),l+=a.move("]:"),o.children&&o.children.length>0&&(a.shift(4),l+=a.move((i?`
166
- `:" ")+m.indentLines(m.containerFlow(o,a.current()),i?r1:zR))),c(),l}}function zR(e,i,r){return i===0?e:r1(e,i,r)}function r1(e,i,r){return(r?"":" ")+e}const PR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];s1.peek=qR;function UR(){return{canContainEols:["delete"],enter:{strikethrough:jR},exit:{strikethrough:$R}}}function HR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:PR}],handlers:{delete:s1}}}function jR(e){this.enter({type:"delete",children:[]},e)}function $R(e){this.exit(e)}function s1(e,i,r,o){const h=r.createTracker(o),m=r.enter("strikethrough");let p=h.move("~~");return p+=r.containerPhrasing(e,{...h.current(),before:p,after:"~"}),p+=h.move("~~"),m(),p}function qR(){return"~"}function WR(e){return e.length}function GR(e,i){const r=i||{},o=(r.align||[]).concat(),h=r.stringLength||WR,m=[],p=[],a=[],l=[];let c=0,f=-1;for(;++f<e.length;){const b=[],g=[];let _=-1;for(e[f].length>c&&(c=e[f].length);++_<e[f].length;){const v=KR(e[f][_]);if(r.alignDelimiters!==!1){const S=h(v);g[_]=S,(l[_]===void 0||S>l[_])&&(l[_]=S)}b.push(v)}p[f]=b,a[f]=g}let u=-1;if(typeof o=="object"&&"length"in o)for(;++u<c;)m[u]=Pv(o[u]);else{const b=Pv(o);for(;++u<c;)m[u]=b}u=-1;const y=[],C=[];for(;++u<c;){const b=m[u];let g="",_="";b===99?(g=":",_=":"):b===108?g=":":b===114&&(_=":");let v=r.alignDelimiters===!1?1:Math.max(1,l[u]-g.length-_.length);const S=g+"-".repeat(v)+_;r.alignDelimiters!==!1&&(v=g.length+v+_.length,v>l[u]&&(l[u]=v),C[u]=v),y[u]=S}p.splice(1,0,y),a.splice(1,0,C),f=-1;const w=[];for(;++f<p.length;){const b=p[f],g=a[f];u=-1;const _=[];for(;++u<c;){const v=b[u]||"";let S="",D="";if(r.alignDelimiters!==!1){const R=l[u]-(g[u]||0),x=m[u];x===114?S=" ".repeat(R):x===99?R%2?(S=" ".repeat(R/2+.5),D=" ".repeat(R/2-.5)):(S=" ".repeat(R/2),D=S):D=" ".repeat(R)}r.delimiterStart!==!1&&!u&&_.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&v==="")&&(r.delimiterStart!==!1||u)&&_.push(" "),r.alignDelimiters!==!1&&_.push(S),_.push(v),r.alignDelimiters!==!1&&_.push(D),r.padding!==!1&&_.push(" "),(r.delimiterEnd!==!1||u!==c-1)&&_.push("|")}w.push(r.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return w.join(`
167
- `)}function KR(e){return e==null?"":String(e)}function Pv(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function VR(e,i,r,o){const h=r.enter("blockquote"),m=r.createTracker(o);m.move("> "),m.shift(2);const p=r.indentLines(r.containerFlow(e,m.current()),YR);return h(),p}function YR(e,i,r){return">"+(r?"":" ")+e}function XR(e,i){return Uv(e,i.inConstruct,!0)&&!Uv(e,i.notInConstruct,!1)}function Uv(e,i,r){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return r;let o=-1;for(;++o<i.length;)if(e.includes(i[o]))return!0;return!1}function Hv(e,i,r,o){let h=-1;for(;++h<r.unsafe.length;)if(r.unsafe[h].character===`
168
- `&&XR(r.stack,r.unsafe[h]))return/[ \t]/.test(o.before)?"":" ";return`\\
169
- `}function ZR(e,i){const r=String(e);let o=r.indexOf(i),h=o,m=0,p=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===h?++m>p&&(p=m):m=1,h=o+i.length,o=r.indexOf(i,h);return p}function QR(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function JR(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function eT(e,i,r,o){const h=JR(r),m=e.value||"",p=h==="`"?"GraveAccent":"Tilde";if(QR(e,r)){const u=r.enter("codeIndented"),y=r.indentLines(m,tT);return u(),y}const a=r.createTracker(o),l=h.repeat(Math.max(ZR(m,h)+1,3)),c=r.enter("codeFenced");let f=a.move(l);if(e.lang){const u=r.enter(`codeFencedLang${p}`);f+=a.move(r.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),u()}if(e.lang&&e.meta){const u=r.enter(`codeFencedMeta${p}`);f+=a.move(" "),f+=a.move(r.safe(e.meta,{before:f,after:`
170
- `,encode:["`"],...a.current()})),u()}return f+=a.move(`
171
- `),m&&(f+=a.move(m+`
172
- `)),f+=a.move(l),c(),f}function tT(e,i,r){return(r?"":" ")+e}function Df(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function nT(e,i,r,o){const h=Df(r),m=h==='"'?"Quote":"Apostrophe",p=r.enter("definition");let a=r.enter("label");const l=r.createTracker(o);let c=l.move("[");return c+=l.move(r.safe(r.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=r.enter("destinationRaw"),c+=l.move(r.safe(e.url,{before:c,after:e.title?" ":`
173
- `,...l.current()}))),a(),e.title&&(a=r.enter(`title${m}`),c+=l.move(" "+h),c+=l.move(r.safe(e.title,{before:c,after:h,...l.current()})),c+=l.move(h),a()),p(),c}function iT(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function Co(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Cc(e,i,r){const o=Xs(e),h=Xs(i);return o===void 0?h===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:h===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?h===void 0?{inside:!1,outside:!1}:h===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:h===void 0?{inside:!1,outside:!1}:h===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}a1.peek=rT;function a1(e,i,r,o){const h=iT(r),m=r.enter("emphasis"),p=r.createTracker(o),a=p.move(h);let l=p.move(r.containerPhrasing(e,{after:h,before:a,...p.current()}));const c=l.charCodeAt(0),f=Cc(o.before.charCodeAt(o.before.length-1),c,h);f.inside&&(l=Co(c)+l.slice(1));const u=l.charCodeAt(l.length-1),y=Cc(o.after.charCodeAt(0),u,h);y.inside&&(l=l.slice(0,-1)+Co(u));const C=p.move(h);return m(),r.attentionEncodeSurroundingInfo={after:y.outside,before:f.outside},a+l+C}function rT(e,i,r){return r.options.emphasis||"*"}function sT(e,i){let r=!1;return Ic(e,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return r=!0,Ud}),!!((!e.depth||e.depth<3)&&vf(e)&&(i.options.setext||r))}function aT(e,i,r,o){const h=Math.max(Math.min(6,e.depth||1),1),m=r.createTracker(o);if(sT(e,r)){const f=r.enter("headingSetext"),u=r.enter("phrasing"),y=r.containerPhrasing(e,{...m.current(),before:`
174
- `,after:`
175
- `});return u(),f(),y+`
176
- `+(h===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
177
- `))+1))}const p="#".repeat(h),a=r.enter("headingAtx"),l=r.enter("phrasing");m.move(p+" ");let c=r.containerPhrasing(e,{before:"# ",after:`
178
- `,...m.current()});return/^[\t ]/.test(c)&&(c=Co(c.charCodeAt(0))+c.slice(1)),c=c?p+" "+c:p,r.options.closeAtx&&(c+=" "+p),l(),a(),c}o1.peek=oT;function o1(e){return e.value||""}function oT(){return"<"}l1.peek=lT;function l1(e,i,r,o){const h=Df(r),m=h==='"'?"Quote":"Apostrophe",p=r.enter("image");let a=r.enter("label");const l=r.createTracker(o);let c=l.move("![");return c+=l.move(r.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=r.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(r.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=r.enter("destinationRaw"),c+=l.move(r.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=r.enter(`title${m}`),c+=l.move(" "+h),c+=l.move(r.safe(e.title,{before:c,after:h,...l.current()})),c+=l.move(h),a()),c+=l.move(")"),p(),c}function lT(){return"!"}c1.peek=cT;function c1(e,i,r,o){const h=e.referenceType,m=r.enter("imageReference");let p=r.enter("label");const a=r.createTracker(o);let l=a.move("![");const c=r.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),p();const f=r.stack;r.stack=[],p=r.enter("reference");const u=r.safe(r.associationId(e),{before:l,after:"]",...a.current()});return p(),r.stack=f,m(),h==="full"||!c||c!==u?l+=a.move(u+"]"):h==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function cT(){return"!"}u1.peek=uT;function u1(e,i,r){let o=e.value||"",h="`",m=-1;for(;new RegExp("(^|[^`])"+h+"([^`]|$)").test(o);)h+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++m<r.unsafe.length;){const p=r.unsafe[m],a=r.compilePattern(p);let l;if(p.atBreak)for(;l=a.exec(o);){let c=l.index;o.charCodeAt(c)===10&&o.charCodeAt(c-1)===13&&c--,o=o.slice(0,c)+" "+o.slice(l.index+1)}}return h+o+h}function uT(){return"`"}function h1(e,i){const r=vf(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}d1.peek=hT;function d1(e,i,r,o){const h=Df(r),m=h==='"'?"Quote":"Apostrophe",p=r.createTracker(o);let a,l;if(h1(e,r)){const f=r.stack;r.stack=[],a=r.enter("autolink");let u=p.move("<");return u+=p.move(r.containerPhrasing(e,{before:u,after:">",...p.current()})),u+=p.move(">"),a(),r.stack=f,u}a=r.enter("link"),l=r.enter("label");let c=p.move("[");return c+=p.move(r.containerPhrasing(e,{before:c,after:"](",...p.current()})),c+=p.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=r.enter("destinationLiteral"),c+=p.move("<"),c+=p.move(r.safe(e.url,{before:c,after:">",...p.current()})),c+=p.move(">")):(l=r.enter("destinationRaw"),c+=p.move(r.safe(e.url,{before:c,after:e.title?" ":")",...p.current()}))),l(),e.title&&(l=r.enter(`title${m}`),c+=p.move(" "+h),c+=p.move(r.safe(e.title,{before:c,after:h,...p.current()})),c+=p.move(h),l()),c+=p.move(")"),a(),c}function hT(e,i,r){return h1(e,r)?"<":"["}f1.peek=dT;function f1(e,i,r,o){const h=e.referenceType,m=r.enter("linkReference");let p=r.enter("label");const a=r.createTracker(o);let l=a.move("[");const c=r.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),p();const f=r.stack;r.stack=[],p=r.enter("reference");const u=r.safe(r.associationId(e),{before:l,after:"]",...a.current()});return p(),r.stack=f,m(),h==="full"||!c||c!==u?l+=a.move(u+"]"):h==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function dT(){return"["}function Af(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function fT(e){const i=Af(e),r=e.options.bulletOther;if(!r)return i==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+r+"`) to be different");return r}function gT(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function g1(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function pT(e,i,r,o){const h=r.enter("list"),m=r.bulletCurrent;let p=e.ordered?gT(r):Af(r);const a=e.ordered?p==="."?")":".":fT(r);let l=i&&r.bulletLastUsed?p===r.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((p==="*"||p==="-")&&f&&(!f.children||!f.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(l=!0),g1(r)===p&&f){let u=-1;for(;++u<e.children.length;){const y=e.children[u];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(p=a),r.bulletCurrent=p;const c=r.containerFlow(e,o);return r.bulletLastUsed=p,r.bulletCurrent=m,h(),c}function mT(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function _T(e,i,r,o){const h=mT(r);let m=r.bulletCurrent||Af(r);i&&i.type==="list"&&i.ordered&&(m=(typeof i.start=="number"&&i.start>-1?i.start:1)+(r.options.incrementListMarker===!1?0:i.children.indexOf(e))+m);let p=m.length+1;(h==="tab"||h==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(p=Math.ceil(p/4)*4);const a=r.createTracker(o);a.move(m+" ".repeat(p-m.length)),a.shift(p);const l=r.enter("listItem"),c=r.indentLines(r.containerFlow(e,a.current()),f);return l(),c;function f(u,y,C){return y?(C?"":" ".repeat(p))+u:(C?m:m+" ".repeat(p-m.length))+u}}function vT(e,i,r,o){const h=r.enter("paragraph"),m=r.enter("phrasing"),p=r.containerPhrasing(e,o);return m(),h(),p}const bT=Mo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function yT(e,i,r,o){return(e.children.some(function(p){return bT(p)})?r.containerPhrasing:r.containerFlow).call(r,e,o)}function ST(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}p1.peek=CT;function p1(e,i,r,o){const h=ST(r),m=r.enter("strong"),p=r.createTracker(o),a=p.move(h+h);let l=p.move(r.containerPhrasing(e,{after:h,before:a,...p.current()}));const c=l.charCodeAt(0),f=Cc(o.before.charCodeAt(o.before.length-1),c,h);f.inside&&(l=Co(c)+l.slice(1));const u=l.charCodeAt(l.length-1),y=Cc(o.after.charCodeAt(0),u,h);y.inside&&(l=l.slice(0,-1)+Co(u));const C=p.move(h+h);return m(),r.attentionEncodeSurroundingInfo={after:y.outside,before:f.outside},a+l+C}function CT(e,i,r){return r.options.strong||"*"}function ET(e,i,r,o){return r.safe(e.value,o)}function wT(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function xT(e,i,r){const o=(g1(r)+(r.options.ruleSpaces?" ":"")).repeat(wT(r));return r.options.ruleSpaces?o.slice(0,-1):o}const m1={blockquote:VR,break:Hv,code:eT,definition:nT,emphasis:a1,hardBreak:Hv,heading:aT,html:o1,image:l1,imageReference:c1,inlineCode:u1,link:d1,linkReference:f1,list:pT,listItem:_T,paragraph:vT,root:yT,strong:p1,text:ET,thematicBreak:xT};function DT(){return{enter:{table:AT,tableData:jv,tableHeader:jv,tableRow:RT},exit:{codeText:TT,table:kT,tableData:bd,tableHeader:bd,tableRow:bd}}}function AT(e){const i=e._align;this.enter({type:"table",align:i.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function kT(e){this.exit(e),this.data.inTable=void 0}function RT(e){this.enter({type:"tableRow",children:[]},e)}function bd(e){this.exit(e)}function jv(e){this.enter({type:"tableCell",children:[]},e)}function TT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,MT));const r=this.stack[this.stack.length-1];r.type,r.value=i,this.exit(e)}function MT(e,i){return i==="|"?i:e}function LT(e){const i=e||{},r=i.tableCellPadding,o=i.tablePipeAlign,h=i.stringLength,m=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
179
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:p,tableCell:l,tableRow:a}};function p(C,w,b,g){return c(f(C,b,g),C.align)}function a(C,w,b,g){const _=u(C,b,g),v=c([_]);return v.slice(0,v.indexOf(`
180
- `))}function l(C,w,b,g){const _=b.enter("tableCell"),v=b.enter("phrasing"),S=b.containerPhrasing(C,{...g,before:m,after:m});return v(),_(),S}function c(C,w){return GR(C,{align:w,alignDelimiters:o,padding:r,stringLength:h})}function f(C,w,b){const g=C.children;let _=-1;const v=[],S=w.enter("table");for(;++_<g.length;)v[_]=u(g[_],w,b);return S(),v}function u(C,w,b){const g=C.children;let _=-1;const v=[],S=w.enter("tableRow");for(;++_<g.length;)v[_]=l(g[_],C,w,b);return S(),v}function y(C,w,b){let g=m1.inlineCode(C,w,b);return b.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function OT(){return{exit:{taskListCheckValueChecked:$v,taskListCheckValueUnchecked:$v,paragraph:NT}}}function BT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:IT}}}function $v(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function NT(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const o=r.children[0];if(o&&o.type==="text"){const h=i.children;let m=-1,p;for(;++m<h.length;){const a=h[m];if(a.type==="paragraph"){p=a;break}}p===r&&(o.value=o.value.slice(1),o.value.length===0?r.children.shift():r.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,r.position.start=Object.assign({},o.position.start)))}}this.exit(e)}function IT(e,i,r,o){const h=e.children[0],m=typeof e.checked=="boolean"&&h&&h.type==="paragraph",p="["+(e.checked?"x":" ")+"] ",a=r.createTracker(o);m&&a.move(p);let l=m1.listItem(e,i,r,{...o,...a.current()});return m&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(f){return f+p}}function FT(){return[pR(),IR(),UR(),DT(),OT()]}function zT(e){return{extensions:[mR(),FR(e),HR(),LT(e),BT()]}}const PT={tokenize:WT,partial:!0},_1={tokenize:GT,partial:!0},v1={tokenize:KT,partial:!0},b1={tokenize:VT,partial:!0},UT={tokenize:YT,partial:!0},y1={name:"wwwAutolink",tokenize:$T,previous:C1},S1={name:"protocolAutolink",tokenize:qT,previous:E1},tr={name:"emailAutolink",tokenize:jT,previous:w1},Li={};function HT(){return{text:Li}}let Jr=48;for(;Jr<123;)Li[Jr]=tr,Jr++,Jr===58?Jr=65:Jr===91&&(Jr=97);Li[43]=tr;Li[45]=tr;Li[46]=tr;Li[95]=tr;Li[72]=[tr,S1];Li[104]=[tr,S1];Li[87]=[tr,y1];Li[119]=[tr,y1];function jT(e,i,r){const o=this;let h,m;return p;function p(u){return!qd(u)||!w1.call(o,o.previous)||kf(o.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(u))}function a(u){return qd(u)?(e.consume(u),a):u===64?(e.consume(u),l):r(u)}function l(u){return u===46?e.check(UT,f,c)(u):u===45||u===95||Cn(u)?(m=!0,e.consume(u),l):f(u)}function c(u){return e.consume(u),h=!0,l}function f(u){return m&&h&&Mn(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(u)):r(u)}}function $T(e,i,r){const o=this;return h;function h(p){return p!==87&&p!==119||!C1.call(o,o.previous)||kf(o.events)?r(p):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(PT,e.attempt(_1,e.attempt(v1,m),r),r)(p))}function m(p){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(p)}}function qT(e,i,r){const o=this;let h="",m=!1;return p;function p(u){return(u===72||u===104)&&E1.call(o,o.previous)&&!kf(o.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),h+=String.fromCodePoint(u),e.consume(u),a):r(u)}function a(u){if(Mn(u)&&h.length<5)return h+=String.fromCodePoint(u),e.consume(u),a;if(u===58){const y=h.toLowerCase();if(y==="http"||y==="https")return e.consume(u),l}return r(u)}function l(u){return u===47?(e.consume(u),m?c:(m=!0,l)):r(u)}function c(u){return u===null||bc(u)||Ot(u)||ns(u)||Lc(u)?r(u):e.attempt(_1,e.attempt(v1,f),r)(u)}function f(u){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(u)}}function WT(e,i,r){let o=0;return h;function h(p){return(p===87||p===119)&&o<3?(o++,e.consume(p),h):p===46&&o===3?(e.consume(p),m):r(p)}function m(p){return p===null?r(p):i(p)}}function GT(e,i,r){let o,h,m;return p;function p(c){return c===46||c===95?e.check(b1,l,a)(c):c===null||Ot(c)||ns(c)||c!==45&&Lc(c)?l(c):(m=!0,e.consume(c),p)}function a(c){return c===95?o=!0:(h=o,o=void 0),e.consume(c),p}function l(c){return h||o||!m?r(c):i(c)}}function KT(e,i){let r=0,o=0;return h;function h(p){return p===40?(r++,e.consume(p),h):p===41&&o<r?m(p):p===33||p===34||p===38||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===60||p===63||p===93||p===95||p===126?e.check(b1,i,m)(p):p===null||Ot(p)||ns(p)?i(p):(e.consume(p),h)}function m(p){return p===41&&o++,e.consume(p),h}}function VT(e,i,r){return o;function o(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),o):a===38?(e.consume(a),m):a===93?(e.consume(a),h):a===60||a===null||Ot(a)||ns(a)?i(a):r(a)}function h(a){return a===null||a===40||a===91||Ot(a)||ns(a)?i(a):o(a)}function m(a){return Mn(a)?p(a):r(a)}function p(a){return a===59?(e.consume(a),o):Mn(a)?(e.consume(a),p):r(a)}}function YT(e,i,r){return o;function o(m){return e.consume(m),h}function h(m){return Cn(m)?r(m):i(m)}}function C1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ot(e)}function E1(e){return!Mn(e)}function w1(e){return!(e===47||qd(e))}function qd(e){return e===43||e===45||e===46||e===95||Cn(e)}function kf(e){let i=e.length,r=!1;for(;i--;){const o=e[i][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){r=!0;break}if(o._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const XT={tokenize:r3,partial:!0};function ZT(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:t3,continuation:{tokenize:n3},exit:i3}},text:{91:{name:"gfmFootnoteCall",tokenize:e3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:QT,resolveTo:JT}}}}function QT(e,i,r){const o=this;let h=o.events.length;const m=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let p;for(;h--;){const l=o.events[h][1];if(l.type==="labelImage"){p=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!p||!p._balanced)return r(l);const c=yi(o.sliceSerialize({start:p.end,end:o.now()}));return c.codePointAt(0)!==94||!m.includes(c.slice(1))?r(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),i(l))}}function JT(e,i){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},h={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};h.end.column++,h.end.offset++,h.end._bufferIndex++;const m={type:"gfmFootnoteCallString",start:Object.assign({},h.end),end:Object.assign({},e[e.length-1][1].start)},p={type:"chunkString",contentType:"string",start:Object.assign({},m.start),end:Object.assign({},m.end)},a=[e[r+1],e[r+2],["enter",o,i],e[r+3],e[r+4],["enter",h,i],["exit",h,i],["enter",m,i],["enter",p,i],["exit",p,i],["exit",m,i],e[e.length-2],e[e.length-1],["exit",o,i]];return e.splice(r,e.length-r+1,...a),e}function e3(e,i,r){const o=this,h=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let m=0,p;return a;function a(u){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),l}function l(u){return u!==94?r(u):(e.enter("gfmFootnoteCallMarker"),e.consume(u),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(u){if(m>999||u===93&&!p||u===null||u===91||Ot(u))return r(u);if(u===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return h.includes(yi(o.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):r(u)}return Ot(u)||(p=!0),m++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),m++,c):c(u)}}function t3(e,i,r){const o=this,h=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let m,p=0,a;return l;function l(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):r(w)}function f(w){if(p>999||w===93&&!a||w===null||w===91||Ot(w))return r(w);if(w===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return m=yi(o.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ot(w)||(a=!0),p++,e.consume(w),w===92?u:f}function u(w){return w===91||w===92||w===93?(e.consume(w),p++,f):f(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),h.includes(m)||h.push(m),gt(e,C,"gfmFootnoteDefinitionWhitespace")):r(w)}function C(w){return i(w)}}function n3(e,i,r){return e.check(To,i,e.attempt(XT,i,r))}function i3(e){e.exit("gfmFootnoteDefinition")}function r3(e,i,r){const o=this;return gt(e,h,"gfmFootnoteDefinitionIndent",5);function h(m){const p=o.events[o.events.length-1];return p&&p[1].type==="gfmFootnoteDefinitionIndent"&&p[2].sliceSerialize(p[1],!0).length===4?i(m):r(m)}}function s3(e){let r=(e||{}).singleTilde;const o={name:"strikethrough",tokenize:m,resolveAll:h};return r==null&&(r=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function h(p,a){let l=-1;for(;++l<p.length;)if(p[l][0]==="enter"&&p[l][1].type==="strikethroughSequenceTemporary"&&p[l][1]._close){let c=l;for(;c--;)if(p[c][0]==="exit"&&p[c][1].type==="strikethroughSequenceTemporary"&&p[c][1]._open&&p[l][1].end.offset-p[l][1].start.offset===p[c][1].end.offset-p[c][1].start.offset){p[l][1].type="strikethroughSequence",p[c][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},p[c][1].start),end:Object.assign({},p[l][1].end)},u={type:"strikethroughText",start:Object.assign({},p[c][1].end),end:Object.assign({},p[l][1].start)},y=[["enter",f,a],["enter",p[c][1],a],["exit",p[c][1],a],["enter",u,a]],C=a.parser.constructs.insideSpan.null;C&&ti(y,y.length,0,Oc(C,p.slice(c+1,l),a)),ti(y,y.length,0,[["exit",u,a],["enter",p[l][1],a],["exit",p[l][1],a],["exit",f,a]]),ti(p,c-1,l-c+3,y),l=c+y.length-2;break}}for(l=-1;++l<p.length;)p[l][1].type==="strikethroughSequenceTemporary"&&(p[l][1].type="data");return p}function m(p,a,l){const c=this.previous,f=this.events;let u=0;return y;function y(w){return c===126&&f[f.length-1][1].type!=="characterEscape"?l(w):(p.enter("strikethroughSequenceTemporary"),C(w))}function C(w){const b=Xs(c);if(w===126)return u>1?l(w):(p.consume(w),u++,C);if(u<2&&!r)return l(w);const g=p.exit("strikethroughSequenceTemporary"),_=Xs(w);return g._open=!_||_===2&&!!b,g._close=!b||b===2&&!!_,a(w)}}}class a3{constructor(){this.map=[]}add(i,r,o){o3(this,i,r,o)}consume(i){if(this.map.sort(function(m,p){return m[0]-p[0]}),this.map.length===0)return;let r=this.map.length;const o=[];for(;r>0;)r-=1,o.push(i.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),i.length=this.map[r][0];o.push(i.slice()),i.length=0;let h=o.pop();for(;h;){for(const m of h)i.push(m);h=o.pop()}this.map.length=0}}function o3(e,i,r,o){let h=0;if(!(r===0&&o.length===0)){for(;h<e.map.length;){if(e.map[h][0]===i){e.map[h][1]+=r,e.map[h][2].push(...o);return}h+=1}e.map.push([i,r,o])}}function l3(e,i){let r=!1;const o=[];for(;i<e.length;){const h=e[i];if(r){if(h[0]==="enter")h[1].type==="tableContent"&&o.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(h[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const m=o.length-1;o[m]=o[m]==="left"?"center":"right"}}else if(h[1].type==="tableDelimiterRow")break}else h[0]==="enter"&&h[1].type==="tableDelimiterRow"&&(r=!0);i+=1}return o}function c3(){return{flow:{null:{name:"table",tokenize:u3,resolveAll:h3}}}}function u3(e,i,r){const o=this;let h=0,m=0,p;return a;function a(T){let P=o.events.length-1;for(;P>-1;){const $=o.events[P][1].type;if($==="lineEnding"||$==="linePrefix")P--;else break}const B=P>-1?o.events[P][1].type:null,F=B==="tableHead"||B==="tableRow"?x:l;return F===x&&o.parser.lazy[o.now().line]?r(T):F(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),c(T)}function c(T){return T===124||(p=!0,m+=1),f(T)}function f(T){return T===null?r(T):je(T)?m>1?(m=0,o.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),C):r(T):st(T)?gt(e,f,"whitespace")(T):(m+=1,p&&(p=!1,h+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p=!0,f):(e.enter("data"),u(T)))}function u(T){return T===null||T===124||Ot(T)?(e.exit("data"),f(T)):(e.consume(T),T===92?y:u)}function y(T){return T===92||T===124?(e.consume(T),u):u(T)}function C(T){return o.interrupt=!1,o.parser.lazy[o.now().line]?r(T):(e.enter("tableDelimiterRow"),p=!1,st(T)?gt(e,w,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):w(T))}function w(T){return T===45||T===58?g(T):T===124?(p=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),b):R(T)}function b(T){return st(T)?gt(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(m+=1,p=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),_):T===45?(m+=1,_(T)):T===null||je(T)?D(T):R(T)}function _(T){return T===45?(e.enter("tableDelimiterFiller"),v(T)):R(T)}function v(T){return T===45?(e.consume(T),v):T===58?(p=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(T))}function S(T){return st(T)?gt(e,D,"whitespace")(T):D(T)}function D(T){return T===124?w(T):T===null||je(T)?!p||h!==m?R(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(T)):R(T)}function R(T){return r(T)}function x(T){return e.enter("tableRow"),M(T)}function M(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),M):T===null||je(T)?(e.exit("tableRow"),i(T)):st(T)?gt(e,M,"whitespace")(T):(e.enter("data"),k(T))}function k(T){return T===null||T===124||Ot(T)?(e.exit("data"),M(T)):(e.consume(T),T===92?L:k)}function L(T){return T===92||T===124?(e.consume(T),k):k(T)}}function h3(e,i){let r=-1,o=!0,h=0,m=[0,0,0,0],p=[0,0,0,0],a=!1,l=0,c,f,u;const y=new a3;for(;++r<e.length;){const C=e[r],w=C[1];C[0]==="enter"?w.type==="tableHead"?(a=!1,l!==0&&(qv(y,i,l,c,f),f=void 0,l=0),c={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(r,0,[["enter",c,i]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(o=!0,u=void 0,m=[0,0,0,0],p=[0,r+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(r,0,[["enter",f,i]])),h=w.type==="tableDelimiterRow"?2:f?3:1):h&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(o=!1,p[2]===0&&(m[1]!==0&&(p[0]=p[1],u=ic(y,i,m,h,void 0,u),m=[0,0,0,0]),p[2]=r)):w.type==="tableCellDivider"&&(o?o=!1:(m[1]!==0&&(p[0]=p[1],u=ic(y,i,m,h,void 0,u)),m=p,p=[m[1],r,0,0])):w.type==="tableHead"?(a=!0,l=r):w.type==="tableRow"||w.type==="tableDelimiterRow"?(l=r,m[1]!==0?(p[0]=p[1],u=ic(y,i,m,h,r,u)):p[1]!==0&&(u=ic(y,i,p,h,r,u)),h=0):h&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(p[3]=r)}for(l!==0&&qv(y,i,l,c,f),y.consume(i.events),r=-1;++r<i.events.length;){const C=i.events[r];C[0]==="enter"&&C[1].type==="table"&&(C[1]._align=l3(i.events,r))}return e}function ic(e,i,r,o,h,m){const p=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(m.end=Object.assign({},$s(i.events,r[0])),e.add(r[0],0,[["exit",m,i]]));const l=$s(i.events,r[1]);if(m={type:p,start:Object.assign({},l),end:Object.assign({},l)},e.add(r[1],0,[["enter",m,i]]),r[2]!==0){const c=$s(i.events,r[2]),f=$s(i.events,r[3]),u={type:a,start:Object.assign({},c),end:Object.assign({},f)};if(e.add(r[2],0,[["enter",u,i]]),o!==2){const y=i.events[r[2]],C=i.events[r[3]];if(y[1].end=Object.assign({},C[1].end),y[1].type="chunkText",y[1].contentType="text",r[3]>r[2]+1){const w=r[2]+1,b=r[3]-r[2]-1;e.add(w,b,[])}}e.add(r[3]+1,0,[["exit",u,i]])}return h!==void 0&&(m.end=Object.assign({},$s(i.events,h)),e.add(h,0,[["exit",m,i]]),m=void 0),m}function qv(e,i,r,o,h){const m=[],p=$s(i.events,r);h&&(h.end=Object.assign({},p),m.push(["exit",h,i])),o.end=Object.assign({},p),m.push(["exit",o,i]),e.add(r+1,0,m)}function $s(e,i){const r=e[i],o=r[0]==="enter"?"start":"end";return r[1][o]}const d3={name:"tasklistCheck",tokenize:g3};function f3(){return{text:{91:d3}}}function g3(e,i,r){const o=this;return h;function h(l){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?r(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),m)}function m(l){return Ot(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),p):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),p):r(l)}function p(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):r(l)}function a(l){return je(l)?i(l):st(l)?e.check({tokenize:p3},i,r)(l):r(l)}}function p3(e,i,r){return gt(e,o,"whitespace");function o(h){return h===null?r(h):i(h)}}function m3(e){return Nb([HT(),ZT(),s3(e),c3(),f3()])}const _3={};function v3(e){const i=this,r=e||_3,o=i.data(),h=o.micromarkExtensions||(o.micromarkExtensions=[]),m=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),p=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);h.push(m3(r)),m.push(FT()),p.push(zT(r))}const Wv=(function(e,i,r){const o=Mo(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof i=="number"){if(i<0||i===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(i=e.children.indexOf(i),i<0)throw new Error("Expected child node or index");for(;++i<e.children.length;)if(o(e.children[i],i,e))return e.children[i]}),rs=(function(e){if(e==null)return S3;if(typeof e=="string")return y3(e);if(typeof e=="object")return b3(e);if(typeof e=="function")return Rf(e);throw new Error("Expected function, string, or array as `test`")});function b3(e){const i=[];let r=-1;for(;++r<e.length;)i[r]=rs(e[r]);return Rf(o);function o(...h){let m=-1;for(;++m<i.length;)if(i[m].apply(this,h))return!0;return!1}}function y3(e){return Rf(i);function i(r){return r.tagName===e}}function Rf(e){return i;function i(r,o,h){return!!(C3(r)&&e.call(this,r,typeof o=="number"?o:void 0,h||void 0))}}function S3(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function C3(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Gv=/\n/g,Kv=/[\t ]+/g,Wd=rs("br"),Vv=rs(T3),E3=rs("p"),Yv=rs("tr"),w3=rs(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",R3,M3]),x1=rs(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function x3(e,i){const r=i||{},o="children"in e?e.children:[],h=x1(e),m=k1(e,{whitespace:r.whitespace||"normal"}),p=[];(e.type==="text"||e.type==="comment")&&p.push(...A1(e,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<o.length;)p.push(...D1(o[a],e,{whitespace:m,breakBefore:a?void 0:h,breakAfter:a<o.length-1?Wd(o[a+1]):h}));const l=[];let c;for(a=-1;++a<p.length;){const f=p[a];typeof f=="number"?c!==void 0&&f>c&&(c=f):f&&(c!==void 0&&c>-1&&l.push(`
181
- `.repeat(c)||" "),c=-1,l.push(f))}return l.join("")}function D1(e,i,r){return e.type==="element"?D3(e,i,r):e.type==="text"?r.whitespace==="normal"?A1(e,r):A3(e):[]}function D3(e,i,r){const o=k1(e,r),h=e.children||[];let m=-1,p=[];if(w3(e))return p;let a,l;for(Wd(e)||Yv(e)&&Wv(i,e,Yv)?l=`
182
- `:E3(e)?(a=2,l=2):x1(e)&&(a=1,l=1);++m<h.length;)p=p.concat(D1(h[m],e,{whitespace:o,breakBefore:m?void 0:a,breakAfter:m<h.length-1?Wd(h[m+1]):l}));return Vv(e)&&Wv(i,e,Vv)&&p.push(" "),a&&p.unshift(a),l&&p.push(l),p}function A1(e,i){const r=String(e.value),o=[],h=[];let m=0;for(;m<=r.length;){Gv.lastIndex=m;const l=Gv.exec(r),c=l&&"index"in l?l.index:r.length;o.push(k3(r.slice(m,c).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),m===0?i.breakBefore:!0,c===r.length?i.breakAfter:!0)),m=c+1}let p=-1,a;for(;++p<o.length;)o[p].charCodeAt(o[p].length-1)===8203||p<o.length-1&&o[p+1].charCodeAt(0)===8203?(h.push(o[p]),a=void 0):o[p]?(typeof a=="number"&&h.push(a),h.push(o[p]),a=0):(p===0||p===o.length-1)&&h.push(0);return h}function A3(e){return[String(e.value)]}function k3(e,i,r){const o=[];let h=0,m;for(;h<e.length;){Kv.lastIndex=h;const p=Kv.exec(e);m=p?p.index:e.length,!h&&!m&&p&&!i&&o.push(""),h!==m&&o.push(e.slice(h,m)),h=p?m+p[0].length:m}return h!==m&&!r&&o.push(""),o.join(" ")}function k1(e,i){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":i.whitespace;case"textarea":return"pre-wrap"}}return i.whitespace}function R3(e){return!!(e.properties||{}).hidden}function T3(e){return e.tagName==="td"||e.tagName==="th"}function M3(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function L3(e){const i=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",h="[a-zA-Z_]\\w*::",p="(?!struct)("+o+"|"+i.optional(h)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:i.optional(h)+e.IDENT_RE,relevance:0},C=i.optional(h)+e.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:b,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},R={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:i.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},x=[R,u,a,r,e.C_BLOCK_COMMENT_MODE,f,c],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:x.concat([{begin:/\(/,end:/\)/,keywords:D,contains:x.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+p+"[\\*&\\s]+)+"+C,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:D,relevance:0},{begin:C,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,c,f,a,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,c,f,a]}]},a,r,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,k,R,x,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function O3(e){const i={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},r=L3(e),o=r.keywords;return o.type=[...o.type,...i.type],o.literal=[...o.literal,...i.literal],o.built_in=[...o.built_in,...i.built_in],o._hints=i._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function B3(e){const i=e.regex,r={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});const h={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},m=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),p={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,h]};h.contains.push(a);const l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},f={match:/\\'/},u={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],C=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],_={match:/(\/[a-z._-]+)+/},v=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],D=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],R=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:g,built_in:[...v,...S,"set","shopt",...D,...R]},contains:[C,e.SHEBANG(),w,u,m,p,_,a,l,c,f,r]}}function N3(e){const i=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",h="[a-zA-Z_]\\w*::",p="("+o+"|"+i.optional(h)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:i.optional(h)+e.IDENT_RE,relevance:0},C=i.optional(h)+e.IDENT_RE+"\\s*\\(",g={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},_=[u,a,r,e.C_BLOCK_COMMENT_MODE,f,c],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:_.concat([{begin:/\(/,end:/\)/,keywords:g,contains:_.concat(["self"]),relevance:0}]),relevance:0},S={begin:"("+p+"[\\*&\\s]+)+"+C,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:g,relevance:0},{begin:C,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,c,f,a,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,c,f,a]}]},a,r,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C",aliases:["h"],keywords:g,disableAutodetect:!0,illegal:"</",contains:[].concat(v,S,_,[u,{begin:e.IDENT_RE+"::",keywords:g},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:u,strings:c,keywords:g}}}function I3(e){const i=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",h="[a-zA-Z_]\\w*::",p="(?!struct)("+o+"|"+i.optional(h)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},u={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:i.optional(h)+e.IDENT_RE,relevance:0},C=i.optional(h)+e.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],_=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],D={type:b,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},R={className:"function.dispatch",relevance:0,keywords:{_hint:_},begin:i.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},x=[R,u,a,r,e.C_BLOCK_COMMENT_MODE,f,c],M={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:x.concat([{begin:/\(/,end:/\)/,keywords:D,contains:x.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+p+"[\\*&\\s]+)+"+C,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:D,relevance:0},{begin:C,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,c,f,a,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,c,f,a]}]},a,r,e.C_BLOCK_COMMENT_MODE,u]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(M,k,R,x,[u,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:D,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function F3(e){const i=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],o=["default","false","null","true"],h=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],m=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],p={keyword:h.concat(m),built_in:i,literal:o},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=e.inherit(f,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:p},C=e.inherit(y,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,C]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},g=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},C]});y.contains=[b,w,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],C.contains=[g,w,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const _={variants:[c,b,w,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},S=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:p,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},_,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,v,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,v,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+S+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:p,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,v],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:p,relevance:0,contains:[_,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},D]}}const z3=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),P3=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],U3=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],H3=[...P3,...U3],j3=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),$3=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),q3=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),W3=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function G3(e){const i=e.regex,r=z3(e),o={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},h="and or not only",m=/@-?\w[\w]*(-\w+)*/,p="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,o,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+p,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+$3.join("|")+")"},{begin:":(:)?("+q3.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+W3.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:i.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:m},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:h,attribute:j3.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+H3.join("|")+")\\b"}]}}function K3(e){const i=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:i.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:i.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function V3(e){const m={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:m,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:m,illegal:/["']/}]}]}}function Y3(e){const i=e.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:i.concat(r,i.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function X3(e){const i=e.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},o=e.COMMENT();o.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const h={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},m={className:"literal",begin:/\bon|off|true|false|yes|no\b/},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[o,m,h,p,r,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,f=/'[^']*'/,u=i.either(l,c,f),y=i.concat(u,"(\\s*\\.\\s*",u,")*",i.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[o,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[o,a,m,h,p,r]}}]}}var qs="[0-9](_*[0-9])*",rc=`\\.(${qs})`,sc="[0-9a-fA-F](_*[0-9a-fA-F])*",Xv={className:"number",variants:[{begin:`(\\b(${qs})((${rc})|\\.)?|(${rc}))[eE][+-]?(${qs})[fFdD]?\\b`},{begin:`\\b(${qs})((${rc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${rc})[fFdD]?\\b`},{begin:`\\b(${qs})[fFdD]\\b`},{begin:`\\b0[xX]((${sc})\\.?|(${sc})?\\.(${sc}))[pP][+-]?(${qs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${sc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function R1(e,i,r){return r===-1?"":e.replace(i,o=>R1(e,i,r-1))}function Z3(e){const i=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",o=r+R1("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[i.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],className:{1:"keyword",3:"title.class"},contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+o+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Xv,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Xv,c]}}const Zv="[A-Za-z$_][0-9A-Za-z$_]*",Q3=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],J3=["true","false","null","undefined","NaN","Infinity"],T1=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],M1=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],L1=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],eM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tM=[].concat(L1,T1,M1);function nM(e){const i=e.regex,r=(X,{after:U})=>{const O="</"+X[0].slice(1);return X.input.indexOf(O,U)!==-1},o=Zv,h={begin:"<>",end:"</>"},m=/<[A-Za-z0-9\\._:-]+\s*\/>/,p={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,U)=>{const O=X[0].length+X.index,z=X.input[O];if(z==="<"||z===","){U.ignoreMatch();return}z===">"&&(r(X,{after:O})||U.ignoreMatch());let j;const H=X.input.substring(O);if(j=H.match(/^\s*=/)){U.ignoreMatch();return}if((j=H.match(/^\s+extends\s+/))&&j.index===0){U.ignoreMatch();return}}},a={$pattern:Zv,keyword:Q3,literal:J3,built_in:tM,"variable.language":eM},l="[0-9](_?[0-9])*",c=`\\.(${l})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${f})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${f})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},v={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,w,b,g,{match:/\$\d+/},u];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(S)});const D=[].concat(v,y.contains),R=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(D)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:R},M={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,i.concat(o,"(",i.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:i.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...T1,...M1]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(X){return i.concat("(?!",X.join("|"),")")}const F={match:i.concat(/\b/,B([...L1,"super","import"].map(X=>`${X}\\s*\\(`)),o,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:i.concat(/\./,i.lookahead(i.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},W="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(W)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,w,b,g,v,{match:/\$\d+/},u,k,{scope:"attr",match:o+i.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,e.REGEXP_MODE,{className:"function",begin:W,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:h.begin,end:h.end},{match:m},{begin:p.begin,"on:begin":p.isTrulyOpeningTag,end:p.end}],subLanguage:"xml",contains:[{begin:p.begin,end:p.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},F,P,M,q,{match:/\$[(.]/}]}}function iM(e){const i={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],h={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:o},contains:[i,r,e.QUOTE_STRING_MODE,h,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ws="[0-9](_*[0-9])*",ac=`\\.(${Ws})`,oc="[0-9a-fA-F](_*[0-9a-fA-F])*",rM={className:"number",variants:[{begin:`(\\b(${Ws})((${ac})|\\.)?|(${ac}))[eE][+-]?(${Ws})[fFdD]?\\b`},{begin:`\\b(${Ws})((${ac})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ac})[fFdD]?\\b`},{begin:`\\b(${Ws})[fFdD]\\b`},{begin:`\\b0[xX]((${oc})\\.?|(${oc})?\\.(${oc}))[pP][+-]?(${Ws})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${oc})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function sM(e){const i={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},o={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},h={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},m={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},p={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[m,h]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,m,h]}]};h.contains.push(p);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(p,{className:"string"}),"self"]}]},c=rM,f=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),u={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=u;return y.variants[1].contains=[u],u.variants[1].contains=[y],{name:"Kotlin",aliases:["kt","kts"],keywords:i,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,f,r,o,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:i,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[u,e.C_LINE_COMMENT_MODE,f],relevance:0},e.C_LINE_COMMENT_MODE,f,a,l,p,e.C_NUMBER_MODE]},f]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},p,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
183
- `},c]}}const aM=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),oM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],lM=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],cM=[...oM,...lM],uM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),O1=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),B1=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hM=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),dM=O1.concat(B1).sort().reverse();function fM(e){const i=aM(e),r=dM,o="and or not only",h="[\\w-]+",m="("+h+"|@\\{"+h+"\\})",p=[],a=[],l=function(S){return{className:"string",begin:"~?"+S+".*?"+S}},c=function(S,D,R){return{className:S,begin:D,relevance:R}},f={$pattern:/[a-z-]+/,keyword:o,attribute:uM.join(" ")},u={begin:"\\(",end:"\\)",contains:a,keywords:f,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),i.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},i.HEXCOLOR,u,c("variable","@@?"+h,10),c("variable","@\\{"+h+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:h+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},i.IMPORTANT,{beginKeywords:"and not"},i.FUNCTION_DISPATCH);const y=a.concat({begin:/\{/,end:/\}/,contains:p}),C={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},w={begin:m+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hM.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:f,returnEnd:!0,contains:a,relevance:0}},g={className:"variable",variants:[{begin:"@"+h+"\\s*:",relevance:15},{begin:"@"+h}],starts:{end:"[;}]",returnEnd:!0,contains:y}},_={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:m,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,C,c("keyword","all\\b"),c("variable","@\\{"+h+"\\}"),{begin:"\\b("+cM.join("|")+")\\b",className:"selector-tag"},i.CSS_NUMBER_MODE,c("selector-tag",m,0),c("selector-id","#"+m),c("selector-class","\\."+m,0),c("selector-tag","&",0),i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+O1.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+B1.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},i.FUNCTION_DISPATCH]},v={begin:h+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[_]};return p.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,g,v,w,_,C,i.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:p}}function gM(e){const i="\\[=*\\[",r="\\]=*\\]",o={begin:i,end:r,contains:["self"]},h=[e.COMMENT("--(?!"+i+")","$"),e.COMMENT("--"+i,r,{contains:[o],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:h.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:h}].concat(h)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:i,end:r,contains:[o],relevance:5}])}}function pM(e){const i={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i]},o={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[i,r]},h={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},m={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},p={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[i]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,i,r,o,h,m,p]}}function mM(e){const i=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={begin:"^[-\\*]{3,}",end:"$"},h={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},m={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},p={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:i.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),y=e.inherit(f,{contains:[]});c.contains.push(y),f.contains.push(u);let C=[r,l];return[c,f,u,y].forEach(_=>{_.contains=_.contains.concat(C)}),C=C.concat(c,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:C},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:C}]}]},r,m,c,f,{className:"quote",begin:"^>\\s+",contains:C,end:"$"},h,o,l,p,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function _M(e){const i={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function vM(e){const i=e.regex,r=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],o=/[dualxmsipngr]{0,12}/,h={$pattern:/[\w.]+/,keyword:r.join(" ")},m={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:h},p={begin:/->\{/,end:/\}/},a={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:i.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[a]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},f=[e.BACKSLASH_ESCAPE,m,l],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(b,g,_="\\1")=>{const v=_==="\\1"?_:i.concat(_,g);return i.concat(i.concat("(?:",b,")"),g,/(?:\\.|[^\\\/])*?/,v,/(?:\\.|[^\\\/])*?/,_,o)},C=(b,g,_)=>i.concat(i.concat("(?:",b,")"),g,/(?:\\.|[^\\\/])*?/,_,o),w=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),p,{className:"string",contains:f,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",i.either(...u,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:C("(?:m|qr)?",/\//,/\//)},{begin:C("m|qr",i.either(...u,{capture:!0}),/\1/)},{begin:C("m|qr",/\(/,/\)/)},{begin:C("m|qr",/\[/,/\]/)},{begin:C("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,a,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return m.contains=w,p.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:h,contains:w}}function bM(e){const i=e.regex,r=/(?![A-Za-z0-9])(?![$])/,o=i.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),h=i.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),m=i.concat(/[A-Z]+/,r),p={scope:"variable",match:"\\$+"+o},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),f=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":($,q)=>{q.data._beginMatch=$[1]||$[2]},"on:end":($,q)=>{q.data._beginMatch!==$[1]&&q.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),C=`[
184
- ]`,w={scope:"string",variants:[f,c,u,y]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},g=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],v=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],D={keyword:_,literal:($=>{const q=[];return $.forEach(W=>{q.push(W),W.toLowerCase()===W?q.push(W.toUpperCase()):q.push(W.toLowerCase())}),q})(g),built_in:v},R=$=>$.map(q=>q.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,i.concat(C,"+"),i.concat("(?!",R(v).join("\\b|"),"\\b)"),h],scope:{1:"keyword",4:"title.class"}}]},M=i.concat(o,"\\b(?!\\()"),k={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),M],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[h,i.concat(/::/,i.lookahead(/(?!class\b)/)),M],scope:{1:"title.class",3:"variable.constant"}},{match:[h,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[h,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},L={scope:"attr",match:i.concat(o,i.lookahead(":"),i.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[L,p,k,e.C_BLOCK_COMMENT_MODE,w,b,x]},P={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",R(_).join("\\b|"),"|",R(v).join("\\b|"),"\\b)"),o,i.concat(C,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[T]};T.contains.push(P);const B=[L,k,e.C_BLOCK_COMMENT_MODE,w,b,x],F={begin:i.concat(/#\[\s*\\?/,i.either(h,m)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:h},{match:m}]}]};return{case_insensitive:!1,keywords:D,contains:[F,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},p,P,k,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:D,contains:["self",F,p,k,e.C_BLOCK_COMMENT_MODE,w,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},w,b]}}function yM(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function SM(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function CM(e){const i=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},f={begin:/\{\{/,relevance:0},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,f,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,f,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",C=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,w=`\\b|${o.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${C}))[eE][+-]?(${y})[jJ]?(?=${w})`},{begin:`(${C})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b(${y})[jJ](?=${w})`}]},g={className:"comment",begin:i.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,b,u,e.HASH_COMMENT_MODE]}]};return c.contains=[u,b,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},u,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,_,u]}]}}function EM(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function wM(e){const i=e.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,o=i.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),h=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,m=i.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:i.lookahead(i.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[h,o]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,o]},{scope:{1:"punctuation",2:"number"},match:[m,o]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,o]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:h},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:m},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function xM(e){const i=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",o=i.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),h=i.concat(o,/(::\w+)*/),p={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:p},u={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:i.concat(/<<[-~]?'?/,i.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},y="[1-9](_?[0-9])*|0",C="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${C}))?([eE][+-]?(${C})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:p}]},x=[u,{variants:[{match:[/class\s+/,h,/\s+<\s+/,h]},{match:[/\b(class|module)\s+/,h]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:p},{match:[/(include|extend)\s+/,h],scope:{2:"title.class"},keywords:p},{relevance:0,match:[h,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:o,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:r}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:p},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);f.contains=x,b.contains=x;const T=[{begin:/^\s*=>/,starts:{end:"$",contains:x}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:p,contains:x}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:p,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(T).concat(c).concat(x)}}function DM(e){const i=e.regex,r=/(r#)?/,o=i.concat(r,e.UNDERSCORE_IDENT_RE),h=i.concat(r,e.IDENT_RE),m={className:"title.function.invoke",relevance:0,begin:i.concat(/\b/,/(?!let|for|while|if|else|match\b)/,h,i.lookahead(/\s*\(/))},p="([ui](8|16|32|64|128|size)|f(32|64))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:f,keyword:a,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+p},{begin:"\\b0o([0-7_]+)"+p},{begin:"\\b0x([A-Fa-f0-9_]+)"+p},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+p}],relevance:0},{begin:[/fn/,/\s+/,o],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,o],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,o,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:f}},{className:"punctuation",begin:"->"},m]}}const AM=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),kM=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],RM=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],TM=[...kM,...RM],MM=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),LM=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),OM=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),BM=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function NM(e){const i=AM(e),r=OM,o=LM,h="@[a-z-]+",m="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+TM.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[i.CSS_NUMBER_MODE]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+BM.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[i.BLOCK_COMMENT,a,i.HEXCOLOR,i.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i.IMPORTANT,i.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:h,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:m,attribute:MM.join(" ")},contains:[{begin:h,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i.HEXCOLOR,i.CSS_NUMBER_MODE]},i.FUNCTION_DISPATCH]}}function IM(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function FM(e){const i=e.regex,r=e.COMMENT("--","$"),o={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},h={begin:/"/,end:/"/,contains:[{match:/""/}]},m=["true","false","unknown"],p=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],u=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],C=f,w=[...c,...l].filter(R=>!f.includes(R)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},g={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:i.concat(/\b/,i.either(...C),/\s*\(/),relevance:0,keywords:{built_in:C}};function v(R){return i.concat(/\b/,i.either(...R.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:v(y),relevance:0};function D(R,{exceptions:x,when:M}={}){const k=M;return x=x||[],R.map(L=>L.match(/\|\d+$/)||x.includes(L)?L:k(L)?`${L}|0`:L)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(w,{when:R=>R.length<3}),literal:m,type:a,built_in:u},contains:[{scope:"type",match:v(p)},S,_,b,o,h,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,g]}}function N1(e){return e?typeof e=="string"?e:e.source:null}function so(e){return Tt("(?=",e,")")}function Tt(...e){return e.map(r=>N1(r)).join("")}function zM(e){const i=e[e.length-1];return typeof i=="object"&&i.constructor===Object?(e.splice(e.length-1,1),i):{}}function Tn(...e){return"("+(zM(e).capture?"":"?:")+e.map(o=>N1(o)).join("|")+")"}const Tf=e=>Tt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),PM=["Protocol","Type"].map(Tf),Qv=["init","self"].map(Tf),UM=["Any","Self"],yd=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Jv=["false","nil","true"],HM=["assignment","associativity","higherThan","left","lowerThan","none","right"],jM=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],e0=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],I1=Tn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),F1=Tn(I1,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Sd=Tt(I1,F1,"*"),z1=Tn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Ec=Tn(z1,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ai=Tt(z1,Ec,"*"),lc=Tt(/[A-Z]/,Ec,"*"),$M=["attached","autoclosure",Tt(/convention\(/,Tn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Tt(/objc\(/,Ai,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],qM=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function WM(e){const i={match:/\s+/,relevance:0},r=e.COMMENT("/\\*","\\*/",{contains:["self"]}),o=[e.C_LINE_COMMENT_MODE,r],h={match:[/\./,Tn(...PM,...Qv)],className:{2:"keyword"}},m={match:Tt(/\./,Tn(...yd)),relevance:0},p=yd.filter(Me=>typeof Me=="string").concat(["_|0"]),a=yd.filter(Me=>typeof Me!="string").concat(UM).map(Tf),l={variants:[{className:"keyword",match:Tn(...a,...Qv)}]},c={$pattern:Tn(/\b\w+/,/#\w+/),keyword:p.concat(jM),literal:Jv},f=[h,m,l],u={match:Tt(/\./,Tn(...e0)),relevance:0},y={className:"built_in",match:Tt(/\b/,Tn(...e0),/(?=\()/)},C=[u,y],w={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:Sd},{match:`\\.(\\.|${F1})+`}]},g=[w,b],_="([0-9]_*)+",v="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${_})(\\.(${_}))?([eE][+-]?(${_}))?\\b`},{match:`\\b0x(${v})(\\.(${v}))?([pP][+-]?(${_}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},D=(Me="")=>({className:"subst",variants:[{match:Tt(/\\/,Me,/[0\\tnr"']/)},{match:Tt(/\\/,Me,/u\{[0-9a-fA-F]{1,8}\}/)}]}),R=(Me="")=>({className:"subst",match:Tt(/\\/,Me,/[\t ]*(?:[\r\n]|\r\n)/)}),x=(Me="")=>({className:"subst",label:"interpol",begin:Tt(/\\/,Me,/\(/),end:/\)/}),M=(Me="")=>({begin:Tt(Me,/"""/),end:Tt(/"""/,Me),contains:[D(Me),R(Me),x(Me)]}),k=(Me="")=>({begin:Tt(Me,/"/),end:Tt(/"/,Me),contains:[D(Me),x(Me)]}),L={className:"string",variants:[M(),M("#"),M("##"),M("###"),k(),k("#"),k("##"),k("###")]},T=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],P={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},B=Me=>{const ke=Tt(Me,/\//),Bt=Tt(/\//,Me);return{begin:ke,end:Bt,contains:[...T,{scope:"comment",begin:`#(?!.*${Bt})`,end:/$/}]}},F={scope:"regexp",variants:[B("###"),B("##"),B("#"),P]},$={match:Tt(/`/,Ai,/`/)},q={className:"variable",match:/\$\d+/},W={className:"variable",match:`\\$${Ec}+`},K=[$,q,W],X={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:qM,contains:[...g,S,L]}]}},U={scope:"keyword",match:Tt(/@/,Tn(...$M),so(Tn(/\(/,/\s+/)))},O={scope:"meta",match:Tt(/@/,Ai)},z=[X,U,O],j={match:so(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Tt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Ec,"+")},{className:"type",match:lc,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Tt(/\s+&\s+/,so(lc)),relevance:0}]},H={begin:/</,end:/>/,keywords:c,contains:[...o,...f,...z,w,j]};j.contains.push(H);const ee={match:Tt(Ai,/\s*:/),keywords:"_|0",relevance:0},he={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",ee,...o,F,...f,...C,...g,S,L,...K,...z,j]},se={begin:/</,end:/>/,keywords:"repeat each",contains:[...o,j]},Z={begin:Tn(so(Tt(Ai,/\s*:/)),so(Tt(Ai,/\s+/,Ai,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ai}]},G={begin:/\(/,end:/\)/,keywords:c,contains:[Z,...o,...f,...g,S,L,...z,j,he],endsParent:!0,illegal:/["']/},re={match:[/(func|macro)/,/\s+/,Tn($.match,Ai,Sd)],className:{1:"keyword",3:"title.function"},contains:[se,G,i],illegal:[/\[/,/%/]},ne={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[se,G,i],illegal:/\[|%/},ve={match:[/operator/,/\s+/,Sd],className:{1:"keyword",3:"title"}},me={begin:[/precedencegroup/,/\s+/,lc],className:{1:"keyword",3:"title"},contains:[j],keywords:[...HM,...Jv],end:/}/},Te={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},xe={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ve={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ai,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[se,...f,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:lc},...f],relevance:0}]};for(const Me of L.variants){const ke=Me.contains.find(Gt=>Gt.label==="interpol");ke.keywords=c;const Bt=[...f,...C,...g,S,L,...K];ke.contains=[...Bt,{begin:/\(/,end:/\)/,contains:["self",...Bt]}]}return{name:"Swift",keywords:c,contains:[...o,re,ne,Te,xe,Ve,ve,me,{beginKeywords:"import",end:/$/,contains:[...o],relevance:0},F,...f,...C,...g,S,L,...K,...z,j,he]}}const wc="[A-Za-z$_][0-9A-Za-z$_]*",P1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],U1=["true","false","null","undefined","NaN","Infinity"],H1=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],j1=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$1=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],q1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],W1=[].concat($1,H1,j1);function GM(e){const i=e.regex,r=(X,{after:U})=>{const O="</"+X[0].slice(1);return X.input.indexOf(O,U)!==-1},o=wc,h={begin:"<>",end:"</>"},m=/<[A-Za-z0-9\\._:-]+\s*\/>/,p={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,U)=>{const O=X[0].length+X.index,z=X.input[O];if(z==="<"||z===","){U.ignoreMatch();return}z===">"&&(r(X,{after:O})||U.ignoreMatch());let j;const H=X.input.substring(O);if(j=H.match(/^\s*=/)){U.ignoreMatch();return}if((j=H.match(/^\s+extends\s+/))&&j.index===0){U.ignoreMatch();return}}},a={$pattern:wc,keyword:P1,literal:U1,built_in:W1,"variable.language":q1},l="[0-9](_?[0-9])*",c=`\\.(${l})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",u={className:"number",variants:[{begin:`(\\b(${f})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${f})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},v={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,w,b,g,{match:/\$\d+/},u];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(S)});const D=[].concat(v,y.contains),R=D.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(D)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:R},M={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,i.concat(o,"(",i.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:i.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...H1,...j1]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(X){return i.concat("(?!",X.join("|"),")")}const F={match:i.concat(/\b/,B([...$1,"super","import"].map(X=>`${X}\\s*\\(`)),o,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},$={begin:i.concat(/\./,i.lookahead(i.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},W="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",K={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(W)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,w,b,g,v,{match:/\$\d+/},u,k,{scope:"attr",match:o+i.lookahead(":"),relevance:0},K,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[v,e.REGEXP_MODE,{className:"function",begin:W,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:h.begin,end:h.end},{match:m},{begin:p.begin,"on:begin":p.isTrulyOpeningTag,end:p.end}],subLanguage:"xml",contains:[{begin:p.begin,end:p.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},$,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},F,P,M,q,{match:/\$[(.]/}]}}function KM(e){const i=e.regex,r=GM(e),o=wc,h=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],m={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},p={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:h},contains:[r.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:wc,keyword:P1.concat(l),literal:U1,built_in:W1.concat(h),"variable.language":q1},f={className:"meta",begin:"@"+o},u=(b,g,_)=>{const v=b.contains.findIndex(S=>S.label===g);if(v===-1)throw new Error("can not find mode to replace");b.contains.splice(v,1,_)};Object.assign(r.keywords,c),r.exports.PARAMS_CONTAINS.push(f);const y=r.contains.find(b=>b.scope==="attr"),C=Object.assign({},y,{match:i.concat(o,i.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,y,C]),r.contains=r.contains.concat([f,m,p,C]),u(r,"shebang",e.SHEBANG()),u(r,"use_strict",a);const w=r.contains.find(b=>b.label==="func.def");return w.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function VM(e){const i=e.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},o={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},h=/\d{1,2}\/\d{1,2}\/\d{4}/,m=/\d{4}-\d{1,2}-\d{1,2}/,p=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:i.concat(/# */,i.either(m,h),/ *#/)},{begin:i.concat(/# */,a,/ *#/)},{begin:i.concat(/# */,p,/ *#/)},{begin:i.concat(/# */,i.either(m,h),/ +/,i.either(p,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},u=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[r,o,l,c,f,u,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}function YM(e){e.regex;const i=e.COMMENT(/\(;/,/;\)/);i.contains.push("self");const r=e.COMMENT(/;;/,/$/),o=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],h={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},m={className:"variable",begin:/\$[\w_]+/},p={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:o},contains:[r,i,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},m,p,h,e.QUOTE_STRING_MODE,l,c,a]}}function XM(e){const i=e.regex,r=i.concat(/[\p{L}_]/u,i.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,h={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},m={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},p=e.inherit(m,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[h]},{begin:/'/,end:/'/,contains:[h]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[m,l,a,p,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[m,p,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},h,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:i.concat(/</,i.lookahead(i.concat(r,i.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:c}]},{className:"tag",begin:i.concat(/<\//,i.lookahead(i.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ZM(e){const i="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},h={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},m={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},p={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,h]},a=e.inherit(p,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},C={end:",",endsWithParent:!0,excludeEnd:!0,keywords:i,relevance:0},w={begin:/\{/,end:/\}/,contains:[C],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[C],illegal:"\\n",relevance:0},g=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:i,keywords:{literal:i}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},w,b,m,p],_=[...g];return _.pop(),_.push(a),C.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}const QM={arduino:O3,bash:B3,c:N3,cpp:I3,csharp:F3,css:G3,diff:K3,go:V3,graphql:Y3,ini:X3,java:Z3,javascript:nM,json:iM,kotlin:sM,less:fM,lua:gM,makefile:pM,markdown:mM,objectivec:_M,perl:vM,php:bM,"php-template":yM,plaintext:SM,python:CM,"python-repl":EM,r:wM,ruby:xM,rust:DM,scss:NM,shell:IM,sql:FM,swift:WM,typescript:KM,vbnet:VM,wasm:YM,xml:XM,yaml:ZM};var Cd,t0;function JM(){if(t0)return Cd;t0=1;function e(Q){return Q instanceof Map?Q.clear=Q.delete=Q.set=function(){throw new Error("map is read-only")}:Q instanceof Set&&(Q.add=Q.clear=Q.delete=function(){throw new Error("set is read-only")}),Object.freeze(Q),Object.getOwnPropertyNames(Q).forEach(de=>{const ye=Q[de],Le=typeof ye;(Le==="object"||Le==="function")&&!Object.isFrozen(ye)&&e(ye)}),Q}class i{constructor(de){de.data===void 0&&(de.data={}),this.data=de.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(Q){return Q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function o(Q,...de){const ye=Object.create(null);for(const Le in Q)ye[Le]=Q[Le];return de.forEach(function(Le){for(const at in Le)ye[at]=Le[at]}),ye}const h="</span>",m=Q=>!!Q.scope,p=(Q,{prefix:de})=>{if(Q.startsWith("language:"))return Q.replace("language:","language-");if(Q.includes(".")){const ye=Q.split(".");return[`${de}${ye.shift()}`,...ye.map((Le,at)=>`${Le}${"_".repeat(at+1)}`)].join(" ")}return`${de}${Q}`};class a{constructor(de,ye){this.buffer="",this.classPrefix=ye.classPrefix,de.walk(this)}addText(de){this.buffer+=r(de)}openNode(de){if(!m(de))return;const ye=p(de.scope,{prefix:this.classPrefix});this.span(ye)}closeNode(de){m(de)&&(this.buffer+=h)}value(){return this.buffer}span(de){this.buffer+=`<span class="${de}">`}}const l=(Q={})=>{const de={children:[]};return Object.assign(de,Q),de};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(de){this.top.children.push(de)}openNode(de){const ye=l({scope:de});this.add(ye),this.stack.push(ye)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(de){return this.constructor._walk(de,this.rootNode)}static _walk(de,ye){return typeof ye=="string"?de.addText(ye):ye.children&&(de.openNode(ye),ye.children.forEach(Le=>this._walk(de,Le)),de.closeNode(ye)),de}static _collapse(de){typeof de!="string"&&de.children&&(de.children.every(ye=>typeof ye=="string")?de.children=[de.children.join("")]:de.children.forEach(ye=>{c._collapse(ye)}))}}class f extends c{constructor(de){super(),this.options=de}addText(de){de!==""&&this.add(de)}startScope(de){this.openNode(de)}endScope(){this.closeNode()}__addSublanguage(de,ye){const Le=de.root;ye&&(Le.scope=`language:${ye}`),this.add(Le)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function u(Q){return Q?typeof Q=="string"?Q:Q.source:null}function y(Q){return b("(?=",Q,")")}function C(Q){return b("(?:",Q,")*")}function w(Q){return b("(?:",Q,")?")}function b(...Q){return Q.map(ye=>u(ye)).join("")}function g(Q){const de=Q[Q.length-1];return typeof de=="object"&&de.constructor===Object?(Q.splice(Q.length-1,1),de):{}}function _(...Q){return"("+(g(Q).capture?"":"?:")+Q.map(Le=>u(Le)).join("|")+")"}function v(Q){return new RegExp(Q.toString()+"|").exec("").length-1}function S(Q,de){const ye=Q&&Q.exec(de);return ye&&ye.index===0}const D=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function R(Q,{joinWith:de}){let ye=0;return Q.map(Le=>{ye+=1;const at=ye;let ft=u(Le),Ee="";for(;ft.length>0;){const we=D.exec(ft);if(!we){Ee+=ft;break}Ee+=ft.substring(0,we.index),ft=ft.substring(we.index+we[0].length),we[0][0]==="\\"&&we[1]?Ee+="\\"+String(Number(we[1])+at):(Ee+=we[0],we[0]==="("&&ye++)}return Ee}).map(Le=>`(${Le})`).join(de)}const x=/\b\B/,M="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",L="\\b\\d+(\\.\\d+)?",T="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",P="\\b(0b[01]+)",B="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",F=(Q={})=>{const de=/^#![ ]*\//;return Q.binary&&(Q.begin=b(de,/.*\b/,Q.binary,/\b.*/)),o({scope:"meta",begin:de,end:/$/,relevance:0,"on:begin":(ye,Le)=>{ye.index!==0&&Le.ignoreMatch()}},Q)},$={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[$]},W={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[$]},K={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},X=function(Q,de,ye={}){const Le=o({scope:"comment",begin:Q,end:de,contains:[]},ye);Le.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const at=_("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Le.contains.push({begin:b(/[ ]+/,"(",at,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Le},U=X("//","$"),O=X("/\\*","\\*/"),z=X("#","$"),j={scope:"number",begin:L,relevance:0},H={scope:"number",begin:T,relevance:0},ee={scope:"number",begin:P,relevance:0},he={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[$,{begin:/\[/,end:/\]/,relevance:0,contains:[$]}]},se={scope:"title",begin:M,relevance:0},Z={scope:"title",begin:k,relevance:0},G={begin:"\\.\\s*"+k,relevance:0};var ne=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:$,BINARY_NUMBER_MODE:ee,BINARY_NUMBER_RE:P,COMMENT:X,C_BLOCK_COMMENT_MODE:O,C_LINE_COMMENT_MODE:U,C_NUMBER_MODE:H,C_NUMBER_RE:T,END_SAME_AS_BEGIN:function(Q){return Object.assign(Q,{"on:begin":(de,ye)=>{ye.data._beginMatch=de[1]},"on:end":(de,ye)=>{ye.data._beginMatch!==de[1]&&ye.ignoreMatch()}})},HASH_COMMENT_MODE:z,IDENT_RE:M,MATCH_NOTHING_RE:x,METHOD_GUARD:G,NUMBER_MODE:j,NUMBER_RE:L,PHRASAL_WORDS_MODE:K,QUOTE_STRING_MODE:W,REGEXP_MODE:he,RE_STARTERS_RE:B,SHEBANG:F,TITLE_MODE:se,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:Z});function ve(Q,de){Q.input[Q.index-1]==="."&&de.ignoreMatch()}function me(Q,de){Q.className!==void 0&&(Q.scope=Q.className,delete Q.className)}function Te(Q,de){de&&Q.beginKeywords&&(Q.begin="\\b("+Q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Q.__beforeBegin=ve,Q.keywords=Q.keywords||Q.beginKeywords,delete Q.beginKeywords,Q.relevance===void 0&&(Q.relevance=0))}function xe(Q,de){Array.isArray(Q.illegal)&&(Q.illegal=_(...Q.illegal))}function Ve(Q,de){if(Q.match){if(Q.begin||Q.end)throw new Error("begin & end are not supported with match");Q.begin=Q.match,delete Q.match}}function Me(Q,de){Q.relevance===void 0&&(Q.relevance=1)}const ke=(Q,de)=>{if(!Q.beforeMatch)return;if(Q.starts)throw new Error("beforeMatch cannot be used with starts");const ye=Object.assign({},Q);Object.keys(Q).forEach(Le=>{delete Q[Le]}),Q.keywords=ye.keywords,Q.begin=b(ye.beforeMatch,y(ye.begin)),Q.starts={relevance:0,contains:[Object.assign(ye,{endsParent:!0})]},Q.relevance=0,delete ye.beforeMatch},Bt=["of","and","for","in","not","or","if","then","parent","list","value"],Gt="keyword";function $e(Q,de,ye=Gt){const Le=Object.create(null);return typeof Q=="string"?at(ye,Q.split(" ")):Array.isArray(Q)?at(ye,Q):Object.keys(Q).forEach(function(ft){Object.assign(Le,$e(Q[ft],de,ft))}),Le;function at(ft,Ee){de&&(Ee=Ee.map(we=>we.toLowerCase())),Ee.forEach(function(we){const Ie=we.split("|");Le[Ie[0]]=[ft,Ke(Ie[0],Ie[1])]})}}function Ke(Q,de){return de?Number(de):Ye(Q)?0:1}function Ye(Q){return Bt.includes(Q.toLowerCase())}const De={},Ne=Q=>{console.error(Q)},_t=(Q,...de)=>{console.log(`WARN: ${Q}`,...de)},le=(Q,de)=>{De[`${Q}/${de}`]||(console.log(`Deprecated as of ${Q}. ${de}`),De[`${Q}/${de}`]=!0)},_e=new Error;function Ae(Q,de,{key:ye}){let Le=0;const at=Q[ye],ft={},Ee={};for(let we=1;we<=de.length;we++)Ee[we+Le]=at[we],ft[we+Le]=!0,Le+=v(de[we-1]);Q[ye]=Ee,Q[ye]._emit=ft,Q[ye]._multi=!0}function Fe(Q){if(Array.isArray(Q.begin)){if(Q.skip||Q.excludeBegin||Q.returnBegin)throw Ne("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),_e;if(typeof Q.beginScope!="object"||Q.beginScope===null)throw Ne("beginScope must be object"),_e;Ae(Q,Q.begin,{key:"beginScope"}),Q.begin=R(Q.begin,{joinWith:""})}}function ze(Q){if(Array.isArray(Q.end)){if(Q.skip||Q.excludeEnd||Q.returnEnd)throw Ne("skip, excludeEnd, returnEnd not compatible with endScope: {}"),_e;if(typeof Q.endScope!="object"||Q.endScope===null)throw Ne("endScope must be object"),_e;Ae(Q,Q.end,{key:"endScope"}),Q.end=R(Q.end,{joinWith:""})}}function qe(Q){Q.scope&&typeof Q.scope=="object"&&Q.scope!==null&&(Q.beginScope=Q.scope,delete Q.scope)}function He(Q){qe(Q),typeof Q.beginScope=="string"&&(Q.beginScope={_wrap:Q.beginScope}),typeof Q.endScope=="string"&&(Q.endScope={_wrap:Q.endScope}),Fe(Q),ze(Q)}function Ft(Q){function de(Ee,we){return new RegExp(u(Ee),"m"+(Q.case_insensitive?"i":"")+(Q.unicodeRegex?"u":"")+(we?"g":""))}class ye{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(we,Ie){Ie.position=this.position++,this.matchIndexes[this.matchAt]=Ie,this.regexes.push([Ie,we]),this.matchAt+=v(we)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const we=this.regexes.map(Ie=>Ie[1]);this.matcherRe=de(R(we,{joinWith:"|"}),!0),this.lastIndex=0}exec(we){this.matcherRe.lastIndex=this.lastIndex;const Ie=this.matcherRe.exec(we);if(!Ie)return null;const vt=Ie.findIndex((wn,xn)=>xn>0&&wn!==void 0),St=this.matchIndexes[vt];return Ie.splice(0,vt),Object.assign(Ie,St)}}class Le{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(we){if(this.multiRegexes[we])return this.multiRegexes[we];const Ie=new ye;return this.rules.slice(we).forEach(([vt,St])=>Ie.addRule(vt,St)),Ie.compile(),this.multiRegexes[we]=Ie,Ie}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(we,Ie){this.rules.push([we,Ie]),Ie.type==="begin"&&this.count++}exec(we){const Ie=this.getMatcher(this.regexIndex);Ie.lastIndex=this.lastIndex;let vt=Ie.exec(we);if(this.resumingScanAtSamePosition()&&!(vt&&vt.index===this.lastIndex)){const St=this.getMatcher(0);St.lastIndex=this.lastIndex+1,vt=St.exec(we)}return vt&&(this.regexIndex+=vt.position+1,this.regexIndex===this.count&&this.considerAll()),vt}}function at(Ee){const we=new Le;return Ee.contains.forEach(Ie=>we.addRule(Ie.begin,{rule:Ie,type:"begin"})),Ee.terminatorEnd&&we.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&we.addRule(Ee.illegal,{type:"illegal"}),we}function ft(Ee,we){const Ie=Ee;if(Ee.isCompiled)return Ie;[me,Ve,He,ke].forEach(St=>St(Ee,we)),Q.compilerExtensions.forEach(St=>St(Ee,we)),Ee.__beforeBegin=null,[Te,xe,Me].forEach(St=>St(Ee,we)),Ee.isCompiled=!0;let vt=null;return typeof Ee.keywords=="object"&&Ee.keywords.$pattern&&(Ee.keywords=Object.assign({},Ee.keywords),vt=Ee.keywords.$pattern,delete Ee.keywords.$pattern),vt=vt||/\w+/,Ee.keywords&&(Ee.keywords=$e(Ee.keywords,Q.case_insensitive)),Ie.keywordPatternRe=de(vt,!0),we&&(Ee.begin||(Ee.begin=/\B|\b/),Ie.beginRe=de(Ie.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(Ie.endRe=de(Ie.end)),Ie.terminatorEnd=u(Ie.end)||"",Ee.endsWithParent&&we.terminatorEnd&&(Ie.terminatorEnd+=(Ee.end?"|":"")+we.terminatorEnd)),Ee.illegal&&(Ie.illegalRe=de(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(St){return zt(St==="self"?Ee:St)})),Ee.contains.forEach(function(St){ft(St,Ie)}),Ee.starts&&ft(Ee.starts,we),Ie.matcher=at(Ie),Ie}if(Q.compilerExtensions||(Q.compilerExtensions=[]),Q.contains&&Q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Q.classNameAliases=o(Q.classNameAliases||{}),ft(Q)}function Ct(Q){return Q?Q.endsWithParent||Ct(Q.starts):!1}function zt(Q){return Q.variants&&!Q.cachedVariants&&(Q.cachedVariants=Q.variants.map(function(de){return o(Q,{variants:null},de)})),Q.cachedVariants?Q.cachedVariants:Ct(Q)?o(Q,{starts:Q.starts?o(Q.starts):null}):Object.isFrozen(Q)?o(Q):Q}var ut="11.11.1";class hn extends Error{constructor(de,ye){super(de),this.name="HTMLInjectionError",this.html=ye}}const Zt=r,nr=o,qn=Symbol("nomatch"),mi=7,Mt=function(Q){const de=Object.create(null),ye=Object.create(null),Le=[];let at=!0;const ft="Could not find the language '{}', did you forget to load/include a language module?",Ee={disableAutodetect:!0,name:"Plain text",contains:[]};let we={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function Ie(be){return we.noHighlightRe.test(be)}function vt(be){let Pe=be.className+" ";Pe+=be.parentNode?be.parentNode.className:"";const tt=we.languageDetectRe.exec(Pe);if(tt){const Et=Dn(tt[1]);return Et||(_t(ft.replace("{}",tt[1])),_t("Falling back to no-highlight mode for this block.",be)),Et?tt[1]:"no-highlight"}return Pe.split(/\s+/).find(Et=>Ie(Et)||Dn(Et))}function St(be,Pe,tt){let Et="",Vt="";typeof Pe=="object"?(Et=be,tt=Pe.ignoreIllegals,Vt=Pe.language):(le("10.7.0","highlight(lang, code, ...args) has been deprecated."),le("10.7.0",`Please use highlight(code, options) instead.
185
- https://github.com/highlightjs/highlight.js/issues/2277`),Vt=be,Et=Pe),tt===void 0&&(tt=!0);const bn={code:Et,language:Vt};Nr("before:highlight",bn);const Wn=bn.result?bn.result:wn(bn.language,bn.code,tt);return Wn.code=bn.code,Nr("after:highlight",Wn),Wn}function wn(be,Pe,tt,Et){const Vt=Object.create(null);function bn(Ce,Oe){return Ce.keywords[Oe]}function Wn(){if(!Ge.keywords){Jt.addText(wt);return}let Ce=0;Ge.keywordPatternRe.lastIndex=0;let Oe=Ge.keywordPatternRe.exec(wt),Ze="";for(;Oe;){Ze+=wt.substring(Ce,Oe.index);const ot=dn.case_insensitive?Oe[0].toLowerCase():Oe[0],jt=bn(Ge,ot);if(jt){const[ii,ca]=jt;if(Jt.addText(Ze),Ze="",Vt[ot]=(Vt[ot]||0)+1,Vt[ot]<=mi&&(ar+=ca),ii.startsWith("_"))Ze+=Oe[0];else{const Po=dn.classNameAliases[ii]||ii;Gn(Oe[0],Po)}}else Ze+=Oe[0];Ce=Ge.keywordPatternRe.lastIndex,Oe=Ge.keywordPatternRe.exec(wt)}Ze+=wt.substring(Ce),Jt.addText(Ze)}function On(){if(wt==="")return;let Ce=null;if(typeof Ge.subLanguage=="string"){if(!de[Ge.subLanguage]){Jt.addText(wt);return}Ce=wn(Ge.subLanguage,wt,!0,zo[Ge.subLanguage]),zo[Ge.subLanguage]=Ce._top}else Ce=ni(wt,Ge.subLanguage.length?Ge.subLanguage:null);Ge.relevance>0&&(ar+=Ce.relevance),Jt.__addSublanguage(Ce._emitter,Ce.language)}function Nt(){Ge.subLanguage!=null?On():Wn(),wt=""}function Gn(Ce,Oe){Ce!==""&&(Jt.startScope(Oe),Jt.addText(Ce),Jt.endScope())}function Io(Ce,Oe){let Ze=1;const ot=Oe.length-1;for(;Ze<=ot;){if(!Ce._emit[Ze]){Ze++;continue}const jt=dn.classNameAliases[Ce[Ze]]||Ce[Ze],ii=Oe[Ze];jt?Gn(ii,jt):(wt=ii,Wn(),wt=""),Ze++}}function as(Ce,Oe){return Ce.scope&&typeof Ce.scope=="string"&&Jt.openNode(dn.classNameAliases[Ce.scope]||Ce.scope),Ce.beginScope&&(Ce.beginScope._wrap?(Gn(wt,dn.classNameAliases[Ce.beginScope._wrap]||Ce.beginScope._wrap),wt=""):Ce.beginScope._multi&&(Io(Ce.beginScope,Oe),wt="")),Ge=Object.create(Ce,{parent:{value:Ge}}),Ge}function aa(Ce,Oe,Ze){let ot=S(Ce.endRe,Ze);if(ot){if(Ce["on:end"]){const jt=new i(Ce);Ce["on:end"](Oe,jt),jt.isMatchIgnored&&(ot=!1)}if(ot){for(;Ce.endsParent&&Ce.parent;)Ce=Ce.parent;return Ce}}if(Ce.endsWithParent)return aa(Ce.parent,Oe,Ze)}function os(Ce){return Ge.matcher.regexIndex===0?(wt+=Ce[0],1):(or=!0,0)}function Fc(Ce){const Oe=Ce[0],Ze=Ce.rule,ot=new i(Ze),jt=[Ze.__beforeBegin,Ze["on:begin"]];for(const ii of jt)if(ii&&(ii(Ce,ot),ot.isMatchIgnored))return os(Oe);return Ze.skip?wt+=Oe:(Ze.excludeBegin&&(wt+=Oe),Nt(),!Ze.returnBegin&&!Ze.excludeBegin&&(wt=Oe)),as(Ze,Ce),Ze.returnBegin?0:Oe.length}function Bn(Ce){const Oe=Ce[0],Ze=Pe.substring(Ce.index),ot=aa(Ge,Ce,Ze);if(!ot)return qn;const jt=Ge;Ge.endScope&&Ge.endScope._wrap?(Nt(),Gn(Oe,Ge.endScope._wrap)):Ge.endScope&&Ge.endScope._multi?(Nt(),Io(Ge.endScope,Ce)):jt.skip?wt+=Oe:(jt.returnEnd||jt.excludeEnd||(wt+=Oe),Nt(),jt.excludeEnd&&(wt=Oe));do Ge.scope&&Jt.closeNode(),!Ge.skip&&!Ge.subLanguage&&(ar+=Ge.relevance),Ge=Ge.parent;while(Ge!==ot.parent);return ot.starts&&as(ot.starts,Ce),jt.returnEnd?0:Oe.length}function oa(){const Ce=[];for(let Oe=Ge;Oe!==dn;Oe=Oe.parent)Oe.scope&&Ce.unshift(Oe.scope);Ce.forEach(Oe=>Jt.openNode(Oe))}let Ir={};function ls(Ce,Oe){const Ze=Oe&&Oe[0];if(wt+=Ce,Ze==null)return Nt(),0;if(Ir.type==="begin"&&Oe.type==="end"&&Ir.index===Oe.index&&Ze===""){if(wt+=Pe.slice(Oe.index,Oe.index+1),!at){const ot=new Error(`0 width match regex (${be})`);throw ot.languageName=be,ot.badRule=Ir.rule,ot}return 1}if(Ir=Oe,Oe.type==="begin")return Fc(Oe);if(Oe.type==="illegal"&&!tt){const ot=new Error('Illegal lexeme "'+Ze+'" for mode "'+(Ge.scope||"<unnamed>")+'"');throw ot.mode=Ge,ot}else if(Oe.type==="end"){const ot=Bn(Oe);if(ot!==qn)return ot}if(Oe.type==="illegal"&&Ze==="")return wt+=`
186
- `,1;if(la>1e5&&la>Oe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return wt+=Ze,Ze.length}const dn=Dn(be);if(!dn)throw Ne(ft.replace("{}",be)),new Error('Unknown language: "'+be+'"');const Fo=Ft(dn);let cs="",Ge=Et||Fo;const zo={},Jt=new we.__emitter(we);oa();let wt="",ar=0,Ni=0,la=0,or=!1;try{if(dn.__emitTokens)dn.__emitTokens(Pe,Jt);else{for(Ge.matcher.considerAll();;){la++,or?or=!1:Ge.matcher.considerAll(),Ge.matcher.lastIndex=Ni;const Ce=Ge.matcher.exec(Pe);if(!Ce)break;const Oe=Pe.substring(Ni,Ce.index),Ze=ls(Oe,Ce);Ni=Ce.index+Ze}ls(Pe.substring(Ni))}return Jt.finalize(),cs=Jt.toHTML(),{language:be,value:cs,relevance:ar,illegal:!1,_emitter:Jt,_top:Ge}}catch(Ce){if(Ce.message&&Ce.message.includes("Illegal"))return{language:be,value:Zt(Pe),illegal:!0,relevance:0,_illegalBy:{message:Ce.message,index:Ni,context:Pe.slice(Ni-100,Ni+100),mode:Ce.mode,resultSoFar:cs},_emitter:Jt};if(at)return{language:be,value:Zt(Pe),illegal:!1,relevance:0,errorRaised:Ce,_emitter:Jt,_top:Ge};throw Ce}}function xn(be){const Pe={value:Zt(be),illegal:!1,relevance:0,_top:Ee,_emitter:new we.__emitter(we)};return Pe._emitter.addText(be),Pe}function ni(be,Pe){Pe=Pe||we.languages||Object.keys(de);const tt=xn(be),Et=Pe.filter(Dn).filter(rr).map(Nt=>wn(Nt,be,!1));Et.unshift(tt);const Vt=Et.sort((Nt,Gn)=>{if(Nt.relevance!==Gn.relevance)return Gn.relevance-Nt.relevance;if(Nt.language&&Gn.language){if(Dn(Nt.language).supersetOf===Gn.language)return 1;if(Dn(Gn.language).supersetOf===Nt.language)return-1}return 0}),[bn,Wn]=Vt,On=bn;return On.secondBest=Wn,On}function Ln(be,Pe,tt){const Et=Pe&&ye[Pe]||tt;be.classList.add("hljs"),be.classList.add(`language-${Et}`)}function Kt(be){let Pe=null;const tt=vt(be);if(Ie(tt))return;if(Nr("before:highlightElement",{el:be,language:tt}),be.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",be);return}if(be.children.length>0&&(we.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(be)),we.throwUnescapedHTML))throw new hn("One of your code blocks includes unescaped HTML.",be.innerHTML);Pe=be;const Et=Pe.textContent,Vt=tt?St(Et,{language:tt,ignoreIllegals:!0}):ni(Et);be.innerHTML=Vt.value,be.dataset.highlighted="yes",Ln(be,tt,Vt.language),be.result={language:Vt.language,re:Vt.relevance,relevance:Vt.relevance},Vt.secondBest&&(be.secondBest={language:Vt.secondBest.language,relevance:Vt.secondBest.relevance}),Nr("after:highlightElement",{el:be,result:Vt,text:Et})}function vn(be){we=nr(we,be)}const ir=()=>{ss(),le("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ra(){ss(),le("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Oo=!1;function ss(){function be(){ss()}if(document.readyState==="loading"){Oo||window.addEventListener("DOMContentLoaded",be,!1),Oo=!0;return}document.querySelectorAll(we.cssSelector).forEach(Kt)}function Bo(be,Pe){let tt=null;try{tt=Pe(Q)}catch(Et){if(Ne("Language definition for '{}' could not be registered.".replace("{}",be)),at)Ne(Et);else throw Et;tt=Ee}tt.name||(tt.name=be),de[be]=tt,tt.rawDefinition=Pe.bind(null,Q),tt.aliases&&Oi(tt.aliases,{languageName:be})}function Br(be){delete de[be];for(const Pe of Object.keys(ye))ye[Pe]===be&&delete ye[Pe]}function sa(){return Object.keys(de)}function Dn(be){return be=(be||"").toLowerCase(),de[be]||de[ye[be]]}function Oi(be,{languageName:Pe}){typeof be=="string"&&(be=[be]),be.forEach(tt=>{ye[tt.toLowerCase()]=Pe})}function rr(be){const Pe=Dn(be);return Pe&&!Pe.disableAutodetect}function sr(be){be["before:highlightBlock"]&&!be["before:highlightElement"]&&(be["before:highlightElement"]=Pe=>{be["before:highlightBlock"](Object.assign({block:Pe.el},Pe))}),be["after:highlightBlock"]&&!be["after:highlightElement"]&&(be["after:highlightElement"]=Pe=>{be["after:highlightBlock"](Object.assign({block:Pe.el},Pe))})}function Qt(be){sr(be),Le.push(be)}function No(be){const Pe=Le.indexOf(be);Pe!==-1&&Le.splice(Pe,1)}function Nr(be,Pe){const tt=be;Le.forEach(function(Et){Et[tt]&&Et[tt](Pe)})}function Bi(be){return le("10.7.0","highlightBlock will be removed entirely in v12.0"),le("10.7.0","Please use highlightElement now."),Kt(be)}Object.assign(Q,{highlight:St,highlightAuto:ni,highlightAll:ss,highlightElement:Kt,highlightBlock:Bi,configure:vn,initHighlighting:ir,initHighlightingOnLoad:ra,registerLanguage:Bo,unregisterLanguage:Br,listLanguages:sa,getLanguage:Dn,registerAliases:Oi,autoDetection:rr,inherit:nr,addPlugin:Qt,removePlugin:No}),Q.debugMode=function(){at=!1},Q.safeMode=function(){at=!0},Q.versionString=ut,Q.regex={concat:b,lookahead:y,either:_,optional:w,anyNumberOfTimes:C};for(const be in ne)typeof ne[be]=="object"&&e(ne[be]);return Object.assign(Q,ne),Q},yt=Mt({});return yt.newInstance=()=>Mt({}),Cd=yt,yt.HighlightJS=yt,yt.default=yt,Cd}var eL=JM();const tL=xc(eL),n0={},nL="hljs-";function iL(e){const i=tL.newInstance();return e&&m(e),{highlight:r,highlightAuto:o,listLanguages:h,register:m,registerAlias:p,registered:a};function r(l,c,f){const u=f||n0,y=typeof u.prefix=="string"?u.prefix:nL;if(!i.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");i.configure({__emitter:rL,classPrefix:y});const C=i.highlight(c,{ignoreIllegals:!0,language:l});if(C.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:C.errorRaised});const w=C._emitter.root,b=w.data;return b.language=C.language,b.relevance=C.relevance,w}function o(l,c){const u=(c||n0).subset||h();let y=-1,C=0,w;for(;++y<u.length;){const b=u[y];if(!i.getLanguage(b))continue;const g=r(b,l,c);g.data&&g.data.relevance!==void 0&&g.data.relevance>C&&(C=g.data.relevance,w=g)}return w||{type:"root",children:[],data:{language:void 0,relevance:C}}}function h(){return i.listLanguages()}function m(l,c){if(typeof l=="string")i.registerLanguage(l,c);else{let f;for(f in l)Object.hasOwn(l,f)&&i.registerLanguage(f,l[f])}}function p(l,c){if(typeof l=="string")i.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let f;for(f in l)if(Object.hasOwn(l,f)){const u=l[f];i.registerAliases(typeof u=="string"?u:[...u],{languageName:f})}}}function a(l){return!!i.getLanguage(l)}}class rL{constructor(i){this.options=i,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(i){if(i==="")return;const r=this.stack[this.stack.length-1],o=r.children[r.children.length-1];o&&o.type==="text"?o.value+=i:r.children.push({type:"text",value:i})}startScope(i){this.openNode(String(i))}endScope(){this.closeNode()}__addSublanguage(i,r){const o=this.stack[this.stack.length-1],h=i.root.children;r?o.children.push({type:"element",tagName:"span",properties:{className:[r]},children:h}):o.children.push(...h)}openNode(i){const r=this,o=i.split(".").map(function(p,a){return a?p+"_".repeat(a):r.options.classPrefix+p}),h=this.stack[this.stack.length-1],m={type:"element",tagName:"span",properties:{className:o},children:[]};h.children.push(m),this.stack.push(m)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const sL={};function aL(e){const i=e||sL,r=i.aliases,o=i.detect||!1,h=i.languages||QM,m=i.plainText,p=i.prefix,a=i.subset;let l="hljs";const c=iL(h);if(r&&c.registerAlias(r),p){const f=p.indexOf("-");l=f===-1?p:p.slice(0,f)}return function(f,u){Ic(f,"element",function(y,C,w){if(y.tagName!=="code"||!w||w.type!=="element"||w.tagName!=="pre")return;const b=oL(y);if(b===!1||!b&&!o||b&&m&&m.includes(b))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(l)||y.properties.className.unshift(l);const g=x3(y,{whitespace:"pre"});let _;try{_=b?c.highlight(b,g,{prefix:p}):c.highlightAuto(g,{prefix:p,subset:a})}catch(v){const S=v;if(b&&/Unknown language/.test(S.message)){u.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[w,y],cause:S,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw S}!b&&_.data&&_.data.language&&y.properties.className.push("language-"+_.data.language),_.children.length>0&&(y.children=_.children)})}}function oL(e){const i=e.properties.className;let r=-1;if(!Array.isArray(i))return;let o;for(;++r<i.length;){const h=String(i[r]);if(h==="no-highlight"||h==="nohighlight")return!1;!o&&h.slice(0,5)==="lang-"&&(o=h.slice(5)),!o&&h.slice(0,9)==="language-"&&(o=h.slice(9))}return o}const lL=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,cL=Object.hasOwnProperty;class G1{constructor(){this.occurrences,this.reset()}slug(i,r){const o=this;let h=uL(i,r===!0);const m=h;for(;cL.call(o.occurrences,h);)o.occurrences[m]++,h=m+"-"+o.occurrences[m];return o.occurrences[h]=0,h}reset(){this.occurrences=Object.create(null)}}function uL(e,i){return typeof e!="string"?"":(i||(e=e.toLowerCase()),e.replace(lL,"").replace(/ /g,"-"))}function Gd(e){return typeof e=="string"?e:typeof e=="number"?String(e):Array.isArray(e)?e.map(Gd).join(""):e&&typeof e=="object"&&"props"in e?Gd(e.props.children):""}function hL(e){const i=[],r=new G1,o=e.split(`
187
- `);let h=!1;for(const m of o){if(m.trimStart().startsWith("```")||m.trimStart().startsWith("~~~")){h=!h;continue}if(h)continue;const p=m.match(/^(#{1,6})\s+(.+)$/);if(p){const a=p[1].length,c=p[2].trim().replace(/\*\*(.+?)\*\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1").replace(/`(.+?)`/g,"$1"),f=r.slug(c);i.push({level:a,text:c,id:f})}}return i}function dL({content:e,onHeadingClick:i}){const r=new G1,o=h=>({children:m,...p})=>{const a=Gd(m),l=r.slug(a);return Y.jsx(h,{id:l,...p,children:m})};return Y.jsx("div",{className:"markdown-body",children:Y.jsx(sR,{remarkPlugins:[v3],rehypePlugins:[aL],components:{h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),a:({href:h,children:m,...p})=>h!=null&&h.startsWith("#")&&i?Y.jsx("a",{href:h,onClick:a=>{a.preventDefault(),i(h.slice(1))},...p,children:m}):h!=null&&h.startsWith("http")?Y.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",...p,children:m}):Y.jsx("a",{href:h,...p,children:m})},children:e})})}const Gs=44,K1="toc-button-position",fL={right:16,bottom:80};function gL(){try{const e=localStorage.getItem(K1);if(e){const i=JSON.parse(e);if(typeof i.right=="number"&&typeof i.bottom=="number")return i}}catch{}return fL}function pL(e){try{localStorage.setItem(K1,JSON.stringify(e))}catch{}}function mL({headings:e,onHeadingClick:i,activeId:r}){const[o,h]=N.useState(!1),[m,p]=N.useState(gL),[a,l]=N.useState(!1),[c,f]=N.useState(!1),u=N.useRef({x:0,y:0,right:0,bottom:0}),y=N.useRef(!1),C=N.useCallback((k,L)=>{f(!0),y.current=!1,u.current={x:k,y:L,right:m.right,bottom:m.bottom}},[m.right,m.bottom]),w=N.useCallback((k,L)=>{if(!c)return;const T=k-u.current.x,P=L-u.current.y;if(Math.sqrt(T*T+P*P)>10&&!y.current&&(y.current=!0,l(!0)),y.current){const F=Math.max(0,u.current.right-T),$=Math.max(0,u.current.bottom-P),q=window.innerWidth-Gs,W=window.innerHeight-Gs;p({right:Math.min(F,q),bottom:Math.min($,W)})}},[c]),b=N.useCallback(()=>{f(!1),l(!1),y.current?pL(m):h(!0),y.current=!1},[m]),g=N.useCallback(k=>{const L=k.touches[0];C(L.clientX,L.clientY)},[C]),_=N.useCallback(k=>{const L=k.touches[0];w(L.clientX,L.clientY)},[w]),v=N.useCallback(k=>{k.preventDefault(),b()},[b]),S=N.useCallback(k=>{k.preventDefault(),C(k.clientX,k.clientY)},[C]),D=N.useCallback(k=>{w(k.clientX,k.clientY)},[w]),R=N.useCallback(()=>{b()},[b]),x=N.useCallback(()=>{c&&b()},[c,b]);if(N.useEffect(()=>{const k=()=>{const L=window.innerWidth-Gs,T=window.innerHeight-Gs;p(P=>({right:Math.min(P.right,L),bottom:Math.min(P.bottom,T)}))};return window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]),e.length===0)return null;const M=k=>{i(k),h(!1)};return Y.jsxs(Y.Fragment,{children:[Y.jsx("button",{className:"toc-fab","data-testid":"toc--button--fab",onTouchStart:g,onTouchMove:_,onTouchEnd:v,onMouseDown:S,onMouseMove:D,onMouseUp:R,onMouseLeave:x,style:{..._n.fab,right:m.right,bottom:m.bottom,cursor:a?"grabbing":"grab",boxShadow:c?"0 2px 8px rgba(0, 0, 0, 0.5)":"0 4px 12px rgba(0, 0, 0, 0.4)",transform:c?"scale(0.95)":"scale(1)",transition:a?"none":"transform 0.1s ease, box-shadow 0.1s ease",background:"linear-gradient(135deg, #21262d 0%, #161b22 100%)",border:"1px solid var(--border-color)",touchAction:"none"},"aria-label":"Table of contents",children:Y.jsx("span",{style:_n.fabIcon,children:"📑"})}),o&&Y.jsx("div",{style:_n.overlay,onClick:()=>h(!1),"data-testid":"toc--overlay"}),Y.jsxs("nav",{className:"toc-drawer",style:{..._n.drawer,...o?_n.drawerOpen:{}},"data-testid":"toc--drawer",children:[Y.jsxs("div",{style:_n.drawerHeader,children:[Y.jsx("span",{children:"目录"}),Y.jsx("button",{style:_n.closeButton,onClick:()=>h(!1),"data-testid":"toc--button--close",children:"×"})]}),Y.jsx("ul",{style:_n.list,"data-testid":"toc--list",children:e.map(k=>Y.jsx("li",{style:{..._n.item,...r===k.id?_n.itemActive:{},paddingLeft:`${(k.level-1)*12+12}px`},children:Y.jsx("button",{style:_n.link,onClick:()=>M(k.id),"data-testid":`toc--item--${k.id}`,children:k.text})},k.id))})]}),Y.jsxs("nav",{className:"toc-sidebar",style:_n.sidebar,"data-testid":"toc--sidebar",children:[Y.jsx("div",{style:_n.sidebarHeader,children:"目录"}),Y.jsx("ul",{style:_n.list,children:e.map(k=>Y.jsx("li",{style:{..._n.item,...r===k.id?_n.itemActive:{},paddingLeft:`${(k.level-1)*8+8}px`},children:Y.jsx("button",{style:_n.link,onClick:()=>M(k.id),children:k.text})},`sidebar-${k.id}`))})]})]})}const _n={fab:{position:"fixed",width:Gs,height:Gs,borderRadius:"50%",border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",zIndex:100,userSelect:"none",WebkitUserSelect:"none"},fabIcon:{fontSize:20,lineHeight:1,filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.5))",display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.5)",zIndex:200},drawer:{position:"fixed",bottom:0,left:0,right:0,maxHeight:"60vh",background:"var(--bg-primary)",borderTopLeftRadius:"1rem",borderTopRightRadius:"1rem",transform:"translateY(100%)",transition:"transform 0.3s ease-out",zIndex:201,overflow:"auto",overscrollBehavior:"contain",display:"none"},drawerOpen:{transform:"translateY(0)"},drawerHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1rem",borderBottom:"1px solid var(--border-color)",fontWeight:600},closeButton:{background:"none",border:"none",color:"var(--text-secondary)",fontSize:"1.5rem",cursor:"pointer",padding:0,lineHeight:1},sidebar:{display:"none",position:"fixed",top:"4rem",right:0,width:"240px",maxHeight:"calc(100vh - 4rem)",padding:"1rem",overflow:"auto",borderLeft:"1px solid var(--border-color)",background:"var(--bg-primary)"},sidebarHeader:{fontWeight:600,marginBottom:"0.75rem",color:"var(--text-secondary)",fontSize:"0.875rem"},list:{listStyle:"none",margin:0,padding:0},item:{margin:0},itemActive:{background:"var(--bg-secondary)"},link:{display:"block",width:"100%",padding:"0.5rem 0.75rem",background:"none",border:"none",color:"var(--text-primary)",textAlign:"left",cursor:"pointer",fontSize:"0.875rem",borderRadius:"0.25rem"}};function _L(){const[e]=LE(),i=e.get("path"),r=e.get("instanceId"),[o,h]=N.useState(null),[m,p]=N.useState(null),[a,l]=N.useState(!0),[c,f]=N.useState();N.useEffect(()=>{if(!i){p("No file path specified"),l(!1);return}l(!0),p(null),m2(i,{instanceId:r??void 0}).then(C=>{h(C),l(!1)}).catch(C=>{p(C.message||"Failed to load file"),l(!1)})},[i,r]),N.useEffect(()=>(o!=null&&o.filename&&(document.title=`${o.filename} - Markdown Viewer`),()=>{document.title="Claude Remote"}),[o==null?void 0:o.filename]);const u=N.useCallback(C=>{const w=document.getElementById(C);w&&(w.scrollIntoView({behavior:"smooth",block:"start"}),f(C))},[]),y=o?hL(o.content):[];return a?Y.jsx("div",{style:kn.container,"data-testid":"viewer--page",children:Y.jsx("div",{style:kn.loading,"data-testid":"viewer--loading",children:"Loading..."})}):m?Y.jsx("div",{style:kn.container,"data-testid":"viewer--page",children:Y.jsxs("div",{style:kn.error,"data-testid":"viewer--error",children:[Y.jsx("h2",{children:"Error"}),Y.jsx("p",{children:m}),Y.jsx(lo,{to:"/",style:kn.backLink,"data-testid":"viewer--link--back",children:"← Back to Console"})]})}):o?Y.jsxs("div",{style:kn.container,"data-testid":"viewer--page",children:[Y.jsxs("header",{style:kn.header,"data-testid":"viewer--header",children:[Y.jsxs("div",{style:kn.headerRow,children:[Y.jsx(lo,{to:"/",style:kn.backLink,"data-testid":"viewer--link--back",children:"← Back"}),Y.jsx("h1",{style:kn.title,"data-testid":"viewer--title",children:o.filename})]}),Y.jsx("span",{style:kn.path,"data-testid":"viewer--path",children:o.path})]}),Y.jsx("main",{style:kn.content,className:"viewer-content","data-testid":"viewer--content",children:Y.jsx(dL,{content:o.content,onHeadingClick:u})}),Y.jsx(mL,{headings:y,onHeadingClick:u,activeId:c})]}):Y.jsx("div",{style:kn.container,"data-testid":"viewer--page",children:Y.jsxs("div",{style:kn.error,"data-testid":"viewer--error",children:[Y.jsx("h2",{children:"File not found"}),Y.jsx(lo,{to:"/",style:kn.backLink,"data-testid":"viewer--link--back",children:"← Back to Console"})]})})}const kn={container:{position:"fixed",top:0,left:0,right:0,bottom:0,overflowY:"auto",WebkitOverflowScrolling:"touch",background:"var(--bg-primary)",color:"var(--text-primary)"},header:{padding:"1rem",paddingTop:"calc(var(--safe-top) + 1rem)",borderBottom:"1px solid var(--border-color)",display:"flex",flexDirection:"column",gap:"0.25rem",position:"sticky",top:0,background:"var(--bg-primary)",zIndex:10},headerRow:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:"0.5rem"},title:{fontSize:"1.125rem",margin:0,flex:1,textAlign:"right"},path:{fontSize:"0.875rem",color:"var(--text-secondary)",wordBreak:"break-all"},content:{padding:"1rem",maxWidth:"900px",overflowX:"hidden"},loading:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh"},error:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",textAlign:"center"},backLink:{color:"var(--accent-color)",textDecoration:"none"}},i0=[{id:"add-instance",target:'button[aria-label="Create new instance"]',title:"Start Here",description:"Tap + to create a new Claude Code session. Each instance runs independently.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:16},{id:"instance-tabs",target:'[data-testid="instance--tabs"]',title:"Switch Sessions",description:"Tap any tab to switch between different Claude sessions.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:8},{id:"clone-instance",target:'[data-testid="instance--tab"], [data-testid="instance--tab--active"]',title:"Clone Sessions",description:"Long press a tab to clone it with all settings. Perfect for backup or testing.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:8},{id:"shortcut-bar",target:'[data-testid="console--shortcut-bar"]',title:"Quick Keys",description:"Send Ctrl+C, Tab, Enter etc. instantly without typing.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"command-buttons",target:'[data-testid="console--command-buttons"]',title:"One-Tap Commands",description:"Run preset commands with a single tap.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"input-bar",target:'[data-testid="console--input--command"]',title:"Chat with Claude",description:"Type your message or command here. Claude Code will respond in real-time.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"settings-button",target:'button[aria-label="Settings"]',title:"Customize",description:"Adjust shortcuts, commands, and preferences.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:16},{id:"floating-doc-button",target:'[data-testid="floating-doc-button"]',title:"View Documents",description:"Tap to browse project docs and help files. Long press to hide.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:22}],r0="claude_remote_spotlight_done";function vL(){const[e,i]=N.useState(!1),[r,o]=N.useState(0),[h,m]=N.useState(null),[p,a]=N.useState(!0),l=N.useRef(null),c=i0[r]??null,f=i0.length,u=N.useCallback(_=>{const v=document.querySelector(_.target);if(!v)return null;const S=v.getBoundingClientRect(),D=document.querySelector('[data-testid="console--page"]'),R=D?window.getComputedStyle(D):null,x=R==null?void 0:R.transform;let M=0;if(x&&x!=="none"){const k=x.match(/matrix\([^,]+,[^,]+,[^,]+,[^,]+,[^,]+,([^)]+)\)/);k&&(M=parseFloat(k[1]))}return{left:S.left,top:S.top-M,width:S.width,height:S.height}},[]),y=N.useCallback(()=>{if(!c)return;const _=u(c);m(_)},[c,u]);N.useEffect(()=>{localStorage.getItem(r0)||i(!0)},[]),N.useEffect(()=>{if(!e||!c)return;const _=document.querySelector(c.target);_&&_.scrollIntoView({behavior:"smooth",block:"center"});const v=setTimeout(()=>{const S=u(c);S?(m(S),a(!1)):r<f-1?o(r+1):C()},100);return()=>clearTimeout(v)},[e,r,c,u,f]),N.useEffect(()=>{if(!e||!c)return;const _=document.querySelector(c.target);if(!_)return;const v=_.style.outline,S=_.style.outlineOffset,D=_.style.position,R=_.style.zIndex;return _.style.outline="2px solid var(--status-running)",_.style.outlineOffset="2px",window.getComputedStyle(_).position==="static"&&(_.style.position="relative"),_.style.zIndex="2001",()=>{_.style.outline=v,_.style.outlineOffset=S,_.style.position=D,_.style.zIndex=R}},[e,c]),N.useEffect(()=>{if(!e)return;const _=()=>{l.current&&clearTimeout(l.current),l.current=window.setTimeout(()=>{y()},100)};return window.addEventListener("resize",_),window.visualViewport&&window.visualViewport.addEventListener("resize",_),()=>{window.removeEventListener("resize",_),window.visualViewport&&window.visualViewport.removeEventListener("resize",_),l.current&&clearTimeout(l.current)}},[e,y]);const C=N.useCallback(()=>{localStorage.setItem(r0,"true"),i(!1),a(!0),m(null)},[]),w=N.useCallback(()=>{r<f-1?o(r+1):C()},[r,f,C]),b=N.useCallback(()=>{r>0&&o(r-1)},[r]),g=N.useCallback(()=>{C()},[C]);return{visible:e,currentStep:r,totalSteps:f,step:c,targetRect:h,isLoading:p,handleNext:w,handlePrev:b,handleSkip:g,recalculate:y}}const V1=N.createContext(null);function bL({children:e}){const i=vL();return Y.jsx(V1.Provider,{value:i,children:e})}function yL(){const e=N.useContext(V1);if(!e)throw new Error("useSpotlightContext must be used within a SpotlightProvider");return e}function SL(){const{visible:e,currentStep:i,totalSteps:r,step:o,targetRect:h,isLoading:m,handleNext:p,handlePrev:a,handleSkip:l}=yL(),c=N.useRef(null),f=N.useRef(null),u=N.useCallback(B=>{switch(B.key){case"ArrowRight":case"ArrowDown":B.preventDefault(),p();break;case"ArrowLeft":case"ArrowUp":B.preventDefault(),a();break;case"Escape":B.preventDefault(),l();break;case"Enter":case" ":B.preventDefault(),p();break}},[p,a,l]);if(N.useEffect(()=>{if(e){f.current=document.activeElement;const B=setTimeout(()=>{var F;(F=c.current)==null||F.focus()},100);return()=>clearTimeout(B)}else f.current&&f.current.focus()},[e]),!e||!o||!h)return null;const y=o.spotlightPadding??4;o.spotlightRadius;const C=i===r-1,w=i===0,b=h.left-y,g=h.top-y,_=h.width+y*2,v=h.height+y*2,S=140,D=g,R=window.innerHeight-(g+v);let x=o.tooltipPosition;o.tooltipPosition==="bottom"&&R<S&&D>=S?x="top":o.tooltipPosition==="top"&&D<S&&R>=S&&(x="bottom");const M=x==="bottom"?g+v+12:g-12,k=Math.min(M,window.innerHeight-S-16),L=280,T=Math.max(16,Math.min(window.innerWidth-L-16,b)),P=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;return Y.jsxs("div",{ref:c,"data-testid":"spotlight--dialog",role:"dialog","aria-modal":"true","aria-label":`Guide step ${i+1} of ${r}: ${o.title}`,tabIndex:-1,onKeyDown:u,style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2e3,cursor:"pointer",WebkitTapHighlightColor:"transparent"},onClick:B=>{B.target.closest("[data-spotlight-tooltip]")||p()},children:[Y.jsx("div",{style:{position:"absolute",inset:0,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.75)",pointerEvents:"none"}}),Y.jsxs("div",{"data-spotlight-tooltip":!0,"data-testid":"spotlight--tooltip",style:{position:"absolute",left:T,top:Math.max(16,k),transform:x==="top"?"translateY(-100%)":"none",maxWidth:L,padding:"12px 16px",borderRadius:12,background:"var(--bg-secondary)",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.3)",pointerEvents:"auto",animation:P?"none":"spotlight-tooltip-enter 0.3s ease-out"},children:[Y.jsx("div",{style:{position:"absolute",left:Math.max(16,Math.min(L-28,b+_/2-T-6)),[x==="top"?"bottom":"top"]:-6,width:12,height:12,background:"var(--bg-secondary)",transform:x==="top"?"translateY(50%) rotate(45deg)":"translateY(-50%) rotate(45deg)"}}),Y.jsxs("div",{style:{position:"relative",zIndex:1},children:[Y.jsx("div",{"data-testid":"spotlight--title",style:{fontSize:16,fontWeight:600,marginBottom:4,color:"var(--text-primary)"},children:o.title}),Y.jsx("div",{"data-testid":"spotlight--description",style:{fontSize:13,lineHeight:1.5,color:"var(--text-secondary)"},children:o.description}),Y.jsxs("div",{style:{marginTop:12,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Y.jsx("div",{"data-testid":"spotlight--dots",style:{display:"flex",gap:6},children:Array.from({length:r}).map((B,F)=>Y.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:F===i?"var(--status-running)":F<i?"var(--status-idle)":"var(--border-color)"}},F))}),Y.jsxs("div",{style:{display:"flex",gap:8},children:[Y.jsx("button",{"data-testid":"spotlight--button--skip",onClick:B=>{B.stopPropagation(),l()},style:{padding:"6px 12px",borderRadius:6,border:"none",background:"transparent",color:"var(--text-muted)",fontSize:13,cursor:"pointer"},children:"Skip"}),!w&&Y.jsx("button",{"data-testid":"spotlight--button--prev",onClick:B=>{B.stopPropagation(),a()},style:{padding:"6px 14px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:13,cursor:"pointer"},children:"Prev"}),Y.jsx("button",{"data-testid":"spotlight--button--next",onClick:B=>{B.stopPropagation(),p()},style:{padding:"6px 16px",borderRadius:6,border:"none",background:"var(--status-running)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:C?"Done":"Next"})]})]})]})]}),Y.jsx("style",{children:`
188
- @keyframes spotlight-tooltip-enter {
189
- from {
190
- opacity: 0;
191
- transform: translateY(8px);
192
- }
193
- to {
194
- opacity: 1;
195
- transform: translateY(0);
196
- }
197
- }
198
- `})]})}function CL(){const i=new URLSearchParams(window.location.search).get("token");if(i){const r=window.location.pathname+window.location.hash;window.history.replaceState({},"",r)}return i}function EL(){const e=rt(m=>m.isAuthenticated),i=rt(m=>m.isCheckingAuth),r=rt(m=>m.setAuthenticated),o=rt(m=>m.setCheckingAuth),h=rt(m=>m.setCachedToken);return N.useEffect(()=>{const m=CL();if(m){Ti(m).then(p=>{p?(r(!0),h(m),k0(m)):(sessionStorage.setItem("prefill_token",m),o(!1))}).catch(()=>{sessionStorage.setItem("prefill_token",m),o(!1)});return}HE().then(()=>{r(!0);const p=ts();p&&h(p)}).catch(async()=>{const p=ts();if(p)try{if(await Ti(p)){r(!0),h(p);return}}catch{}o(!1),R0(),h(null)})},[r,o,h]),i?Y.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-primary)",color:"var(--text-secondary)"},children:"Checking session…"}):e?Y.jsxs(nE,{children:[Y.jsx(wd,{path:"/viewer",element:Y.jsx(_L,{})}),Y.jsx(wd,{path:"/*",element:Y.jsxs(bL,{children:[Y.jsx(V2,{}),Y.jsx(SL,{})]})})]}):Y.jsx(WE,{})}sC.createRoot(document.getElementById("root")).render(Y.jsx(N.StrictMode,{children:Y.jsx(AE,{children:Y.jsx(EL,{})})}));