@jean2/client 0.3.4 → 0.4.1

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,499 +0,0 @@
1
- function U2(e,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in e)){const h=Object.getOwnPropertyDescriptor(s,l);h&&Object.defineProperty(e,l,h.get?h:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const h of l)if(h.type==="childList")for(const d of h.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const h={};return l.integrity&&(h.integrity=l.integrity),l.referrerPolicy&&(h.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?h.credentials="include":l.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function s(l){if(l.ep)return;l.ep=!0;const h=i(l);fetch(l.href,h)}})();function Ku(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yf={exports:{}},Qo={};/**
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 gb;function $2(){if(gb)return Qo;gb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(s,l,h){var d=null;if(h!==void 0&&(d=""+h),l.key!==void 0&&(d=""+l.key),"key"in l){h={};for(var o in l)o!=="key"&&(h[o]=l[o])}else h=l;return l=h.ref,{$$typeof:e,type:s,key:d,ref:l!==void 0?l:null,props:h}}return Qo.Fragment=n,Qo.jsx=i,Qo.jsxs=i,Qo}var vb;function q2(){return vb||(vb=1,Yf.exports=$2()),Yf.exports}var g=q2(),Xf={exports:{}},Ue={};/**
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 _b;function V2(){if(_b)return Ue;_b=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),d=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),y=Symbol.iterator;function S(L){return L===null||typeof L!="object"?null:(L=y&&L[y]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function b(L,B,z){this.props=L,this.context=B,this.refs=_,this.updater=z||k}b.prototype.isReactComponent={},b.prototype.setState=function(L,B){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,B,"setState")},b.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function v(){}v.prototype=b.prototype;function x(L,B,z){this.props=L,this.context=B,this.refs=_,this.updater=z||k}var E=x.prototype=new v;E.constructor=x,w(E,b.prototype),E.isPureReactComponent=!0;var M=Array.isArray;function R(){}var j={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function O(L,B,z){var X=z.ref;return{$$typeof:e,type:L,key:B,ref:X!==void 0?X:null,props:z}}function P(L,B){return O(L.type,B,L.props)}function U(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function q(L){var B={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(z){return B[z]})}var $=/\/+/g;function K(L,B){return typeof L=="object"&&L!==null&&L.key!=null?q(""+L.key):B.toString(36)}function Y(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(R,R):(L.status="pending",L.then(function(B){L.status==="pending"&&(L.status="fulfilled",L.value=B)},function(B){L.status==="pending"&&(L.status="rejected",L.reason=B)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function V(L,B,z,X,J){var te=typeof L;(te==="undefined"||te==="boolean")&&(L=null);var W=!1;if(L===null)W=!0;else switch(te){case"bigint":case"string":case"number":W=!0;break;case"object":switch(L.$$typeof){case e:case n:W=!0;break;case m:return W=L._init,V(W(L._payload),B,z,X,J)}}if(W)return J=J(L),W=X===""?"."+K(L,0):X,M(J)?(z="",W!=null&&(z=W.replace($,"$&/")+"/"),V(J,B,z,"",function(ae){return ae})):J!=null&&(U(J)&&(J=P(J,z+(J.key==null||L&&L.key===J.key?"":(""+J.key).replace($,"$&/")+"/")+W)),B.push(J)),1;W=0;var H=X===""?".":X+":";if(M(L))for(var ne=0;ne<L.length;ne++)X=L[ne],te=H+K(X,ne),W+=V(X,B,z,te,J);else if(ne=S(L),typeof ne=="function")for(L=ne.call(L),ne=0;!(X=L.next()).done;)X=X.value,te=H+K(X,ne++),W+=V(X,B,z,te,J);else if(te==="object"){if(typeof L.then=="function")return V(Y(L),B,z,X,J);throw B=String(L),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return W}function Z(L,B,z){if(L==null)return L;var X=[],J=0;return V(L,X,"","",function(te){return B.call(z,te,J++)}),X}function Q(L){if(L._status===-1){var B=L._result;B=B(),B.then(function(z){(L._status===0||L._status===-1)&&(L._status=1,L._result=z)},function(z){(L._status===0||L._status===-1)&&(L._status=2,L._result=z)}),L._status===-1&&(L._status=0,L._result=B)}if(L._status===1)return L._result.default;throw L._result}var F=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},N={map:Z,forEach:function(L,B,z){Z(L,function(){B.apply(this,arguments)},z)},count:function(L){var B=0;return Z(L,function(){B++}),B},toArray:function(L){return Z(L,function(B){return B})||[]},only:function(L){if(!U(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ue.Activity=f,Ue.Children=N,Ue.Component=b,Ue.Fragment=i,Ue.Profiler=l,Ue.PureComponent=x,Ue.StrictMode=s,Ue.Suspense=c,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(L){return j.H.useMemoCache(L)}},Ue.cache=function(L){return function(){return L.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(L,B,z){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var X=w({},L.props),J=L.key;if(B!=null)for(te in B.key!==void 0&&(J=""+B.key),B)!D.call(B,te)||te==="key"||te==="__self"||te==="__source"||te==="ref"&&B.ref===void 0||(X[te]=B[te]);var te=arguments.length-2;if(te===1)X.children=z;else if(1<te){for(var W=Array(te),H=0;H<te;H++)W[H]=arguments[H+2];X.children=W}return O(L.type,J,X)},Ue.createContext=function(L){return L={$$typeof:d,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:h,_context:L},L},Ue.createElement=function(L,B,z){var X,J={},te=null;if(B!=null)for(X in B.key!==void 0&&(te=""+B.key),B)D.call(B,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(J[X]=B[X]);var W=arguments.length-2;if(W===1)J.children=z;else if(1<W){for(var H=Array(W),ne=0;ne<W;ne++)H[ne]=arguments[ne+2];J.children=H}if(L&&L.defaultProps)for(X in W=L.defaultProps,W)J[X]===void 0&&(J[X]=W[X]);return O(L,te,J)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(L){return{$$typeof:o,render:L}},Ue.isValidElement=U,Ue.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:Q}},Ue.memo=function(L,B){return{$$typeof:u,type:L,compare:B===void 0?null:B}},Ue.startTransition=function(L){var B=j.T,z={};j.T=z;try{var X=L(),J=j.S;J!==null&&J(z,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(R,F)}catch(te){F(te)}finally{B!==null&&z.types!==null&&(B.types=z.types),j.T=B}},Ue.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ue.use=function(L){return j.H.use(L)},Ue.useActionState=function(L,B,z){return j.H.useActionState(L,B,z)},Ue.useCallback=function(L,B){return j.H.useCallback(L,B)},Ue.useContext=function(L){return j.H.useContext(L)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(L,B){return j.H.useDeferredValue(L,B)},Ue.useEffect=function(L,B){return j.H.useEffect(L,B)},Ue.useEffectEvent=function(L){return j.H.useEffectEvent(L)},Ue.useId=function(){return j.H.useId()},Ue.useImperativeHandle=function(L,B,z){return j.H.useImperativeHandle(L,B,z)},Ue.useInsertionEffect=function(L,B){return j.H.useInsertionEffect(L,B)},Ue.useLayoutEffect=function(L,B){return j.H.useLayoutEffect(L,B)},Ue.useMemo=function(L,B){return j.H.useMemo(L,B)},Ue.useOptimistic=function(L,B){return j.H.useOptimistic(L,B)},Ue.useReducer=function(L,B,z){return j.H.useReducer(L,B,z)},Ue.useRef=function(L){return j.H.useRef(L)},Ue.useState=function(L){return j.H.useState(L)},Ue.useSyncExternalStore=function(L,B,z){return j.H.useSyncExternalStore(L,B,z)},Ue.useTransition=function(){return j.H.useTransition()},Ue.version="19.2.4",Ue}var yb;function wm(){return yb||(yb=1,Xf.exports=V2()),Xf.exports}var T=wm();const Yn=Ku(T),Ax=U2({__proto__:null,default:Yn},[T]);var Zf={exports:{}},Jo={},Qf={exports:{}},Jf={};/**
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 bb;function G2(){return bb||(bb=1,(function(e){function n(V,Z){var Q=V.length;V.push(Z);e:for(;0<Q;){var F=Q-1>>>1,N=V[F];if(0<l(N,Z))V[F]=Z,V[Q]=N,Q=F;else break e}}function i(V){return V.length===0?null:V[0]}function s(V){if(V.length===0)return null;var Z=V[0],Q=V.pop();if(Q!==Z){V[0]=Q;e:for(var F=0,N=V.length,L=N>>>1;F<L;){var B=2*(F+1)-1,z=V[B],X=B+1,J=V[X];if(0>l(z,Q))X<N&&0>l(J,z)?(V[F]=J,V[X]=Q,F=X):(V[F]=z,V[B]=Q,F=B);else if(X<N&&0>l(J,Q))V[F]=J,V[X]=Q,F=X;else break e}}return Z}function l(V,Z){var Q=V.sortIndex-Z.sortIndex;return Q!==0?Q:V.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var d=Date,o=d.now();e.unstable_now=function(){return d.now()-o}}var c=[],u=[],m=1,f=null,y=3,S=!1,k=!1,w=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var Z=i(u);Z!==null;){if(Z.callback===null)s(u);else if(Z.startTime<=V)s(u),Z.sortIndex=Z.expirationTime,n(c,Z);else break;Z=i(u)}}function M(V){if(w=!1,E(V),!k)if(i(c)!==null)k=!0,R||(R=!0,q());else{var Z=i(u);Z!==null&&Y(M,Z.startTime-V)}}var R=!1,j=-1,D=5,O=-1;function P(){return _?!0:!(e.unstable_now()-O<D)}function U(){if(_=!1,R){var V=e.unstable_now();O=V;var Z=!0;try{e:{k=!1,w&&(w=!1,v(j),j=-1),S=!0;var Q=y;try{t:{for(E(V),f=i(c);f!==null&&!(f.expirationTime>V&&P());){var F=f.callback;if(typeof F=="function"){f.callback=null,y=f.priorityLevel;var N=F(f.expirationTime<=V);if(V=e.unstable_now(),typeof N=="function"){f.callback=N,E(V),Z=!0;break t}f===i(c)&&s(c),E(V)}else s(c);f=i(c)}if(f!==null)Z=!0;else{var L=i(u);L!==null&&Y(M,L.startTime-V),Z=!1}}break e}finally{f=null,y=Q,S=!1}Z=void 0}}finally{Z?q():R=!1}}}var q;if(typeof x=="function")q=function(){x(U)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,K=$.port2;$.port1.onmessage=U,q=function(){K.postMessage(null)}}else q=function(){b(U,0)};function Y(V,Z){j=b(function(){V(e.unstable_now())},Z)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(V){switch(y){case 1:case 2:case 3:var Z=3;break;default:Z=y}var Q=y;y=Z;try{return V()}finally{y=Q}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(V,Z){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var Q=y;y=V;try{return Z()}finally{y=Q}},e.unstable_scheduleCallback=function(V,Z,Q){var F=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?F+Q:F):Q=F,V){case 1:var N=-1;break;case 2:N=250;break;case 5:N=1073741823;break;case 4:N=1e4;break;default:N=5e3}return N=Q+N,V={id:m++,callback:Z,priorityLevel:V,startTime:Q,expirationTime:N,sortIndex:-1},Q>F?(V.sortIndex=Q,n(u,V),i(c)===null&&V===i(u)&&(w?(v(j),j=-1):w=!0,Y(M,Q-F))):(V.sortIndex=N,n(c,V),k||S||(k=!0,R||(R=!0,q()))),V},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(V){var Z=y;return function(){var Q=y;y=Z;try{return V.apply(this,arguments)}finally{y=Q}}}})(Jf)),Jf}var xb;function W2(){return xb||(xb=1,Qf.exports=G2()),Qf.exports}var ep={exports:{}},rn={};/**
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 Sb;function K2(){if(Sb)return rn;Sb=1;var e=wm();function n(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},l=Symbol.for("react.portal");function h(c,u,m){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:f==null?null:""+f,children:c,containerInfo:u,implementation:m}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,rn.createPortal=function(c,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(n(299));return h(c,u,null,m)},rn.flushSync=function(c){var u=d.T,m=s.p;try{if(d.T=null,s.p=2,c)return c()}finally{d.T=u,s.p=m,s.d.f()}},rn.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,s.d.C(c,u))},rn.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},rn.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var m=u.as,f=o(m,u.crossOrigin),y=typeof u.integrity=="string"?u.integrity:void 0,S=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;m==="style"?s.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:f,integrity:y,fetchPriority:S}):m==="script"&&s.d.X(c,{crossOrigin:f,integrity:y,fetchPriority:S,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},rn.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var m=o(u.as,u.crossOrigin);s.d.M(c,{crossOrigin:m,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&s.d.M(c)},rn.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var m=u.as,f=o(m,u.crossOrigin);s.d.L(c,m,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},rn.preloadModule=function(c,u){if(typeof c=="string")if(u){var m=o(u.as,u.crossOrigin);s.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:m,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else s.d.m(c)},rn.requestFormReset=function(c){s.d.r(c)},rn.unstable_batchedUpdates=function(c,u){return c(u)},rn.useFormState=function(c,u,m){return d.H.useFormState(c,u,m)},rn.useFormStatus=function(){return d.H.useHostTransitionStatus()},rn.version="19.2.4",rn}var wb;function Tx(){if(wb)return ep.exports;wb=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(n){console.error(n)}}return e(),ep.exports=K2(),ep.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 Cb;function Y2(){if(Cb)return Jo;Cb=1;var e=W2(),n=wm(),i=Tx();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function h(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function o(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function c(t){if(h(t)!==t)throw Error(s(188))}function u(t){var r=t.alternate;if(!r){if(r=h(t),r===null)throw Error(s(188));return r!==t?null:t}for(var a=t,p=r;;){var C=a.return;if(C===null)break;var A=C.alternate;if(A===null){if(p=C.return,p!==null){a=p;continue}break}if(C.child===A.child){for(A=C.child;A;){if(A===a)return c(C),t;if(A===p)return c(C),r;A=A.sibling}throw Error(s(188))}if(a.return!==p.return)a=C,p=A;else{for(var I=!1,G=C.child;G;){if(G===a){I=!0,a=C,p=A;break}if(G===p){I=!0,p=C,a=A;break}G=G.sibling}if(!I){for(G=A.child;G;){if(G===a){I=!0,a=A,p=C;break}if(G===p){I=!0,p=A,a=C;break}G=G.sibling}if(!I)throw Error(s(189))}}if(a.alternate!==p)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function m(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=m(t),r!==null)return r;t=t.sibling}return null}var f=Object.assign,y=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),x=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function q(t){return t===null||typeof t!="object"?null:(t=U&&t[U]||t["@@iterator"],typeof t=="function"?t:null)}var $=Symbol.for("react.client.reference");function K(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===$?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case w:return"Fragment";case b:return"Profiler";case _:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList";case O:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case x:return t.displayName||"Context";case v:return(t._context.displayName||"Context")+".Consumer";case E:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case j:return r=t.displayName||null,r!==null?r:K(t.type)||"Memo";case D:r=t._payload,t=t._init;try{return K(t(r))}catch{}}return null}var Y=Array.isArray,V=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},F=[],N=-1;function L(t){return{current:t}}function B(t){0>N||(t.current=F[N],F[N]=null,N--)}function z(t,r){N++,F[N]=t.current,t.current=r}var X=L(null),J=L(null),te=L(null),W=L(null);function H(t,r){switch(z(te,r),z(J,t),z(X,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Py(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Py(r),t=Fy(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}B(X),z(X,t)}function ne(){B(X),B(J),B(te)}function ae(t){t.memoizedState!==null&&z(W,t);var r=X.current,a=Fy(r,t.type);r!==a&&(z(J,t),z(X,a))}function pe(t){J.current===t&&(B(X),B(J)),W.current===t&&(B(W),Ko._currentValue=Q)}var ue,Re;function Ie(t){if(ue===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);ue=r&&r[1]||"",Re=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ue+t+Re}var Fe=!1;function lt(t,r){if(!t||Fe)return"";Fe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(r){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(de){var ce=de}Reflect.construct(t,[],_e)}else{try{_e.call()}catch(de){ce=de}t.call(_e.prototype)}}else{try{throw Error()}catch(de){ce=de}(_e=t())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(de){if(de&&ce&&typeof de.stack=="string")return[de.stack,ce.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=p.DetermineComponentFrameRoot(),I=A[0],G=A[1];if(I&&G){var ee=I.split(`
44
- `),le=G.split(`
45
- `);for(C=p=0;p<ee.length&&!ee[p].includes("DetermineComponentFrameRoot");)p++;for(;C<le.length&&!le[C].includes("DetermineComponentFrameRoot");)C++;if(p===ee.length||C===le.length)for(p=ee.length-1,C=le.length-1;1<=p&&0<=C&&ee[p]!==le[C];)C--;for(;1<=p&&0<=C;p--,C--)if(ee[p]!==le[C]){if(p!==1||C!==1)do if(p--,C--,0>C||ee[p]!==le[C]){var fe=`
46
- `+ee[p].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),fe}while(1<=p&&0<=C);break}}}finally{Fe=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ie(a):""}function De(t,r){switch(t.tag){case 26:case 27:case 5:return Ie(t.type);case 16:return Ie("Lazy");case 13:return t.child!==r&&r!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return lt(t.type,!1);case 11:return lt(t.type.render,!1);case 1:return lt(t.type,!0);case 31:return Ie("Activity");default:return""}}function en(t){try{var r="",a=null;do r+=De(t,a),a=t,t=t.return;while(t);return r}catch(p){return`
47
- Error generating stack: `+p.message+`
48
- `+p.stack}}var Wt=Object.prototype.hasOwnProperty,fn=e.unstable_scheduleCallback,Kt=e.unstable_cancelCallback,ur=e.unstable_shouldYield,$t=e.unstable_requestPaint,gt=e.unstable_now,Mt=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,xe=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,qe=e.unstable_IdlePriority,wt=e.log,Xe=e.unstable_setDisableYieldValue,zt=null,Tt=null;function tn(t){if(typeof wt=="function"&&Xe(t),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(zt,t)}catch{}}var it=Math.clz32?Math.clz32:to,wn=Math.log,zn=Math.LN2;function to(t){return t>>>=0,t===0?32:31-(wn(t)/zn|0)|0}var ct=256,ut=262144,Ar=4194304;function Pn(t){var r=t&42;if(r!==0)return r;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 Zi(t,r,a){var p=t.pendingLanes;if(p===0)return 0;var C=0,A=t.suspendedLanes,I=t.pingedLanes;t=t.warmLanes;var G=p&134217727;return G!==0?(p=G&~A,p!==0?C=Pn(p):(I&=G,I!==0?C=Pn(I):a||(a=G&~t,a!==0&&(C=Pn(a))))):(G=p&~A,G!==0?C=Pn(G):I!==0?C=Pn(I):a||(a=p&~t,a!==0&&(C=Pn(a)))),C===0?0:r!==0&&r!==C&&(r&A)===0&&(A=C&-C,a=r&-r,A>=a||A===32&&(a&4194048)!==0)?r:C}function Cn(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function zd(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Os(){var t=Ar;return Ar<<=1,(Ar&62914560)===0&&(Ar=4194304),t}function Fn(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Qi(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Gl(t,r,a,p,C,A){var I=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var G=t.entanglements,ee=t.expirationTimes,le=t.hiddenUpdates;for(a=I&~a;0<a;){var fe=31-it(a),_e=1<<fe;G[fe]=0,ee[fe]=-1;var ce=le[fe];if(ce!==null)for(le[fe]=null,fe=0;fe<ce.length;fe++){var de=ce[fe];de!==null&&(de.lane&=-536870913)}a&=~_e}p!==0&&Wl(t,p,0),A!==0&&C===0&&t.tag!==0&&(t.suspendedLanes|=A&~(I&~r))}function Wl(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var p=31-it(r);t.entangledLanes|=r,t.entanglements[p]=t.entanglements[p]|1073741824|a&261930}function no(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var p=31-it(a),C=1<<p;C&r|t[p]&r&&(t[p]|=r),a&=~C}}function Kl(t,r){var a=r&-r;return a=(a&42)!==0?1:ro(a),(a&(t.suspendedLanes|r))!==0?0:a}function ro(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 io(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function so(){var t=Z.p;return t!==0?t:(t=window.event,t===void 0?32:cb(t.type))}function Ve(t,r){var a=Z.p;try{return Z.p=t,r()}finally{Z.p=a}}var dr=Math.random().toString(36).slice(2),Ct="__reactFiber$"+dr,nn="__reactProps$"+dr,ii="__reactContainer$"+dr,ao="__reactEvents$"+dr,Pd="__reactListeners$"+dr,Fd="__reactHandles$"+dr,Yl="__reactResources$"+dr,Ji="__reactMarker$"+dr;function oo(t){delete t[Ct],delete t[nn],delete t[ao],delete t[Pd],delete t[Fd]}function si(t){var r=t[Ct];if(r)return r;for(var a=t.parentNode;a;){if(r=a[ii]||a[Ct]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=Wy(t);t!==null;){if(a=t[Ct])return a;t=Wy(t)}return r}t=a,a=t.parentNode}return null}function ai(t){if(t=t[Ct]||t[ii]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function oi(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function li(t){var r=t[Yl];return r||(r=t[Yl]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Nt(t){t[Ji]=!0}var Xl=new Set,Zl={};function Tr(t,r){ci(t,r),ci(t+"Capture",r)}function ci(t,r){for(Zl[t]=r,t=0;t<r.length;t++)Xl.add(r[t])}var Hd=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]*$"),lo={},es={};function Ud(t){return Wt.call(es,t)?!0:Wt.call(lo,t)?!1:Hd.test(t)?es[t]=!0:(lo[t]=!0,!1)}function Ls(t,r,a){if(Ud(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var p=r.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function Pt(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function tr(t,r,a,p){if(p===null)t.removeAttribute(a);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+p)}}function on(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function co(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ql(t,r,a){var p=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var C=p.get,A=p.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return C.call(this)},set:function(I){a=""+I,A.call(this,I)}}),Object.defineProperty(t,r,{enumerable:p.enumerable}),{getValue:function(){return a},setValue:function(I){a=""+I},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Is(t){if(!t._valueTracker){var r=co(t)?"checked":"value";t._valueTracker=Ql(t,r,""+t[r])}}function re(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),p="";return t&&(p=co(t)?t.checked?"true":"false":t.value),t=p,t!==a?(r.setValue(t),!0):!1}function we(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 ge=/[\n"\\]/g;function me(t){return t.replace(ge,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function He(t,r,a,p,C,A,I,G){t.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?t.type=I:t.removeAttribute("type"),r!=null?I==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+on(r)):t.value!==""+on(r)&&(t.value=""+on(r)):I!=="submit"&&I!=="reset"||t.removeAttribute("value"),r!=null?ln(t,I,on(r)):a!=null?ln(t,I,on(a)):p!=null&&t.removeAttribute("value"),C==null&&A!=null&&(t.defaultChecked=!!A),C!=null&&(t.checked=C&&typeof C!="function"&&typeof C!="symbol"),G!=null&&typeof G!="function"&&typeof G!="symbol"&&typeof G!="boolean"?t.name=""+on(G):t.removeAttribute("name")}function kt(t,r,a,p,C,A,I,G){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(t.type=A),r!=null||a!=null){if(!(A!=="submit"&&A!=="reset"||r!=null)){Is(t);return}a=a!=null?""+on(a):"",r=r!=null?""+on(r):a,G||r===t.value||(t.value=r),t.defaultValue=r}p=p!=null?p:C,p=typeof p!="function"&&typeof p!="symbol"&&!!p,t.checked=G?t.checked:!!p,t.defaultChecked=!!p,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(t.name=I),Is(t)}function ln(t,r,a){r==="number"&&we(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function cn(t,r,a,p){if(t=t.options,r){r={};for(var C=0;C<a.length;C++)r["$"+a[C]]=!0;for(a=0;a<t.length;a++)C=r.hasOwnProperty("$"+t[a].value),t[a].selected!==C&&(t[a].selected=C),C&&p&&(t[a].defaultSelected=!0)}else{for(a=""+on(a),r=null,C=0;C<t.length;C++){if(t[C].value===a){t[C].selected=!0,p&&(t[C].defaultSelected=!0);return}r!==null||t[C].disabled||(r=t[C])}r!==null&&(r.selected=!0)}}function hr(t,r,a){if(r!=null&&(r=""+on(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a!=null?""+on(a):""}function ts(t,r,a,p){if(r==null){if(p!=null){if(a!=null)throw Error(s(92));if(Y(p)){if(1<p.length)throw Error(s(93));p=p[0]}a=p}a==null&&(a=""),r=a}a=on(r),t.defaultValue=a,p=t.textContent,p===a&&p!==""&&p!==null&&(t.value=p),Is(t)}function fr(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var $d=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 Ig(t,r,a){var p=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?p?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":p?t.setProperty(r,a):typeof a!="number"||a===0||$d.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function Bg(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var p in a)!a.hasOwnProperty(p)||r!=null&&r.hasOwnProperty(p)||(p.indexOf("--")===0?t.setProperty(p,""):p==="float"?t.cssFloat="":t[p]="");for(var C in r)p=r[C],r.hasOwnProperty(C)&&a[C]!==p&&Ig(t,C,p)}else for(var A in r)r.hasOwnProperty(A)&&Ig(t,A,r[A])}function qd(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 zk=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"]]),Pk=/^[\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 Jl(t){return Pk.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Rr(){}var Vd=null;function Gd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Bs=null,zs=null;function zg(t){var r=ai(t);if(r&&(t=r.stateNode)){var a=t[nn]||null;e:switch(t=r.stateNode,r.type){case"input":if(He(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+me(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var p=a[r];if(p!==t&&p.form===t.form){var C=p[nn]||null;if(!C)throw Error(s(90));He(p,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(r=0;r<a.length;r++)p=a[r],p.form===t.form&&re(p)}break e;case"textarea":hr(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&cn(t,!!a.multiple,r,!1)}}}var Wd=!1;function Pg(t,r,a){if(Wd)return t(r,a);Wd=!0;try{var p=t(r);return p}finally{if(Wd=!1,(Bs!==null||zs!==null)&&(Fc(),Bs&&(r=Bs,t=zs,zs=Bs=null,zg(r),t)))for(r=0;r<t.length;r++)zg(t[r])}}function uo(t,r){var a=t.stateNode;if(a===null)return null;var p=a[nn]||null;if(p===null)return null;a=p[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(t=t.type,p=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!p;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kd=!1;if(Dr)try{var ho={};Object.defineProperty(ho,"passive",{get:function(){Kd=!0}}),window.addEventListener("test",ho,ho),window.removeEventListener("test",ho,ho)}catch{Kd=!1}var ui=null,Yd=null,ec=null;function Fg(){if(ec)return ec;var t,r=Yd,a=r.length,p,C="value"in ui?ui.value:ui.textContent,A=C.length;for(t=0;t<a&&r[t]===C[t];t++);var I=a-t;for(p=1;p<=I&&r[a-p]===C[A-p];p++);return ec=C.slice(t,1<p?1-p:void 0)}function tc(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function nc(){return!0}function Hg(){return!1}function pn(t){function r(a,p,C,A,I){this._reactName=a,this._targetInst=C,this.type=p,this.nativeEvent=A,this.target=I,this.currentTarget=null;for(var G in t)t.hasOwnProperty(G)&&(a=t[G],this[G]=a?a(A):A[G]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?nc:Hg,this.isPropagationStopped=Hg,this}return f(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=nc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=nc)},persist:function(){},isPersistent:nc}),r}var ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rc=pn(ns),fo=f({},ns,{view:0,detail:0}),Fk=pn(fo),Xd,Zd,po,ic=f({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jd,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!==po&&(po&&t.type==="mousemove"?(Xd=t.screenX-po.screenX,Zd=t.screenY-po.screenY):Zd=Xd=0,po=t),Xd)},movementY:function(t){return"movementY"in t?t.movementY:Zd}}),Ug=pn(ic),Hk=f({},ic,{dataTransfer:0}),Uk=pn(Hk),$k=f({},fo,{relatedTarget:0}),Qd=pn($k),qk=f({},ns,{animationName:0,elapsedTime:0,pseudoElement:0}),Vk=pn(qk),Gk=f({},ns,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Wk=pn(Gk),Kk=f({},ns,{data:0}),$g=pn(Kk),Yk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xk={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"},Zk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qk(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=Zk[t])?!!r[t]:!1}function Jd(){return Qk}var Jk=f({},fo,{key:function(t){if(t.key){var r=Yk[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=tc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Xk[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jd,charCode:function(t){return t.type==="keypress"?tc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?tc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),eE=pn(Jk),tE=f({},ic,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qg=pn(tE),nE=f({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jd}),rE=pn(nE),iE=f({},ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),sE=pn(iE),aE=f({},ic,{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}),oE=pn(aE),lE=f({},ns,{newState:0,oldState:0}),cE=pn(lE),uE=[9,13,27,32],eh=Dr&&"CompositionEvent"in window,mo=null;Dr&&"documentMode"in document&&(mo=document.documentMode);var dE=Dr&&"TextEvent"in window&&!mo,Vg=Dr&&(!eh||mo&&8<mo&&11>=mo),Gg=" ",Wg=!1;function Kg(t,r){switch(t){case"keyup":return uE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ps=!1;function hE(t,r){switch(t){case"compositionend":return Yg(r);case"keypress":return r.which!==32?null:(Wg=!0,Gg);case"textInput":return t=r.data,t===Gg&&Wg?null:t;default:return null}}function fE(t,r){if(Ps)return t==="compositionend"||!eh&&Kg(t,r)?(t=Fg(),ec=Yd=ui=null,Ps=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Vg&&r.locale!=="ko"?null:r.data;default:return null}}var pE={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 Xg(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!pE[t.type]:r==="textarea"}function Zg(t,r,a,p){Bs?zs?zs.push(p):zs=[p]:Bs=p,r=Wc(r,"onChange"),0<r.length&&(a=new rc("onChange","change",null,a,p),t.push({event:a,listeners:r}))}var go=null,vo=null;function mE(t){jy(t,0)}function sc(t){var r=oi(t);if(re(r))return t}function Qg(t,r){if(t==="change")return r}var Jg=!1;if(Dr){var th;if(Dr){var nh="oninput"in document;if(!nh){var ev=document.createElement("div");ev.setAttribute("oninput","return;"),nh=typeof ev.oninput=="function"}th=nh}else th=!1;Jg=th&&(!document.documentMode||9<document.documentMode)}function tv(){go&&(go.detachEvent("onpropertychange",nv),vo=go=null)}function nv(t){if(t.propertyName==="value"&&sc(vo)){var r=[];Zg(r,vo,t,Gd(t)),Pg(mE,r)}}function gE(t,r,a){t==="focusin"?(tv(),go=r,vo=a,go.attachEvent("onpropertychange",nv)):t==="focusout"&&tv()}function vE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return sc(vo)}function _E(t,r){if(t==="click")return sc(r)}function yE(t,r){if(t==="input"||t==="change")return sc(r)}function bE(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var kn=typeof Object.is=="function"?Object.is:bE;function _o(t,r){if(kn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),p=Object.keys(r);if(a.length!==p.length)return!1;for(p=0;p<a.length;p++){var C=a[p];if(!Wt.call(r,C)||!kn(t[C],r[C]))return!1}return!0}function rv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function iv(t,r){var a=rv(t);t=0;for(var p;a;){if(a.nodeType===3){if(p=t+a.textContent.length,t<=r&&p>=r)return{node:a,offset:r-t};t=p}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=rv(a)}}function sv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?sv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function av(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=we(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=we(t.document)}return r}function rh(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var xE=Dr&&"documentMode"in document&&11>=document.documentMode,Fs=null,ih=null,yo=null,sh=!1;function ov(t,r,a){var p=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;sh||Fs==null||Fs!==we(p)||(p=Fs,"selectionStart"in p&&rh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),yo&&_o(yo,p)||(yo=p,p=Wc(ih,"onSelect"),0<p.length&&(r=new rc("onSelect","select",null,r,a),t.push({event:r,listeners:p}),r.target=Fs)))}function rs(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Hs={animationend:rs("Animation","AnimationEnd"),animationiteration:rs("Animation","AnimationIteration"),animationstart:rs("Animation","AnimationStart"),transitionrun:rs("Transition","TransitionRun"),transitionstart:rs("Transition","TransitionStart"),transitioncancel:rs("Transition","TransitionCancel"),transitionend:rs("Transition","TransitionEnd")},ah={},lv={};Dr&&(lv=document.createElement("div").style,"AnimationEvent"in window||(delete Hs.animationend.animation,delete Hs.animationiteration.animation,delete Hs.animationstart.animation),"TransitionEvent"in window||delete Hs.transitionend.transition);function is(t){if(ah[t])return ah[t];if(!Hs[t])return t;var r=Hs[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in lv)return ah[t]=r[a];return t}var cv=is("animationend"),uv=is("animationiteration"),dv=is("animationstart"),SE=is("transitionrun"),wE=is("transitionstart"),CE=is("transitioncancel"),hv=is("transitionend"),fv=new Map,oh="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(" ");oh.push("scrollEnd");function nr(t,r){fv.set(t,r),Tr(r,[t])}var ac=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Hn=[],Us=0,lh=0;function oc(){for(var t=Us,r=lh=Us=0;r<t;){var a=Hn[r];Hn[r++]=null;var p=Hn[r];Hn[r++]=null;var C=Hn[r];Hn[r++]=null;var A=Hn[r];if(Hn[r++]=null,p!==null&&C!==null){var I=p.pending;I===null?C.next=C:(C.next=I.next,I.next=C),p.pending=C}A!==0&&pv(a,C,A)}}function lc(t,r,a,p){Hn[Us++]=t,Hn[Us++]=r,Hn[Us++]=a,Hn[Us++]=p,lh|=p,t.lanes|=p,t=t.alternate,t!==null&&(t.lanes|=p)}function ch(t,r,a,p){return lc(t,r,a,p),cc(t)}function ss(t,r){return lc(t,null,null,r),cc(t)}function pv(t,r,a){t.lanes|=a;var p=t.alternate;p!==null&&(p.lanes|=a);for(var C=!1,A=t.return;A!==null;)A.childLanes|=a,p=A.alternate,p!==null&&(p.childLanes|=a),A.tag===22&&(t=A.stateNode,t===null||t._visibility&1||(C=!0)),t=A,A=A.return;return t.tag===3?(A=t.stateNode,C&&r!==null&&(C=31-it(a),t=A.hiddenUpdates,p=t[C],p===null?t[C]=[r]:p.push(r),r.lane=a|536870912),A):null}function cc(t){if(50<Ho)throw Ho=0,yf=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var $s={};function kE(t,r,a,p){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(t,r,a,p){return new kE(t,r,a,p)}function uh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Mr(t,r){var a=t.alternate;return a===null?(a=En(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function mv(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function uc(t,r,a,p,C,A){var I=0;if(p=t,typeof t=="function")uh(t)&&(I=1);else if(typeof t=="string")I=D2(t,a,X.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O:return t=En(31,a,r,C),t.elementType=O,t.lanes=A,t;case w:return as(a.children,C,A,r);case _:I=8,C|=24;break;case b:return t=En(12,a,r,C|2),t.elementType=b,t.lanes=A,t;case M:return t=En(13,a,r,C),t.elementType=M,t.lanes=A,t;case R:return t=En(19,a,r,C),t.elementType=R,t.lanes=A,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case x:I=10;break e;case v:I=9;break e;case E:I=11;break e;case j:I=14;break e;case D:I=16,p=null;break e}I=29,a=Error(s(130,t===null?"null":typeof t,"")),p=null}return r=En(I,a,r,C),r.elementType=t,r.type=p,r.lanes=A,r}function as(t,r,a,p){return t=En(7,t,p,r),t.lanes=a,t}function dh(t,r,a){return t=En(6,t,null,r),t.lanes=a,t}function gv(t){var r=En(18,null,null,0);return r.stateNode=t,r}function hh(t,r,a){return r=En(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var vv=new WeakMap;function Un(t,r){if(typeof t=="object"&&t!==null){var a=vv.get(t);return a!==void 0?a:(r={value:t,source:r,stack:en(r)},vv.set(t,r),r)}return{value:t,source:r,stack:en(r)}}var qs=[],Vs=0,dc=null,bo=0,$n=[],qn=0,di=null,pr=1,mr="";function Nr(t,r){qs[Vs++]=bo,qs[Vs++]=dc,dc=t,bo=r}function _v(t,r,a){$n[qn++]=pr,$n[qn++]=mr,$n[qn++]=di,di=t;var p=pr;t=mr;var C=32-it(p)-1;p&=~(1<<C),a+=1;var A=32-it(r)+C;if(30<A){var I=C-C%5;A=(p&(1<<I)-1).toString(32),p>>=I,C-=I,pr=1<<32-it(r)+C|a<<C|p,mr=A+t}else pr=1<<A|a<<C|p,mr=t}function fh(t){t.return!==null&&(Nr(t,1),_v(t,1,0))}function ph(t){for(;t===dc;)dc=qs[--Vs],qs[Vs]=null,bo=qs[--Vs],qs[Vs]=null;for(;t===di;)di=$n[--qn],$n[qn]=null,mr=$n[--qn],$n[qn]=null,pr=$n[--qn],$n[qn]=null}function yv(t,r){$n[qn++]=pr,$n[qn++]=mr,$n[qn++]=di,pr=r.id,mr=r.overflow,di=t}var Yt=null,bt=null,nt=!1,hi=null,Vn=!1,mh=Error(s(519));function fi(t){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xo(Un(r,t)),mh}function bv(t){var r=t.stateNode,a=t.type,p=t.memoizedProps;switch(r[Ct]=t,r[nn]=p,a){case"dialog":Qe("cancel",r),Qe("close",r);break;case"iframe":case"object":case"embed":Qe("load",r);break;case"video":case"audio":for(a=0;a<$o.length;a++)Qe($o[a],r);break;case"source":Qe("error",r);break;case"img":case"image":case"link":Qe("error",r),Qe("load",r);break;case"details":Qe("toggle",r);break;case"input":Qe("invalid",r),kt(r,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Qe("invalid",r);break;case"textarea":Qe("invalid",r),ts(r,p.value,p.defaultValue,p.children)}a=p.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||p.suppressHydrationWarning===!0||By(r.textContent,a)?(p.popover!=null&&(Qe("beforetoggle",r),Qe("toggle",r)),p.onScroll!=null&&Qe("scroll",r),p.onScrollEnd!=null&&Qe("scrollend",r),p.onClick!=null&&(r.onclick=Rr),r=!0):r=!1,r||fi(t,!0)}function xv(t){for(Yt=t.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Vn=!1;return;case 27:case 3:Vn=!0;return;default:Yt=Yt.return}}function Gs(t){if(t!==Yt)return!1;if(!nt)return xv(t),nt=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Of(t.type,t.memoizedProps)),a=!a),a&&bt&&fi(t),xv(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));bt=Gy(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));bt=Gy(t)}else r===27?(r=bt,Ai(t.type)?(t=Pf,Pf=null,bt=t):bt=r):bt=Yt?Wn(t.stateNode.nextSibling):null;return!0}function os(){bt=Yt=null,nt=!1}function gh(){var t=hi;return t!==null&&(_n===null?_n=t:_n.push.apply(_n,t),hi=null),t}function xo(t){hi===null?hi=[t]:hi.push(t)}var vh=L(null),ls=null,jr=null;function pi(t,r,a){z(vh,r._currentValue),r._currentValue=a}function Or(t){t._currentValue=vh.current,B(vh)}function _h(t,r,a){for(;t!==null;){var p=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,p!==null&&(p.childLanes|=r)):p!==null&&(p.childLanes&r)!==r&&(p.childLanes|=r),t===a)break;t=t.return}}function yh(t,r,a,p){var C=t.child;for(C!==null&&(C.return=t);C!==null;){var A=C.dependencies;if(A!==null){var I=C.child;A=A.firstContext;e:for(;A!==null;){var G=A;A=C;for(var ee=0;ee<r.length;ee++)if(G.context===r[ee]){A.lanes|=a,G=A.alternate,G!==null&&(G.lanes|=a),_h(A.return,a,t),p||(I=null);break e}A=G.next}}else if(C.tag===18){if(I=C.return,I===null)throw Error(s(341));I.lanes|=a,A=I.alternate,A!==null&&(A.lanes|=a),_h(I,a,t),I=null}else I=C.child;if(I!==null)I.return=C;else for(I=C;I!==null;){if(I===t){I=null;break}if(C=I.sibling,C!==null){C.return=I.return,I=C;break}I=I.return}C=I}}function Ws(t,r,a,p){t=null;for(var C=r,A=!1;C!==null;){if(!A){if((C.flags&524288)!==0)A=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var I=C.alternate;if(I===null)throw Error(s(387));if(I=I.memoizedProps,I!==null){var G=C.type;kn(C.pendingProps.value,I.value)||(t!==null?t.push(G):t=[G])}}else if(C===W.current){if(I=C.alternate,I===null)throw Error(s(387));I.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(t!==null?t.push(Ko):t=[Ko])}C=C.return}t!==null&&yh(r,t,a,p),r.flags|=262144}function hc(t){for(t=t.firstContext;t!==null;){if(!kn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function cs(t){ls=t,jr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Xt(t){return Sv(ls,t)}function fc(t,r){return ls===null&&cs(t),Sv(t,r)}function Sv(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},jr===null){if(t===null)throw Error(s(308));jr=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else jr=jr.next=r;return a}var EE=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,p){t.push(p)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},AE=e.unstable_scheduleCallback,TE=e.unstable_NormalPriority,jt={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function bh(){return{controller:new EE,data:new Map,refCount:0}}function So(t){t.refCount--,t.refCount===0&&AE(TE,function(){t.controller.abort()})}var wo=null,xh=0,Ks=0,Ys=null;function RE(t,r){if(wo===null){var a=wo=[];xh=0,Ks=kf(),Ys={status:"pending",value:void 0,then:function(p){a.push(p)}}}return xh++,r.then(wv,wv),r}function wv(){if(--xh===0&&wo!==null){Ys!==null&&(Ys.status="fulfilled");var t=wo;wo=null,Ks=0,Ys=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function DE(t,r){var a=[],p={status:"pending",value:null,reason:null,then:function(C){a.push(C)}};return t.then(function(){p.status="fulfilled",p.value=r;for(var C=0;C<a.length;C++)(0,a[C])(r)},function(C){for(p.status="rejected",p.reason=C,C=0;C<a.length;C++)(0,a[C])(void 0)}),p}var Cv=V.S;V.S=function(t,r){oy=gt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&RE(t,r),Cv!==null&&Cv(t,r)};var us=L(null);function Sh(){var t=us.current;return t!==null?t:vt.pooledCache}function pc(t,r){r===null?z(us,us.current):z(us,r.pool)}function kv(){var t=Sh();return t===null?null:{parent:jt._currentValue,pool:t}}var Xs=Error(s(460)),wh=Error(s(474)),mc=Error(s(542)),gc={then:function(){}};function Ev(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Av(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(Rr,Rr),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Rv(t),t;default:if(typeof r.status=="string")r.then(Rr,Rr);else{if(t=vt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(p){if(r.status==="pending"){var C=r;C.status="fulfilled",C.value=p}},function(p){if(r.status==="pending"){var C=r;C.status="rejected",C.reason=p}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Rv(t),t}throw hs=r,Xs}}function ds(t){try{var r=t._init;return r(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(hs=a,Xs):a}}var hs=null;function Tv(){if(hs===null)throw Error(s(459));var t=hs;return hs=null,t}function Rv(t){if(t===Xs||t===mc)throw Error(s(483))}var Zs=null,Co=0;function vc(t){var r=Co;return Co+=1,Zs===null&&(Zs=[]),Av(Zs,t,r)}function ko(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function _c(t,r){throw r.$$typeof===y?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Dv(t){function r(se,ie){if(t){var oe=se.deletions;oe===null?(se.deletions=[ie],se.flags|=16):oe.push(ie)}}function a(se,ie){if(!t)return null;for(;ie!==null;)r(se,ie),ie=ie.sibling;return null}function p(se){for(var ie=new Map;se!==null;)se.key!==null?ie.set(se.key,se):ie.set(se.index,se),se=se.sibling;return ie}function C(se,ie){return se=Mr(se,ie),se.index=0,se.sibling=null,se}function A(se,ie,oe){return se.index=oe,t?(oe=se.alternate,oe!==null?(oe=oe.index,oe<ie?(se.flags|=67108866,ie):oe):(se.flags|=67108866,ie)):(se.flags|=1048576,ie)}function I(se){return t&&se.alternate===null&&(se.flags|=67108866),se}function G(se,ie,oe,ve){return ie===null||ie.tag!==6?(ie=dh(oe,se.mode,ve),ie.return=se,ie):(ie=C(ie,oe),ie.return=se,ie)}function ee(se,ie,oe,ve){var Le=oe.type;return Le===w?fe(se,ie,oe.props.children,ve,oe.key):ie!==null&&(ie.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===D&&ds(Le)===ie.type)?(ie=C(ie,oe.props),ko(ie,oe),ie.return=se,ie):(ie=uc(oe.type,oe.key,oe.props,null,se.mode,ve),ko(ie,oe),ie.return=se,ie)}function le(se,ie,oe,ve){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==oe.containerInfo||ie.stateNode.implementation!==oe.implementation?(ie=hh(oe,se.mode,ve),ie.return=se,ie):(ie=C(ie,oe.children||[]),ie.return=se,ie)}function fe(se,ie,oe,ve,Le){return ie===null||ie.tag!==7?(ie=as(oe,se.mode,ve,Le),ie.return=se,ie):(ie=C(ie,oe),ie.return=se,ie)}function _e(se,ie,oe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=dh(""+ie,se.mode,oe),ie.return=se,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case S:return oe=uc(ie.type,ie.key,ie.props,null,se.mode,oe),ko(oe,ie),oe.return=se,oe;case k:return ie=hh(ie,se.mode,oe),ie.return=se,ie;case D:return ie=ds(ie),_e(se,ie,oe)}if(Y(ie)||q(ie))return ie=as(ie,se.mode,oe,null),ie.return=se,ie;if(typeof ie.then=="function")return _e(se,vc(ie),oe);if(ie.$$typeof===x)return _e(se,fc(se,ie),oe);_c(se,ie)}return null}function ce(se,ie,oe,ve){var Le=ie!==null?ie.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Le!==null?null:G(se,ie,""+oe,ve);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return oe.key===Le?ee(se,ie,oe,ve):null;case k:return oe.key===Le?le(se,ie,oe,ve):null;case D:return oe=ds(oe),ce(se,ie,oe,ve)}if(Y(oe)||q(oe))return Le!==null?null:fe(se,ie,oe,ve,null);if(typeof oe.then=="function")return ce(se,ie,vc(oe),ve);if(oe.$$typeof===x)return ce(se,ie,fc(se,oe),ve);_c(se,oe)}return null}function de(se,ie,oe,ve,Le){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return se=se.get(oe)||null,G(ie,se,""+ve,Le);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case S:return se=se.get(ve.key===null?oe:ve.key)||null,ee(ie,se,ve,Le);case k:return se=se.get(ve.key===null?oe:ve.key)||null,le(ie,se,ve,Le);case D:return ve=ds(ve),de(se,ie,oe,ve,Le)}if(Y(ve)||q(ve))return se=se.get(oe)||null,fe(ie,se,ve,Le,null);if(typeof ve.then=="function")return de(se,ie,oe,vc(ve),Le);if(ve.$$typeof===x)return de(se,ie,oe,fc(ie,ve),Le);_c(ie,ve)}return null}function ke(se,ie,oe,ve){for(var Le=null,st=null,Me=ie,Ge=ie=0,tt=null;Me!==null&&Ge<oe.length;Ge++){Me.index>Ge?(tt=Me,Me=null):tt=Me.sibling;var at=ce(se,Me,oe[Ge],ve);if(at===null){Me===null&&(Me=tt);break}t&&Me&&at.alternate===null&&r(se,Me),ie=A(at,ie,Ge),st===null?Le=at:st.sibling=at,st=at,Me=tt}if(Ge===oe.length)return a(se,Me),nt&&Nr(se,Ge),Le;if(Me===null){for(;Ge<oe.length;Ge++)Me=_e(se,oe[Ge],ve),Me!==null&&(ie=A(Me,ie,Ge),st===null?Le=Me:st.sibling=Me,st=Me);return nt&&Nr(se,Ge),Le}for(Me=p(Me);Ge<oe.length;Ge++)tt=de(Me,se,Ge,oe[Ge],ve),tt!==null&&(t&&tt.alternate!==null&&Me.delete(tt.key===null?Ge:tt.key),ie=A(tt,ie,Ge),st===null?Le=tt:st.sibling=tt,st=tt);return t&&Me.forEach(function(Ni){return r(se,Ni)}),nt&&Nr(se,Ge),Le}function ze(se,ie,oe,ve){if(oe==null)throw Error(s(151));for(var Le=null,st=null,Me=ie,Ge=ie=0,tt=null,at=oe.next();Me!==null&&!at.done;Ge++,at=oe.next()){Me.index>Ge?(tt=Me,Me=null):tt=Me.sibling;var Ni=ce(se,Me,at.value,ve);if(Ni===null){Me===null&&(Me=tt);break}t&&Me&&Ni.alternate===null&&r(se,Me),ie=A(Ni,ie,Ge),st===null?Le=Ni:st.sibling=Ni,st=Ni,Me=tt}if(at.done)return a(se,Me),nt&&Nr(se,Ge),Le;if(Me===null){for(;!at.done;Ge++,at=oe.next())at=_e(se,at.value,ve),at!==null&&(ie=A(at,ie,Ge),st===null?Le=at:st.sibling=at,st=at);return nt&&Nr(se,Ge),Le}for(Me=p(Me);!at.done;Ge++,at=oe.next())at=de(Me,se,Ge,at.value,ve),at!==null&&(t&&at.alternate!==null&&Me.delete(at.key===null?Ge:at.key),ie=A(at,ie,Ge),st===null?Le=at:st.sibling=at,st=at);return t&&Me.forEach(function(H2){return r(se,H2)}),nt&&Nr(se,Ge),Le}function mt(se,ie,oe,ve){if(typeof oe=="object"&&oe!==null&&oe.type===w&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:e:{for(var Le=oe.key;ie!==null;){if(ie.key===Le){if(Le=oe.type,Le===w){if(ie.tag===7){a(se,ie.sibling),ve=C(ie,oe.props.children),ve.return=se,se=ve;break e}}else if(ie.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===D&&ds(Le)===ie.type){a(se,ie.sibling),ve=C(ie,oe.props),ko(ve,oe),ve.return=se,se=ve;break e}a(se,ie);break}else r(se,ie);ie=ie.sibling}oe.type===w?(ve=as(oe.props.children,se.mode,ve,oe.key),ve.return=se,se=ve):(ve=uc(oe.type,oe.key,oe.props,null,se.mode,ve),ko(ve,oe),ve.return=se,se=ve)}return I(se);case k:e:{for(Le=oe.key;ie!==null;){if(ie.key===Le)if(ie.tag===4&&ie.stateNode.containerInfo===oe.containerInfo&&ie.stateNode.implementation===oe.implementation){a(se,ie.sibling),ve=C(ie,oe.children||[]),ve.return=se,se=ve;break e}else{a(se,ie);break}else r(se,ie);ie=ie.sibling}ve=hh(oe,se.mode,ve),ve.return=se,se=ve}return I(se);case D:return oe=ds(oe),mt(se,ie,oe,ve)}if(Y(oe))return ke(se,ie,oe,ve);if(q(oe)){if(Le=q(oe),typeof Le!="function")throw Error(s(150));return oe=Le.call(oe),ze(se,ie,oe,ve)}if(typeof oe.then=="function")return mt(se,ie,vc(oe),ve);if(oe.$$typeof===x)return mt(se,ie,fc(se,oe),ve);_c(se,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,ie!==null&&ie.tag===6?(a(se,ie.sibling),ve=C(ie,oe),ve.return=se,se=ve):(a(se,ie),ve=dh(oe,se.mode,ve),ve.return=se,se=ve),I(se)):a(se,ie)}return function(se,ie,oe,ve){try{Co=0;var Le=mt(se,ie,oe,ve);return Zs=null,Le}catch(Me){if(Me===Xs||Me===mc)throw Me;var st=En(29,Me,null,se.mode);return st.lanes=ve,st.return=se,st}finally{}}}var fs=Dv(!0),Mv=Dv(!1),mi=!1;function Ch(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function gi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function vi(t,r,a){var p=t.updateQueue;if(p===null)return null;if(p=p.shared,(ot&2)!==0){var C=p.pending;return C===null?r.next=r:(r.next=C.next,C.next=r),p.pending=r,r=cc(t),pv(t,null,a),r}return lc(t,p,r,a),cc(t)}function Eo(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var p=r.lanes;p&=t.pendingLanes,a|=p,r.lanes=a,no(t,a)}}function Eh(t,r){var a=t.updateQueue,p=t.alternate;if(p!==null&&(p=p.updateQueue,a===p)){var C=null,A=null;if(a=a.firstBaseUpdate,a!==null){do{var I={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};A===null?C=A=I:A=A.next=I,a=a.next}while(a!==null);A===null?C=A=r:A=A.next=r}else C=A=r;a={baseState:p.baseState,firstBaseUpdate:C,lastBaseUpdate:A,shared:p.shared,callbacks:p.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var Ah=!1;function Ao(){if(Ah){var t=Ys;if(t!==null)throw t}}function To(t,r,a,p){Ah=!1;var C=t.updateQueue;mi=!1;var A=C.firstBaseUpdate,I=C.lastBaseUpdate,G=C.shared.pending;if(G!==null){C.shared.pending=null;var ee=G,le=ee.next;ee.next=null,I===null?A=le:I.next=le,I=ee;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,G=fe.lastBaseUpdate,G!==I&&(G===null?fe.firstBaseUpdate=le:G.next=le,fe.lastBaseUpdate=ee))}if(A!==null){var _e=C.baseState;I=0,fe=le=ee=null,G=A;do{var ce=G.lane&-536870913,de=ce!==G.lane;if(de?(et&ce)===ce:(p&ce)===ce){ce!==0&&ce===Ks&&(Ah=!0),fe!==null&&(fe=fe.next={lane:0,tag:G.tag,payload:G.payload,callback:null,next:null});e:{var ke=t,ze=G;ce=r;var mt=a;switch(ze.tag){case 1:if(ke=ze.payload,typeof ke=="function"){_e=ke.call(mt,_e,ce);break e}_e=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=ze.payload,ce=typeof ke=="function"?ke.call(mt,_e,ce):ke,ce==null)break e;_e=f({},_e,ce);break e;case 2:mi=!0}}ce=G.callback,ce!==null&&(t.flags|=64,de&&(t.flags|=8192),de=C.callbacks,de===null?C.callbacks=[ce]:de.push(ce))}else de={lane:ce,tag:G.tag,payload:G.payload,callback:G.callback,next:null},fe===null?(le=fe=de,ee=_e):fe=fe.next=de,I|=ce;if(G=G.next,G===null){if(G=C.shared.pending,G===null)break;de=G,G=de.next,de.next=null,C.lastBaseUpdate=de,C.shared.pending=null}}while(!0);fe===null&&(ee=_e),C.baseState=ee,C.firstBaseUpdate=le,C.lastBaseUpdate=fe,A===null&&(C.shared.lanes=0),Si|=I,t.lanes=I,t.memoizedState=_e}}function Nv(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function jv(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Nv(a[t],r)}var Qs=L(null),yc=L(0);function Ov(t,r){t=$r,z(yc,t),z(Qs,r),$r=t|r.baseLanes}function Th(){z(yc,$r),z(Qs,Qs.current)}function Rh(){$r=yc.current,B(Qs),B(yc)}var An=L(null),Gn=null;function _i(t){var r=t.alternate;z(Rt,Rt.current&1),z(An,t),Gn===null&&(r===null||Qs.current!==null||r.memoizedState!==null)&&(Gn=t)}function Dh(t){z(Rt,Rt.current),z(An,t),Gn===null&&(Gn=t)}function Lv(t){t.tag===22?(z(Rt,Rt.current),z(An,t),Gn===null&&(Gn=t)):yi()}function yi(){z(Rt,Rt.current),z(An,An.current)}function Tn(t){B(An),Gn===t&&(Gn=null),B(Rt)}var Rt=L(0);function bc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Bf(a)||zf(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Lr=0,$e=null,ft=null,Ot=null,xc=!1,Js=!1,ps=!1,Sc=0,Ro=0,ea=null,ME=0;function Et(){throw Error(s(321))}function Mh(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!kn(t[a],r[a]))return!1;return!0}function Nh(t,r,a,p,C,A){return Lr=A,$e=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,V.H=t===null||t.memoizedState===null?__:Wh,ps=!1,A=a(p,C),ps=!1,Js&&(A=Bv(r,a,p,C)),Iv(t),A}function Iv(t){V.H=No;var r=ft!==null&&ft.next!==null;if(Lr=0,Ot=ft=$e=null,xc=!1,Ro=0,ea=null,r)throw Error(s(300));t===null||Lt||(t=t.dependencies,t!==null&&hc(t)&&(Lt=!0))}function Bv(t,r,a,p){$e=t;var C=0;do{if(Js&&(ea=null),Ro=0,Js=!1,25<=C)throw Error(s(301));if(C+=1,Ot=ft=null,t.updateQueue!=null){var A=t.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}V.H=y_,A=r(a,p)}while(Js);return A}function NE(){var t=V.H,r=t.useState()[0];return r=typeof r.then=="function"?Do(r):r,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&($e.flags|=1024),r}function jh(){var t=Sc!==0;return Sc=0,t}function Oh(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function Lh(t){if(xc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}xc=!1}Lr=0,Ot=ft=$e=null,Js=!1,Ro=Sc=0,ea=null}function un(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?$e.memoizedState=Ot=t:Ot=Ot.next=t,Ot}function Dt(){if(ft===null){var t=$e.alternate;t=t!==null?t.memoizedState:null}else t=ft.next;var r=Ot===null?$e.memoizedState:Ot.next;if(r!==null)Ot=r,ft=t;else{if(t===null)throw $e.alternate===null?Error(s(467)):Error(s(310));ft=t,t={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Ot===null?$e.memoizedState=Ot=t:Ot=Ot.next=t}return Ot}function wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Do(t){var r=Ro;return Ro+=1,ea===null&&(ea=[]),t=Av(ea,t,r),r=$e,(Ot===null?r.memoizedState:Ot.next)===null&&(r=r.alternate,V.H=r===null||r.memoizedState===null?__:Wh),t}function Cc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Do(t);if(t.$$typeof===x)return Xt(t)}throw Error(s(438,String(t)))}function Ih(t){var r=null,a=$e.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var p=$e.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(r={data:p.data.map(function(C){return C.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=wc(),$e.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),p=0;p<t;p++)a[p]=P;return r.index++,a}function Ir(t,r){return typeof r=="function"?r(t):r}function kc(t){var r=Dt();return Bh(r,ft,t)}function Bh(t,r,a){var p=t.queue;if(p===null)throw Error(s(311));p.lastRenderedReducer=a;var C=t.baseQueue,A=p.pending;if(A!==null){if(C!==null){var I=C.next;C.next=A.next,A.next=I}r.baseQueue=C=A,p.pending=null}if(A=t.baseState,C===null)t.memoizedState=A;else{r=C.next;var G=I=null,ee=null,le=r,fe=!1;do{var _e=le.lane&-536870913;if(_e!==le.lane?(et&_e)===_e:(Lr&_e)===_e){var ce=le.revertLane;if(ce===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),_e===Ks&&(fe=!0);else if((Lr&ce)===ce){le=le.next,ce===Ks&&(fe=!0);continue}else _e={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},ee===null?(G=ee=_e,I=A):ee=ee.next=_e,$e.lanes|=ce,Si|=ce;_e=le.action,ps&&a(A,_e),A=le.hasEagerState?le.eagerState:a(A,_e)}else ce={lane:_e,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},ee===null?(G=ee=ce,I=A):ee=ee.next=ce,$e.lanes|=_e,Si|=_e;le=le.next}while(le!==null&&le!==r);if(ee===null?I=A:ee.next=G,!kn(A,t.memoizedState)&&(Lt=!0,fe&&(a=Ys,a!==null)))throw a;t.memoizedState=A,t.baseState=I,t.baseQueue=ee,p.lastRenderedState=A}return C===null&&(p.lanes=0),[t.memoizedState,p.dispatch]}function zh(t){var r=Dt(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var p=a.dispatch,C=a.pending,A=r.memoizedState;if(C!==null){a.pending=null;var I=C=C.next;do A=t(A,I.action),I=I.next;while(I!==C);kn(A,r.memoizedState)||(Lt=!0),r.memoizedState=A,r.baseQueue===null&&(r.baseState=A),a.lastRenderedState=A}return[A,p]}function zv(t,r,a){var p=$e,C=Dt(),A=nt;if(A){if(a===void 0)throw Error(s(407));a=a()}else a=r();var I=!kn((ft||C).memoizedState,a);if(I&&(C.memoizedState=a,Lt=!0),C=C.queue,Hh(Hv.bind(null,p,C,t),[t]),C.getSnapshot!==r||I||Ot!==null&&Ot.memoizedState.tag&1){if(p.flags|=2048,ta(9,{destroy:void 0},Fv.bind(null,p,C,a,r),null),vt===null)throw Error(s(349));A||(Lr&127)!==0||Pv(p,r,a)}return a}function Pv(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=$e.updateQueue,r===null?(r=wc(),$e.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function Fv(t,r,a,p){r.value=a,r.getSnapshot=p,Uv(r)&&$v(t)}function Hv(t,r,a){return a(function(){Uv(r)&&$v(t)})}function Uv(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!kn(t,a)}catch{return!0}}function $v(t){var r=ss(t,2);r!==null&&yn(r,t,2)}function Ph(t){var r=un();if(typeof t=="function"){var a=t;if(t=a(),ps){tn(!0);try{a()}finally{tn(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:t},r}function qv(t,r,a,p){return t.baseState=a,Bh(t,ft,typeof p=="function"?p:Ir)}function jE(t,r,a,p,C){if(Tc(t))throw Error(s(485));if(t=r.action,t!==null){var A={payload:C,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){A.listeners.push(I)}};V.T!==null?a(!0):A.isTransition=!1,p(A),a=r.pending,a===null?(A.next=r.pending=A,Vv(r,A)):(A.next=a.next,r.pending=a.next=A)}}function Vv(t,r){var a=r.action,p=r.payload,C=t.state;if(r.isTransition){var A=V.T,I={};V.T=I;try{var G=a(C,p),ee=V.S;ee!==null&&ee(I,G),Gv(t,r,G)}catch(le){Fh(t,r,le)}finally{A!==null&&I.types!==null&&(A.types=I.types),V.T=A}}else try{A=a(C,p),Gv(t,r,A)}catch(le){Fh(t,r,le)}}function Gv(t,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(p){Wv(t,r,p)},function(p){return Fh(t,r,p)}):Wv(t,r,a)}function Wv(t,r,a){r.status="fulfilled",r.value=a,Kv(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,Vv(t,a)))}function Fh(t,r,a){var p=t.pending;if(t.pending=null,p!==null){p=p.next;do r.status="rejected",r.reason=a,Kv(r),r=r.next;while(r!==p)}t.action=null}function Kv(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Yv(t,r){return r}function Xv(t,r){if(nt){var a=vt.formState;if(a!==null){e:{var p=$e;if(nt){if(bt){t:{for(var C=bt,A=Vn;C.nodeType!==8;){if(!A){C=null;break t}if(C=Wn(C.nextSibling),C===null){C=null;break t}}A=C.data,C=A==="F!"||A==="F"?C:null}if(C){bt=Wn(C.nextSibling),p=C.data==="F!";break e}}fi(p)}p=!1}p&&(r=a[0])}}return a=un(),a.memoizedState=a.baseState=r,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yv,lastRenderedState:r},a.queue=p,a=m_.bind(null,$e,p),p.dispatch=a,p=Ph(!1),A=Gh.bind(null,$e,!1,p.queue),p=un(),C={state:r,dispatch:null,action:t,pending:null},p.queue=C,a=jE.bind(null,$e,C,A,a),C.dispatch=a,p.memoizedState=t,[r,a,!1]}function Zv(t){var r=Dt();return Qv(r,ft,t)}function Qv(t,r,a){if(r=Bh(t,r,Yv)[0],t=kc(Ir)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var p=Do(r)}catch(I){throw I===Xs?mc:I}else p=r;r=Dt();var C=r.queue,A=C.dispatch;return a!==r.memoizedState&&($e.flags|=2048,ta(9,{destroy:void 0},OE.bind(null,C,a),null)),[p,A,t]}function OE(t,r){t.action=r}function Jv(t){var r=Dt(),a=ft;if(a!==null)return Qv(r,a,t);Dt(),r=r.memoizedState,a=Dt();var p=a.queue.dispatch;return a.memoizedState=t,[r,p,!1]}function ta(t,r,a,p){return t={tag:t,create:a,deps:p,inst:r,next:null},r=$e.updateQueue,r===null&&(r=wc(),$e.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(p=a.next,a.next=t,t.next=p,r.lastEffect=t),t}function e_(){return Dt().memoizedState}function Ec(t,r,a,p){var C=un();$e.flags|=t,C.memoizedState=ta(1|r,{destroy:void 0},a,p===void 0?null:p)}function Ac(t,r,a,p){var C=Dt();p=p===void 0?null:p;var A=C.memoizedState.inst;ft!==null&&p!==null&&Mh(p,ft.memoizedState.deps)?C.memoizedState=ta(r,A,a,p):($e.flags|=t,C.memoizedState=ta(1|r,A,a,p))}function t_(t,r){Ec(8390656,8,t,r)}function Hh(t,r){Ac(2048,8,t,r)}function LE(t){$e.flags|=4;var r=$e.updateQueue;if(r===null)r=wc(),$e.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function n_(t){var r=Dt().memoizedState;return LE({ref:r,nextImpl:t}),function(){if((ot&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function r_(t,r){return Ac(4,2,t,r)}function i_(t,r){return Ac(4,4,t,r)}function s_(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function a_(t,r,a){a=a!=null?a.concat([t]):null,Ac(4,4,s_.bind(null,r,t),a)}function Uh(){}function o_(t,r){var a=Dt();r=r===void 0?null:r;var p=a.memoizedState;return r!==null&&Mh(r,p[1])?p[0]:(a.memoizedState=[t,r],t)}function l_(t,r){var a=Dt();r=r===void 0?null:r;var p=a.memoizedState;if(r!==null&&Mh(r,p[1]))return p[0];if(p=t(),ps){tn(!0);try{t()}finally{tn(!1)}}return a.memoizedState=[p,r],p}function $h(t,r,a){return a===void 0||(Lr&1073741824)!==0&&(et&261930)===0?t.memoizedState=r:(t.memoizedState=a,t=cy(),$e.lanes|=t,Si|=t,a)}function c_(t,r,a,p){return kn(a,r)?a:Qs.current!==null?(t=$h(t,a,p),kn(t,r)||(Lt=!0),t):(Lr&42)===0||(Lr&1073741824)!==0&&(et&261930)===0?(Lt=!0,t.memoizedState=a):(t=cy(),$e.lanes|=t,Si|=t,r)}function u_(t,r,a,p,C){var A=Z.p;Z.p=A!==0&&8>A?A:8;var I=V.T,G={};V.T=G,Gh(t,!1,r,a);try{var ee=C(),le=V.S;if(le!==null&&le(G,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var fe=DE(ee,p);Mo(t,r,fe,Mn(t))}else Mo(t,r,p,Mn(t))}catch(_e){Mo(t,r,{then:function(){},status:"rejected",reason:_e},Mn())}finally{Z.p=A,I!==null&&G.types!==null&&(I.types=G.types),V.T=I}}function IE(){}function qh(t,r,a,p){if(t.tag!==5)throw Error(s(476));var C=d_(t).queue;u_(t,C,r,Q,a===null?IE:function(){return h_(t),a(p)})}function d_(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:Q},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ir,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function h_(t){var r=d_(t);r.next===null&&(r=t.alternate.memoizedState),Mo(t,r.next.queue,{},Mn())}function Vh(){return Xt(Ko)}function f_(){return Dt().memoizedState}function p_(){return Dt().memoizedState}function BE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Mn();t=gi(a);var p=vi(r,t,a);p!==null&&(yn(p,r,a),Eo(p,r,a)),r={cache:bh()},t.payload=r;return}r=r.return}}function zE(t,r,a){var p=Mn();a={lane:p,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Tc(t)?g_(r,a):(a=ch(t,r,a,p),a!==null&&(yn(a,t,p),v_(a,r,p)))}function m_(t,r,a){var p=Mn();Mo(t,r,a,p)}function Mo(t,r,a,p){var C={lane:p,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Tc(t))g_(r,C);else{var A=t.alternate;if(t.lanes===0&&(A===null||A.lanes===0)&&(A=r.lastRenderedReducer,A!==null))try{var I=r.lastRenderedState,G=A(I,a);if(C.hasEagerState=!0,C.eagerState=G,kn(G,I))return lc(t,r,C,0),vt===null&&oc(),!1}catch{}finally{}if(a=ch(t,r,C,p),a!==null)return yn(a,t,p),v_(a,r,p),!0}return!1}function Gh(t,r,a,p){if(p={lane:2,revertLane:kf(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Tc(t)){if(r)throw Error(s(479))}else r=ch(t,a,p,2),r!==null&&yn(r,t,2)}function Tc(t){var r=t.alternate;return t===$e||r!==null&&r===$e}function g_(t,r){Js=xc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function v_(t,r,a){if((a&4194048)!==0){var p=r.lanes;p&=t.pendingLanes,a|=p,r.lanes=a,no(t,a)}}var No={readContext:Xt,use:Cc,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};No.useEffectEvent=Et;var __={readContext:Xt,use:Cc,useCallback:function(t,r){return un().memoizedState=[t,r===void 0?null:r],t},useContext:Xt,useEffect:t_,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,Ec(4194308,4,s_.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Ec(4194308,4,t,r)},useInsertionEffect:function(t,r){Ec(4,2,t,r)},useMemo:function(t,r){var a=un();r=r===void 0?null:r;var p=t();if(ps){tn(!0);try{t()}finally{tn(!1)}}return a.memoizedState=[p,r],p},useReducer:function(t,r,a){var p=un();if(a!==void 0){var C=a(r);if(ps){tn(!0);try{a(r)}finally{tn(!1)}}}else C=r;return p.memoizedState=p.baseState=C,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:C},p.queue=t,t=t.dispatch=zE.bind(null,$e,t),[p.memoizedState,t]},useRef:function(t){var r=un();return t={current:t},r.memoizedState=t},useState:function(t){t=Ph(t);var r=t.queue,a=m_.bind(null,$e,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:Uh,useDeferredValue:function(t,r){var a=un();return $h(a,t,r)},useTransition:function(){var t=Ph(!1);return t=u_.bind(null,$e,t.queue,!0,!1),un().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var p=$e,C=un();if(nt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),vt===null)throw Error(s(349));(et&127)!==0||Pv(p,r,a)}C.memoizedState=a;var A={value:a,getSnapshot:r};return C.queue=A,t_(Hv.bind(null,p,A,t),[t]),p.flags|=2048,ta(9,{destroy:void 0},Fv.bind(null,p,A,a,r),null),a},useId:function(){var t=un(),r=vt.identifierPrefix;if(nt){var a=mr,p=pr;a=(p&~(1<<32-it(p)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Sc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=ME++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Vh,useFormState:Xv,useActionState:Xv,useOptimistic:function(t){var r=un();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Gh.bind(null,$e,!0,a),a.dispatch=r,[t,r]},useMemoCache:Ih,useCacheRefresh:function(){return un().memoizedState=BE.bind(null,$e)},useEffectEvent:function(t){var r=un(),a={impl:t};return r.memoizedState=a,function(){if((ot&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Wh={readContext:Xt,use:Cc,useCallback:o_,useContext:Xt,useEffect:Hh,useImperativeHandle:a_,useInsertionEffect:r_,useLayoutEffect:i_,useMemo:l_,useReducer:kc,useRef:e_,useState:function(){return kc(Ir)},useDebugValue:Uh,useDeferredValue:function(t,r){var a=Dt();return c_(a,ft.memoizedState,t,r)},useTransition:function(){var t=kc(Ir)[0],r=Dt().memoizedState;return[typeof t=="boolean"?t:Do(t),r]},useSyncExternalStore:zv,useId:f_,useHostTransitionStatus:Vh,useFormState:Zv,useActionState:Zv,useOptimistic:function(t,r){var a=Dt();return qv(a,ft,t,r)},useMemoCache:Ih,useCacheRefresh:p_};Wh.useEffectEvent=n_;var y_={readContext:Xt,use:Cc,useCallback:o_,useContext:Xt,useEffect:Hh,useImperativeHandle:a_,useInsertionEffect:r_,useLayoutEffect:i_,useMemo:l_,useReducer:zh,useRef:e_,useState:function(){return zh(Ir)},useDebugValue:Uh,useDeferredValue:function(t,r){var a=Dt();return ft===null?$h(a,t,r):c_(a,ft.memoizedState,t,r)},useTransition:function(){var t=zh(Ir)[0],r=Dt().memoizedState;return[typeof t=="boolean"?t:Do(t),r]},useSyncExternalStore:zv,useId:f_,useHostTransitionStatus:Vh,useFormState:Jv,useActionState:Jv,useOptimistic:function(t,r){var a=Dt();return ft!==null?qv(a,ft,t,r):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Ih,useCacheRefresh:p_};y_.useEffectEvent=n_;function Kh(t,r,a,p){r=t.memoizedState,a=a(p,r),a=a==null?r:f({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Yh={enqueueSetState:function(t,r,a){t=t._reactInternals;var p=Mn(),C=gi(p);C.payload=r,a!=null&&(C.callback=a),r=vi(t,C,p),r!==null&&(yn(r,t,p),Eo(r,t,p))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var p=Mn(),C=gi(p);C.tag=1,C.payload=r,a!=null&&(C.callback=a),r=vi(t,C,p),r!==null&&(yn(r,t,p),Eo(r,t,p))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Mn(),p=gi(a);p.tag=2,r!=null&&(p.callback=r),r=vi(t,p,a),r!==null&&(yn(r,t,a),Eo(r,t,a))}};function b_(t,r,a,p,C,A,I){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(p,A,I):r.prototype&&r.prototype.isPureReactComponent?!_o(a,p)||!_o(C,A):!0}function x_(t,r,a,p){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,p),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,p),r.state!==t&&Yh.enqueueReplaceState(r,r.state,null)}function ms(t,r){var a=r;if("ref"in r){a={};for(var p in r)p!=="ref"&&(a[p]=r[p])}if(t=t.defaultProps){a===r&&(a=f({},a));for(var C in t)a[C]===void 0&&(a[C]=t[C])}return a}function S_(t){ac(t)}function w_(t){console.error(t)}function C_(t){ac(t)}function Rc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(p){setTimeout(function(){throw p})}}function k_(t,r,a){try{var p=t.onCaughtError;p(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function Xh(t,r,a){return a=gi(a),a.tag=3,a.payload={element:null},a.callback=function(){Rc(t,r)},a}function E_(t){return t=gi(t),t.tag=3,t}function A_(t,r,a,p){var C=a.type.getDerivedStateFromError;if(typeof C=="function"){var A=p.value;t.payload=function(){return C(A)},t.callback=function(){k_(r,a,p)}}var I=a.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(t.callback=function(){k_(r,a,p),typeof C!="function"&&(wi===null?wi=new Set([this]):wi.add(this));var G=p.stack;this.componentDidCatch(p.value,{componentStack:G!==null?G:""})})}function PE(t,r,a,p,C){if(a.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(r=a.alternate,r!==null&&Ws(r,a,C,!0),a=An.current,a!==null){switch(a.tag){case 31:case 13:return Gn===null?Hc():a.alternate===null&&At===0&&(At=3),a.flags&=-257,a.flags|=65536,a.lanes=C,p===gc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([p]):r.add(p),Sf(t,p,C)),!1;case 22:return a.flags|=65536,p===gc?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([p])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([p]):a.add(p)),Sf(t,p,C)),!1}throw Error(s(435,a.tag))}return Sf(t,p,C),Hc(),!1}if(nt)return r=An.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=C,p!==mh&&(t=Error(s(422),{cause:p}),xo(Un(t,a)))):(p!==mh&&(r=Error(s(423),{cause:p}),xo(Un(r,a))),t=t.current.alternate,t.flags|=65536,C&=-C,t.lanes|=C,p=Un(p,a),C=Xh(t.stateNode,p,C),Eh(t,C),At!==4&&(At=2)),!1;var A=Error(s(520),{cause:p});if(A=Un(A,a),Fo===null?Fo=[A]:Fo.push(A),At!==4&&(At=2),r===null)return!0;p=Un(p,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=C&-C,a.lanes|=t,t=Xh(a.stateNode,p,t),Eh(a,t),!1;case 1:if(r=a.type,A=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(wi===null||!wi.has(A))))return a.flags|=65536,C&=-C,a.lanes|=C,C=E_(C),A_(C,t,a,p),Eh(a,C),!1}a=a.return}while(a!==null);return!1}var Zh=Error(s(461)),Lt=!1;function Zt(t,r,a,p){r.child=t===null?Mv(r,null,a,p):fs(r,t.child,a,p)}function T_(t,r,a,p,C){a=a.render;var A=r.ref;if("ref"in p){var I={};for(var G in p)G!=="ref"&&(I[G]=p[G])}else I=p;return cs(r),p=Nh(t,r,a,I,A,C),G=jh(),t!==null&&!Lt?(Oh(t,r,C),Br(t,r,C)):(nt&&G&&fh(r),r.flags|=1,Zt(t,r,p,C),r.child)}function R_(t,r,a,p,C){if(t===null){var A=a.type;return typeof A=="function"&&!uh(A)&&A.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=A,D_(t,r,A,p,C)):(t=uc(a.type,null,p,r,r.mode,C),t.ref=r.ref,t.return=r,r.child=t)}if(A=t.child,!af(t,C)){var I=A.memoizedProps;if(a=a.compare,a=a!==null?a:_o,a(I,p)&&t.ref===r.ref)return Br(t,r,C)}return r.flags|=1,t=Mr(A,p),t.ref=r.ref,t.return=r,r.child=t}function D_(t,r,a,p,C){if(t!==null){var A=t.memoizedProps;if(_o(A,p)&&t.ref===r.ref)if(Lt=!1,r.pendingProps=p=A,af(t,C))(t.flags&131072)!==0&&(Lt=!0);else return r.lanes=t.lanes,Br(t,r,C)}return Qh(t,r,a,p,C)}function M_(t,r,a,p){var C=p.children,A=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((r.flags&128)!==0){if(A=A!==null?A.baseLanes|a:a,t!==null){for(p=r.child=t.child,C=0;p!==null;)C=C|p.lanes|p.childLanes,p=p.sibling;p=C&~A}else p=0,r.child=null;return N_(t,r,A,a,p)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&pc(r,A!==null?A.cachePool:null),A!==null?Ov(r,A):Th(),Lv(r);else return p=r.lanes=536870912,N_(t,r,A!==null?A.baseLanes|a:a,a,p)}else A!==null?(pc(r,A.cachePool),Ov(r,A),yi(),r.memoizedState=null):(t!==null&&pc(r,null),Th(),yi());return Zt(t,r,C,a),r.child}function jo(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function N_(t,r,a,p,C){var A=Sh();return A=A===null?null:{parent:jt._currentValue,pool:A},r.memoizedState={baseLanes:a,cachePool:A},t!==null&&pc(r,null),Th(),Lv(r),t!==null&&Ws(t,r,p,!0),r.childLanes=C,null}function Dc(t,r){return r=Nc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function j_(t,r,a){return fs(r,t.child,null,a),t=Dc(r,r.pendingProps),t.flags|=2,Tn(r),r.memoizedState=null,t}function FE(t,r,a){var p=r.pendingProps,C=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(nt){if(p.mode==="hidden")return t=Dc(r,p),r.lanes=536870912,jo(null,t);if(Dh(r),(t=bt)?(t=Vy(t,Vn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:di!==null?{id:pr,overflow:mr}:null,retryLane:536870912,hydrationErrors:null},a=gv(t),a.return=r,r.child=a,Yt=r,bt=null)):t=null,t===null)throw fi(r);return r.lanes=536870912,null}return Dc(r,p)}var A=t.memoizedState;if(A!==null){var I=A.dehydrated;if(Dh(r),C)if(r.flags&256)r.flags&=-257,r=j_(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(Lt||Ws(t,r,a,!1),C=(a&t.childLanes)!==0,Lt||C){if(p=vt,p!==null&&(I=Kl(p,a),I!==0&&I!==A.retryLane))throw A.retryLane=I,ss(t,I),yn(p,t,I),Zh;Hc(),r=j_(t,r,a)}else t=A.treeContext,bt=Wn(I.nextSibling),Yt=r,nt=!0,hi=null,Vn=!1,t!==null&&yv(r,t),r=Dc(r,p),r.flags|=4096;return r}return t=Mr(t.child,{mode:p.mode,children:p.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Mc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function Qh(t,r,a,p,C){return cs(r),a=Nh(t,r,a,p,void 0,C),p=jh(),t!==null&&!Lt?(Oh(t,r,C),Br(t,r,C)):(nt&&p&&fh(r),r.flags|=1,Zt(t,r,a,C),r.child)}function O_(t,r,a,p,C,A){return cs(r),r.updateQueue=null,a=Bv(r,p,a,C),Iv(t),p=jh(),t!==null&&!Lt?(Oh(t,r,A),Br(t,r,A)):(nt&&p&&fh(r),r.flags|=1,Zt(t,r,a,A),r.child)}function L_(t,r,a,p,C){if(cs(r),r.stateNode===null){var A=$s,I=a.contextType;typeof I=="object"&&I!==null&&(A=Xt(I)),A=new a(p,A),r.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=Yh,r.stateNode=A,A._reactInternals=r,A=r.stateNode,A.props=p,A.state=r.memoizedState,A.refs={},Ch(r),I=a.contextType,A.context=typeof I=="object"&&I!==null?Xt(I):$s,A.state=r.memoizedState,I=a.getDerivedStateFromProps,typeof I=="function"&&(Kh(r,a,I,p),A.state=r.memoizedState),typeof a.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&&Yh.enqueueReplaceState(A,A.state,null),To(r,p,A,C),Ao(),A.state=r.memoizedState),typeof A.componentDidMount=="function"&&(r.flags|=4194308),p=!0}else if(t===null){A=r.stateNode;var G=r.memoizedProps,ee=ms(a,G);A.props=ee;var le=A.context,fe=a.contextType;I=$s,typeof fe=="object"&&fe!==null&&(I=Xt(fe));var _e=a.getDerivedStateFromProps;fe=typeof _e=="function"||typeof A.getSnapshotBeforeUpdate=="function",G=r.pendingProps!==G,fe||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(G||le!==I)&&x_(r,A,p,I),mi=!1;var ce=r.memoizedState;A.state=ce,To(r,p,A,C),Ao(),le=r.memoizedState,G||ce!==le||mi?(typeof _e=="function"&&(Kh(r,a,_e,p),le=r.memoizedState),(ee=mi||b_(r,a,ee,p,ce,le,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"&&(r.flags|=4194308)):(typeof A.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=p,r.memoizedState=le),A.props=p,A.state=le,A.context=I,p=ee):(typeof A.componentDidMount=="function"&&(r.flags|=4194308),p=!1)}else{A=r.stateNode,kh(t,r),I=r.memoizedProps,fe=ms(a,I),A.props=fe,_e=r.pendingProps,ce=A.context,le=a.contextType,ee=$s,typeof le=="object"&&le!==null&&(ee=Xt(le)),G=a.getDerivedStateFromProps,(le=typeof G=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(I!==_e||ce!==ee)&&x_(r,A,p,ee),mi=!1,ce=r.memoizedState,A.state=ce,To(r,p,A,C),Ao();var de=r.memoizedState;I!==_e||ce!==de||mi||t!==null&&t.dependencies!==null&&hc(t.dependencies)?(typeof G=="function"&&(Kh(r,a,G,p),de=r.memoizedState),(fe=mi||b_(r,a,fe,p,ce,de,ee)||t!==null&&t.dependencies!==null&&hc(t.dependencies))?(le||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(p,de,ee),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(p,de,ee)),typeof A.componentDidUpdate=="function"&&(r.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof A.componentDidUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(r.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(r.flags|=1024),r.memoizedProps=p,r.memoizedState=de),A.props=p,A.state=de,A.context=ee,p=fe):(typeof A.componentDidUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(r.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&ce===t.memoizedState||(r.flags|=1024),p=!1)}return A=p,Mc(t,r),p=(r.flags&128)!==0,A||p?(A=r.stateNode,a=p&&typeof a.getDerivedStateFromError!="function"?null:A.render(),r.flags|=1,t!==null&&p?(r.child=fs(r,t.child,null,C),r.child=fs(r,null,a,C)):Zt(t,r,a,C),r.memoizedState=A.state,t=r.child):t=Br(t,r,C),t}function I_(t,r,a,p){return os(),r.flags|=256,Zt(t,r,a,p),r.child}var Jh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ef(t){return{baseLanes:t,cachePool:kv()}}function tf(t,r,a){return t=t!==null?t.childLanes&~a:0,r&&(t|=Dn),t}function B_(t,r,a){var p=r.pendingProps,C=!1,A=(r.flags&128)!==0,I;if((I=A)||(I=t!==null&&t.memoizedState===null?!1:(Rt.current&2)!==0),I&&(C=!0,r.flags&=-129),I=(r.flags&32)!==0,r.flags&=-33,t===null){if(nt){if(C?_i(r):yi(),(t=bt)?(t=Vy(t,Vn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:di!==null?{id:pr,overflow:mr}:null,retryLane:536870912,hydrationErrors:null},a=gv(t),a.return=r,r.child=a,Yt=r,bt=null)):t=null,t===null)throw fi(r);return zf(t)?r.lanes=32:r.lanes=536870912,null}var G=p.children;return p=p.fallback,C?(yi(),C=r.mode,G=Nc({mode:"hidden",children:G},C),p=as(p,C,a,null),G.return=r,p.return=r,G.sibling=p,r.child=G,p=r.child,p.memoizedState=ef(a),p.childLanes=tf(t,I,a),r.memoizedState=Jh,jo(null,p)):(_i(r),nf(r,G))}var ee=t.memoizedState;if(ee!==null&&(G=ee.dehydrated,G!==null)){if(A)r.flags&256?(_i(r),r.flags&=-257,r=rf(t,r,a)):r.memoizedState!==null?(yi(),r.child=t.child,r.flags|=128,r=null):(yi(),G=p.fallback,C=r.mode,p=Nc({mode:"visible",children:p.children},C),G=as(G,C,a,null),G.flags|=2,p.return=r,G.return=r,p.sibling=G,r.child=p,fs(r,t.child,null,a),p=r.child,p.memoizedState=ef(a),p.childLanes=tf(t,I,a),r.memoizedState=Jh,r=jo(null,p));else if(_i(r),zf(G)){if(I=G.nextSibling&&G.nextSibling.dataset,I)var le=I.dgst;I=le,p=Error(s(419)),p.stack="",p.digest=I,xo({value:p,source:null,stack:null}),r=rf(t,r,a)}else if(Lt||Ws(t,r,a,!1),I=(a&t.childLanes)!==0,Lt||I){if(I=vt,I!==null&&(p=Kl(I,a),p!==0&&p!==ee.retryLane))throw ee.retryLane=p,ss(t,p),yn(I,t,p),Zh;Bf(G)||Hc(),r=rf(t,r,a)}else Bf(G)?(r.flags|=192,r.child=t.child,r=null):(t=ee.treeContext,bt=Wn(G.nextSibling),Yt=r,nt=!0,hi=null,Vn=!1,t!==null&&yv(r,t),r=nf(r,p.children),r.flags|=4096);return r}return C?(yi(),G=p.fallback,C=r.mode,ee=t.child,le=ee.sibling,p=Mr(ee,{mode:"hidden",children:p.children}),p.subtreeFlags=ee.subtreeFlags&65011712,le!==null?G=Mr(le,G):(G=as(G,C,a,null),G.flags|=2),G.return=r,p.return=r,p.sibling=G,r.child=p,jo(null,p),p=r.child,G=t.child.memoizedState,G===null?G=ef(a):(C=G.cachePool,C!==null?(ee=jt._currentValue,C=C.parent!==ee?{parent:ee,pool:ee}:C):C=kv(),G={baseLanes:G.baseLanes|a,cachePool:C}),p.memoizedState=G,p.childLanes=tf(t,I,a),r.memoizedState=Jh,jo(t.child,p)):(_i(r),a=t.child,t=a.sibling,a=Mr(a,{mode:"visible",children:p.children}),a.return=r,a.sibling=null,t!==null&&(I=r.deletions,I===null?(r.deletions=[t],r.flags|=16):I.push(t)),r.child=a,r.memoizedState=null,a)}function nf(t,r){return r=Nc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Nc(t,r){return t=En(22,t,null,r),t.lanes=0,t}function rf(t,r,a){return fs(r,t.child,null,a),t=nf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function z_(t,r,a){t.lanes|=r;var p=t.alternate;p!==null&&(p.lanes|=r),_h(t.return,r,a)}function sf(t,r,a,p,C,A){var I=t.memoizedState;I===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:p,tail:a,tailMode:C,treeForkCount:A}:(I.isBackwards=r,I.rendering=null,I.renderingStartTime=0,I.last=p,I.tail=a,I.tailMode=C,I.treeForkCount=A)}function P_(t,r,a){var p=r.pendingProps,C=p.revealOrder,A=p.tail;p=p.children;var I=Rt.current,G=(I&2)!==0;if(G?(I=I&1|2,r.flags|=128):I&=1,z(Rt,I),Zt(t,r,p,a),p=nt?bo:0,!G&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&z_(t,a,r);else if(t.tag===19)z_(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(C){case"forwards":for(a=r.child,C=null;a!==null;)t=a.alternate,t!==null&&bc(t)===null&&(C=a),a=a.sibling;a=C,a===null?(C=r.child,r.child=null):(C=a.sibling,a.sibling=null),sf(r,!1,C,a,A,p);break;case"backwards":case"unstable_legacy-backwards":for(a=null,C=r.child,r.child=null;C!==null;){if(t=C.alternate,t!==null&&bc(t)===null){r.child=C;break}t=C.sibling,C.sibling=a,a=C,C=t}sf(r,!0,a,null,A,p);break;case"together":sf(r,!1,null,null,void 0,p);break;default:r.memoizedState=null}return r.child}function Br(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),Si|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(Ws(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,a=Mr(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Mr(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function af(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&hc(t)))}function HE(t,r,a){switch(r.tag){case 3:H(r,r.stateNode.containerInfo),pi(r,jt,t.memoizedState.cache),os();break;case 27:case 5:ae(r);break;case 4:H(r,r.stateNode.containerInfo);break;case 10:pi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Dh(r),null;break;case 13:var p=r.memoizedState;if(p!==null)return p.dehydrated!==null?(_i(r),r.flags|=128,null):(a&r.child.childLanes)!==0?B_(t,r,a):(_i(r),t=Br(t,r,a),t!==null?t.sibling:null);_i(r);break;case 19:var C=(t.flags&128)!==0;if(p=(a&r.childLanes)!==0,p||(Ws(t,r,a,!1),p=(a&r.childLanes)!==0),C){if(p)return P_(t,r,a);r.flags|=128}if(C=r.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),z(Rt,Rt.current),p)break;return null;case 22:return r.lanes=0,M_(t,r,a,r.pendingProps);case 24:pi(r,jt,t.memoizedState.cache)}return Br(t,r,a)}function F_(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)Lt=!0;else{if(!af(t,a)&&(r.flags&128)===0)return Lt=!1,HE(t,r,a);Lt=(t.flags&131072)!==0}else Lt=!1,nt&&(r.flags&1048576)!==0&&_v(r,bo,r.index);switch(r.lanes=0,r.tag){case 16:e:{var p=r.pendingProps;if(t=ds(r.elementType),r.type=t,typeof t=="function")uh(t)?(p=ms(t,p),r.tag=1,r=L_(null,r,t,p,a)):(r.tag=0,r=Qh(null,r,t,p,a));else{if(t!=null){var C=t.$$typeof;if(C===E){r.tag=11,r=T_(null,r,t,p,a);break e}else if(C===j){r.tag=14,r=R_(null,r,t,p,a);break e}}throw r=K(t)||t,Error(s(306,r,""))}}return r;case 0:return Qh(t,r,r.type,r.pendingProps,a);case 1:return p=r.type,C=ms(p,r.pendingProps),L_(t,r,p,C,a);case 3:e:{if(H(r,r.stateNode.containerInfo),t===null)throw Error(s(387));p=r.pendingProps;var A=r.memoizedState;C=A.element,kh(t,r),To(r,p,null,a);var I=r.memoizedState;if(p=I.cache,pi(r,jt,p),p!==A.cache&&yh(r,[jt],a,!0),Ao(),p=I.element,A.isDehydrated)if(A={element:p,isDehydrated:!1,cache:I.cache},r.updateQueue.baseState=A,r.memoizedState=A,r.flags&256){r=I_(t,r,p,a);break e}else if(p!==C){C=Un(Error(s(424)),r),xo(C),r=I_(t,r,p,a);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(bt=Wn(t.firstChild),Yt=r,nt=!0,hi=null,Vn=!0,a=Mv(r,null,p,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(os(),p===C){r=Br(t,r,a);break e}Zt(t,r,p,a)}r=r.child}return r;case 26:return Mc(t,r),t===null?(a=Zy(r.type,null,r.pendingProps,null))?r.memoizedState=a:nt||(a=r.type,t=r.pendingProps,p=Kc(te.current).createElement(a),p[Ct]=r,p[nn]=t,Qt(p,a,t),Nt(p),r.stateNode=p):r.memoizedState=Zy(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return ae(r),t===null&&nt&&(p=r.stateNode=Ky(r.type,r.pendingProps,te.current),Yt=r,Vn=!0,C=bt,Ai(r.type)?(Pf=C,bt=Wn(p.firstChild)):bt=C),Zt(t,r,r.pendingProps.children,a),Mc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&nt&&((C=p=bt)&&(p=v2(p,r.type,r.pendingProps,Vn),p!==null?(r.stateNode=p,Yt=r,bt=Wn(p.firstChild),Vn=!1,C=!0):C=!1),C||fi(r)),ae(r),C=r.type,A=r.pendingProps,I=t!==null?t.memoizedProps:null,p=A.children,Of(C,A)?p=null:I!==null&&Of(C,I)&&(r.flags|=32),r.memoizedState!==null&&(C=Nh(t,r,NE,null,null,a),Ko._currentValue=C),Mc(t,r),Zt(t,r,p,a),r.child;case 6:return t===null&&nt&&((t=a=bt)&&(a=_2(a,r.pendingProps,Vn),a!==null?(r.stateNode=a,Yt=r,bt=null,t=!0):t=!1),t||fi(r)),null;case 13:return B_(t,r,a);case 4:return H(r,r.stateNode.containerInfo),p=r.pendingProps,t===null?r.child=fs(r,null,p,a):Zt(t,r,p,a),r.child;case 11:return T_(t,r,r.type,r.pendingProps,a);case 7:return Zt(t,r,r.pendingProps,a),r.child;case 8:return Zt(t,r,r.pendingProps.children,a),r.child;case 12:return Zt(t,r,r.pendingProps.children,a),r.child;case 10:return p=r.pendingProps,pi(r,r.type,p.value),Zt(t,r,p.children,a),r.child;case 9:return C=r.type._context,p=r.pendingProps.children,cs(r),C=Xt(C),p=p(C),r.flags|=1,Zt(t,r,p,a),r.child;case 14:return R_(t,r,r.type,r.pendingProps,a);case 15:return D_(t,r,r.type,r.pendingProps,a);case 19:return P_(t,r,a);case 31:return FE(t,r,a);case 22:return M_(t,r,a,r.pendingProps);case 24:return cs(r),p=Xt(jt),t===null?(C=Sh(),C===null&&(C=vt,A=bh(),C.pooledCache=A,A.refCount++,A!==null&&(C.pooledCacheLanes|=a),C=A),r.memoizedState={parent:p,cache:C},Ch(r),pi(r,jt,C)):((t.lanes&a)!==0&&(kh(t,r),To(r,null,null,a),Ao()),C=t.memoizedState,A=r.memoizedState,C.parent!==p?(C={parent:p,cache:p},r.memoizedState=C,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=C),pi(r,jt,p)):(p=A.cache,pi(r,jt,p),p!==C.cache&&yh(r,[jt],a,!0))),Zt(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function zr(t){t.flags|=4}function of(t,r,a,p,C){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(C&335544128)===C)if(t.stateNode.complete)t.flags|=8192;else if(fy())t.flags|=8192;else throw hs=gc,wh}else t.flags&=-16777217}function H_(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!nb(r))if(fy())t.flags|=8192;else throw hs=gc,wh}function jc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Os():536870912,t.lanes|=r,sa|=r)}function Oo(t,r){if(!nt)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var p=null;a!==null;)a.alternate!==null&&(p=a),a=a.sibling;p===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:p.sibling=null}}function xt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,p=0;if(r)for(var C=t.child;C!==null;)a|=C.lanes|C.childLanes,p|=C.subtreeFlags&65011712,p|=C.flags&65011712,C.return=t,C=C.sibling;else for(C=t.child;C!==null;)a|=C.lanes|C.childLanes,p|=C.subtreeFlags,p|=C.flags,C.return=t,C=C.sibling;return t.subtreeFlags|=p,t.childLanes=a,r}function UE(t,r,a){var p=r.pendingProps;switch(ph(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(r),null;case 1:return xt(r),null;case 3:return a=r.stateNode,p=null,t!==null&&(p=t.memoizedState.cache),r.memoizedState.cache!==p&&(r.flags|=2048),Or(jt),ne(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Gs(r)?zr(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,gh())),xt(r),null;case 26:var C=r.type,A=r.memoizedState;return t===null?(zr(r),A!==null?(xt(r),H_(r,A)):(xt(r),of(r,C,null,p,a))):A?A!==t.memoizedState?(zr(r),xt(r),H_(r,A)):(xt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==p&&zr(r),xt(r),of(r,C,t,p,a)),null;case 27:if(pe(r),a=te.current,C=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==p&&zr(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return xt(r),null}t=X.current,Gs(r)?bv(r):(t=Ky(C,p,a),r.stateNode=t,zr(r))}return xt(r),null;case 5:if(pe(r),C=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==p&&zr(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return xt(r),null}if(A=X.current,Gs(r))bv(r);else{var I=Kc(te.current);switch(A){case 1:A=I.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:A=I.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":A=I.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":A=I.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":A=I.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof p.is=="string"?I.createElement("select",{is:p.is}):I.createElement("select"),p.multiple?A.multiple=!0:p.size&&(A.size=p.size);break;default:A=typeof p.is=="string"?I.createElement(C,{is:p.is}):I.createElement(C)}}A[Ct]=r,A[nn]=p;e:for(I=r.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===r)break e;for(;I.sibling===null;){if(I.return===null||I.return===r)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}r.stateNode=A;e:switch(Qt(A,C,p),C){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&zr(r)}}return xt(r),of(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==p&&zr(r);else{if(typeof p!="string"&&r.stateNode===null)throw Error(s(166));if(t=te.current,Gs(r)){if(t=r.stateNode,a=r.memoizedProps,p=null,C=Yt,C!==null)switch(C.tag){case 27:case 5:p=C.memoizedProps}t[Ct]=r,t=!!(t.nodeValue===a||p!==null&&p.suppressHydrationWarning===!0||By(t.nodeValue,a)),t||fi(r,!0)}else t=Kc(t).createTextNode(p),t[Ct]=r,r.stateNode=t}return xt(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(p=Gs(r),a!==null){if(t===null){if(!p)throw Error(s(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Ct]=r}else os(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;xt(r),t=!1}else a=gh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(Tn(r),r):(Tn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return xt(r),null;case 13:if(p=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(C=Gs(r),p!==null&&p.dehydrated!==null){if(t===null){if(!C)throw Error(s(318));if(C=r.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(s(317));C[Ct]=r}else os(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;xt(r),C=!1}else C=gh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=C),C=!0;if(!C)return r.flags&256?(Tn(r),r):(Tn(r),null)}return Tn(r),(r.flags&128)!==0?(r.lanes=a,r):(a=p!==null,t=t!==null&&t.memoizedState!==null,a&&(p=r.child,C=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(C=p.alternate.memoizedState.cachePool.pool),A=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(A=p.memoizedState.cachePool.pool),A!==C&&(p.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),jc(r,r.updateQueue),xt(r),null);case 4:return ne(),t===null&&Rf(r.stateNode.containerInfo),xt(r),null;case 10:return Or(r.type),xt(r),null;case 19:if(B(Rt),p=r.memoizedState,p===null)return xt(r),null;if(C=(r.flags&128)!==0,A=p.rendering,A===null)if(C)Oo(p,!1);else{if(At!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(A=bc(t),A!==null){for(r.flags|=128,Oo(p,!1),t=A.updateQueue,r.updateQueue=t,jc(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)mv(a,t),a=a.sibling;return z(Rt,Rt.current&1|2),nt&&Nr(r,p.treeForkCount),r.child}t=t.sibling}p.tail!==null&&gt()>zc&&(r.flags|=128,C=!0,Oo(p,!1),r.lanes=4194304)}else{if(!C)if(t=bc(A),t!==null){if(r.flags|=128,C=!0,t=t.updateQueue,r.updateQueue=t,jc(r,t),Oo(p,!0),p.tail===null&&p.tailMode==="hidden"&&!A.alternate&&!nt)return xt(r),null}else 2*gt()-p.renderingStartTime>zc&&a!==536870912&&(r.flags|=128,C=!0,Oo(p,!1),r.lanes=4194304);p.isBackwards?(A.sibling=r.child,r.child=A):(t=p.last,t!==null?t.sibling=A:r.child=A,p.last=A)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=gt(),t.sibling=null,a=Rt.current,z(Rt,C?a&1|2:a&1),nt&&Nr(r,p.treeForkCount),t):(xt(r),null);case 22:case 23:return Tn(r),Rh(),p=r.memoizedState!==null,t!==null?t.memoizedState!==null!==p&&(r.flags|=8192):p&&(r.flags|=8192),p?(a&536870912)!==0&&(r.flags&128)===0&&(xt(r),r.subtreeFlags&6&&(r.flags|=8192)):xt(r),a=r.updateQueue,a!==null&&jc(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),p=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(p=r.memoizedState.cachePool.pool),p!==a&&(r.flags|=2048),t!==null&&B(us),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Or(jt),xt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function $E(t,r){switch(ph(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Or(jt),ne(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return pe(r),null;case 31:if(r.memoizedState!==null){if(Tn(r),r.alternate===null)throw Error(s(340));os()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Tn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));os()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return B(Rt),null;case 4:return ne(),null;case 10:return Or(r.type),null;case 22:case 23:return Tn(r),Rh(),t!==null&&B(us),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Or(jt),null;case 25:return null;default:return null}}function U_(t,r){switch(ph(r),r.tag){case 3:Or(jt),ne();break;case 26:case 27:case 5:pe(r);break;case 4:ne();break;case 31:r.memoizedState!==null&&Tn(r);break;case 13:Tn(r);break;case 19:B(Rt);break;case 10:Or(r.type);break;case 22:case 23:Tn(r),Rh(),t!==null&&B(us);break;case 24:Or(jt)}}function Lo(t,r){try{var a=r.updateQueue,p=a!==null?a.lastEffect:null;if(p!==null){var C=p.next;a=C;do{if((a.tag&t)===t){p=void 0;var A=a.create,I=a.inst;p=A(),I.destroy=p}a=a.next}while(a!==C)}}catch(G){ht(r,r.return,G)}}function bi(t,r,a){try{var p=r.updateQueue,C=p!==null?p.lastEffect:null;if(C!==null){var A=C.next;p=A;do{if((p.tag&t)===t){var I=p.inst,G=I.destroy;if(G!==void 0){I.destroy=void 0,C=r;var ee=a,le=G;try{le()}catch(fe){ht(C,ee,fe)}}}p=p.next}while(p!==A)}}catch(fe){ht(r,r.return,fe)}}function $_(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{jv(r,a)}catch(p){ht(t,t.return,p)}}}function q_(t,r,a){a.props=ms(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(p){ht(t,r,p)}}function Io(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var p=t.stateNode;break;case 30:p=t.stateNode;break;default:p=t.stateNode}typeof a=="function"?t.refCleanup=a(p):a.current=p}}catch(C){ht(t,r,C)}}function gr(t,r){var a=t.ref,p=t.refCleanup;if(a!==null)if(typeof p=="function")try{p()}catch(C){ht(t,r,C)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(C){ht(t,r,C)}else a.current=null}function V_(t){var r=t.type,a=t.memoizedProps,p=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&p.focus();break e;case"img":a.src?p.src=a.src:a.srcSet&&(p.srcset=a.srcSet)}}catch(C){ht(t,t.return,C)}}function lf(t,r,a){try{var p=t.stateNode;d2(p,t.type,a,r),p[nn]=r}catch(C){ht(t,t.return,C)}}function G_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ai(t.type)||t.tag===4}function cf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||G_(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&&Ai(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 uf(t,r,a){var p=t.tag;if(p===5||p===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=Rr));else if(p!==4&&(p===27&&Ai(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(uf(t,r,a),t=t.sibling;t!==null;)uf(t,r,a),t=t.sibling}function Oc(t,r,a){var p=t.tag;if(p===5||p===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(p!==4&&(p===27&&Ai(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Oc(t,r,a),t=t.sibling;t!==null;)Oc(t,r,a),t=t.sibling}function W_(t){var r=t.stateNode,a=t.memoizedProps;try{for(var p=t.type,C=r.attributes;C.length;)r.removeAttributeNode(C[0]);Qt(r,p,a),r[Ct]=t,r[nn]=a}catch(A){ht(t,t.return,A)}}var Pr=!1,It=!1,df=!1,K_=typeof WeakSet=="function"?WeakSet:Set,qt=null;function qE(t,r){if(t=t.containerInfo,Nf=tu,t=av(t),rh(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var p=a.getSelection&&a.getSelection();if(p&&p.rangeCount!==0){a=p.anchorNode;var C=p.anchorOffset,A=p.focusNode;p=p.focusOffset;try{a.nodeType,A.nodeType}catch{a=null;break e}var I=0,G=-1,ee=-1,le=0,fe=0,_e=t,ce=null;t:for(;;){for(var de;_e!==a||C!==0&&_e.nodeType!==3||(G=I+C),_e!==A||p!==0&&_e.nodeType!==3||(ee=I+p),_e.nodeType===3&&(I+=_e.nodeValue.length),(de=_e.firstChild)!==null;)ce=_e,_e=de;for(;;){if(_e===t)break t;if(ce===a&&++le===C&&(G=I),ce===A&&++fe===p&&(ee=I),(de=_e.nextSibling)!==null)break;_e=ce,ce=_e.parentNode}_e=de}a=G===-1||ee===-1?null:{start:G,end:ee}}else a=null}a=a||{start:0,end:0}}else a=null;for(jf={focusedElem:t,selectionRange:a},tu=!1,qt=r;qt!==null;)if(r=qt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,qt=t;else for(;qt!==null;){switch(r=qt,A=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)C=t[a],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&A!==null){t=void 0,a=r,C=A.memoizedProps,A=A.memoizedState,p=a.stateNode;try{var ke=ms(a.type,C);t=p.getSnapshotBeforeUpdate(ke,A),p.__reactInternalSnapshotBeforeUpdate=t}catch(ze){ht(a,a.return,ze)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)If(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":If(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(s(163))}if(t=r.sibling,t!==null){t.return=r.return,qt=t;break}qt=r.return}}function Y_(t,r,a){var p=a.flags;switch(a.tag){case 0:case 11:case 15:Hr(t,a),p&4&&Lo(5,a);break;case 1:if(Hr(t,a),p&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(I){ht(a,a.return,I)}else{var C=ms(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(C,r,t.__reactInternalSnapshotBeforeUpdate)}catch(I){ht(a,a.return,I)}}p&64&&$_(a),p&512&&Io(a,a.return);break;case 3:if(Hr(t,a),p&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{jv(t,r)}catch(I){ht(a,a.return,I)}}break;case 27:r===null&&p&4&&W_(a);case 26:case 5:Hr(t,a),r===null&&p&4&&V_(a),p&512&&Io(a,a.return);break;case 12:Hr(t,a);break;case 31:Hr(t,a),p&4&&Q_(t,a);break;case 13:Hr(t,a),p&4&&J_(t,a),p&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=JE.bind(null,a),y2(t,a))));break;case 22:if(p=a.memoizedState!==null||Pr,!p){r=r!==null&&r.memoizedState!==null||It,C=Pr;var A=It;Pr=p,(It=r)&&!A?Ur(t,a,(a.subtreeFlags&8772)!==0):Hr(t,a),Pr=C,It=A}break;case 30:break;default:Hr(t,a)}}function X_(t){var r=t.alternate;r!==null&&(t.alternate=null,X_(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&oo(r)),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 St=null,mn=!1;function Fr(t,r,a){for(a=a.child;a!==null;)Z_(t,r,a),a=a.sibling}function Z_(t,r,a){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(zt,a)}catch{}switch(a.tag){case 26:It||gr(a,r),Fr(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:It||gr(a,r);var p=St,C=mn;Ai(a.type)&&(St=a.stateNode,mn=!1),Fr(t,r,a),Vo(a.stateNode),St=p,mn=C;break;case 5:It||gr(a,r);case 6:if(p=St,C=mn,St=null,Fr(t,r,a),St=p,mn=C,St!==null)if(mn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(a.stateNode)}catch(A){ht(a,r,A)}else try{St.removeChild(a.stateNode)}catch(A){ht(a,r,A)}break;case 18:St!==null&&(mn?(t=St,$y(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),fa(t)):$y(St,a.stateNode));break;case 4:p=St,C=mn,St=a.stateNode.containerInfo,mn=!0,Fr(t,r,a),St=p,mn=C;break;case 0:case 11:case 14:case 15:bi(2,a,r),It||bi(4,a,r),Fr(t,r,a);break;case 1:It||(gr(a,r),p=a.stateNode,typeof p.componentWillUnmount=="function"&&q_(a,r,p)),Fr(t,r,a);break;case 21:Fr(t,r,a);break;case 22:It=(p=It)||a.memoizedState!==null,Fr(t,r,a),It=p;break;default:Fr(t,r,a)}}function Q_(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{fa(t)}catch(a){ht(r,r.return,a)}}}function J_(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{fa(t)}catch(a){ht(r,r.return,a)}}function VE(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new K_),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new K_),r;default:throw Error(s(435,t.tag))}}function Lc(t,r){var a=VE(t);r.forEach(function(p){if(!a.has(p)){a.add(p);var C=e2.bind(null,t,p);p.then(C,C)}})}function gn(t,r){var a=r.deletions;if(a!==null)for(var p=0;p<a.length;p++){var C=a[p],A=t,I=r,G=I;e:for(;G!==null;){switch(G.tag){case 27:if(Ai(G.type)){St=G.stateNode,mn=!1;break e}break;case 5:St=G.stateNode,mn=!1;break e;case 3:case 4:St=G.stateNode.containerInfo,mn=!0;break e}G=G.return}if(St===null)throw Error(s(160));Z_(A,I,C),St=null,mn=!1,A=C.alternate,A!==null&&(A.return=null),C.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)ey(r,t),r=r.sibling}var rr=null;function ey(t,r){var a=t.alternate,p=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:gn(r,t),vn(t),p&4&&(bi(3,t,t.return),Lo(3,t),bi(5,t,t.return));break;case 1:gn(r,t),vn(t),p&512&&(It||a===null||gr(a,a.return)),p&64&&Pr&&(t=t.updateQueue,t!==null&&(p=t.callbacks,p!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?p:a.concat(p))));break;case 26:var C=rr;if(gn(r,t),vn(t),p&512&&(It||a===null||gr(a,a.return)),p&4){var A=a!==null?a.memoizedState:null;if(p=t.memoizedState,a===null)if(p===null)if(t.stateNode===null){e:{p=t.type,a=t.memoizedProps,C=C.ownerDocument||C;t:switch(p){case"title":A=C.getElementsByTagName("title")[0],(!A||A[Ji]||A[Ct]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=C.createElement(p),C.head.insertBefore(A,C.querySelector("head > title"))),Qt(A,p,a),A[Ct]=t,Nt(A),p=A;break e;case"link":var I=eb("link","href",C).get(p+(a.href||""));if(I){for(var G=0;G<I.length;G++)if(A=I[G],A.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&A.getAttribute("rel")===(a.rel==null?null:a.rel)&&A.getAttribute("title")===(a.title==null?null:a.title)&&A.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){I.splice(G,1);break t}}A=C.createElement(p),Qt(A,p,a),C.head.appendChild(A);break;case"meta":if(I=eb("meta","content",C).get(p+(a.content||""))){for(G=0;G<I.length;G++)if(A=I[G],A.getAttribute("content")===(a.content==null?null:""+a.content)&&A.getAttribute("name")===(a.name==null?null:a.name)&&A.getAttribute("property")===(a.property==null?null:a.property)&&A.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&A.getAttribute("charset")===(a.charSet==null?null:a.charSet)){I.splice(G,1);break t}}A=C.createElement(p),Qt(A,p,a),C.head.appendChild(A);break;default:throw Error(s(468,p))}A[Ct]=t,Nt(A),p=A}t.stateNode=p}else tb(C,t.type,t.stateNode);else t.stateNode=Jy(C,p,t.memoizedProps);else A!==p?(A===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):A.count--,p===null?tb(C,t.type,t.stateNode):Jy(C,p,t.memoizedProps)):p===null&&t.stateNode!==null&&lf(t,t.memoizedProps,a.memoizedProps)}break;case 27:gn(r,t),vn(t),p&512&&(It||a===null||gr(a,a.return)),a!==null&&p&4&&lf(t,t.memoizedProps,a.memoizedProps);break;case 5:if(gn(r,t),vn(t),p&512&&(It||a===null||gr(a,a.return)),t.flags&32){C=t.stateNode;try{fr(C,"")}catch(ke){ht(t,t.return,ke)}}p&4&&t.stateNode!=null&&(C=t.memoizedProps,lf(t,C,a!==null?a.memoizedProps:C)),p&1024&&(df=!0);break;case 6:if(gn(r,t),vn(t),p&4){if(t.stateNode===null)throw Error(s(162));p=t.memoizedProps,a=t.stateNode;try{a.nodeValue=p}catch(ke){ht(t,t.return,ke)}}break;case 3:if(Zc=null,C=rr,rr=Yc(r.containerInfo),gn(r,t),rr=C,vn(t),p&4&&a!==null&&a.memoizedState.isDehydrated)try{fa(r.containerInfo)}catch(ke){ht(t,t.return,ke)}df&&(df=!1,ty(t));break;case 4:p=rr,rr=Yc(t.stateNode.containerInfo),gn(r,t),vn(t),rr=p;break;case 12:gn(r,t),vn(t);break;case 31:gn(r,t),vn(t),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,Lc(t,p)));break;case 13:gn(r,t),vn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Bc=gt()),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,Lc(t,p)));break;case 22:C=t.memoizedState!==null;var ee=a!==null&&a.memoizedState!==null,le=Pr,fe=It;if(Pr=le||C,It=fe||ee,gn(r,t),It=fe,Pr=le,vn(t),p&8192)e:for(r=t.stateNode,r._visibility=C?r._visibility&-2:r._visibility|1,C&&(a===null||ee||Pr||It||gs(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){ee=a=r;try{if(A=ee.stateNode,C)I=A.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{G=ee.stateNode;var _e=ee.memoizedProps.style,ce=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;G.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(ke){ht(ee,ee.return,ke)}}}else if(r.tag===6){if(a===null){ee=r;try{ee.stateNode.nodeValue=C?"":ee.memoizedProps}catch(ke){ht(ee,ee.return,ke)}}}else if(r.tag===18){if(a===null){ee=r;try{var de=ee.stateNode;C?qy(de,!0):qy(ee.stateNode,!1)}catch(ke){ht(ee,ee.return,ke)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}p&4&&(p=t.updateQueue,p!==null&&(a=p.retryQueue,a!==null&&(p.retryQueue=null,Lc(t,a))));break;case 19:gn(r,t),vn(t),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,Lc(t,p)));break;case 30:break;case 21:break;default:gn(r,t),vn(t)}}function vn(t){var r=t.flags;if(r&2){try{for(var a,p=t.return;p!==null;){if(G_(p)){a=p;break}p=p.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var C=a.stateNode,A=cf(t);Oc(t,A,C);break;case 5:var I=a.stateNode;a.flags&32&&(fr(I,""),a.flags&=-33);var G=cf(t);Oc(t,G,I);break;case 3:case 4:var ee=a.stateNode.containerInfo,le=cf(t);uf(t,le,ee);break;default:throw Error(s(161))}}catch(fe){ht(t,t.return,fe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function ty(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;ty(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Hr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Y_(t,r.alternate,r),r=r.sibling}function gs(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:bi(4,r,r.return),gs(r);break;case 1:gr(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&q_(r,r.return,a),gs(r);break;case 27:Vo(r.stateNode);case 26:case 5:gr(r,r.return),gs(r);break;case 22:r.memoizedState===null&&gs(r);break;case 30:gs(r);break;default:gs(r)}t=t.sibling}}function Ur(t,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var p=r.alternate,C=t,A=r,I=A.flags;switch(A.tag){case 0:case 11:case 15:Ur(C,A,a),Lo(4,A);break;case 1:if(Ur(C,A,a),p=A,C=p.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(le){ht(p,p.return,le)}if(p=A,C=p.updateQueue,C!==null){var G=p.stateNode;try{var ee=C.shared.hiddenCallbacks;if(ee!==null)for(C.shared.hiddenCallbacks=null,C=0;C<ee.length;C++)Nv(ee[C],G)}catch(le){ht(p,p.return,le)}}a&&I&64&&$_(A),Io(A,A.return);break;case 27:W_(A);case 26:case 5:Ur(C,A,a),a&&p===null&&I&4&&V_(A),Io(A,A.return);break;case 12:Ur(C,A,a);break;case 31:Ur(C,A,a),a&&I&4&&Q_(C,A);break;case 13:Ur(C,A,a),a&&I&4&&J_(C,A);break;case 22:A.memoizedState===null&&Ur(C,A,a),Io(A,A.return);break;case 30:break;default:Ur(C,A,a)}r=r.sibling}}function hf(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&So(a))}function ff(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&So(t))}function ir(t,r,a,p){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)ny(t,r,a,p),r=r.sibling}function ny(t,r,a,p){var C=r.flags;switch(r.tag){case 0:case 11:case 15:ir(t,r,a,p),C&2048&&Lo(9,r);break;case 1:ir(t,r,a,p);break;case 3:ir(t,r,a,p),C&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&So(t)));break;case 12:if(C&2048){ir(t,r,a,p),t=r.stateNode;try{var A=r.memoizedProps,I=A.id,G=A.onPostCommit;typeof G=="function"&&G(I,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(ee){ht(r,r.return,ee)}}else ir(t,r,a,p);break;case 31:ir(t,r,a,p);break;case 13:ir(t,r,a,p);break;case 23:break;case 22:A=r.stateNode,I=r.alternate,r.memoizedState!==null?A._visibility&2?ir(t,r,a,p):Bo(t,r):A._visibility&2?ir(t,r,a,p):(A._visibility|=2,na(t,r,a,p,(r.subtreeFlags&10256)!==0||!1)),C&2048&&hf(I,r);break;case 24:ir(t,r,a,p),C&2048&&ff(r.alternate,r);break;default:ir(t,r,a,p)}}function na(t,r,a,p,C){for(C=C&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var A=t,I=r,G=a,ee=p,le=I.flags;switch(I.tag){case 0:case 11:case 15:na(A,I,G,ee,C),Lo(8,I);break;case 23:break;case 22:var fe=I.stateNode;I.memoizedState!==null?fe._visibility&2?na(A,I,G,ee,C):Bo(A,I):(fe._visibility|=2,na(A,I,G,ee,C)),C&&le&2048&&hf(I.alternate,I);break;case 24:na(A,I,G,ee,C),C&&le&2048&&ff(I.alternate,I);break;default:na(A,I,G,ee,C)}r=r.sibling}}function Bo(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,p=r,C=p.flags;switch(p.tag){case 22:Bo(a,p),C&2048&&hf(p.alternate,p);break;case 24:Bo(a,p),C&2048&&ff(p.alternate,p);break;default:Bo(a,p)}r=r.sibling}}var zo=8192;function ra(t,r,a){if(t.subtreeFlags&zo)for(t=t.child;t!==null;)ry(t,r,a),t=t.sibling}function ry(t,r,a){switch(t.tag){case 26:ra(t,r,a),t.flags&zo&&t.memoizedState!==null&&M2(a,rr,t.memoizedState,t.memoizedProps);break;case 5:ra(t,r,a);break;case 3:case 4:var p=rr;rr=Yc(t.stateNode.containerInfo),ra(t,r,a),rr=p;break;case 22:t.memoizedState===null&&(p=t.alternate,p!==null&&p.memoizedState!==null?(p=zo,zo=16777216,ra(t,r,a),zo=p):ra(t,r,a));break;default:ra(t,r,a)}}function iy(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Po(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var p=r[a];qt=p,ay(p,t)}iy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sy(t),t=t.sibling}function sy(t){switch(t.tag){case 0:case 11:case 15:Po(t),t.flags&2048&&bi(9,t,t.return);break;case 3:Po(t);break;case 12:Po(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Ic(t)):Po(t);break;default:Po(t)}}function Ic(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var p=r[a];qt=p,ay(p,t)}iy(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:bi(8,r,r.return),Ic(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Ic(r));break;default:Ic(r)}t=t.sibling}}function ay(t,r){for(;qt!==null;){var a=qt;switch(a.tag){case 0:case 11:case 15:bi(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var p=a.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:So(a.memoizedState.cache)}if(p=a.child,p!==null)p.return=a,qt=p;else e:for(a=t;qt!==null;){p=qt;var C=p.sibling,A=p.return;if(X_(p),p===a){qt=null;break e}if(C!==null){C.return=A,qt=C;break e}qt=A}}}var GE={getCacheForType:function(t){var r=Xt(jt),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Xt(jt).controller.signal}},WE=typeof WeakMap=="function"?WeakMap:Map,ot=0,vt=null,Ze=null,et=0,dt=0,Rn=null,xi=!1,ia=!1,pf=!1,$r=0,At=0,Si=0,vs=0,mf=0,Dn=0,sa=0,Fo=null,_n=null,gf=!1,Bc=0,oy=0,zc=1/0,Pc=null,wi=null,Ft=0,Ci=null,aa=null,qr=0,vf=0,_f=null,ly=null,Ho=0,yf=null;function Mn(){return(ot&2)!==0&&et!==0?et&-et:V.T!==null?kf():so()}function cy(){if(Dn===0)if((et&536870912)===0||nt){var t=ut;ut<<=1,(ut&3932160)===0&&(ut=262144),Dn=t}else Dn=536870912;return t=An.current,t!==null&&(t.flags|=32),Dn}function yn(t,r,a){(t===vt&&(dt===2||dt===9)||t.cancelPendingCommit!==null)&&(oa(t,0),ki(t,et,Dn,!1)),Qi(t,a),((ot&2)===0||t!==vt)&&(t===vt&&((ot&2)===0&&(vs|=a),At===4&&ki(t,et,Dn,!1)),vr(t))}function uy(t,r,a){if((ot&6)!==0)throw Error(s(327));var p=!a&&(r&127)===0&&(r&t.expiredLanes)===0||Cn(t,r),C=p?XE(t,r):xf(t,r,!0),A=p;do{if(C===0){ia&&!p&&ki(t,r,0,!1);break}else{if(a=t.current.alternate,A&&!KE(a)){C=xf(t,r,!1),A=!1;continue}if(C===2){if(A=r,t.errorRecoveryDisabledLanes&A)var I=0;else I=t.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){r=I;e:{var G=t;C=Fo;var ee=G.current.memoizedState.isDehydrated;if(ee&&(oa(G,I).flags|=256),I=xf(G,I,!1),I!==2){if(pf&&!ee){G.errorRecoveryDisabledLanes|=A,vs|=A,C=4;break e}A=_n,_n=C,A!==null&&(_n===null?_n=A:_n.push.apply(_n,A))}C=I}if(A=!1,C!==2)continue}}if(C===1){oa(t,0),ki(t,r,0,!0);break}e:{switch(p=t,A=C,A){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:ki(p,r,Dn,!xi);break e;case 2:_n=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(C=Bc+300-gt(),10<C)){if(ki(p,r,Dn,!xi),Zi(p,0,!0)!==0)break e;qr=r,p.timeoutHandle=Hy(dy.bind(null,p,a,_n,Pc,gf,r,Dn,vs,sa,xi,A,"Throttled",-0,0),C);break e}dy(p,a,_n,Pc,gf,r,Dn,vs,sa,xi,A,null,-0,0)}}break}while(!0);vr(t)}function dy(t,r,a,p,C,A,I,G,ee,le,fe,_e,ce,de){if(t.timeoutHandle=-1,_e=r.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rr},ry(r,A,_e);var ke=(A&62914560)===A?Bc-gt():(A&4194048)===A?oy-gt():0;if(ke=N2(_e,ke),ke!==null){qr=A,t.cancelPendingCommit=ke(yy.bind(null,t,r,A,a,p,C,I,G,ee,fe,_e,null,ce,de)),ki(t,A,I,!le);return}}yy(t,r,A,a,p,C,I,G,ee)}function KE(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var p=0;p<a.length;p++){var C=a[p],A=C.getSnapshot;C=C.value;try{if(!kn(A(),C))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function ki(t,r,a,p){r&=~mf,r&=~vs,t.suspendedLanes|=r,t.pingedLanes&=~r,p&&(t.warmLanes|=r),p=t.expirationTimes;for(var C=r;0<C;){var A=31-it(C),I=1<<A;p[A]=-1,C&=~I}a!==0&&Wl(t,a,r)}function Fc(){return(ot&6)===0?(Uo(0),!1):!0}function bf(){if(Ze!==null){if(dt===0)var t=Ze.return;else t=Ze,jr=ls=null,Lh(t),Zs=null,Co=0,t=Ze;for(;t!==null;)U_(t.alternate,t),t=t.return;Ze=null}}function oa(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,p2(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),qr=0,bf(),vt=t,Ze=a=Mr(t.current,null),et=r,dt=0,Rn=null,xi=!1,ia=Cn(t,r),pf=!1,sa=Dn=mf=vs=Si=At=0,_n=Fo=null,gf=!1,(r&8)!==0&&(r|=r&32);var p=t.entangledLanes;if(p!==0)for(t=t.entanglements,p&=r;0<p;){var C=31-it(p),A=1<<C;r|=t[C],p&=~A}return $r=r,oc(),a}function hy(t,r){$e=null,V.H=No,r===Xs||r===mc?(r=Tv(),dt=3):r===wh?(r=Tv(),dt=4):dt=r===Zh?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Rn=r,Ze===null&&(At=1,Rc(t,Un(r,t.current)))}function fy(){var t=An.current;return t===null?!0:(et&4194048)===et?Gn===null:(et&62914560)===et||(et&536870912)!==0?t===Gn:!1}function py(){var t=V.H;return V.H=No,t===null?No:t}function my(){var t=V.A;return V.A=GE,t}function Hc(){At=4,xi||(et&4194048)!==et&&An.current!==null||(ia=!0),(Si&134217727)===0&&(vs&134217727)===0||vt===null||ki(vt,et,Dn,!1)}function xf(t,r,a){var p=ot;ot|=2;var C=py(),A=my();(vt!==t||et!==r)&&(Pc=null,oa(t,r)),r=!1;var I=At;e:do try{if(dt!==0&&Ze!==null){var G=Ze,ee=Rn;switch(dt){case 8:bf(),I=6;break e;case 3:case 2:case 9:case 6:An.current===null&&(r=!0);var le=dt;if(dt=0,Rn=null,la(t,G,ee,le),a&&ia){I=0;break e}break;default:le=dt,dt=0,Rn=null,la(t,G,ee,le)}}YE(),I=At;break}catch(fe){hy(t,fe)}while(!0);return r&&t.shellSuspendCounter++,jr=ls=null,ot=p,V.H=C,V.A=A,Ze===null&&(vt=null,et=0,oc()),I}function YE(){for(;Ze!==null;)gy(Ze)}function XE(t,r){var a=ot;ot|=2;var p=py(),C=my();vt!==t||et!==r?(Pc=null,zc=gt()+500,oa(t,r)):ia=Cn(t,r);e:do try{if(dt!==0&&Ze!==null){r=Ze;var A=Rn;t:switch(dt){case 1:dt=0,Rn=null,la(t,r,A,1);break;case 2:case 9:if(Ev(A)){dt=0,Rn=null,vy(r);break}r=function(){dt!==2&&dt!==9||vt!==t||(dt=7),vr(t)},A.then(r,r);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:Ev(A)?(dt=0,Rn=null,vy(r)):(dt=0,Rn=null,la(t,r,A,7));break;case 5:var I=null;switch(Ze.tag){case 26:I=Ze.memoizedState;case 5:case 27:var G=Ze;if(I?nb(I):G.stateNode.complete){dt=0,Rn=null;var ee=G.sibling;if(ee!==null)Ze=ee;else{var le=G.return;le!==null?(Ze=le,Uc(le)):Ze=null}break t}}dt=0,Rn=null,la(t,r,A,5);break;case 6:dt=0,Rn=null,la(t,r,A,6);break;case 8:bf(),At=6;break e;default:throw Error(s(462))}}ZE();break}catch(fe){hy(t,fe)}while(!0);return jr=ls=null,V.H=p,V.A=C,ot=a,Ze!==null?0:(vt=null,et=0,oc(),At)}function ZE(){for(;Ze!==null&&!ur();)gy(Ze)}function gy(t){var r=F_(t.alternate,t,$r);t.memoizedProps=t.pendingProps,r===null?Uc(t):Ze=r}function vy(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=O_(a,r,r.pendingProps,r.type,void 0,et);break;case 11:r=O_(a,r,r.pendingProps,r.type.render,r.ref,et);break;case 5:Lh(r);default:U_(a,r),r=Ze=mv(r,$r),r=F_(a,r,$r)}t.memoizedProps=t.pendingProps,r===null?Uc(t):Ze=r}function la(t,r,a,p){jr=ls=null,Lh(r),Zs=null,Co=0;var C=r.return;try{if(PE(t,C,r,a,et)){At=1,Rc(t,Un(a,t.current)),Ze=null;return}}catch(A){if(C!==null)throw Ze=C,A;At=1,Rc(t,Un(a,t.current)),Ze=null;return}r.flags&32768?(nt||p===1?t=!0:ia||(et&536870912)!==0?t=!1:(xi=t=!0,(p===2||p===9||p===3||p===6)&&(p=An.current,p!==null&&p.tag===13&&(p.flags|=16384))),_y(r,t)):Uc(r)}function Uc(t){var r=t;do{if((r.flags&32768)!==0){_y(r,xi);return}t=r.return;var a=UE(r.alternate,r,$r);if(a!==null){Ze=a;return}if(r=r.sibling,r!==null){Ze=r;return}Ze=r=t}while(r!==null);At===0&&(At=5)}function _y(t,r){do{var a=$E(t.alternate,t);if(a!==null){a.flags&=32767,Ze=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){Ze=t;return}Ze=t=a}while(t!==null);At=6,Ze=null}function yy(t,r,a,p,C,A,I,G,ee){t.cancelPendingCommit=null;do $c();while(Ft!==0);if((ot&6)!==0)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(A=r.lanes|r.childLanes,A|=lh,Gl(t,a,A,I,G,ee),t===vt&&(Ze=vt=null,et=0),aa=r,Ci=t,qr=a,vf=A,_f=C,ly=p,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,t2(Oe,function(){return Cy(),null})):(t.callbackNode=null,t.callbackPriority=0),p=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||p){p=V.T,V.T=null,C=Z.p,Z.p=2,I=ot,ot|=4;try{qE(t,r,a)}finally{ot=I,Z.p=C,V.T=p}}Ft=1,by(),xy(),Sy()}}function by(){if(Ft===1){Ft=0;var t=Ci,r=aa,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=V.T,V.T=null;var p=Z.p;Z.p=2;var C=ot;ot|=4;try{ey(r,t);var A=jf,I=av(t.containerInfo),G=A.focusedElem,ee=A.selectionRange;if(I!==G&&G&&G.ownerDocument&&sv(G.ownerDocument.documentElement,G)){if(ee!==null&&rh(G)){var le=ee.start,fe=ee.end;if(fe===void 0&&(fe=le),"selectionStart"in G)G.selectionStart=le,G.selectionEnd=Math.min(fe,G.value.length);else{var _e=G.ownerDocument||document,ce=_e&&_e.defaultView||window;if(ce.getSelection){var de=ce.getSelection(),ke=G.textContent.length,ze=Math.min(ee.start,ke),mt=ee.end===void 0?ze:Math.min(ee.end,ke);!de.extend&&ze>mt&&(I=mt,mt=ze,ze=I);var se=iv(G,ze),ie=iv(G,mt);if(se&&ie&&(de.rangeCount!==1||de.anchorNode!==se.node||de.anchorOffset!==se.offset||de.focusNode!==ie.node||de.focusOffset!==ie.offset)){var oe=_e.createRange();oe.setStart(se.node,se.offset),de.removeAllRanges(),ze>mt?(de.addRange(oe),de.extend(ie.node,ie.offset)):(oe.setEnd(ie.node,ie.offset),de.addRange(oe))}}}}for(_e=[],de=G;de=de.parentNode;)de.nodeType===1&&_e.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof G.focus=="function"&&G.focus(),G=0;G<_e.length;G++){var ve=_e[G];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}tu=!!Nf,jf=Nf=null}finally{ot=C,Z.p=p,V.T=a}}t.current=r,Ft=2}}function xy(){if(Ft===2){Ft=0;var t=Ci,r=aa,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=V.T,V.T=null;var p=Z.p;Z.p=2;var C=ot;ot|=4;try{Y_(t,r.alternate,r)}finally{ot=C,Z.p=p,V.T=a}}Ft=3}}function Sy(){if(Ft===4||Ft===3){Ft=0,$t();var t=Ci,r=aa,a=qr,p=ly;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Ft=5:(Ft=0,aa=Ci=null,wy(t,t.pendingLanes));var C=t.pendingLanes;if(C===0&&(wi=null),io(a),r=r.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(zt,r,void 0,(r.current.flags&128)===128)}catch{}if(p!==null){r=V.T,C=Z.p,Z.p=2,V.T=null;try{for(var A=t.onRecoverableError,I=0;I<p.length;I++){var G=p[I];A(G.value,{componentStack:G.stack})}}finally{V.T=r,Z.p=C}}(qr&3)!==0&&$c(),vr(t),C=t.pendingLanes,(a&261930)!==0&&(C&42)!==0?t===yf?Ho++:(Ho=0,yf=t):Ho=0,Uo(0)}}function wy(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,So(r)))}function $c(){return by(),xy(),Sy(),Cy()}function Cy(){if(Ft!==5)return!1;var t=Ci,r=vf;vf=0;var a=io(qr),p=V.T,C=Z.p;try{Z.p=32>a?32:a,V.T=null,a=_f,_f=null;var A=Ci,I=qr;if(Ft=0,aa=Ci=null,qr=0,(ot&6)!==0)throw Error(s(331));var G=ot;if(ot|=4,sy(A.current),ny(A,A.current,I,a),ot=G,Uo(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(zt,A)}catch{}return!0}finally{Z.p=C,V.T=p,wy(t,r)}}function ky(t,r,a){r=Un(a,r),r=Xh(t.stateNode,r,2),t=vi(t,r,2),t!==null&&(Qi(t,2),vr(t))}function ht(t,r,a){if(t.tag===3)ky(t,t,a);else for(;r!==null;){if(r.tag===3){ky(r,t,a);break}else if(r.tag===1){var p=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(wi===null||!wi.has(p))){t=Un(a,t),a=E_(2),p=vi(r,a,2),p!==null&&(A_(a,p,r,t),Qi(p,2),vr(p));break}}r=r.return}}function Sf(t,r,a){var p=t.pingCache;if(p===null){p=t.pingCache=new WE;var C=new Set;p.set(r,C)}else C=p.get(r),C===void 0&&(C=new Set,p.set(r,C));C.has(a)||(pf=!0,C.add(a),t=QE.bind(null,t,r,a),r.then(t,t))}function QE(t,r,a){var p=t.pingCache;p!==null&&p.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,vt===t&&(et&a)===a&&(At===4||At===3&&(et&62914560)===et&&300>gt()-Bc?(ot&2)===0&&oa(t,0):mf|=a,sa===et&&(sa=0)),vr(t)}function Ey(t,r){r===0&&(r=Os()),t=ss(t,r),t!==null&&(Qi(t,r),vr(t))}function JE(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),Ey(t,a)}function e2(t,r){var a=0;switch(t.tag){case 31:case 13:var p=t.stateNode,C=t.memoizedState;C!==null&&(a=C.retryLane);break;case 19:p=t.stateNode;break;case 22:p=t.stateNode._retryCache;break;default:throw Error(s(314))}p!==null&&p.delete(r),Ey(t,a)}function t2(t,r){return fn(t,r)}var qc=null,ca=null,wf=!1,Vc=!1,Cf=!1,Ei=0;function vr(t){t!==ca&&t.next===null&&(ca===null?qc=ca=t:ca=ca.next=t),Vc=!0,wf||(wf=!0,r2())}function Uo(t,r){if(!Cf&&Vc){Cf=!0;do for(var a=!1,p=qc;p!==null;){if(t!==0){var C=p.pendingLanes;if(C===0)var A=0;else{var I=p.suspendedLanes,G=p.pingedLanes;A=(1<<31-it(42|t)+1)-1,A&=C&~(I&~G),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(a=!0,Dy(p,A))}else A=et,A=Zi(p,p===vt?A:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(A&3)===0||Cn(p,A)||(a=!0,Dy(p,A));p=p.next}while(a);Cf=!1}}function n2(){Ay()}function Ay(){Vc=wf=!1;var t=0;Ei!==0&&f2()&&(t=Ei);for(var r=gt(),a=null,p=qc;p!==null;){var C=p.next,A=Ty(p,r);A===0?(p.next=null,a===null?qc=C:a.next=C,C===null&&(ca=a)):(a=p,(t!==0||(A&3)!==0)&&(Vc=!0)),p=C}Ft!==0&&Ft!==5||Uo(t),Ei!==0&&(Ei=0)}function Ty(t,r){for(var a=t.suspendedLanes,p=t.pingedLanes,C=t.expirationTimes,A=t.pendingLanes&-62914561;0<A;){var I=31-it(A),G=1<<I,ee=C[I];ee===-1?((G&a)===0||(G&p)!==0)&&(C[I]=zd(G,r)):ee<=r&&(t.expiredLanes|=G),A&=~G}if(r=vt,a=et,a=Zi(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),p=t.callbackNode,a===0||t===r&&(dt===2||dt===9)||t.cancelPendingCommit!==null)return p!==null&&p!==null&&Kt(p),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Cn(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(p!==null&&Kt(p),io(a)){case 2:case 8:a=xe;break;case 32:a=Oe;break;case 268435456:a=qe;break;default:a=Oe}return p=Ry.bind(null,t),a=fn(a,p),t.callbackPriority=r,t.callbackNode=a,r}return p!==null&&p!==null&&Kt(p),t.callbackPriority=2,t.callbackNode=null,2}function Ry(t,r){if(Ft!==0&&Ft!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if($c()&&t.callbackNode!==a)return null;var p=et;return p=Zi(t,t===vt?p:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),p===0?null:(uy(t,p,r),Ty(t,gt()),t.callbackNode!=null&&t.callbackNode===a?Ry.bind(null,t):null)}function Dy(t,r){if($c())return null;uy(t,r,!0)}function r2(){m2(function(){(ot&6)!==0?fn(he,n2):Ay()})}function kf(){if(Ei===0){var t=Ks;t===0&&(t=ct,ct<<=1,(ct&261888)===0&&(ct=256)),Ei=t}return Ei}function My(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Jl(""+t)}function Ny(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function i2(t,r,a,p,C){if(r==="submit"&&a&&a.stateNode===C){var A=My((C[nn]||null).action),I=p.submitter;I&&(r=(r=I[nn]||null)?My(r.formAction):I.getAttribute("formAction"),r!==null&&(A=r,I=null));var G=new rc("action","action",null,p,C);t.push({event:G,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Ei!==0){var ee=I?Ny(C,I):new FormData(C);qh(a,{pending:!0,data:ee,method:C.method,action:A},null,ee)}}else typeof A=="function"&&(G.preventDefault(),ee=I?Ny(C,I):new FormData(C),qh(a,{pending:!0,data:ee,method:C.method,action:A},A,ee))},currentTarget:C}]})}}for(var Ef=0;Ef<oh.length;Ef++){var Af=oh[Ef],s2=Af.toLowerCase(),a2=Af[0].toUpperCase()+Af.slice(1);nr(s2,"on"+a2)}nr(cv,"onAnimationEnd"),nr(uv,"onAnimationIteration"),nr(dv,"onAnimationStart"),nr("dblclick","onDoubleClick"),nr("focusin","onFocus"),nr("focusout","onBlur"),nr(SE,"onTransitionRun"),nr(wE,"onTransitionStart"),nr(CE,"onTransitionCancel"),nr(hv,"onTransitionEnd"),ci("onMouseEnter",["mouseout","mouseover"]),ci("onMouseLeave",["mouseout","mouseover"]),ci("onPointerEnter",["pointerout","pointerover"]),ci("onPointerLeave",["pointerout","pointerover"]),Tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Tr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $o="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(" "),o2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($o));function jy(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var p=t[a],C=p.event;p=p.listeners;e:{var A=void 0;if(r)for(var I=p.length-1;0<=I;I--){var G=p[I],ee=G.instance,le=G.currentTarget;if(G=G.listener,ee!==A&&C.isPropagationStopped())break e;A=G,C.currentTarget=le;try{A(C)}catch(fe){ac(fe)}C.currentTarget=null,A=ee}else for(I=0;I<p.length;I++){if(G=p[I],ee=G.instance,le=G.currentTarget,G=G.listener,ee!==A&&C.isPropagationStopped())break e;A=G,C.currentTarget=le;try{A(C)}catch(fe){ac(fe)}C.currentTarget=null,A=ee}}}}function Qe(t,r){var a=r[ao];a===void 0&&(a=r[ao]=new Set);var p=t+"__bubble";a.has(p)||(Oy(r,t,2,!1),a.add(p))}function Tf(t,r,a){var p=0;r&&(p|=4),Oy(a,t,p,r)}var Gc="_reactListening"+Math.random().toString(36).slice(2);function Rf(t){if(!t[Gc]){t[Gc]=!0,Xl.forEach(function(a){a!=="selectionchange"&&(o2.has(a)||Tf(a,!1,t),Tf(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Gc]||(r[Gc]=!0,Tf("selectionchange",!1,r))}}function Oy(t,r,a,p){switch(cb(r)){case 2:var C=L2;break;case 8:C=I2;break;default:C=qf}a=C.bind(null,r,a,t),C=void 0,!Kd||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(C=!0),p?C!==void 0?t.addEventListener(r,a,{capture:!0,passive:C}):t.addEventListener(r,a,!0):C!==void 0?t.addEventListener(r,a,{passive:C}):t.addEventListener(r,a,!1)}function Df(t,r,a,p,C){var A=p;if((r&1)===0&&(r&2)===0&&p!==null)e:for(;;){if(p===null)return;var I=p.tag;if(I===3||I===4){var G=p.stateNode.containerInfo;if(G===C)break;if(I===4)for(I=p.return;I!==null;){var ee=I.tag;if((ee===3||ee===4)&&I.stateNode.containerInfo===C)return;I=I.return}for(;G!==null;){if(I=si(G),I===null)return;if(ee=I.tag,ee===5||ee===6||ee===26||ee===27){p=A=I;continue e}G=G.parentNode}}p=p.return}Pg(function(){var le=A,fe=Gd(a),_e=[];e:{var ce=fv.get(t);if(ce!==void 0){var de=rc,ke=t;switch(t){case"keypress":if(tc(a)===0)break e;case"keydown":case"keyup":de=eE;break;case"focusin":ke="focus",de=Qd;break;case"focusout":ke="blur",de=Qd;break;case"beforeblur":case"afterblur":de=Qd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Ug;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Uk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=rE;break;case cv:case uv:case dv:de=Vk;break;case hv:de=sE;break;case"scroll":case"scrollend":de=Fk;break;case"wheel":de=oE;break;case"copy":case"cut":case"paste":de=Wk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=qg;break;case"toggle":case"beforetoggle":de=cE}var ze=(r&4)!==0,mt=!ze&&(t==="scroll"||t==="scrollend"),se=ze?ce!==null?ce+"Capture":null:ce;ze=[];for(var ie=le,oe;ie!==null;){var ve=ie;if(oe=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||oe===null||se===null||(ve=uo(ie,se),ve!=null&&ze.push(qo(ie,ve,oe))),mt)break;ie=ie.return}0<ze.length&&(ce=new de(ce,ke,null,a,fe),_e.push({event:ce,listeners:ze}))}}if((r&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",de=t==="mouseout"||t==="pointerout",ce&&a!==Vd&&(ke=a.relatedTarget||a.fromElement)&&(si(ke)||ke[ii]))break e;if((de||ce)&&(ce=fe.window===fe?fe:(ce=fe.ownerDocument)?ce.defaultView||ce.parentWindow:window,de?(ke=a.relatedTarget||a.toElement,de=le,ke=ke?si(ke):null,ke!==null&&(mt=h(ke),ze=ke.tag,ke!==mt||ze!==5&&ze!==27&&ze!==6)&&(ke=null)):(de=null,ke=le),de!==ke)){if(ze=Ug,ve="onMouseLeave",se="onMouseEnter",ie="mouse",(t==="pointerout"||t==="pointerover")&&(ze=qg,ve="onPointerLeave",se="onPointerEnter",ie="pointer"),mt=de==null?ce:oi(de),oe=ke==null?ce:oi(ke),ce=new ze(ve,ie+"leave",de,a,fe),ce.target=mt,ce.relatedTarget=oe,ve=null,si(fe)===le&&(ze=new ze(se,ie+"enter",ke,a,fe),ze.target=oe,ze.relatedTarget=mt,ve=ze),mt=ve,de&&ke)t:{for(ze=l2,se=de,ie=ke,oe=0,ve=se;ve;ve=ze(ve))oe++;ve=0;for(var Le=ie;Le;Le=ze(Le))ve++;for(;0<oe-ve;)se=ze(se),oe--;for(;0<ve-oe;)ie=ze(ie),ve--;for(;oe--;){if(se===ie||ie!==null&&se===ie.alternate){ze=se;break t}se=ze(se),ie=ze(ie)}ze=null}else ze=null;de!==null&&Ly(_e,ce,de,ze,!1),ke!==null&&mt!==null&&Ly(_e,mt,ke,ze,!0)}}e:{if(ce=le?oi(le):window,de=ce.nodeName&&ce.nodeName.toLowerCase(),de==="select"||de==="input"&&ce.type==="file")var st=Qg;else if(Xg(ce))if(Jg)st=yE;else{st=vE;var Me=gE}else de=ce.nodeName,!de||de.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&qd(le.elementType)&&(st=Qg):st=_E;if(st&&(st=st(t,le))){Zg(_e,st,a,fe);break e}Me&&Me(t,ce,le),t==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&ln(ce,"number",ce.value)}switch(Me=le?oi(le):window,t){case"focusin":(Xg(Me)||Me.contentEditable==="true")&&(Fs=Me,ih=le,yo=null);break;case"focusout":yo=ih=Fs=null;break;case"mousedown":sh=!0;break;case"contextmenu":case"mouseup":case"dragend":sh=!1,ov(_e,a,fe);break;case"selectionchange":if(xE)break;case"keydown":case"keyup":ov(_e,a,fe)}var Ge;if(eh)e:{switch(t){case"compositionstart":var tt="onCompositionStart";break e;case"compositionend":tt="onCompositionEnd";break e;case"compositionupdate":tt="onCompositionUpdate";break e}tt=void 0}else Ps?Kg(t,a)&&(tt="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(tt="onCompositionStart");tt&&(Vg&&a.locale!=="ko"&&(Ps||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Ps&&(Ge=Fg()):(ui=fe,Yd="value"in ui?ui.value:ui.textContent,Ps=!0)),Me=Wc(le,tt),0<Me.length&&(tt=new $g(tt,t,null,a,fe),_e.push({event:tt,listeners:Me}),Ge?tt.data=Ge:(Ge=Yg(a),Ge!==null&&(tt.data=Ge)))),(Ge=dE?hE(t,a):fE(t,a))&&(tt=Wc(le,"onBeforeInput"),0<tt.length&&(Me=new $g("onBeforeInput","beforeinput",null,a,fe),_e.push({event:Me,listeners:tt}),Me.data=Ge)),i2(_e,t,le,a,fe)}jy(_e,r)})}function qo(t,r,a){return{instance:t,listener:r,currentTarget:a}}function Wc(t,r){for(var a=r+"Capture",p=[];t!==null;){var C=t,A=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||A===null||(C=uo(t,a),C!=null&&p.unshift(qo(t,C,A)),C=uo(t,r),C!=null&&p.push(qo(t,C,A))),t.tag===3)return p;t=t.return}return[]}function l2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ly(t,r,a,p,C){for(var A=r._reactName,I=[];a!==null&&a!==p;){var G=a,ee=G.alternate,le=G.stateNode;if(G=G.tag,ee!==null&&ee===p)break;G!==5&&G!==26&&G!==27||le===null||(ee=le,C?(le=uo(a,A),le!=null&&I.unshift(qo(a,le,ee))):C||(le=uo(a,A),le!=null&&I.push(qo(a,le,ee)))),a=a.return}I.length!==0&&t.push({event:r,listeners:I})}var c2=/\r\n?/g,u2=/\u0000|\uFFFD/g;function Iy(t){return(typeof t=="string"?t:""+t).replace(c2,`
49
- `).replace(u2,"")}function By(t,r){return r=Iy(r),Iy(t)===r}function pt(t,r,a,p,C,A){switch(a){case"children":typeof p=="string"?r==="body"||r==="textarea"&&p===""||fr(t,p):(typeof p=="number"||typeof p=="bigint")&&r!=="body"&&fr(t,""+p);break;case"className":Pt(t,"class",p);break;case"tabIndex":Pt(t,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Pt(t,a,p);break;case"style":Bg(t,p,A);break;case"data":if(r!=="object"){Pt(t,"data",p);break}case"src":case"href":if(p===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){t.removeAttribute(a);break}p=Jl(""+p),t.setAttribute(a,p);break;case"action":case"formAction":if(typeof p=="function"){t.setAttribute(a,"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"&&(a==="formAction"?(r!=="input"&&pt(t,r,"name",C.name,C,null),pt(t,r,"formEncType",C.formEncType,C,null),pt(t,r,"formMethod",C.formMethod,C,null),pt(t,r,"formTarget",C.formTarget,C,null)):(pt(t,r,"encType",C.encType,C,null),pt(t,r,"method",C.method,C,null),pt(t,r,"target",C.target,C,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){t.removeAttribute(a);break}p=Jl(""+p),t.setAttribute(a,p);break;case"onClick":p!=null&&(t.onclick=Rr);break;case"onScroll":p!=null&&Qe("scroll",t);break;case"onScrollEnd":p!=null&&Qe("scrollend",t);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(a=p.__html,a!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":t.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){t.removeAttribute("xlink:href");break}a=Jl(""+p),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(a,""+p):t.removeAttribute(a);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":p&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":p===!0?t.setAttribute(a,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?t.setAttribute(a,p):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?t.setAttribute(a,p):t.removeAttribute(a);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?t.removeAttribute(a):t.setAttribute(a,p);break;case"popover":Qe("beforetoggle",t),Qe("toggle",t),Ls(t,"popover",p);break;case"xlinkActuate":tr(t,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":tr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":tr(t,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":tr(t,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":tr(t,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":tr(t,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":tr(t,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":tr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":tr(t,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Ls(t,"is",p);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=zk.get(a)||a,Ls(t,a,p))}}function Mf(t,r,a,p,C,A){switch(a){case"style":Bg(t,p,A);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(a=p.__html,a!=null){if(C.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof p=="string"?fr(t,p):(typeof p=="number"||typeof p=="bigint")&&fr(t,""+p);break;case"onScroll":p!=null&&Qe("scroll",t);break;case"onScrollEnd":p!=null&&Qe("scrollend",t);break;case"onClick":p!=null&&(t.onclick=Rr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zl.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(C=a.endsWith("Capture"),r=a.slice(2,C?a.length-7:void 0),A=t[nn]||null,A=A!=null?A[a]:null,typeof A=="function"&&t.removeEventListener(r,A,C),typeof p=="function")){typeof A!="function"&&A!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,p,C);break e}a in t?t[a]=p:p===!0?t.setAttribute(a,""):Ls(t,a,p)}}}function Qt(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",t),Qe("load",t);var p=!1,C=!1,A;for(A in a)if(a.hasOwnProperty(A)){var I=a[A];if(I!=null)switch(A){case"src":p=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:pt(t,r,A,I,a,null)}}C&&pt(t,r,"srcSet",a.srcSet,a,null),p&&pt(t,r,"src",a.src,a,null);return;case"input":Qe("invalid",t);var G=A=I=C=null,ee=null,le=null;for(p in a)if(a.hasOwnProperty(p)){var fe=a[p];if(fe!=null)switch(p){case"name":C=fe;break;case"type":I=fe;break;case"checked":ee=fe;break;case"defaultChecked":le=fe;break;case"value":A=fe;break;case"defaultValue":G=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,r));break;default:pt(t,r,p,fe,a,null)}}kt(t,A,G,ee,le,I,C,!1);return;case"select":Qe("invalid",t),p=I=A=null;for(C in a)if(a.hasOwnProperty(C)&&(G=a[C],G!=null))switch(C){case"value":A=G;break;case"defaultValue":I=G;break;case"multiple":p=G;default:pt(t,r,C,G,a,null)}r=A,a=I,t.multiple=!!p,r!=null?cn(t,!!p,r,!1):a!=null&&cn(t,!!p,a,!0);return;case"textarea":Qe("invalid",t),A=C=p=null;for(I in a)if(a.hasOwnProperty(I)&&(G=a[I],G!=null))switch(I){case"value":p=G;break;case"defaultValue":C=G;break;case"children":A=G;break;case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(91));break;default:pt(t,r,I,G,a,null)}ts(t,p,C,A);return;case"option":for(ee in a)if(a.hasOwnProperty(ee)&&(p=a[ee],p!=null))switch(ee){case"selected":t.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:pt(t,r,ee,p,a,null)}return;case"dialog":Qe("beforetoggle",t),Qe("toggle",t),Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":Qe("load",t);break;case"video":case"audio":for(p=0;p<$o.length;p++)Qe($o[p],t);break;case"image":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"embed":case"source":case"link":Qe("error",t),Qe("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(le in a)if(a.hasOwnProperty(le)&&(p=a[le],p!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:pt(t,r,le,p,a,null)}return;default:if(qd(r)){for(fe in a)a.hasOwnProperty(fe)&&(p=a[fe],p!==void 0&&Mf(t,r,fe,p,a,void 0));return}}for(G in a)a.hasOwnProperty(G)&&(p=a[G],p!=null&&pt(t,r,G,p,a,null))}function d2(t,r,a,p){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,A=null,I=null,G=null,ee=null,le=null,fe=null;for(de in a){var _e=a[de];if(a.hasOwnProperty(de)&&_e!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":ee=_e;default:p.hasOwnProperty(de)||pt(t,r,de,null,p,_e)}}for(var ce in p){var de=p[ce];if(_e=a[ce],p.hasOwnProperty(ce)&&(de!=null||_e!=null))switch(ce){case"type":A=de;break;case"name":C=de;break;case"checked":le=de;break;case"defaultChecked":fe=de;break;case"value":I=de;break;case"defaultValue":G=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:de!==_e&&pt(t,r,ce,de,p,_e)}}He(t,I,G,ee,le,fe,A,C);return;case"select":de=I=G=ce=null;for(A in a)if(ee=a[A],a.hasOwnProperty(A)&&ee!=null)switch(A){case"value":break;case"multiple":de=ee;default:p.hasOwnProperty(A)||pt(t,r,A,null,p,ee)}for(C in p)if(A=p[C],ee=a[C],p.hasOwnProperty(C)&&(A!=null||ee!=null))switch(C){case"value":ce=A;break;case"defaultValue":G=A;break;case"multiple":I=A;default:A!==ee&&pt(t,r,C,A,p,ee)}r=G,a=I,p=de,ce!=null?cn(t,!!a,ce,!1):!!p!=!!a&&(r!=null?cn(t,!!a,r,!0):cn(t,!!a,a?[]:"",!1));return;case"textarea":de=ce=null;for(G in a)if(C=a[G],a.hasOwnProperty(G)&&C!=null&&!p.hasOwnProperty(G))switch(G){case"value":break;case"children":break;default:pt(t,r,G,null,p,C)}for(I in p)if(C=p[I],A=a[I],p.hasOwnProperty(I)&&(C!=null||A!=null))switch(I){case"value":ce=C;break;case"defaultValue":de=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:C!==A&&pt(t,r,I,C,p,A)}hr(t,ce,de);return;case"option":for(var ke in a)if(ce=a[ke],a.hasOwnProperty(ke)&&ce!=null&&!p.hasOwnProperty(ke))switch(ke){case"selected":t.selected=!1;break;default:pt(t,r,ke,null,p,ce)}for(ee in p)if(ce=p[ee],de=a[ee],p.hasOwnProperty(ee)&&ce!==de&&(ce!=null||de!=null))switch(ee){case"selected":t.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:pt(t,r,ee,ce,p,de)}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 ze in a)ce=a[ze],a.hasOwnProperty(ze)&&ce!=null&&!p.hasOwnProperty(ze)&&pt(t,r,ze,null,p,ce);for(le in p)if(ce=p[le],de=a[le],p.hasOwnProperty(le)&&ce!==de&&(ce!=null||de!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,r));break;default:pt(t,r,le,ce,p,de)}return;default:if(qd(r)){for(var mt in a)ce=a[mt],a.hasOwnProperty(mt)&&ce!==void 0&&!p.hasOwnProperty(mt)&&Mf(t,r,mt,void 0,p,ce);for(fe in p)ce=p[fe],de=a[fe],!p.hasOwnProperty(fe)||ce===de||ce===void 0&&de===void 0||Mf(t,r,fe,ce,p,de);return}}for(var se in a)ce=a[se],a.hasOwnProperty(se)&&ce!=null&&!p.hasOwnProperty(se)&&pt(t,r,se,null,p,ce);for(_e in p)ce=p[_e],de=a[_e],!p.hasOwnProperty(_e)||ce===de||ce==null&&de==null||pt(t,r,_e,ce,p,de)}function zy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function h2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),p=0;p<a.length;p++){var C=a[p],A=C.transferSize,I=C.initiatorType,G=C.duration;if(A&&G&&zy(I)){for(I=0,G=C.responseEnd,p+=1;p<a.length;p++){var ee=a[p],le=ee.startTime;if(le>G)break;var fe=ee.transferSize,_e=ee.initiatorType;fe&&zy(_e)&&(ee=ee.responseEnd,I+=fe*(ee<G?1:(G-le)/(ee-le)))}if(--p,r+=8*(A+I)/(C.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Nf=null,jf=null;function Kc(t){return t.nodeType===9?t:t.ownerDocument}function Py(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 Fy(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Of(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Lf=null;function f2(){var t=window.event;return t&&t.type==="popstate"?t===Lf?!1:(Lf=t,!0):(Lf=null,!1)}var Hy=typeof setTimeout=="function"?setTimeout:void 0,p2=typeof clearTimeout=="function"?clearTimeout:void 0,Uy=typeof Promise=="function"?Promise:void 0,m2=typeof queueMicrotask=="function"?queueMicrotask:typeof Uy<"u"?function(t){return Uy.resolve(null).then(t).catch(g2)}:Hy;function g2(t){setTimeout(function(){throw t})}function Ai(t){return t==="head"}function $y(t,r){var a=r,p=0;do{var C=a.nextSibling;if(t.removeChild(a),C&&C.nodeType===8)if(a=C.data,a==="/$"||a==="/&"){if(p===0){t.removeChild(C),fa(r);return}p--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")p++;else if(a==="html")Vo(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Vo(a);for(var A=a.firstChild;A;){var I=A.nextSibling,G=A.nodeName;A[Ji]||G==="SCRIPT"||G==="STYLE"||G==="LINK"&&A.rel.toLowerCase()==="stylesheet"||a.removeChild(A),A=I}}else a==="body"&&Vo(t.ownerDocument.body);a=C}while(a);fa(r)}function qy(t,r){var a=t;t=0;do{var p=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),p&&p.nodeType===8)if(a=p.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=p}while(a)}function If(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":If(a),oo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function v2(t,r,a,p){for(;t.nodeType===1;){var C=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!p&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(p){if(!t[Ji])switch(r){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!==C.rel||t.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||t.getAttribute("title")!==(C.title==null?null:C.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(A=t.getAttribute("src"),(A!==(C.src==null?null:C.src)||t.getAttribute("type")!==(C.type==null?null:C.type)||t.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&A&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var A=C.name==null?null:""+C.name;if(C.type==="hidden"&&t.getAttribute("name")===A)return t}else return t;if(t=Wn(t.nextSibling),t===null)break}return null}function _2(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Wn(t.nextSibling),t===null))return null;return t}function Vy(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Wn(t.nextSibling),t===null))return null;return t}function Bf(t){return t.data==="$?"||t.data==="$~"}function zf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function y2(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var p=function(){r(),a.removeEventListener("DOMContentLoaded",p)};a.addEventListener("DOMContentLoaded",p),t._reactRetry=p}}function Wn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var Pf=null;function Gy(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Wn(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function Wy(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function Ky(t,r,a){switch(r=Kc(a),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Vo(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);oo(t)}var Kn=new Map,Yy=new Set;function Yc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Vr=Z.d;Z.d={f:b2,r:x2,D:S2,C:w2,L:C2,m:k2,X:A2,S:E2,M:T2};function b2(){var t=Vr.f(),r=Fc();return t||r}function x2(t){var r=ai(t);r!==null&&r.tag===5&&r.type==="form"?h_(r):Vr.r(t)}var ua=typeof document>"u"?null:document;function Xy(t,r,a){var p=ua;if(p&&typeof r=="string"&&r){var C=me(r);C='link[rel="'+t+'"][href="'+C+'"]',typeof a=="string"&&(C+='[crossorigin="'+a+'"]'),Yy.has(C)||(Yy.add(C),t={rel:t,crossOrigin:a,href:r},p.querySelector(C)===null&&(r=p.createElement("link"),Qt(r,"link",t),Nt(r),p.head.appendChild(r)))}}function S2(t){Vr.D(t),Xy("dns-prefetch",t,null)}function w2(t,r){Vr.C(t,r),Xy("preconnect",t,r)}function C2(t,r,a){Vr.L(t,r,a);var p=ua;if(p&&t&&r){var C='link[rel="preload"][as="'+me(r)+'"]';r==="image"&&a&&a.imageSrcSet?(C+='[imagesrcset="'+me(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(C+='[imagesizes="'+me(a.imageSizes)+'"]')):C+='[href="'+me(t)+'"]';var A=C;switch(r){case"style":A=da(t);break;case"script":A=ha(t)}Kn.has(A)||(t=f({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Kn.set(A,t),p.querySelector(C)!==null||r==="style"&&p.querySelector(Go(A))||r==="script"&&p.querySelector(Wo(A))||(r=p.createElement("link"),Qt(r,"link",t),Nt(r),p.head.appendChild(r)))}}function k2(t,r){Vr.m(t,r);var a=ua;if(a&&t){var p=r&&typeof r.as=="string"?r.as:"script",C='link[rel="modulepreload"][as="'+me(p)+'"][href="'+me(t)+'"]',A=C;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=ha(t)}if(!Kn.has(A)&&(t=f({rel:"modulepreload",href:t},r),Kn.set(A,t),a.querySelector(C)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Wo(A)))return}p=a.createElement("link"),Qt(p,"link",t),Nt(p),a.head.appendChild(p)}}}function E2(t,r,a){Vr.S(t,r,a);var p=ua;if(p&&t){var C=li(p).hoistableStyles,A=da(t);r=r||"default";var I=C.get(A);if(!I){var G={loading:0,preload:null};if(I=p.querySelector(Go(A)))G.loading=5;else{t=f({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Kn.get(A))&&Ff(t,a);var ee=I=p.createElement("link");Nt(ee),Qt(ee,"link",t),ee._p=new Promise(function(le,fe){ee.onload=le,ee.onerror=fe}),ee.addEventListener("load",function(){G.loading|=1}),ee.addEventListener("error",function(){G.loading|=2}),G.loading|=4,Xc(I,r,p)}I={type:"stylesheet",instance:I,count:1,state:G},C.set(A,I)}}}function A2(t,r){Vr.X(t,r);var a=ua;if(a&&t){var p=li(a).hoistableScripts,C=ha(t),A=p.get(C);A||(A=a.querySelector(Wo(C)),A||(t=f({src:t,async:!0},r),(r=Kn.get(C))&&Hf(t,r),A=a.createElement("script"),Nt(A),Qt(A,"link",t),a.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(C,A))}}function T2(t,r){Vr.M(t,r);var a=ua;if(a&&t){var p=li(a).hoistableScripts,C=ha(t),A=p.get(C);A||(A=a.querySelector(Wo(C)),A||(t=f({src:t,async:!0,type:"module"},r),(r=Kn.get(C))&&Hf(t,r),A=a.createElement("script"),Nt(A),Qt(A,"link",t),a.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(C,A))}}function Zy(t,r,a,p){var C=(C=te.current)?Yc(C):null;if(!C)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=da(a.href),a=li(C).hoistableStyles,p=a.get(r),p||(p={type:"style",instance:null,count:0,state:null},a.set(r,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=da(a.href);var A=li(C).hoistableStyles,I=A.get(t);if(I||(C=C.ownerDocument||C,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(t,I),(A=C.querySelector(Go(t)))&&!A._p&&(I.instance=A,I.state.loading=5),Kn.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Kn.set(t,a),A||R2(C,t,a,I.state))),r&&p===null)throw Error(s(528,""));return I}if(r&&p!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=ha(a),a=li(C).hoistableScripts,p=a.get(r),p||(p={type:"script",instance:null,count:0,state:null},a.set(r,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function da(t){return'href="'+me(t)+'"'}function Go(t){return'link[rel="stylesheet"]['+t+"]"}function Qy(t){return f({},t,{"data-precedence":t.precedence,precedence:null})}function R2(t,r,a,p){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?p.loading=1:(r=t.createElement("link"),p.preload=r,r.addEventListener("load",function(){return p.loading|=1}),r.addEventListener("error",function(){return p.loading|=2}),Qt(r,"link",a),Nt(r),t.head.appendChild(r))}function ha(t){return'[src="'+me(t)+'"]'}function Wo(t){return"script[async]"+t}function Jy(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var p=t.querySelector('style[data-href~="'+me(a.href)+'"]');if(p)return r.instance=p,Nt(p),p;var C=f({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return p=(t.ownerDocument||t).createElement("style"),Nt(p),Qt(p,"style",C),Xc(p,a.precedence,t),r.instance=p;case"stylesheet":C=da(a.href);var A=t.querySelector(Go(C));if(A)return r.state.loading|=4,r.instance=A,Nt(A),A;p=Qy(a),(C=Kn.get(C))&&Ff(p,C),A=(t.ownerDocument||t).createElement("link"),Nt(A);var I=A;return I._p=new Promise(function(G,ee){I.onload=G,I.onerror=ee}),Qt(A,"link",p),r.state.loading|=4,Xc(A,a.precedence,t),r.instance=A;case"script":return A=ha(a.src),(C=t.querySelector(Wo(A)))?(r.instance=C,Nt(C),C):(p=a,(C=Kn.get(A))&&(p=f({},a),Hf(p,C)),t=t.ownerDocument||t,C=t.createElement("script"),Nt(C),Qt(C,"link",p),t.head.appendChild(C),r.instance=C);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(p=r.instance,r.state.loading|=4,Xc(p,a.precedence,t));return r.instance}function Xc(t,r,a){for(var p=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=p.length?p[p.length-1]:null,A=C,I=0;I<p.length;I++){var G=p[I];if(G.dataset.precedence===r)A=G;else if(A!==C)break}A?A.parentNode.insertBefore(t,A.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function Ff(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Hf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Zc=null;function eb(t,r,a){if(Zc===null){var p=new Map,C=Zc=new Map;C.set(a,p)}else C=Zc,p=C.get(a),p||(p=new Map,C.set(a,p));if(p.has(t))return p;for(p.set(t,null),a=a.getElementsByTagName(t),C=0;C<a.length;C++){var A=a[C];if(!(A[Ji]||A[Ct]||t==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var I=A.getAttribute(r)||"";I=t+I;var G=p.get(I);G?G.push(A):p.set(I,[A])}}return p}function tb(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function D2(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function nb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function M2(t,r,a,p){if(a.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var C=da(p.href),A=r.querySelector(Go(C));if(A){r=A._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Qc.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=A,Nt(A);return}A=r.ownerDocument||r,p=Qy(p),(C=Kn.get(C))&&Ff(p,C),A=A.createElement("link"),Nt(A);var I=A;I._p=new Promise(function(G,ee){I.onload=G,I.onerror=ee}),Qt(A,"link",p),a.instance=A}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Qc.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Uf=0;function N2(t,r){return t.stylesheets&&t.count===0&&eu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var p=setTimeout(function(){if(t.stylesheets&&eu(t,t.stylesheets),t.unsuspend){var A=t.unsuspend;t.unsuspend=null,A()}},6e4+r);0<t.imgBytes&&Uf===0&&(Uf=62500*h2());var C=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&eu(t,t.stylesheets),t.unsuspend)){var A=t.unsuspend;t.unsuspend=null,A()}},(t.imgBytes>Uf?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(p),clearTimeout(C)}}:null}function Qc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)eu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Jc=null;function eu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Jc=new Map,r.forEach(j2,t),Jc=null,Qc.call(t))}function j2(t,r){if(!(r.state.loading&4)){var a=Jc.get(t);if(a)var p=a.get(null);else{a=new Map,Jc.set(t,a);for(var C=t.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<C.length;A++){var I=C[A];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(a.set(I.dataset.precedence,I),p=I)}p&&a.set(null,p)}C=r.instance,I=C.getAttribute("data-precedence"),A=a.get(I)||p,A===p&&a.set(null,C),a.set(I,C),this.count++,p=Qc.bind(this),C.addEventListener("load",p),C.addEventListener("error",p),A?A.parentNode.insertBefore(C,A.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(C,t.firstChild)),r.state.loading|=4}}var Ko={$$typeof:x,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function O2(t,r,a,p,C,A,I,G,ee){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=Fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fn(0),this.hiddenUpdates=Fn(null),this.identifierPrefix=p,this.onUncaughtError=C,this.onCaughtError=A,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function rb(t,r,a,p,C,A,I,G,ee,le,fe,_e){return t=new O2(t,r,a,I,ee,le,fe,_e,G),r=1,A===!0&&(r|=24),A=En(3,null,null,r),t.current=A,A.stateNode=t,r=bh(),r.refCount++,t.pooledCache=r,r.refCount++,A.memoizedState={element:p,isDehydrated:a,cache:r},Ch(A),t}function ib(t){return t?(t=$s,t):$s}function sb(t,r,a,p,C,A){C=ib(C),p.context===null?p.context=C:p.pendingContext=C,p=gi(r),p.payload={element:a},A=A===void 0?null:A,A!==null&&(p.callback=A),a=vi(t,p,r),a!==null&&(yn(a,t,r),Eo(a,t,r))}function ab(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function $f(t,r){ab(t,r),(t=t.alternate)&&ab(t,r)}function ob(t){if(t.tag===13||t.tag===31){var r=ss(t,67108864);r!==null&&yn(r,t,67108864),$f(t,67108864)}}function lb(t){if(t.tag===13||t.tag===31){var r=Mn();r=ro(r);var a=ss(t,r);a!==null&&yn(a,t,r),$f(t,r)}}var tu=!0;function L2(t,r,a,p){var C=V.T;V.T=null;var A=Z.p;try{Z.p=2,qf(t,r,a,p)}finally{Z.p=A,V.T=C}}function I2(t,r,a,p){var C=V.T;V.T=null;var A=Z.p;try{Z.p=8,qf(t,r,a,p)}finally{Z.p=A,V.T=C}}function qf(t,r,a,p){if(tu){var C=Vf(p);if(C===null)Df(t,r,p,nu,a),ub(t,p);else if(z2(C,t,r,a,p))p.stopPropagation();else if(ub(t,p),r&4&&-1<B2.indexOf(t)){for(;C!==null;){var A=ai(C);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var I=Pn(A.pendingLanes);if(I!==0){var G=A;for(G.pendingLanes|=2,G.entangledLanes|=2;I;){var ee=1<<31-it(I);G.entanglements[1]|=ee,I&=~ee}vr(A),(ot&6)===0&&(zc=gt()+500,Uo(0))}}break;case 31:case 13:G=ss(A,2),G!==null&&yn(G,A,2),Fc(),$f(A,2)}if(A=Vf(p),A===null&&Df(t,r,p,nu,a),A===C)break;C=A}C!==null&&p.stopPropagation()}else Df(t,r,p,null,a)}}function Vf(t){return t=Gd(t),Gf(t)}var nu=null;function Gf(t){if(nu=null,t=si(t),t!==null){var r=h(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=d(r),t!==null)return t;t=null}else if(a===31){if(t=o(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return nu=t,null}function cb(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(Mt()){case he:return 2;case xe:return 8;case Oe:case Pe:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Wf=!1,Ti=null,Ri=null,Di=null,Yo=new Map,Xo=new Map,Mi=[],B2="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 ub(t,r){switch(t){case"focusin":case"focusout":Ti=null;break;case"dragenter":case"dragleave":Ri=null;break;case"mouseover":case"mouseout":Di=null;break;case"pointerover":case"pointerout":Yo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xo.delete(r.pointerId)}}function Zo(t,r,a,p,C,A){return t===null||t.nativeEvent!==A?(t={blockedOn:r,domEventName:a,eventSystemFlags:p,nativeEvent:A,targetContainers:[C]},r!==null&&(r=ai(r),r!==null&&ob(r)),t):(t.eventSystemFlags|=p,r=t.targetContainers,C!==null&&r.indexOf(C)===-1&&r.push(C),t)}function z2(t,r,a,p,C){switch(r){case"focusin":return Ti=Zo(Ti,t,r,a,p,C),!0;case"dragenter":return Ri=Zo(Ri,t,r,a,p,C),!0;case"mouseover":return Di=Zo(Di,t,r,a,p,C),!0;case"pointerover":var A=C.pointerId;return Yo.set(A,Zo(Yo.get(A)||null,t,r,a,p,C)),!0;case"gotpointercapture":return A=C.pointerId,Xo.set(A,Zo(Xo.get(A)||null,t,r,a,p,C)),!0}return!1}function db(t){var r=si(t.target);if(r!==null){var a=h(r);if(a!==null){if(r=a.tag,r===13){if(r=d(a),r!==null){t.blockedOn=r,Ve(t.priority,function(){lb(a)});return}}else if(r===31){if(r=o(a),r!==null){t.blockedOn=r,Ve(t.priority,function(){lb(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ru(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Vf(t.nativeEvent);if(a===null){a=t.nativeEvent;var p=new a.constructor(a.type,a);Vd=p,a.target.dispatchEvent(p),Vd=null}else return r=ai(a),r!==null&&ob(r),t.blockedOn=a,!1;r.shift()}return!0}function hb(t,r,a){ru(t)&&a.delete(r)}function P2(){Wf=!1,Ti!==null&&ru(Ti)&&(Ti=null),Ri!==null&&ru(Ri)&&(Ri=null),Di!==null&&ru(Di)&&(Di=null),Yo.forEach(hb),Xo.forEach(hb)}function iu(t,r){t.blockedOn===r&&(t.blockedOn=null,Wf||(Wf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,P2)))}var su=null;function fb(t){su!==t&&(su=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){su===t&&(su=null);for(var r=0;r<t.length;r+=3){var a=t[r],p=t[r+1],C=t[r+2];if(typeof p!="function"){if(Gf(p||a)===null)continue;break}var A=ai(a);A!==null&&(t.splice(r,3),r-=3,qh(A,{pending:!0,data:C,method:a.method,action:p},p,C))}}))}function fa(t){function r(ee){return iu(ee,t)}Ti!==null&&iu(Ti,t),Ri!==null&&iu(Ri,t),Di!==null&&iu(Di,t),Yo.forEach(r),Xo.forEach(r);for(var a=0;a<Mi.length;a++){var p=Mi[a];p.blockedOn===t&&(p.blockedOn=null)}for(;0<Mi.length&&(a=Mi[0],a.blockedOn===null);)db(a),a.blockedOn===null&&Mi.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(p=0;p<a.length;p+=3){var C=a[p],A=a[p+1],I=C[nn]||null;if(typeof A=="function")I||fb(a);else if(I){var G=null;if(A&&A.hasAttribute("formAction")){if(C=A,I=A[nn]||null)G=I.formAction;else if(Gf(C)!==null)continue}else G=I.action;typeof G=="function"?a[p+1]=G:(a.splice(p,3),p-=3),fb(a)}}}function pb(){function t(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(I){return C=I})},focusReset:"manual",scroll:"manual"})}function r(){C!==null&&(C(),C=null),p||setTimeout(a,20)}function a(){if(!p&&!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 p=!1,C=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){p=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),C!==null&&(C(),C=null)}}}function Kf(t){this._internalRoot=t}au.prototype.render=Kf.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,p=Mn();sb(a,p,t,r,null,null)},au.prototype.unmount=Kf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;sb(t.current,2,null,t,null,null),Fc(),r[ii]=null}};function au(t){this._internalRoot=t}au.prototype.unstable_scheduleHydration=function(t){if(t){var r=so();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Mi.length&&r!==0&&r<Mi[a].priority;a++);Mi.splice(a,0,t),a===0&&db(t)}};var mb=n.version;if(mb!=="19.2.4")throw Error(s(527,mb,"19.2.4"));Z.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=u(r),t=t!==null?m(t):null,t=t===null?null:t.stateNode,t};var F2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ou.isDisabled&&ou.supportsFiber)try{zt=ou.inject(F2),Tt=ou}catch{}}return Jo.createRoot=function(t,r){if(!l(t))throw Error(s(299));var a=!1,p="",C=S_,A=w_,I=C_;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(p=r.identifierPrefix),r.onUncaughtError!==void 0&&(C=r.onUncaughtError),r.onCaughtError!==void 0&&(A=r.onCaughtError),r.onRecoverableError!==void 0&&(I=r.onRecoverableError)),r=rb(t,1,!1,null,null,a,p,null,C,A,I,pb),t[ii]=r.current,Rf(t),new Kf(r)},Jo.hydrateRoot=function(t,r,a){if(!l(t))throw Error(s(299));var p=!1,C="",A=S_,I=w_,G=C_,ee=null;return a!=null&&(a.unstable_strictMode===!0&&(p=!0),a.identifierPrefix!==void 0&&(C=a.identifierPrefix),a.onUncaughtError!==void 0&&(A=a.onUncaughtError),a.onCaughtError!==void 0&&(I=a.onCaughtError),a.onRecoverableError!==void 0&&(G=a.onRecoverableError),a.formState!==void 0&&(ee=a.formState)),r=rb(t,1,!0,r,a!=null?a:null,p,C,ee,A,I,G,pb),r.context=ib(null),a=r.current,p=Mn(),p=ro(p),C=gi(p),C.callback=null,vi(a,C,p),a=p,r.current.lanes=a,Qi(r,a),vr(r),t[ii]=r.current,Rf(t),new au(r)},Jo.version="19.2.4",Jo}var kb;function X2(){if(kb)return Zf.exports;kb=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(n){console.error(n)}}return e(),Zf.exports=Y2(),Zf.exports}var Z2=X2();const Q2={theme:"system",setTheme:()=>null,resolvedTheme:"dark"},Rx=T.createContext(Q2);function J2({children:e,defaultTheme:n="system",storageKey:i="jean2-theme",...s}){const[l,h]=T.useState(()=>localStorage.getItem(i)||n),[d,o]=T.useState("dark");T.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),l==="system"){const m=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(m),o(m);return}u.classList.add(l),o(l)},[l]);const c={theme:l,setTheme:u=>{localStorage.setItem(i,u),h(u)},resolvedTheme:d};return g.jsx(Rx.Provider,{...s,value:c,children:e})}const eA=()=>{const e=T.useContext(Rx);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function tA(e,n={},i){return window.__TAURI_INTERNALS__.invoke(e,n,i)}/**
50
- * @license lucide-react v0.577.0 - ISC
51
- *
52
- * This source code is licensed under the ISC license.
53
- * See the LICENSE file in the root directory of this source tree.
54
- */const Dx=(...e)=>e.filter((n,i,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===i).join(" ").trim();/**
55
- * @license lucide-react v0.577.0 - ISC
56
- *
57
- * This source code is licensed under the ISC license.
58
- * See the LICENSE file in the root directory of this source tree.
59
- */const nA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
60
- * @license lucide-react v0.577.0 - ISC
61
- *
62
- * This source code is licensed under the ISC license.
63
- * See the LICENSE file in the root directory of this source tree.
64
- */const rA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,s)=>s?s.toUpperCase():i.toLowerCase());/**
65
- * @license lucide-react v0.577.0 - ISC
66
- *
67
- * This source code is licensed under the ISC license.
68
- * See the LICENSE file in the root directory of this source tree.
69
- */const Eb=e=>{const n=rA(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
70
- * @license lucide-react v0.577.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */var iA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
75
- * @license lucide-react v0.577.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */const sA=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};/**
80
- * @license lucide-react v0.577.0 - ISC
81
- *
82
- * This source code is licensed under the ISC license.
83
- * See the LICENSE file in the root directory of this source tree.
84
- */const aA=T.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:l="",children:h,iconNode:d,...o},c)=>T.createElement("svg",{ref:c,...iA,width:n,height:n,stroke:e,strokeWidth:s?Number(i)*24/Number(n):i,className:Dx("lucide",l),...!h&&!sA(o)&&{"aria-hidden":"true"},...o},[...d.map(([u,m])=>T.createElement(u,m)),...Array.isArray(h)?h:[h]]));/**
85
- * @license lucide-react v0.577.0 - ISC
86
- *
87
- * This source code is licensed under the ISC license.
88
- * See the LICENSE file in the root directory of this source tree.
89
- */const Ne=(e,n)=>{const i=T.forwardRef(({className:s,...l},h)=>T.createElement(aA,{ref:h,iconNode:n,className:Dx(`lucide-${nA(Eb(e))}`,`lucide-${e}`,s),...l}));return i.displayName=Eb(e),i};/**
90
- * @license lucide-react v0.577.0 - ISC
91
- *
92
- * This source code is licensed under the ISC license.
93
- * See the LICENSE file in the root directory of this source tree.
94
- */const oA=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],lA=Ne("archive",oA);/**
95
- * @license lucide-react v0.577.0 - ISC
96
- *
97
- * This source code is licensed under the ISC license.
98
- * See the LICENSE file in the root directory of this source tree.
99
- */const cA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],uA=Ne("arrow-left",cA);/**
100
- * @license lucide-react v0.577.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */const dA=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],hA=Ne("bot",dA);/**
105
- * @license lucide-react v0.577.0 - ISC
106
- *
107
- * This source code is licensed under the ISC license.
108
- * See the LICENSE file in the root directory of this source tree.
109
- */const fA=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],qp=Ne("box",fA);/**
110
- * @license lucide-react v0.577.0 - ISC
111
- *
112
- * This source code is licensed under the ISC license.
113
- * See the LICENSE file in the root directory of this source tree.
114
- */const pA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Xr=Ne("check",pA);/**
115
- * @license lucide-react v0.577.0 - ISC
116
- *
117
- * This source code is licensed under the ISC license.
118
- * See the LICENSE file in the root directory of this source tree.
119
- */const mA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Fa=Ne("chevron-down",mA);/**
120
- * @license lucide-react v0.577.0 - ISC
121
- *
122
- * This source code is licensed under the ISC license.
123
- * See the LICENSE file in the root directory of this source tree.
124
- */const gA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vA=Ne("chevron-left",gA);/**
125
- * @license lucide-react v0.577.0 - ISC
126
- *
127
- * This source code is licensed under the ISC license.
128
- * See the LICENSE file in the root directory of this source tree.
129
- */const _A=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zr=Ne("chevron-right",_A);/**
130
- * @license lucide-react v0.577.0 - ISC
131
- *
132
- * This source code is licensed under the ISC license.
133
- * See the LICENSE file in the root directory of this source tree.
134
- */const yA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bA=Ne("chevron-up",yA);/**
135
- * @license lucide-react v0.577.0 - ISC
136
- *
137
- * This source code is licensed under the ISC license.
138
- * See the LICENSE file in the root directory of this source tree.
139
- */const xA=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Mx=Ne("chevrons-up-down",xA);/**
140
- * @license lucide-react v0.577.0 - ISC
141
- *
142
- * This source code is licensed under the ISC license.
143
- * See the LICENSE file in the root directory of this source tree.
144
- */const SA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],cl=Ne("circle-alert",SA);/**
145
- * @license lucide-react v0.577.0 - ISC
146
- *
147
- * This source code is licensed under the ISC license.
148
- * See the LICENSE file in the root directory of this source tree.
149
- */const wA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],kl=Ne("circle-check-big",wA);/**
150
- * @license lucide-react v0.577.0 - ISC
151
- *
152
- * This source code is licensed under the ISC license.
153
- * See the LICENSE file in the root directory of this source tree.
154
- */const CA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Yu=Ne("circle-x",CA);/**
155
- * @license lucide-react v0.577.0 - ISC
156
- *
157
- * This source code is licensed under the ISC license.
158
- * See the LICENSE file in the root directory of this source tree.
159
- */const kA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],EA=Ne("circle",kA);/**
160
- * @license lucide-react v0.577.0 - ISC
161
- *
162
- * This source code is licensed under the ISC license.
163
- * See the LICENSE file in the root directory of this source tree.
164
- */const AA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Nx=Ne("clock",AA);/**
165
- * @license lucide-react v0.577.0 - ISC
166
- *
167
- * This source code is licensed under the ISC license.
168
- * See the LICENSE file in the root directory of this source tree.
169
- */const TA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Tu=Ne("copy",TA);/**
170
- * @license lucide-react v0.577.0 - ISC
171
- *
172
- * This source code is licensed under the ISC license.
173
- * See the LICENSE file in the root directory of this source tree.
174
- */const RA=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],DA=Ne("cpu",RA);/**
175
- * @license lucide-react v0.577.0 - ISC
176
- *
177
- * This source code is licensed under the ISC license.
178
- * See the LICENSE file in the root directory of this source tree.
179
- */const MA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],NA=Ne("ellipsis",MA);/**
180
- * @license lucide-react v0.577.0 - ISC
181
- *
182
- * This source code is licensed under the ISC license.
183
- * See the LICENSE file in the root directory of this source tree.
184
- */const jA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Vp=Ne("external-link",jA);/**
185
- * @license lucide-react v0.577.0 - ISC
186
- *
187
- * This source code is licensed under the ISC license.
188
- * See the LICENSE file in the root directory of this source tree.
189
- */const OA=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],LA=Ne("eye-off",OA);/**
190
- * @license lucide-react v0.577.0 - ISC
191
- *
192
- * This source code is licensed under the ISC license.
193
- * See the LICENSE file in the root directory of this source tree.
194
- */const IA=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],BA=Ne("eye",IA);/**
195
- * @license lucide-react v0.577.0 - ISC
196
- *
197
- * This source code is licensed under the ISC license.
198
- * See the LICENSE file in the root directory of this source tree.
199
- */const zA=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],PA=Ne("file-pen",zA);/**
200
- * @license lucide-react v0.577.0 - ISC
201
- *
202
- * This source code is licensed under the ISC license.
203
- * See the LICENSE file in the root directory of this source tree.
204
- */const FA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Cm=Ne("file-text",FA);/**
205
- * @license lucide-react v0.577.0 - ISC
206
- *
207
- * This source code is licensed under the ISC license.
208
- * See the LICENSE file in the root directory of this source tree.
209
- */const HA=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],_r=Ne("file",HA);/**
210
- * @license lucide-react v0.577.0 - ISC
211
- *
212
- * This source code is licensed under the ISC license.
213
- * See the LICENSE file in the root directory of this source tree.
214
- */const UA=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Gp=Ne("folder-open",UA);/**
215
- * @license lucide-react v0.577.0 - ISC
216
- *
217
- * This source code is licensed under the ISC license.
218
- * See the LICENSE file in the root directory of this source tree.
219
- */const $A=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],zi=Ne("folder",$A);/**
220
- * @license lucide-react v0.577.0 - ISC
221
- *
222
- * This source code is licensed under the ISC license.
223
- * See the LICENSE file in the root directory of this source tree.
224
- */const qA=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],VA=Ne("git-branch",qA);/**
225
- * @license lucide-react v0.577.0 - ISC
226
- *
227
- * This source code is licensed under the ISC license.
228
- * See the LICENSE file in the root directory of this source tree.
229
- */const GA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ab=Ne("info",GA);/**
230
- * @license lucide-react v0.577.0 - ISC
231
- *
232
- * This source code is licensed under the ISC license.
233
- * See the LICENSE file in the root directory of this source tree.
234
- */const WA=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],KA=Ne("layout-grid",WA);/**
235
- * @license lucide-react v0.577.0 - ISC
236
- *
237
- * This source code is licensed under the ISC license.
238
- * See the LICENSE file in the root directory of this source tree.
239
- */const YA=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],XA=Ne("layout-list",YA);/**
240
- * @license lucide-react v0.577.0 - ISC
241
- *
242
- * This source code is licensed under the ISC license.
243
- * See the LICENSE file in the root directory of this source tree.
244
- */const ZA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Zn=Ne("loader-circle",ZA);/**
245
- * @license lucide-react v0.577.0 - ISC
246
- *
247
- * This source code is licensed under the ISC license.
248
- * See the LICENSE file in the root directory of this source tree.
249
- */const QA=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],JA=Ne("lock",QA);/**
250
- * @license lucide-react v0.577.0 - ISC
251
- *
252
- * This source code is licensed under the ISC license.
253
- * See the LICENSE file in the root directory of this source tree.
254
- */const eT=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],tT=Ne("message-square",eT);/**
255
- * @license lucide-react v0.577.0 - ISC
256
- *
257
- * This source code is licensed under the ISC license.
258
- * See the LICENSE file in the root directory of this source tree.
259
- */const nT=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],rT=Ne("minimize-2",nT);/**
260
- * @license lucide-react v0.577.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */const iT=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],sT=Ne("monitor",iT);/**
265
- * @license lucide-react v0.577.0 - ISC
266
- *
267
- * This source code is licensed under the ISC license.
268
- * See the LICENSE file in the root directory of this source tree.
269
- */const aT=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],oT=Ne("moon",aT);/**
270
- * @license lucide-react v0.577.0 - ISC
271
- *
272
- * This source code is licensed under the ISC license.
273
- * See the LICENSE file in the root directory of this source tree.
274
- */const lT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],cT=Ne("panel-left",lT);/**
275
- * @license lucide-react v0.577.0 - ISC
276
- *
277
- * This source code is licensed under the ISC license.
278
- * See the LICENSE file in the root directory of this source tree.
279
- */const uT=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],dT=Ne("plug-zap",uT);/**
280
- * @license lucide-react v0.577.0 - ISC
281
- *
282
- * This source code is licensed under the ISC license.
283
- * See the LICENSE file in the root directory of this source tree.
284
- */const hT=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],fT=Ne("plug",hT);/**
285
- * @license lucide-react v0.577.0 - ISC
286
- *
287
- * This source code is licensed under the ISC license.
288
- * See the LICENSE file in the root directory of this source tree.
289
- */const pT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ha=Ne("plus",pT);/**
290
- * @license lucide-react v0.577.0 - ISC
291
- *
292
- * This source code is licensed under the ISC license.
293
- * See the LICENSE file in the root directory of this source tree.
294
- */const mT=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],wa=Ne("refresh-cw",mT);/**
295
- * @license lucide-react v0.577.0 - ISC
296
- *
297
- * This source code is licensed under the ISC license.
298
- * See the LICENSE file in the root directory of this source tree.
299
- */const gT=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],vT=Ne("rotate-ccw",gT);/**
300
- * @license lucide-react v0.577.0 - ISC
301
- *
302
- * This source code is licensed under the ISC license.
303
- * See the LICENSE file in the root directory of this source tree.
304
- */const _T=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],km=Ne("search",_T);/**
305
- * @license lucide-react v0.577.0 - ISC
306
- *
307
- * This source code is licensed under the ISC license.
308
- * See the LICENSE file in the root directory of this source tree.
309
- */const yT=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],bT=Ne("send",yT);/**
310
- * @license lucide-react v0.577.0 - ISC
311
- *
312
- * This source code is licensed under the ISC license.
313
- * See the LICENSE file in the root directory of this source tree.
314
- */const xT=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ss=Ne("server",xT);/**
315
- * @license lucide-react v0.577.0 - ISC
316
- *
317
- * This source code is licensed under the ISC license.
318
- * See the LICENSE file in the root directory of this source tree.
319
- */const ST=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],jx=Ne("settings",ST);/**
320
- * @license lucide-react v0.577.0 - ISC
321
- *
322
- * This source code is licensed under the ISC license.
323
- * See the LICENSE file in the root directory of this source tree.
324
- */const wT=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Ox=Ne("shield",wT);/**
325
- * @license lucide-react v0.577.0 - ISC
326
- *
327
- * This source code is licensed under the ISC license.
328
- * See the LICENSE file in the root directory of this source tree.
329
- */const CT=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Tb=Ne("square-terminal",CT);/**
330
- * @license lucide-react v0.577.0 - ISC
331
- *
332
- * This source code is licensed under the ISC license.
333
- * See the LICENSE file in the root directory of this source tree.
334
- */const kT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Lx=Ne("square",kT);/**
335
- * @license lucide-react v0.577.0 - ISC
336
- *
337
- * This source code is licensed under the ISC license.
338
- * See the LICENSE file in the root directory of this source tree.
339
- */const ET=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Rb=Ne("star",ET);/**
340
- * @license lucide-react v0.577.0 - ISC
341
- *
342
- * This source code is licensed under the ISC license.
343
- * See the LICENSE file in the root directory of this source tree.
344
- */const AT=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],TT=Ne("sun",AT);/**
345
- * @license lucide-react v0.577.0 - ISC
346
- *
347
- * This source code is licensed under the ISC license.
348
- * See the LICENSE file in the root directory of this source tree.
349
- */const RT=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Db=Ne("terminal",RT);/**
350
- * @license lucide-react v0.577.0 - ISC
351
- *
352
- * This source code is licensed under the ISC license.
353
- * See the LICENSE file in the root directory of this source tree.
354
- */const DT=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],El=Ne("trash-2",DT);/**
355
- * @license lucide-react v0.577.0 - ISC
356
- *
357
- * This source code is licensed under the ISC license.
358
- * See the LICENSE file in the root directory of this source tree.
359
- */const MT=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Mb=Ne("triangle-alert",MT);/**
360
- * @license lucide-react v0.577.0 - ISC
361
- *
362
- * This source code is licensed under the ISC license.
363
- * See the LICENSE file in the root directory of this source tree.
364
- */const NT=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],jT=Ne("undo-2",NT);/**
365
- * @license lucide-react v0.577.0 - ISC
366
- *
367
- * This source code is licensed under the ISC license.
368
- * See the LICENSE file in the root directory of this source tree.
369
- */const OT=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],LT=Ne("user",OT);/**
370
- * @license lucide-react v0.577.0 - ISC
371
- *
372
- * This source code is licensed under the ISC license.
373
- * See the LICENSE file in the root directory of this source tree.
374
- */const IT=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ix=Ne("wifi-off",IT);/**
375
- * @license lucide-react v0.577.0 - ISC
376
- *
377
- * This source code is licensed under the ISC license.
378
- * See the LICENSE file in the root directory of this source tree.
379
- */const BT=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],zT=Ne("wifi",BT);/**
380
- * @license lucide-react v0.577.0 - ISC
381
- *
382
- * This source code is licensed under the ISC license.
383
- * See the LICENSE file in the root directory of this source tree.
384
- */const PT=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],FT=Ne("wrench",PT);/**
385
- * @license lucide-react v0.577.0 - ISC
386
- *
387
- * This source code is licensed under the ISC license.
388
- * See the LICENSE file in the root directory of this source tree.
389
- */const HT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Yr=Ne("x",HT);/**
390
- * @license lucide-react v0.577.0 - ISC
391
- *
392
- * This source code is licensed under the ISC license.
393
- * See the LICENSE file in the root directory of this source tree.
394
- */const UT=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],tp=Ne("zap",UT),Qn={SERVERS:"jean2_servers",ACTIVE_SERVER_ID:"jean2_active_server_id",QUICK_CONNECTIONS:"jean2_quick_connections"};function Wr(){try{const e=localStorage.getItem(Qn.SERVERS);return e?JSON.parse(e):[]}catch(e){return console.error("Error reading saved servers from localStorage:",e),[]}}function $T(e){return Wr().find(i=>i.id===e)||null}function qT(e){try{const n=Wr();n.push(e),localStorage.setItem(Qn.SERVERS,JSON.stringify(n))}catch(n){console.error("Error saving server to localStorage:",n)}}function VT(e,n){try{const i=Wr(),s=i.findIndex(l=>l.id===e);if(s===-1){console.error("Server not found:",e);return}i[s]={...i[s],...n},localStorage.setItem(Qn.SERVERS,JSON.stringify(i))}catch(i){console.error("Error updating server in localStorage:",i)}}function GT(e){try{const i=Wr().filter(d=>d.id!==e);localStorage.setItem(Qn.SERVERS,JSON.stringify(i));const l=Kr().filter(d=>d.serverId!==e);localStorage.setItem(Qn.QUICK_CONNECTIONS,JSON.stringify(l)),Bx()===e&&localStorage.removeItem(Qn.ACTIVE_SERVER_ID)}catch(n){console.error("Error deleting server from localStorage:",n)}}function Bx(){try{return localStorage.getItem(Qn.ACTIVE_SERVER_ID)}catch(e){return console.error("Error reading active server ID from localStorage:",e),null}}function np(e){try{localStorage.setItem(Qn.ACTIVE_SERVER_ID,e)}catch(n){console.error("Error setting active server ID in localStorage:",n)}}function Nb(){const e=Bx();return e?$T(e):null}function Kr(){try{const e=localStorage.getItem(Qn.QUICK_CONNECTIONS);return e?JSON.parse(e):[]}catch(e){return console.error("Error reading quick connections from localStorage:",e),[]}}function WT(e){const n=Kr(),i=n.reduce((l,h)=>Math.max(l,h.order),-1),s={...e,id:crypto.randomUUID(),order:i+1};n.push(s);try{localStorage.setItem(Qn.QUICK_CONNECTIONS,JSON.stringify(n))}catch(l){console.error("Error saving quick connection to localStorage:",l)}return s}function KT(e){try{const i=Kr().filter(s=>s.id!==e);localStorage.setItem(Qn.QUICK_CONNECTIONS,JSON.stringify(i))}catch(n){console.error("Error removing quick connection from localStorage:",n)}}function YT(e){try{const n=Kr(),i=new Map(n.map(s=>[s.id,s]));e.forEach((s,l)=>{const h=i.get(s);h&&(h.order=l)}),localStorage.setItem(Qn.QUICK_CONNECTIONS,JSON.stringify(n))}catch(n){console.error("Error reordering quick connections in localStorage:",n)}}function zx(e){return/^[a-f0-9]{64}$/.test(e)}function XT(e){return e.length<12?e:`${e.slice(0,4)}...${e.slice(-4)}`}function Ru(e){let n=e.trim();return n=n.replace(/^(https?:\/\/|wss?:\/\/)/i,""),n=n.replace(/\/+$/,""),n}const Px=T.createContext(null),ZT=({children:e})=>{const[n,i]=T.useState([]),[s,l]=T.useState(null),[h,d]=T.useState([]),[o,c]=T.useState(!1),u=T.useRef(null);T.useEffect(()=>{const x=Wr(),E=Nb(),M=Kr();i(x),l(E),d(M)},[]);const m=(x,E,M)=>{const R=Ru(E),j={id:crypto.randomUUID(),name:x,url:R,token:M,createdAt:new Date().toISOString()};return qT(j),i(Wr()),n.length===0&&(np(j.id),l(j)),j},f=(x,E)=>{const M={...E,...E.url&&{url:Ru(E.url)}};VT(x,M),i(Wr()),(s==null?void 0:s.id)===x&&l(Nb())},y=x=>{const E=(s==null?void 0:s.id)===x;if(GT(x),i(Wr()),E){const M=Wr(),R=M.length>0?M[0]:null;R?(np(R.id),l(R)):l(null)}d(Kr())},S=T.useCallback(x=>(u.current&&(clearTimeout(u.current),u.current=null),o&&(s==null?void 0:s.id)===x?!1:(o&&c(!1),c(!0),u.current=setTimeout(()=>{np(x);const E=n.find(M=>M.id===x)||null;l(E),c(!1)},100),!0)),[o,s,n]),k=T.useCallback(()=>{c(!1)},[]),v={servers:n,activeServer:s,quickConnections:h,isSwitching:o,addServer:m,editServer:f,removeServer:y,switchServer:S,clearSwitchingState:k,addToQuickConnections:(x,E,M,R)=>{WT({serverId:x,serverName:E,workspaceId:M,workspaceName:R}),d(Kr())},removeFromQuickConnections:x=>{KT(x),d(Kr())},reorderQuick:x=>{YT(x),d(Kr())}};return g.jsx(Px.Provider,{value:v,children:e})},Ua=()=>{const e=T.useContext(Px);if(e===null)throw new Error("useServerContext must be used within a ServerProvider");return e};function Fx(e){var n,i,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(i=Fx(e[n]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function Xu(){for(var e,n,i=0,s="",l=arguments.length;i<l;i++)(e=arguments[i])&&(n=Fx(e))&&(s&&(s+=" "),s+=n);return s}const jb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ob=Xu,$a=(e,n)=>i=>{var s;if((n==null?void 0:n.variants)==null)return Ob(e,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:l,defaultVariants:h}=n,d=Object.keys(l).map(u=>{const m=i==null?void 0:i[u],f=h==null?void 0:h[u];if(m===null)return null;const y=jb(m)||jb(f);return l[u][y]}),o=i&&Object.entries(i).reduce((u,m)=>{let[f,y]=m;return y===void 0||(u[f]=y),u},{}),c=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((u,m)=>{let{class:f,className:y,...S}=m;return Object.entries(S).every(k=>{let[w,_]=k;return Array.isArray(_)?_.includes({...h,...o}[w]):{...h,...o}[w]===_})?[...u,f,y]:u},[]);return Ob(e,d,c,i==null?void 0:i.class,i==null?void 0:i.className)};var Al=Tx();const QT=Ku(Al);function Lb(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Qr(...e){return n=>{let i=!1;const s=e.map(l=>{const h=Lb(l,n);return!i&&typeof h=="function"&&(i=!0),h});if(i)return()=>{for(let l=0;l<s.length;l++){const h=s[l];typeof h=="function"?h():Lb(e[l],null)}}}}function Ye(...e){return T.useCallback(Qr(...e),e)}function Fi(e){const n=JT(e),i=T.forwardRef((s,l)=>{const{children:h,...d}=s,o=T.Children.toArray(h),c=o.find(tR);if(c){const u=c.props.children,m=o.map(f=>f===c?T.Children.count(u)>1?T.Children.only(null):T.isValidElement(u)?u.props.children:null:f);return g.jsx(n,{...d,ref:l,children:T.isValidElement(u)?T.cloneElement(u,void 0,m):null})}return g.jsx(n,{...d,ref:l,children:h})});return i.displayName=`${e}.Slot`,i}var Tl=Fi("Slot");function JT(e){const n=T.forwardRef((i,s)=>{const{children:l,...h}=i;if(T.isValidElement(l)){const d=rR(l),o=nR(h,l.props);return l.type!==T.Fragment&&(o.ref=s?Qr(s,d):d),T.cloneElement(l,o)}return T.Children.count(l)>1?T.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Hx=Symbol("radix.slottable");function eR(e){const n=({children:i})=>g.jsx(g.Fragment,{children:i});return n.displayName=`${e}.Slottable`,n.__radixId=Hx,n}function tR(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hx}function nR(e,n){const i={...n};for(const s in n){const l=e[s],h=n[s];/^on[A-Z]/.test(s)?l&&h?i[s]=(...o)=>{const c=h(...o);return l(...o),c}:l&&(i[s]=l):s==="style"?i[s]={...l,...h}:s==="className"&&(i[s]=[l,h].filter(Boolean).join(" "))}return{...e,...i}}function rR(e){var s,l;let n=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var iR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],je=iR.reduce((e,n)=>{const i=Fi(`Primitive.${n}`),s=T.forwardRef((l,h)=>{const{asChild:d,...o}=l,c=d?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...o,ref:h})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{});function Ux(e,n){e&&Al.flushSync(()=>e.dispatchEvent(n))}var $x=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sR="VisuallyHidden",qx=T.forwardRef((e,n)=>g.jsx(je.span,{...e,ref:n,style:{...$x,...e.style}}));qx.displayName=sR;var aR=qx;function oR(e,n){const i=T.createContext(n),s=h=>{const{children:d,...o}=h,c=T.useMemo(()=>o,Object.values(o));return g.jsx(i.Provider,{value:c,children:d})};s.displayName=e+"Provider";function l(h){const d=T.useContext(i);if(d)return d;if(n!==void 0)return n;throw new Error(`\`${h}\` must be used within \`${e}\``)}return[s,l]}function Bn(e,n=[]){let i=[];function s(h,d){const o=T.createContext(d),c=i.length;i=[...i,d];const u=f=>{var b;const{scope:y,children:S,...k}=f,w=((b=y==null?void 0:y[e])==null?void 0:b[c])||o,_=T.useMemo(()=>k,Object.values(k));return g.jsx(w.Provider,{value:_,children:S})};u.displayName=h+"Provider";function m(f,y){var w;const S=((w=y==null?void 0:y[e])==null?void 0:w[c])||o,k=T.useContext(S);if(k)return k;if(d!==void 0)return d;throw new Error(`\`${f}\` must be used within \`${h}\``)}return[u,m]}const l=()=>{const h=i.map(d=>T.createContext(d));return function(o){const c=(o==null?void 0:o[e])||h;return T.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return l.scopeName=e,[s,lR(l,...n)]}function lR(...e){const n=e[0];if(e.length===1)return n;const i=()=>{const s=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(h){const d=s.reduce((o,{useScope:c,scopeName:u})=>{const f=c(h)[`__scope${u}`];return{...o,...f}},{});return T.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return i.scopeName=n.scopeName,i}function Em(e){const n=e+"CollectionProvider",[i,s]=Bn(n),[l,h]=i(n,{collectionRef:{current:null},itemMap:new Map}),d=w=>{const{scope:_,children:b}=w,v=Yn.useRef(null),x=Yn.useRef(new Map).current;return g.jsx(l,{scope:_,itemMap:x,collectionRef:v,children:b})};d.displayName=n;const o=e+"CollectionSlot",c=Fi(o),u=Yn.forwardRef((w,_)=>{const{scope:b,children:v}=w,x=h(o,b),E=Ye(_,x.collectionRef);return g.jsx(c,{ref:E,children:v})});u.displayName=o;const m=e+"CollectionItemSlot",f="data-radix-collection-item",y=Fi(m),S=Yn.forwardRef((w,_)=>{const{scope:b,children:v,...x}=w,E=Yn.useRef(null),M=Ye(_,E),R=h(m,b);return Yn.useEffect(()=>(R.itemMap.set(E,{ref:E,...x}),()=>void R.itemMap.delete(E))),g.jsx(y,{[f]:"",ref:M,children:v})});S.displayName=m;function k(w){const _=h(e+"CollectionConsumer",w);return Yn.useCallback(()=>{const v=_.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(_.itemMap.values()).sort((R,j)=>x.indexOf(R.ref.current)-x.indexOf(j.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:d,Slot:u,ItemSlot:S},k,s]}function Ce(e,n,{checkForDefaultPrevented:i=!0}={}){return function(l){if(e==null||e(l),i===!1||!l.defaultPrevented)return n==null?void 0:n(l)}}var Vt=globalThis!=null&&globalThis.document?T.useLayoutEffect:()=>{},cR=Ax[" useInsertionEffect ".trim().toString()]||Vt;function Jr({prop:e,defaultProp:n,onChange:i=()=>{},caller:s}){const[l,h,d]=uR({defaultProp:n,onChange:i}),o=e!==void 0,c=o?e:l;{const m=T.useRef(e!==void 0);T.useEffect(()=>{const f=m.current;f!==o&&console.warn(`${s} is changing from ${f?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),m.current=o},[o,s])}const u=T.useCallback(m=>{var f;if(o){const y=dR(m)?m(e):m;y!==e&&((f=d.current)==null||f.call(d,y))}else h(m)},[o,e,h,d]);return[c,u]}function uR({defaultProp:e,onChange:n}){const[i,s]=T.useState(e),l=T.useRef(i),h=T.useRef(n);return cR(()=>{h.current=n},[n]),T.useEffect(()=>{var d;l.current!==i&&((d=h.current)==null||d.call(h,i),l.current=i)},[i,l]),[i,s,h]}function dR(e){return typeof e=="function"}function hR(e,n){return T.useReducer((i,s)=>{const l=n[i][s];return l!=null?l:i},e)}var Gt=e=>{const{present:n,children:i}=e,s=fR(n),l=typeof i=="function"?i({present:s.isPresent}):T.Children.only(i),h=Ye(s.ref,pR(l));return typeof i=="function"||s.isPresent?T.cloneElement(l,{ref:h}):null};Gt.displayName="Presence";function fR(e){const[n,i]=T.useState(),s=T.useRef(null),l=T.useRef(e),h=T.useRef("none"),d=e?"mounted":"unmounted",[o,c]=hR(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const u=lu(s.current);h.current=o==="mounted"?u:"none"},[o]),Vt(()=>{const u=s.current,m=l.current;if(m!==e){const y=h.current,S=lu(u);e?c("MOUNT"):S==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(m&&y!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,c]),Vt(()=>{var u;if(n){let m;const f=(u=n.ownerDocument.defaultView)!=null?u:window,y=k=>{const _=lu(s.current).includes(CSS.escape(k.animationName));if(k.target===n&&_&&(c("ANIMATION_END"),!l.current)){const b=n.style.animationFillMode;n.style.animationFillMode="forwards",m=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=b)})}},S=k=>{k.target===n&&(h.current=lu(s.current))};return n.addEventListener("animationstart",S),n.addEventListener("animationcancel",y),n.addEventListener("animationend",y),()=>{f.clearTimeout(m),n.removeEventListener("animationstart",S),n.removeEventListener("animationcancel",y),n.removeEventListener("animationend",y)}}else c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:T.useCallback(u=>{s.current=u?getComputedStyle(u):null,i(u)},[])}}function lu(e){return(e==null?void 0:e.animationName)||"none"}function pR(e){var s,l;let n=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var mR=Ax[" useId ".trim().toString()]||(()=>{}),gR=0;function Ut(e){const[n,i]=T.useState(mR());return Vt(()=>{i(s=>s!=null?s:String(gR++))},[e]),e||(n?`radix-${n}`:"")}var Zu="Collapsible",[vR]=Bn(Zu),[_R,Am]=vR(Zu),Vx=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,open:s,defaultOpen:l,disabled:h,onOpenChange:d,...o}=e,[c,u]=Jr({prop:s,defaultProp:l!=null?l:!1,onChange:d,caller:Zu});return g.jsx(_R,{scope:i,disabled:h,contentId:Ut(),open:c,onOpenToggle:T.useCallback(()=>u(m=>!m),[u]),children:g.jsx(je.div,{"data-state":Rm(c),"data-disabled":h?"":void 0,...o,ref:n})})});Vx.displayName=Zu;var Gx="CollapsibleTrigger",Wx=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,...s}=e,l=Am(Gx,i);return g.jsx(je.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":Rm(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...s,ref:n,onClick:Ce(e.onClick,l.onOpenToggle)})});Wx.displayName=Gx;var Tm="CollapsibleContent",Kx=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=Am(Tm,e.__scopeCollapsible);return g.jsx(Gt,{present:i||l.open,children:({present:h})=>g.jsx(yR,{...s,ref:n,present:h})})});Kx.displayName=Tm;var yR=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,present:s,children:l,...h}=e,d=Am(Tm,i),[o,c]=T.useState(s),u=T.useRef(null),m=Ye(n,u),f=T.useRef(0),y=f.current,S=T.useRef(0),k=S.current,w=d.open||o,_=T.useRef(w),b=T.useRef(void 0);return T.useEffect(()=>{const v=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(v)},[]),Vt(()=>{const v=u.current;if(v){b.current=b.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();f.current=x.height,S.current=x.width,_.current||(v.style.transitionDuration=b.current.transitionDuration,v.style.animationName=b.current.animationName),c(s)}},[d.open,s]),g.jsx(je.div,{"data-state":Rm(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!w,...h,ref:m,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":k?`${k}px`:void 0,...e.style},children:w&&l})});function Rm(e){return e?"open":"closed"}var bR=Vx,xR=T.createContext(void 0);function Rl(e){const n=T.useContext(xR);return e||n||"ltr"}function Jt(e){const n=T.useRef(e);return T.useEffect(()=>{n.current=e}),T.useMemo(()=>(...i)=>{var s;return(s=n.current)==null?void 0:s.call(n,...i)},[])}function SR(e,n=globalThis==null?void 0:globalThis.document){const i=Jt(e);T.useEffect(()=>{const s=l=>{l.key==="Escape"&&i(l)};return n.addEventListener("keydown",s,{capture:!0}),()=>n.removeEventListener("keydown",s,{capture:!0})},[i,n])}var wR="DismissableLayer",Wp="dismissableLayer.update",CR="dismissableLayer.pointerDownOutside",kR="dismissableLayer.focusOutside",Ib,Yx=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qa=T.forwardRef((e,n)=>{var j;const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:h,onInteractOutside:d,onDismiss:o,...c}=e,u=T.useContext(Yx),[m,f]=T.useState(null),y=(j=m==null?void 0:m.ownerDocument)!=null?j:globalThis==null?void 0:globalThis.document,[,S]=T.useState({}),k=Ye(n,D=>f(D)),w=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=w.indexOf(_),v=m?w.indexOf(m):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,E=v>=b,M=TR(D=>{const O=D.target,P=[...u.branches].some(U=>U.contains(O));!E||P||(l==null||l(D),d==null||d(D),D.defaultPrevented||o==null||o())},y),R=RR(D=>{const O=D.target;[...u.branches].some(U=>U.contains(O))||(h==null||h(D),d==null||d(D),D.defaultPrevented||o==null||o())},y);return SR(D=>{v===u.layers.size-1&&(s==null||s(D),!D.defaultPrevented&&o&&(D.preventDefault(),o()))},y),T.useEffect(()=>{if(m)return i&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Ib=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(m)),u.layers.add(m),Bb(),()=>{i&&u.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=Ib)}},[m,y,i,u]),T.useEffect(()=>()=>{m&&(u.layers.delete(m),u.layersWithOutsidePointerEventsDisabled.delete(m),Bb())},[m,u]),T.useEffect(()=>{const D=()=>S({});return document.addEventListener(Wp,D),()=>document.removeEventListener(Wp,D)},[]),g.jsx(je.div,{...c,ref:k,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,M.onPointerDownCapture)})});qa.displayName=wR;var ER="DismissableLayerBranch",AR=T.forwardRef((e,n)=>{const i=T.useContext(Yx),s=T.useRef(null),l=Ye(n,s);return T.useEffect(()=>{const h=s.current;if(h)return i.branches.add(h),()=>{i.branches.delete(h)}},[i.branches]),g.jsx(je.div,{...e,ref:l})});AR.displayName=ER;function TR(e,n=globalThis==null?void 0:globalThis.document){const i=Jt(e),s=T.useRef(!1),l=T.useRef(()=>{});return T.useEffect(()=>{const h=o=>{if(o.target&&!s.current){let c=function(){Xx(CR,i,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(n.removeEventListener("click",l.current),l.current=c,n.addEventListener("click",l.current,{once:!0})):c()}else n.removeEventListener("click",l.current);s.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",h),n.removeEventListener("click",l.current)}},[n,i]),{onPointerDownCapture:()=>s.current=!0}}function RR(e,n=globalThis==null?void 0:globalThis.document){const i=Jt(e),s=T.useRef(!1);return T.useEffect(()=>{const l=h=>{h.target&&!s.current&&Xx(kR,i,{originalEvent:h},{discrete:!1})};return n.addEventListener("focusin",l),()=>n.removeEventListener("focusin",l)},[n,i]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Bb(){const e=new CustomEvent(Wp);document.dispatchEvent(e)}function Xx(e,n,i,{discrete:s}){const l=i.originalEvent.target,h=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});n&&l.addEventListener(e,n,{once:!0}),s?Ux(l,h):l.dispatchEvent(h)}var rp="focusScope.autoFocusOnMount",ip="focusScope.autoFocusOnUnmount",zb={bubbles:!1,cancelable:!0},DR="FocusScope",Dl=T.forwardRef((e,n)=>{const{loop:i=!1,trapped:s=!1,onMountAutoFocus:l,onUnmountAutoFocus:h,...d}=e,[o,c]=T.useState(null),u=Jt(l),m=Jt(h),f=T.useRef(null),y=Ye(n,w=>c(w)),S=T.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;T.useEffect(()=>{if(s){let w=function(x){if(S.paused||!o)return;const E=x.target;o.contains(E)?f.current=E:Bi(f.current,{select:!0})},_=function(x){if(S.paused||!o)return;const E=x.relatedTarget;E!==null&&(o.contains(E)||Bi(f.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const M of x)M.removedNodes.length>0&&Bi(o)};document.addEventListener("focusin",w),document.addEventListener("focusout",_);const v=new MutationObserver(b);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",_),v.disconnect()}}},[s,o,S.paused]),T.useEffect(()=>{if(o){Fb.add(S);const w=document.activeElement;if(!o.contains(w)){const b=new CustomEvent(rp,zb);o.addEventListener(rp,u),o.dispatchEvent(b),b.defaultPrevented||(MR(IR(Zx(o)),{select:!0}),document.activeElement===w&&Bi(o))}return()=>{o.removeEventListener(rp,u),setTimeout(()=>{const b=new CustomEvent(ip,zb);o.addEventListener(ip,m),o.dispatchEvent(b),b.defaultPrevented||Bi(w!=null?w:document.body,{select:!0}),o.removeEventListener(ip,m),Fb.remove(S)},0)}}},[o,u,m,S]);const k=T.useCallback(w=>{if(!i&&!s||S.paused)return;const _=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,b=document.activeElement;if(_&&b){const v=w.currentTarget,[x,E]=NR(v);x&&E?!w.shiftKey&&b===E?(w.preventDefault(),i&&Bi(x,{select:!0})):w.shiftKey&&b===x&&(w.preventDefault(),i&&Bi(E,{select:!0})):b===v&&w.preventDefault()}},[i,s,S.paused]);return g.jsx(je.div,{tabIndex:-1,...d,ref:y,onKeyDown:k})});Dl.displayName=DR;function MR(e,{select:n=!1}={}){const i=document.activeElement;for(const s of e)if(Bi(s,{select:n}),document.activeElement!==i)return}function NR(e){const n=Zx(e),i=Pb(n,e),s=Pb(n.reverse(),e);return[i,s]}function Zx(e){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const l=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||l?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n}function Pb(e,n){for(const i of e)if(!jR(i,{upTo:n}))return i}function jR(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function OR(e){return e instanceof HTMLInputElement&&"select"in e}function Bi(e,{select:n=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&OR(e)&&n&&e.select()}}var Fb=LR();function LR(){let e=[];return{add(n){const i=e[0];n!==i&&(i==null||i.pause()),e=Hb(e,n),e.unshift(n)},remove(n){var i;e=Hb(e,n),(i=e[0])==null||i.resume()}}}function Hb(e,n){const i=[...e],s=i.indexOf(n);return s!==-1&&i.splice(s,1),i}function IR(e){return e.filter(n=>n.tagName!=="A")}var BR="Portal",Va=T.forwardRef((e,n)=>{var o;const{container:i,...s}=e,[l,h]=T.useState(!1);Vt(()=>h(!0),[]);const d=i||l&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return d?QT.createPortal(g.jsx(je.div,{...s,ref:n}),d):null});Va.displayName=BR;var sp=0;function Qu(){T.useEffect(()=>{var n,i;const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(n=e[0])!=null?n:Ub()),document.body.insertAdjacentElement("beforeend",(i=e[1])!=null?i:Ub()),sp++,()=>{sp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(s=>s.remove()),sp--}},[])}function Ub(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var br=function(){return br=Object.assign||function(n){for(var i,s=1,l=arguments.length;s<l;s++){i=arguments[s];for(var h in i)Object.prototype.hasOwnProperty.call(i,h)&&(n[h]=i[h])}return n},br.apply(this,arguments)};function Qx(e,n){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&n.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,s=Object.getOwnPropertySymbols(e);l<s.length;l++)n.indexOf(s[l])<0&&Object.prototype.propertyIsEnumerable.call(e,s[l])&&(i[s[l]]=e[s[l]]);return i}function zR(e,n,i){if(i||arguments.length===2)for(var s=0,l=n.length,h;s<l;s++)(h||!(s in n))&&(h||(h=Array.prototype.slice.call(n,0,s)),h[s]=n[s]);return e.concat(h||Array.prototype.slice.call(n))}var xu="right-scroll-bar-position",Su="width-before-scroll-bar",PR="with-scroll-bars-hidden",FR="--removed-body-scroll-bar-size";function ap(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function HR(e,n){var i=T.useState(function(){return{value:e,callback:n,facade:{get current(){return i.value},set current(s){var l=i.value;l!==s&&(i.value=s,i.callback(s,l))}}}})[0];return i.callback=n,i.facade}var UR=typeof window<"u"?T.useLayoutEffect:T.useEffect,$b=new WeakMap;function $R(e,n){var i=HR(null,function(s){return e.forEach(function(l){return ap(l,s)})});return UR(function(){var s=$b.get(i);if(s){var l=new Set(s),h=new Set(e),d=i.current;l.forEach(function(o){h.has(o)||ap(o,null)}),h.forEach(function(o){l.has(o)||ap(o,d)})}$b.set(i,e)},[e]),i}function qR(e){return e}function VR(e,n){n===void 0&&(n=qR);var i=[],s=!1,l={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:e},useMedium:function(h){var d=n(h,s);return i.push(d),function(){i=i.filter(function(o){return o!==d})}},assignSyncMedium:function(h){for(s=!0;i.length;){var d=i;i=[],d.forEach(h)}i={push:function(o){return h(o)},filter:function(){return i}}},assignMedium:function(h){s=!0;var d=[];if(i.length){var o=i;i=[],o.forEach(h),d=i}var c=function(){var m=d;d=[],m.forEach(h)},u=function(){return Promise.resolve().then(c)};u(),i={push:function(m){d.push(m),u()},filter:function(m){return d=d.filter(m),i}}}};return l}function GR(e){e===void 0&&(e={});var n=VR(null);return n.options=br({async:!0,ssr:!1},e),n}var Jx=function(e){var n=e.sideCar,i=Qx(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=n.read();if(!s)throw new Error("Sidecar medium not found");return T.createElement(s,br({},i))};Jx.isSideCarExport=!0;function WR(e,n){return e.useMedium(n),Jx}var e1=GR(),op=function(){},Ju=T.forwardRef(function(e,n){var i=T.useRef(null),s=T.useState({onScrollCapture:op,onWheelCapture:op,onTouchMoveCapture:op}),l=s[0],h=s[1],d=e.forwardProps,o=e.children,c=e.className,u=e.removeScrollBar,m=e.enabled,f=e.shards,y=e.sideCar,S=e.noRelative,k=e.noIsolation,w=e.inert,_=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,x=e.gapMode,E=Qx(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=y,R=$R([i,n]),j=br(br({},E),l);return T.createElement(T.Fragment,null,m&&T.createElement(M,{sideCar:e1,removeScrollBar:u,shards:f,noRelative:S,noIsolation:k,inert:w,setCallbacks:h,allowPinchZoom:!!_,lockRef:i,gapMode:x}),d?T.cloneElement(T.Children.only(o),br(br({},j),{ref:R})):T.createElement(v,br({},j,{className:c,ref:R}),o))});Ju.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ju.classNames={fullWidth:Su,zeroRight:xu};var KR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function YR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=KR();return n&&e.setAttribute("nonce",n),e}function XR(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function ZR(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var QR=function(){var e=0,n=null;return{add:function(i){e==0&&(n=YR())&&(XR(n,i),ZR(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},JR=function(){var e=QR();return function(n,i){T.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&i])}},t1=function(){var e=JR(),n=function(i){var s=i.styles,l=i.dynamic;return e(s,l),null};return n},eD={left:0,top:0,right:0,gap:0},lp=function(e){return parseInt(e||"",10)||0},tD=function(e){var n=window.getComputedStyle(document.body),i=n[e==="padding"?"paddingLeft":"marginLeft"],s=n[e==="padding"?"paddingTop":"marginTop"],l=n[e==="padding"?"paddingRight":"marginRight"];return[lp(i),lp(s),lp(l)]},nD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return eD;var n=tD(e),i=document.documentElement.clientWidth,s=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,s-i+n[2]-n[0])}},rD=t1(),Ca="data-scroll-locked",iD=function(e,n,i,s){var l=e.left,h=e.top,d=e.right,o=e.gap;return i===void 0&&(i="margin"),`
395
- .`.concat(PR,` {
396
- overflow: hidden `).concat(s,`;
397
- padding-right: `).concat(o,"px ").concat(s,`;
398
- }
399
- body[`).concat(Ca,`] {
400
- overflow: hidden `).concat(s,`;
401
- overscroll-behavior: contain;
402
- `).concat([n&&"position: relative ".concat(s,";"),i==="margin"&&`
403
- padding-left: `.concat(l,`px;
404
- padding-top: `).concat(h,`px;
405
- padding-right: `).concat(d,`px;
406
- margin-left:0;
407
- margin-top:0;
408
- margin-right: `).concat(o,"px ").concat(s,`;
409
- `),i==="padding"&&"padding-right: ".concat(o,"px ").concat(s,";")].filter(Boolean).join(""),`
410
- }
411
-
412
- .`).concat(xu,` {
413
- right: `).concat(o,"px ").concat(s,`;
414
- }
415
-
416
- .`).concat(Su,` {
417
- margin-right: `).concat(o,"px ").concat(s,`;
418
- }
419
-
420
- .`).concat(xu," .").concat(xu,` {
421
- right: 0 `).concat(s,`;
422
- }
423
-
424
- .`).concat(Su," .").concat(Su,` {
425
- margin-right: 0 `).concat(s,`;
426
- }
427
-
428
- body[`).concat(Ca,`] {
429
- `).concat(FR,": ").concat(o,`px;
430
- }
431
- `)},qb=function(){var e=parseInt(document.body.getAttribute(Ca)||"0",10);return isFinite(e)?e:0},sD=function(){T.useEffect(function(){return document.body.setAttribute(Ca,(qb()+1).toString()),function(){var e=qb()-1;e<=0?document.body.removeAttribute(Ca):document.body.setAttribute(Ca,e.toString())}},[])},aD=function(e){var n=e.noRelative,i=e.noImportant,s=e.gapMode,l=s===void 0?"margin":s;sD();var h=T.useMemo(function(){return nD(l)},[l]);return T.createElement(rD,{styles:iD(h,!n,l,i?"":"!important")})},Kp=!1;if(typeof window<"u")try{var cu=Object.defineProperty({},"passive",{get:function(){return Kp=!0,!0}});window.addEventListener("test",cu,cu),window.removeEventListener("test",cu,cu)}catch{Kp=!1}var pa=Kp?{passive:!1}:!1,oD=function(e){return e.tagName==="TEXTAREA"},n1=function(e,n){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!oD(e)&&i[n]==="visible")},lD=function(e){return n1(e,"overflowY")},cD=function(e){return n1(e,"overflowX")},Vb=function(e,n){var i=n.ownerDocument,s=n;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var l=r1(e,s);if(l){var h=i1(e,s),d=h[1],o=h[2];if(d>o)return!0}s=s.parentNode}while(s&&s!==i.body);return!1},uD=function(e){var n=e.scrollTop,i=e.scrollHeight,s=e.clientHeight;return[n,i,s]},dD=function(e){var n=e.scrollLeft,i=e.scrollWidth,s=e.clientWidth;return[n,i,s]},r1=function(e,n){return e==="v"?lD(n):cD(n)},i1=function(e,n){return e==="v"?uD(n):dD(n)},hD=function(e,n){return e==="h"&&n==="rtl"?-1:1},fD=function(e,n,i,s,l){var h=hD(e,window.getComputedStyle(n).direction),d=h*s,o=i.target,c=n.contains(o),u=!1,m=d>0,f=0,y=0;do{if(!o)break;var S=i1(e,o),k=S[0],w=S[1],_=S[2],b=w-_-h*k;(k||b)&&r1(e,o)&&(f+=b,y+=k);var v=o.parentNode;o=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&o!==document.body||c&&(n.contains(o)||n===o));return(m&&Math.abs(f)<1||!m&&Math.abs(y)<1)&&(u=!0),u},uu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gb=function(e){return[e.deltaX,e.deltaY]},Wb=function(e){return e&&"current"in e?e.current:e},pD=function(e,n){return e[0]===n[0]&&e[1]===n[1]},mD=function(e){return`
432
- .block-interactivity-`.concat(e,` {pointer-events: none;}
433
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
434
- `)},gD=0,ma=[];function vD(e){var n=T.useRef([]),i=T.useRef([0,0]),s=T.useRef(),l=T.useState(gD++)[0],h=T.useState(t1)[0],d=T.useRef(e);T.useEffect(function(){d.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var w=zR([e.lockRef.current],(e.shards||[]).map(Wb),!0).filter(Boolean);return w.forEach(function(_){return _.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var o=T.useCallback(function(w,_){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!d.current.allowPinchZoom;var b=uu(w),v=i.current,x="deltaX"in w?w.deltaX:v[0]-b[0],E="deltaY"in w?w.deltaY:v[1]-b[1],M,R=w.target,j=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in w&&j==="h"&&R.type==="range")return!1;var D=window.getSelection(),O=D&&D.anchorNode,P=O?O===R||O.contains(R):!1;if(P)return!1;var U=Vb(j,R);if(!U)return!0;if(U?M=j:(M=j==="v"?"h":"v",U=Vb(j,R)),!U)return!1;if(!s.current&&"changedTouches"in w&&(x||E)&&(s.current=M),!M)return!0;var q=s.current||M;return fD(q,_,w,q==="h"?x:E)},[]),c=T.useCallback(function(w){var _=w;if(!(!ma.length||ma[ma.length-1]!==h)){var b="deltaY"in _?Gb(_):uu(_),v=n.current.filter(function(M){return M.name===_.type&&(M.target===_.target||_.target===M.shadowParent)&&pD(M.delta,b)})[0];if(v&&v.should){_.cancelable&&_.preventDefault();return}if(!v){var x=(d.current.shards||[]).map(Wb).filter(Boolean).filter(function(M){return M.contains(_.target)}),E=x.length>0?o(_,x[0]):!d.current.noIsolation;E&&_.cancelable&&_.preventDefault()}}},[]),u=T.useCallback(function(w,_,b,v){var x={name:w,delta:_,target:b,should:v,shadowParent:_D(b)};n.current.push(x),setTimeout(function(){n.current=n.current.filter(function(E){return E!==x})},1)},[]),m=T.useCallback(function(w){i.current=uu(w),s.current=void 0},[]),f=T.useCallback(function(w){u(w.type,Gb(w),w.target,o(w,e.lockRef.current))},[]),y=T.useCallback(function(w){u(w.type,uu(w),w.target,o(w,e.lockRef.current))},[]);T.useEffect(function(){return ma.push(h),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:y}),document.addEventListener("wheel",c,pa),document.addEventListener("touchmove",c,pa),document.addEventListener("touchstart",m,pa),function(){ma=ma.filter(function(w){return w!==h}),document.removeEventListener("wheel",c,pa),document.removeEventListener("touchmove",c,pa),document.removeEventListener("touchstart",m,pa)}},[]);var S=e.removeScrollBar,k=e.inert;return T.createElement(T.Fragment,null,k?T.createElement(h,{styles:mD(l)}):null,S?T.createElement(aD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _D(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const yD=WR(e1,vD);var Ml=T.forwardRef(function(e,n){return T.createElement(Ju,br({},e,{ref:n,sideCar:yD}))});Ml.classNames=Ju.classNames;var bD=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ga=new WeakMap,du=new WeakMap,hu={},cp=0,s1=function(e){return e&&(e.host||s1(e.parentNode))},xD=function(e,n){return n.map(function(i){if(e.contains(i))return i;var s=s1(i);return s&&e.contains(s)?s:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},SD=function(e,n,i,s){var l=xD(n,Array.isArray(e)?e:[e]);hu[i]||(hu[i]=new WeakMap);var h=hu[i],d=[],o=new Set,c=new Set(l),u=function(f){!f||o.has(f)||(o.add(f),u(f.parentNode))};l.forEach(u);var m=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(y){if(o.has(y))m(y);else try{var S=y.getAttribute(s),k=S!==null&&S!=="false",w=(ga.get(y)||0)+1,_=(h.get(y)||0)+1;ga.set(y,w),h.set(y,_),d.push(y),w===1&&k&&du.set(y,!0),_===1&&y.setAttribute(i,"true"),k||y.setAttribute(s,"true")}catch(b){console.error("aria-hidden: cannot operate on ",y,b)}})};return m(n),o.clear(),cp++,function(){d.forEach(function(f){var y=ga.get(f)-1,S=h.get(f)-1;ga.set(f,y),h.set(f,S),y||(du.has(f)||f.removeAttribute(s),du.delete(f)),S||f.removeAttribute(i)}),cp--,cp||(ga=new WeakMap,ga=new WeakMap,du=new WeakMap,hu={})}},ed=function(e,n,i){i===void 0&&(i="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),l=bD(e);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),SD(s,l,i,"aria-hidden")):function(){return null}},td="Dialog",[a1]=Bn(td),[wD,cr]=a1(td),o1=e=>{const{__scopeDialog:n,children:i,open:s,defaultOpen:l,onOpenChange:h,modal:d=!0}=e,o=T.useRef(null),c=T.useRef(null),[u,m]=Jr({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:td});return g.jsx(wD,{scope:n,triggerRef:o,contentRef:c,contentId:Ut(),titleId:Ut(),descriptionId:Ut(),open:u,onOpenChange:m,onOpenToggle:T.useCallback(()=>m(f=>!f),[m]),modal:d,children:i})};o1.displayName=td;var l1="DialogTrigger",c1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=cr(l1,i),h=Ye(n,l.triggerRef);return g.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Nm(l.open),...s,ref:h,onClick:Ce(e.onClick,l.onOpenToggle)})});c1.displayName=l1;var Dm="DialogPortal",[CD,u1]=a1(Dm,{forceMount:void 0}),d1=e=>{const{__scopeDialog:n,forceMount:i,children:s,container:l}=e,h=cr(Dm,n);return g.jsx(CD,{scope:n,forceMount:i,children:T.Children.map(s,d=>g.jsx(Gt,{present:i||h.open,children:g.jsx(Va,{asChild:!0,container:l,children:d})}))})};d1.displayName=Dm;var Du="DialogOverlay",h1=T.forwardRef((e,n)=>{const i=u1(Du,e.__scopeDialog),{forceMount:s=i.forceMount,...l}=e,h=cr(Du,e.__scopeDialog);return h.modal?g.jsx(Gt,{present:s||h.open,children:g.jsx(ED,{...l,ref:n})}):null});h1.displayName=Du;var kD=Fi("DialogOverlay.RemoveScroll"),ED=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=cr(Du,i);return g.jsx(Ml,{as:kD,allowPinchZoom:!0,shards:[l.contentRef],children:g.jsx(je.div,{"data-state":Nm(l.open),...s,ref:n,style:{pointerEvents:"auto",...s.style}})})}),ws="DialogContent",f1=T.forwardRef((e,n)=>{const i=u1(ws,e.__scopeDialog),{forceMount:s=i.forceMount,...l}=e,h=cr(ws,e.__scopeDialog);return g.jsx(Gt,{present:s||h.open,children:h.modal?g.jsx(AD,{...l,ref:n}):g.jsx(TD,{...l,ref:n})})});f1.displayName=ws;var AD=T.forwardRef((e,n)=>{const i=cr(ws,e.__scopeDialog),s=T.useRef(null),l=Ye(n,i.contentRef,s);return T.useEffect(()=>{const h=s.current;if(h)return ed(h)},[]),g.jsx(p1,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,h=>{var d;h.preventDefault(),(d=i.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,h=>{const d=h.detail.originalEvent,o=d.button===0&&d.ctrlKey===!0;(d.button===2||o)&&h.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,h=>h.preventDefault())})}),TD=T.forwardRef((e,n)=>{const i=cr(ws,e.__scopeDialog),s=T.useRef(!1),l=T.useRef(!1);return g.jsx(p1,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var d,o;(d=e.onCloseAutoFocus)==null||d.call(e,h),h.defaultPrevented||(s.current||(o=i.triggerRef.current)==null||o.focus(),h.preventDefault()),s.current=!1,l.current=!1},onInteractOutside:h=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,h),h.defaultPrevented||(s.current=!0,h.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=h.target;((u=i.triggerRef.current)==null?void 0:u.contains(d))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&l.current&&h.preventDefault()}})}),p1=T.forwardRef((e,n)=>{const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:h,...d}=e,o=cr(ws,i),c=T.useRef(null),u=Ye(n,c);return Qu(),g.jsxs(g.Fragment,{children:[g.jsx(Dl,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:h,children:g.jsx(qa,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Nm(o.open),...d,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(RD,{titleId:o.titleId}),g.jsx(MD,{contentRef:c,descriptionId:o.descriptionId})]})]})}),Mm="DialogTitle",m1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=cr(Mm,i);return g.jsx(je.h2,{id:l.titleId,...s,ref:n})});m1.displayName=Mm;var g1="DialogDescription",v1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=cr(g1,i);return g.jsx(je.p,{id:l.descriptionId,...s,ref:n})});v1.displayName=g1;var _1="DialogClose",y1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=cr(_1,i);return g.jsx(je.button,{type:"button",...s,ref:n,onClick:Ce(e.onClick,()=>l.onOpenChange(!1))})});y1.displayName=_1;function Nm(e){return e?"open":"closed"}var b1="DialogTitleWarning",[i7,x1]=oR(b1,{contentName:ws,titleName:Mm,docsSlug:"dialog"}),RD=({titleId:e})=>{const n=x1(b1),i=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
435
-
436
- If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
437
-
438
- For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return T.useEffect(()=>{e&&(document.getElementById(e)||console.error(i))},[i,e]),null},DD="DialogDescriptionWarning",MD=({contentRef:e,descriptionId:n})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${x1(DD).contentName}}.`;return T.useEffect(()=>{var h;const l=(h=e.current)==null?void 0:h.getAttribute("aria-describedby");n&&l&&(document.getElementById(n)||console.warn(s))},[s,e,n]),null},jm=o1,ND=c1,Om=d1,Lm=h1,Im=f1,S1=m1,w1=v1,nd=y1;function jD(e){const n=T.useRef({value:e,previous:e});return T.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}function OD(e){const[n,i]=T.useState(void 0);return Vt(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const h=l[0];let d,o;if("borderBoxSize"in h){const c=h.borderBoxSize,u=Array.isArray(c)?c[0]:c;d=u.inlineSize,o=u.blockSize}else d=e.offsetWidth,o=e.offsetHeight;i({width:d,height:o})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else i(void 0)},[e]),n}const LD=["top","right","bottom","left"],Hi=Math.min,On=Math.max,Mu=Math.round,fu=Math.floor,Sr=e=>({x:e,y:e}),ID={left:"right",right:"left",bottom:"top",top:"bottom"};function Yp(e,n,i){return On(e,Hi(n,i))}function ei(e,n){return typeof e=="function"?e(n):e}function ti(e){return e.split("-")[0]}function Ga(e){return e.split("-")[1]}function Bm(e){return e==="x"?"y":"x"}function zm(e){return e==="y"?"height":"width"}function xr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function Pm(e){return Bm(xr(e))}function BD(e,n,i){i===void 0&&(i=!1);const s=Ga(e),l=Pm(e),h=zm(l);let d=l==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[h]>n.floating[h]&&(d=Nu(d)),[d,Nu(d)]}function zD(e){const n=Nu(e);return[Xp(e),n,Xp(n)]}function Xp(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Kb=["left","right"],Yb=["right","left"],PD=["top","bottom"],FD=["bottom","top"];function HD(e,n,i){switch(e){case"top":case"bottom":return i?n?Yb:Kb:n?Kb:Yb;case"left":case"right":return n?PD:FD;default:return[]}}function UD(e,n,i,s){const l=Ga(e);let h=HD(ti(e),i==="start",s);return l&&(h=h.map(d=>d+"-"+l),n&&(h=h.concat(h.map(Xp)))),h}function Nu(e){const n=ti(e);return ID[n]+e.slice(n.length)}function $D(e){return{top:0,right:0,bottom:0,left:0,...e}}function C1(e){return typeof e!="number"?$D(e):{top:e,right:e,bottom:e,left:e}}function ju(e){const{x:n,y:i,width:s,height:l}=e;return{width:s,height:l,top:i,left:n,right:n+s,bottom:i+l,x:n,y:i}}function Xb(e,n,i){let{reference:s,floating:l}=e;const h=xr(n),d=Pm(n),o=zm(d),c=ti(n),u=h==="y",m=s.x+s.width/2-l.width/2,f=s.y+s.height/2-l.height/2,y=s[o]/2-l[o]/2;let S;switch(c){case"top":S={x:m,y:s.y-l.height};break;case"bottom":S={x:m,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:f};break;case"left":S={x:s.x-l.width,y:f};break;default:S={x:s.x,y:s.y}}switch(Ga(n)){case"start":S[d]-=y*(i&&u?-1:1);break;case"end":S[d]+=y*(i&&u?-1:1);break}return S}async function qD(e,n){var i;n===void 0&&(n={});const{x:s,y:l,platform:h,rects:d,elements:o,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:y=!1,padding:S=0}=ei(n,e),k=C1(S),_=o[y?f==="floating"?"reference":"floating":f],b=ju(await h.getClippingRect({element:(i=await(h.isElement==null?void 0:h.isElement(_)))==null||i?_:_.contextElement||await(h.getDocumentElement==null?void 0:h.getDocumentElement(o.floating)),boundary:u,rootBoundary:m,strategy:c})),v=f==="floating"?{x:s,y:l,width:d.floating.width,height:d.floating.height}:d.reference,x=await(h.getOffsetParent==null?void 0:h.getOffsetParent(o.floating)),E=await(h.isElement==null?void 0:h.isElement(x))?await(h.getScale==null?void 0:h.getScale(x))||{x:1,y:1}:{x:1,y:1},M=ju(h.convertOffsetParentRelativeRectToViewportRelativeRect?await h.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:x,strategy:c}):v);return{top:(b.top-M.top+k.top)/E.y,bottom:(M.bottom-b.bottom+k.bottom)/E.y,left:(b.left-M.left+k.left)/E.x,right:(M.right-b.right+k.right)/E.x}}const VD=50,GD=async(e,n,i)=>{const{placement:s="bottom",strategy:l="absolute",middleware:h=[],platform:d}=i,o=d.detectOverflow?d:{...d,detectOverflow:qD},c=await(d.isRTL==null?void 0:d.isRTL(n));let u=await d.getElementRects({reference:e,floating:n,strategy:l}),{x:m,y:f}=Xb(u,s,c),y=s,S=0;const k={};for(let w=0;w<h.length;w++){const _=h[w];if(!_)continue;const{name:b,fn:v}=_,{x,y:E,data:M,reset:R}=await v({x:m,y:f,initialPlacement:s,placement:y,strategy:l,middlewareData:k,rects:u,platform:o,elements:{reference:e,floating:n}});m=x!=null?x:m,f=E!=null?E:f,k[b]={...k[b],...M},R&&S<VD&&(S++,typeof R=="object"&&(R.placement&&(y=R.placement),R.rects&&(u=R.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:l}):R.rects),{x:m,y:f}=Xb(u,y,c)),w=-1)}return{x:m,y:f,placement:y,strategy:l,middlewareData:k}},WD=e=>({name:"arrow",options:e,async fn(n){const{x:i,y:s,placement:l,rects:h,platform:d,elements:o,middlewareData:c}=n,{element:u,padding:m=0}=ei(e,n)||{};if(u==null)return{};const f=C1(m),y={x:i,y:s},S=Pm(l),k=zm(S),w=await d.getDimensions(u),_=S==="y",b=_?"top":"left",v=_?"bottom":"right",x=_?"clientHeight":"clientWidth",E=h.reference[k]+h.reference[S]-y[S]-h.floating[k],M=y[S]-h.reference[S],R=await(d.getOffsetParent==null?void 0:d.getOffsetParent(u));let j=R?R[x]:0;(!j||!await(d.isElement==null?void 0:d.isElement(R)))&&(j=o.floating[x]||h.floating[k]);const D=E/2-M/2,O=j/2-w[k]/2-1,P=Hi(f[b],O),U=Hi(f[v],O),q=P,$=j-w[k]-U,K=j/2-w[k]/2+D,Y=Yp(q,K,$),V=!c.arrow&&Ga(l)!=null&&K!==Y&&h.reference[k]/2-(K<q?P:U)-w[k]/2<0,Z=V?K<q?K-q:K-$:0;return{[S]:y[S]+Z,data:{[S]:Y,centerOffset:K-Y-Z,...V&&{alignmentOffset:Z}},reset:V}}}),KD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var i,s;const{placement:l,middlewareData:h,rects:d,initialPlacement:o,platform:c,elements:u}=n,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:y,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:w=!0,..._}=ei(e,n);if((i=h.arrow)!=null&&i.alignmentOffset)return{};const b=ti(l),v=xr(o),x=ti(o)===o,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),M=y||(x||!w?[Nu(o)]:zD(o)),R=k!=="none";!y&&R&&M.push(...UD(o,w,k,E));const j=[o,...M],D=await c.detectOverflow(n,_),O=[];let P=((s=h.flip)==null?void 0:s.overflows)||[];if(m&&O.push(D[b]),f){const K=BD(l,d,E);O.push(D[K[0]],D[K[1]])}if(P=[...P,{placement:l,overflows:O}],!O.every(K=>K<=0)){var U,q;const K=(((U=h.flip)==null?void 0:U.index)||0)+1,Y=j[K];if(Y&&(!(f==="alignment"?v!==xr(Y):!1)||P.every(Q=>xr(Q.placement)===v?Q.overflows[0]>0:!0)))return{data:{index:K,overflows:P},reset:{placement:Y}};let V=(q=P.filter(Z=>Z.overflows[0]<=0).sort((Z,Q)=>Z.overflows[1]-Q.overflows[1])[0])==null?void 0:q.placement;if(!V)switch(S){case"bestFit":{var $;const Z=($=P.filter(Q=>{if(R){const F=xr(Q.placement);return F===v||F==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(F=>F>0).reduce((F,N)=>F+N,0)]).sort((Q,F)=>Q[1]-F[1])[0])==null?void 0:$[0];Z&&(V=Z);break}case"initialPlacement":V=o;break}if(l!==V)return{reset:{placement:V}}}return{}}}};function Zb(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Qb(e){return LD.some(n=>e[n]>=0)}const YD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:i,platform:s}=n,{strategy:l="referenceHidden",...h}=ei(e,n);switch(l){case"referenceHidden":{const d=await s.detectOverflow(n,{...h,elementContext:"reference"}),o=Zb(d,i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Qb(o)}}}case"escaped":{const d=await s.detectOverflow(n,{...h,altBoundary:!0}),o=Zb(d,i.floating);return{data:{escapedOffsets:o,escaped:Qb(o)}}}default:return{}}}}},k1=new Set(["left","top"]);async function XD(e,n){const{placement:i,platform:s,elements:l}=e,h=await(s.isRTL==null?void 0:s.isRTL(l.floating)),d=ti(i),o=Ga(i),c=xr(i)==="y",u=k1.has(d)?-1:1,m=h&&c?-1:1,f=ei(n,e);let{mainAxis:y,crossAxis:S,alignmentAxis:k}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return o&&typeof k=="number"&&(S=o==="end"?k*-1:k),c?{x:S*m,y:y*u}:{x:y*u,y:S*m}}const ZD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var i,s;const{x:l,y:h,placement:d,middlewareData:o}=n,c=await XD(n,e);return d===((i=o.offset)==null?void 0:i.placement)&&(s=o.arrow)!=null&&s.alignmentOffset?{}:{x:l+c.x,y:h+c.y,data:{...c,placement:d}}}}},QD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:i,y:s,placement:l,platform:h}=n,{mainAxis:d=!0,crossAxis:o=!1,limiter:c={fn:b=>{let{x:v,y:x}=b;return{x:v,y:x}}},...u}=ei(e,n),m={x:i,y:s},f=await h.detectOverflow(n,u),y=xr(ti(l)),S=Bm(y);let k=m[S],w=m[y];if(d){const b=S==="y"?"top":"left",v=S==="y"?"bottom":"right",x=k+f[b],E=k-f[v];k=Yp(x,k,E)}if(o){const b=y==="y"?"top":"left",v=y==="y"?"bottom":"right",x=w+f[b],E=w-f[v];w=Yp(x,w,E)}const _=c.fn({...n,[S]:k,[y]:w});return{..._,data:{x:_.x-i,y:_.y-s,enabled:{[S]:d,[y]:o}}}}}},JD=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:i,y:s,placement:l,rects:h,middlewareData:d}=n,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=ei(e,n),m={x:i,y:s},f=xr(l),y=Bm(f);let S=m[y],k=m[f];const w=ei(o,n),_=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const x=y==="y"?"height":"width",E=h.reference[y]-h.floating[x]+_.mainAxis,M=h.reference[y]+h.reference[x]-_.mainAxis;S<E?S=E:S>M&&(S=M)}if(u){var b,v;const x=y==="y"?"width":"height",E=k1.has(ti(l)),M=h.reference[f]-h.floating[x]+(E&&((b=d.offset)==null?void 0:b[f])||0)+(E?0:_.crossAxis),R=h.reference[f]+h.reference[x]+(E?0:((v=d.offset)==null?void 0:v[f])||0)-(E?_.crossAxis:0);k<M?k=M:k>R&&(k=R)}return{[y]:S,[f]:k}}}},eM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var i,s;const{placement:l,rects:h,platform:d,elements:o}=n,{apply:c=()=>{},...u}=ei(e,n),m=await d.detectOverflow(n,u),f=ti(l),y=Ga(l),S=xr(l)==="y",{width:k,height:w}=h.floating;let _,b;f==="top"||f==="bottom"?(_=f,b=y===(await(d.isRTL==null?void 0:d.isRTL(o.floating))?"start":"end")?"left":"right"):(b=f,_=y==="end"?"top":"bottom");const v=w-m.top-m.bottom,x=k-m.left-m.right,E=Hi(w-m[_],v),M=Hi(k-m[b],x),R=!n.middlewareData.shift;let j=E,D=M;if((i=n.middlewareData.shift)!=null&&i.enabled.x&&(D=x),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(j=v),R&&!y){const P=On(m.left,0),U=On(m.right,0),q=On(m.top,0),$=On(m.bottom,0);S?D=k-2*(P!==0||U!==0?P+U:On(m.left,m.right)):j=w-2*(q!==0||$!==0?q+$:On(m.top,m.bottom))}await c({...n,availableWidth:D,availableHeight:j});const O=await d.getDimensions(o.floating);return k!==O.width||w!==O.height?{reset:{rects:!0}}:{}}}};function rd(){return typeof window<"u"}function Wa(e){return E1(e)?(e.nodeName||"").toLowerCase():"#document"}function Ln(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Cr(e){var n;return(n=(E1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function E1(e){return rd()?e instanceof Node||e instanceof Ln(e).Node:!1}function or(e){return rd()?e instanceof Element||e instanceof Ln(e).Element:!1}function ni(e){return rd()?e instanceof HTMLElement||e instanceof Ln(e).HTMLElement:!1}function Jb(e){return!rd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ln(e).ShadowRoot}function Nl(e){const{overflow:n,overflowX:i,overflowY:s,display:l}=lr(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+i)&&l!=="inline"&&l!=="contents"}function tM(e){return/^(table|td|th)$/.test(Wa(e))}function id(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const nM=/transform|translate|scale|rotate|perspective|filter/,rM=/paint|layout|strict|content/,_s=e=>!!e&&e!=="none";let up;function Fm(e){const n=or(e)?lr(e):e;return _s(n.transform)||_s(n.translate)||_s(n.scale)||_s(n.rotate)||_s(n.perspective)||!Hm()&&(_s(n.backdropFilter)||_s(n.filter))||nM.test(n.willChange||"")||rM.test(n.contain||"")}function iM(e){let n=Ui(e);for(;ni(n)&&!Ra(n);){if(Fm(n))return n;if(id(n))return null;n=Ui(n)}return null}function Hm(){return up==null&&(up=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),up}function Ra(e){return/^(html|body|#document)$/.test(Wa(e))}function lr(e){return Ln(e).getComputedStyle(e)}function sd(e){return or(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ui(e){if(Wa(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Jb(e)&&e.host||Cr(e);return Jb(n)?n.host:n}function A1(e){const n=Ui(e);return Ra(n)?e.ownerDocument?e.ownerDocument.body:e.body:ni(n)&&Nl(n)?n:A1(n)}function gl(e,n,i){var s;n===void 0&&(n=[]),i===void 0&&(i=!0);const l=A1(e),h=l===((s=e.ownerDocument)==null?void 0:s.body),d=Ln(l);if(h){const o=Zp(d);return n.concat(d,d.visualViewport||[],Nl(l)?l:[],o&&i?gl(o):[])}else return n.concat(l,gl(l,[],i))}function Zp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function T1(e){const n=lr(e);let i=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const l=ni(e),h=l?e.offsetWidth:i,d=l?e.offsetHeight:s,o=Mu(i)!==h||Mu(s)!==d;return o&&(i=h,s=d),{width:i,height:s,$:o}}function Um(e){return or(e)?e:e.contextElement}function ka(e){const n=Um(e);if(!ni(n))return Sr(1);const i=n.getBoundingClientRect(),{width:s,height:l,$:h}=T1(n);let d=(h?Mu(i.width):i.width)/s,o=(h?Mu(i.height):i.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!o||!Number.isFinite(o))&&(o=1),{x:d,y:o}}const sM=Sr(0);function R1(e){const n=Ln(e);return!Hm()||!n.visualViewport?sM:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function aM(e,n,i){return n===void 0&&(n=!1),!i||n&&i!==Ln(e)?!1:n}function Cs(e,n,i,s){n===void 0&&(n=!1),i===void 0&&(i=!1);const l=e.getBoundingClientRect(),h=Um(e);let d=Sr(1);n&&(s?or(s)&&(d=ka(s)):d=ka(e));const o=aM(h,i,s)?R1(h):Sr(0);let c=(l.left+o.x)/d.x,u=(l.top+o.y)/d.y,m=l.width/d.x,f=l.height/d.y;if(h){const y=Ln(h),S=s&&or(s)?Ln(s):s;let k=y,w=Zp(k);for(;w&&s&&S!==k;){const _=ka(w),b=w.getBoundingClientRect(),v=lr(w),x=b.left+(w.clientLeft+parseFloat(v.paddingLeft))*_.x,E=b.top+(w.clientTop+parseFloat(v.paddingTop))*_.y;c*=_.x,u*=_.y,m*=_.x,f*=_.y,c+=x,u+=E,k=Ln(w),w=Zp(k)}}return ju({width:m,height:f,x:c,y:u})}function ad(e,n){const i=sd(e).scrollLeft;return n?n.left+i:Cs(Cr(e)).left+i}function D1(e,n){const i=e.getBoundingClientRect(),s=i.left+n.scrollLeft-ad(e,i),l=i.top+n.scrollTop;return{x:s,y:l}}function oM(e){let{elements:n,rect:i,offsetParent:s,strategy:l}=e;const h=l==="fixed",d=Cr(s),o=n?id(n.floating):!1;if(s===d||o&&h)return i;let c={scrollLeft:0,scrollTop:0},u=Sr(1);const m=Sr(0),f=ni(s);if((f||!f&&!h)&&((Wa(s)!=="body"||Nl(d))&&(c=sd(s)),f)){const S=Cs(s);u=ka(s),m.x=S.x+s.clientLeft,m.y=S.y+s.clientTop}const y=d&&!f&&!h?D1(d,c):Sr(0);return{width:i.width*u.x,height:i.height*u.y,x:i.x*u.x-c.scrollLeft*u.x+m.x+y.x,y:i.y*u.y-c.scrollTop*u.y+m.y+y.y}}function lM(e){return Array.from(e.getClientRects())}function cM(e){const n=Cr(e),i=sd(e),s=e.ownerDocument.body,l=On(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),h=On(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let d=-i.scrollLeft+ad(e);const o=-i.scrollTop;return lr(s).direction==="rtl"&&(d+=On(n.clientWidth,s.clientWidth)-l),{width:l,height:h,x:d,y:o}}const e0=25;function uM(e,n){const i=Ln(e),s=Cr(e),l=i.visualViewport;let h=s.clientWidth,d=s.clientHeight,o=0,c=0;if(l){h=l.width,d=l.height;const m=Hm();(!m||m&&n==="fixed")&&(o=l.offsetLeft,c=l.offsetTop)}const u=ad(s);if(u<=0){const m=s.ownerDocument,f=m.body,y=getComputedStyle(f),S=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,k=Math.abs(s.clientWidth-f.clientWidth-S);k<=e0&&(h-=k)}else u<=e0&&(h+=u);return{width:h,height:d,x:o,y:c}}function dM(e,n){const i=Cs(e,!0,n==="fixed"),s=i.top+e.clientTop,l=i.left+e.clientLeft,h=ni(e)?ka(e):Sr(1),d=e.clientWidth*h.x,o=e.clientHeight*h.y,c=l*h.x,u=s*h.y;return{width:d,height:o,x:c,y:u}}function t0(e,n,i){let s;if(n==="viewport")s=uM(e,i);else if(n==="document")s=cM(Cr(e));else if(or(n))s=dM(n,i);else{const l=R1(e);s={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return ju(s)}function M1(e,n){const i=Ui(e);return i===n||!or(i)||Ra(i)?!1:lr(i).position==="fixed"||M1(i,n)}function hM(e,n){const i=n.get(e);if(i)return i;let s=gl(e,[],!1).filter(o=>or(o)&&Wa(o)!=="body"),l=null;const h=lr(e).position==="fixed";let d=h?Ui(e):e;for(;or(d)&&!Ra(d);){const o=lr(d),c=Fm(d);!c&&o.position==="fixed"&&(l=null),(h?!c&&!l:!c&&o.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||Nl(d)&&!c&&M1(e,d))?s=s.filter(m=>m!==d):l=o,d=Ui(d)}return n.set(e,s),s}function fM(e){let{element:n,boundary:i,rootBoundary:s,strategy:l}=e;const d=[...i==="clippingAncestors"?id(n)?[]:hM(n,this._c):[].concat(i),s],o=t0(n,d[0],l);let c=o.top,u=o.right,m=o.bottom,f=o.left;for(let y=1;y<d.length;y++){const S=t0(n,d[y],l);c=On(S.top,c),u=Hi(S.right,u),m=Hi(S.bottom,m),f=On(S.left,f)}return{width:u-f,height:m-c,x:f,y:c}}function pM(e){const{width:n,height:i}=T1(e);return{width:n,height:i}}function mM(e,n,i){const s=ni(n),l=Cr(n),h=i==="fixed",d=Cs(e,!0,h,n);let o={scrollLeft:0,scrollTop:0};const c=Sr(0);function u(){c.x=ad(l)}if(s||!s&&!h)if((Wa(n)!=="body"||Nl(l))&&(o=sd(n)),s){const S=Cs(n,!0,h,n);c.x=S.x+n.clientLeft,c.y=S.y+n.clientTop}else l&&u();h&&!s&&l&&u();const m=l&&!s&&!h?D1(l,o):Sr(0),f=d.left+o.scrollLeft-c.x-m.x,y=d.top+o.scrollTop-c.y-m.y;return{x:f,y,width:d.width,height:d.height}}function dp(e){return lr(e).position==="static"}function n0(e,n){if(!ni(e)||lr(e).position==="fixed")return null;if(n)return n(e);let i=e.offsetParent;return Cr(e)===i&&(i=i.ownerDocument.body),i}function N1(e,n){const i=Ln(e);if(id(e))return i;if(!ni(e)){let l=Ui(e);for(;l&&!Ra(l);){if(or(l)&&!dp(l))return l;l=Ui(l)}return i}let s=n0(e,n);for(;s&&tM(s)&&dp(s);)s=n0(s,n);return s&&Ra(s)&&dp(s)&&!Fm(s)?i:s||iM(e)||i}const gM=async function(e){const n=this.getOffsetParent||N1,i=this.getDimensions,s=await i(e.floating);return{reference:mM(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function vM(e){return lr(e).direction==="rtl"}const _M={convertOffsetParentRelativeRectToViewportRelativeRect:oM,getDocumentElement:Cr,getClippingRect:fM,getOffsetParent:N1,getElementRects:gM,getClientRects:lM,getDimensions:pM,getScale:ka,isElement:or,isRTL:vM};function j1(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function yM(e,n){let i=null,s;const l=Cr(e);function h(){var o;clearTimeout(s),(o=i)==null||o.disconnect(),i=null}function d(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),h();const u=e.getBoundingClientRect(),{left:m,top:f,width:y,height:S}=u;if(o||n(),!y||!S)return;const k=fu(f),w=fu(l.clientWidth-(m+y)),_=fu(l.clientHeight-(f+S)),b=fu(m),x={rootMargin:-k+"px "+-w+"px "+-_+"px "+-b+"px",threshold:On(0,Hi(1,c))||1};let E=!0;function M(R){const j=R[0].intersectionRatio;if(j!==c){if(!E)return d();j?d(!1,j):s=setTimeout(()=>{d(!1,1e-7)},1e3)}j===1&&!j1(u,e.getBoundingClientRect())&&d(),E=!1}try{i=new IntersectionObserver(M,{...x,root:l.ownerDocument})}catch{i=new IntersectionObserver(M,x)}i.observe(e)}return d(!0),h}function bM(e,n,i,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:h=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=Um(e),m=l||h?[...u?gl(u):[],...n?gl(n):[]]:[];m.forEach(b=>{l&&b.addEventListener("scroll",i,{passive:!0}),h&&b.addEventListener("resize",i)});const f=u&&o?yM(u,i):null;let y=-1,S=null;d&&(S=new ResizeObserver(b=>{let[v]=b;v&&v.target===u&&S&&n&&(S.unobserve(n),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var x;(x=S)==null||x.observe(n)})),i()}),u&&!c&&S.observe(u),n&&S.observe(n));let k,w=c?Cs(e):null;c&&_();function _(){const b=Cs(e);w&&!j1(w,b)&&i(),w=b,k=requestAnimationFrame(_)}return i(),()=>{var b;m.forEach(v=>{l&&v.removeEventListener("scroll",i),h&&v.removeEventListener("resize",i)}),f==null||f(),(b=S)==null||b.disconnect(),S=null,c&&cancelAnimationFrame(k)}}const xM=ZD,SM=QD,wM=KD,CM=eM,kM=YD,r0=WD,EM=JD,AM=(e,n,i)=>{const s=new Map,l={platform:_M,...i},h={...l.platform,_c:s};return GD(e,n,{...l,platform:h})};var TM=typeof document<"u",RM=function(){},wu=TM?T.useLayoutEffect:RM;function Ou(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let i,s,l;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==n.length)return!1;for(s=i;s--!==0;)if(!Ou(e[s],n[s]))return!1;return!0}if(l=Object.keys(e),i=l.length,i!==Object.keys(n).length)return!1;for(s=i;s--!==0;)if(!{}.hasOwnProperty.call(n,l[s]))return!1;for(s=i;s--!==0;){const h=l[s];if(!(h==="_owner"&&e.$$typeof)&&!Ou(e[h],n[h]))return!1}return!0}return e!==e&&n!==n}function O1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function i0(e,n){const i=O1(e);return Math.round(n*i)/i}function hp(e){const n=T.useRef(e);return wu(()=>{n.current=e}),n}function DM(e){e===void 0&&(e={});const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:l,elements:{reference:h,floating:d}={},transform:o=!0,whileElementsMounted:c,open:u}=e,[m,f]=T.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[y,S]=T.useState(s);Ou(y,s)||S(s);const[k,w]=T.useState(null),[_,b]=T.useState(null),v=T.useCallback(Q=>{Q!==R.current&&(R.current=Q,w(Q))},[]),x=T.useCallback(Q=>{Q!==j.current&&(j.current=Q,b(Q))},[]),E=h||k,M=d||_,R=T.useRef(null),j=T.useRef(null),D=T.useRef(m),O=c!=null,P=hp(c),U=hp(l),q=hp(u),$=T.useCallback(()=>{if(!R.current||!j.current)return;const Q={placement:n,strategy:i,middleware:y};U.current&&(Q.platform=U.current),AM(R.current,j.current,Q).then(F=>{const N={...F,isPositioned:q.current!==!1};K.current&&!Ou(D.current,N)&&(D.current=N,Al.flushSync(()=>{f(N)}))})},[y,n,i,U,q]);wu(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(Q=>({...Q,isPositioned:!1})))},[u]);const K=T.useRef(!1);wu(()=>(K.current=!0,()=>{K.current=!1}),[]),wu(()=>{if(E&&(R.current=E),M&&(j.current=M),E&&M){if(P.current)return P.current(E,M,$);$()}},[E,M,$,P,O]);const Y=T.useMemo(()=>({reference:R,floating:j,setReference:v,setFloating:x}),[v,x]),V=T.useMemo(()=>({reference:E,floating:M}),[E,M]),Z=T.useMemo(()=>{const Q={position:i,left:0,top:0};if(!V.floating)return Q;const F=i0(V.floating,m.x),N=i0(V.floating,m.y);return o?{...Q,transform:"translate("+F+"px, "+N+"px)",...O1(V.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:F,top:N}},[i,o,V.floating,m.x,m.y]);return T.useMemo(()=>({...m,update:$,refs:Y,elements:V,floatingStyles:Z}),[m,$,Y,V,Z])}const MM=e=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:s,padding:l}=typeof e=="function"?e(i):e;return s&&n(s)?s.current!=null?r0({element:s.current,padding:l}).fn(i):{}:s?r0({element:s,padding:l}).fn(i):{}}}},NM=(e,n)=>{const i=xM(e);return{name:i.name,fn:i.fn,options:[e,n]}},jM=(e,n)=>{const i=SM(e);return{name:i.name,fn:i.fn,options:[e,n]}},OM=(e,n)=>({fn:EM(e).fn,options:[e,n]}),LM=(e,n)=>{const i=wM(e);return{name:i.name,fn:i.fn,options:[e,n]}},IM=(e,n)=>{const i=CM(e);return{name:i.name,fn:i.fn,options:[e,n]}},BM=(e,n)=>{const i=kM(e);return{name:i.name,fn:i.fn,options:[e,n]}},zM=(e,n)=>{const i=MM(e);return{name:i.name,fn:i.fn,options:[e,n]}};var PM="Arrow",L1=T.forwardRef((e,n)=>{const{children:i,width:s=10,height:l=5,...h}=e;return g.jsx(je.svg,{...h,ref:n,width:s,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});L1.displayName=PM;var FM=L1,$m="Popper",[I1,Vi]=Bn($m),[HM,B1]=I1($m),z1=e=>{const{__scopePopper:n,children:i}=e,[s,l]=T.useState(null);return g.jsx(HM,{scope:n,anchor:s,onAnchorChange:l,children:i})};z1.displayName=$m;var P1="PopperAnchor",F1=T.forwardRef((e,n)=>{const{__scopePopper:i,virtualRef:s,...l}=e,h=B1(P1,i),d=T.useRef(null),o=Ye(n,d),c=T.useRef(null);return T.useEffect(()=>{const u=c.current;c.current=(s==null?void 0:s.current)||d.current,u!==c.current&&h.onAnchorChange(c.current)}),s?null:g.jsx(je.div,{...l,ref:o})});F1.displayName=P1;var qm="PopperContent",[UM,$M]=I1(qm),H1=T.forwardRef((e,n)=>{var W,H,ne,ae,pe,ue,Re,Ie;const{__scopePopper:i,side:s="bottom",sideOffset:l=0,align:h="center",alignOffset:d=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:m=0,sticky:f="partial",hideWhenDetached:y=!1,updatePositionStrategy:S="optimized",onPlaced:k,...w}=e,_=B1(qm,i),[b,v]=T.useState(null),x=Ye(n,Fe=>v(Fe)),[E,M]=T.useState(null),R=OD(E),j=(W=R==null?void 0:R.width)!=null?W:0,D=(H=R==null?void 0:R.height)!=null?H:0,O=s+(h!=="center"?"-"+h:""),P=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},U=Array.isArray(u)?u:[u],q=U.length>0,$={padding:P,boundary:U.filter(VM),altBoundary:q},{refs:K,floatingStyles:Y,placement:V,isPositioned:Z,middlewareData:Q}=DM({strategy:"fixed",placement:O,whileElementsMounted:(...Fe)=>bM(...Fe,{animationFrame:S==="always"}),elements:{reference:_.anchor},middleware:[NM({mainAxis:l+D,alignmentAxis:d}),c&&jM({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?OM():void 0,...$}),c&&LM({...$}),IM({...$,apply:({elements:Fe,rects:lt,availableWidth:De,availableHeight:en})=>{const{width:Wt,height:fn}=lt.reference,Kt=Fe.floating.style;Kt.setProperty("--radix-popper-available-width",`${De}px`),Kt.setProperty("--radix-popper-available-height",`${en}px`),Kt.setProperty("--radix-popper-anchor-width",`${Wt}px`),Kt.setProperty("--radix-popper-anchor-height",`${fn}px`)}}),E&&zM({element:E,padding:o}),GM({arrowWidth:j,arrowHeight:D}),y&&BM({strategy:"referenceHidden",...$})]}),[F,N]=q1(V),L=Jt(k);Vt(()=>{Z&&(L==null||L())},[Z,L]);const B=(ne=Q.arrow)==null?void 0:ne.x,z=(ae=Q.arrow)==null?void 0:ae.y,X=((pe=Q.arrow)==null?void 0:pe.centerOffset)!==0,[J,te]=T.useState();return Vt(()=>{b&&te(window.getComputedStyle(b).zIndex)},[b]),g.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:Z?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[(ue=Q.transformOrigin)==null?void 0:ue.x,(Re=Q.transformOrigin)==null?void 0:Re.y].join(" "),...((Ie=Q.hide)==null?void 0:Ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(UM,{scope:i,placedSide:F,onArrowChange:M,arrowX:B,arrowY:z,shouldHideArrow:X,children:g.jsx(je.div,{"data-side":F,"data-align":N,...w,ref:x,style:{...w.style,animation:Z?void 0:"none"}})})})});H1.displayName=qm;var U1="PopperArrow",qM={top:"bottom",right:"left",bottom:"top",left:"right"},$1=T.forwardRef(function(n,i){const{__scopePopper:s,...l}=n,h=$M(U1,s),d=qM[h.placedSide];return g.jsx("span",{ref:h.onArrowChange,style:{position:"absolute",left:h.arrowX,top:h.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[h.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[h.placedSide],visibility:h.shouldHideArrow?"hidden":void 0},children:g.jsx(FM,{...l,ref:i,style:{...l.style,display:"block"}})})});$1.displayName=U1;function VM(e){return e!==null}var GM=e=>({name:"transformOrigin",options:e,fn(n){var _,b,v,x,E;const{placement:i,rects:s,middlewareData:l}=n,d=((_=l.arrow)==null?void 0:_.centerOffset)!==0,o=d?0:e.arrowWidth,c=d?0:e.arrowHeight,[u,m]=q1(i),f={start:"0%",center:"50%",end:"100%"}[m],y=((v=(b=l.arrow)==null?void 0:b.x)!=null?v:0)+o/2,S=((E=(x=l.arrow)==null?void 0:x.y)!=null?E:0)+c/2;let k="",w="";return u==="bottom"?(k=d?f:`${y}px`,w=`${-c}px`):u==="top"?(k=d?f:`${y}px`,w=`${s.floating.height+c}px`):u==="right"?(k=`${-c}px`,w=d?f:`${S}px`):u==="left"&&(k=`${s.floating.width+c}px`,w=d?f:`${S}px`),{data:{x:k,y:w}}}});function q1(e){const[n,i="center"]=e.split("-");return[n,i]}var od=z1,jl=F1,ld=H1,cd=$1,fp="rovingFocusGroup.onEntryFocus",WM={bubbles:!1,cancelable:!0},Ol="RovingFocusGroup",[Qp,V1,KM]=Em(Ol),[YM,ud]=Bn(Ol,[KM]),[XM,ZM]=YM(Ol),G1=T.forwardRef((e,n)=>g.jsx(Qp.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Qp.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(QM,{...e,ref:n})})}));G1.displayName=Ol;var QM=T.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:i,orientation:s,loop:l=!1,dir:h,currentTabStopId:d,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:m=!1,...f}=e,y=T.useRef(null),S=Ye(n,y),k=Rl(h),[w,_]=Jr({prop:d,defaultProp:o!=null?o:null,onChange:c,caller:Ol}),[b,v]=T.useState(!1),x=Jt(u),E=V1(i),M=T.useRef(!1),[R,j]=T.useState(0);return T.useEffect(()=>{const D=y.current;if(D)return D.addEventListener(fp,x),()=>D.removeEventListener(fp,x)},[x]),g.jsx(XM,{scope:i,orientation:s,dir:k,loop:l,currentTabStopId:w,onItemFocus:T.useCallback(D=>_(D),[_]),onItemShiftTab:T.useCallback(()=>v(!0),[]),onFocusableItemAdd:T.useCallback(()=>j(D=>D+1),[]),onFocusableItemRemove:T.useCallback(()=>j(D=>D-1),[]),children:g.jsx(je.div,{tabIndex:b||R===0?-1:0,"data-orientation":s,...f,ref:S,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{M.current=!0}),onFocus:Ce(e.onFocus,D=>{const O=!M.current;if(D.target===D.currentTarget&&O&&!b){const P=new CustomEvent(fp,WM);if(D.currentTarget.dispatchEvent(P),!P.defaultPrevented){const U=E().filter(V=>V.focusable),q=U.find(V=>V.active),$=U.find(V=>V.id===w),Y=[q,$,...U].filter(Boolean).map(V=>V.ref.current);Y1(Y,m)}}M.current=!1}),onBlur:Ce(e.onBlur,()=>v(!1))})})}),W1="RovingFocusGroupItem",K1=T.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:i,focusable:s=!0,active:l=!1,tabStopId:h,children:d,...o}=e,c=Ut(),u=h||c,m=ZM(W1,i),f=m.currentTabStopId===u,y=V1(i),{onFocusableItemAdd:S,onFocusableItemRemove:k,currentTabStopId:w}=m;return T.useEffect(()=>{if(s)return S(),()=>k()},[s,S,k]),g.jsx(Qp.ItemSlot,{scope:i,id:u,focusable:s,active:l,children:g.jsx(je.span,{tabIndex:f?0:-1,"data-orientation":m.orientation,...o,ref:n,onMouseDown:Ce(e.onMouseDown,_=>{s?m.onItemFocus(u):_.preventDefault()}),onFocus:Ce(e.onFocus,()=>m.onItemFocus(u)),onKeyDown:Ce(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){m.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const b=tN(_,m.orientation,m.dir);if(b!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let x=y().filter(E=>E.focusable).map(E=>E.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const E=x.indexOf(_.currentTarget);x=m.loop?nN(x,E+1):x.slice(E+1)}setTimeout(()=>Y1(x))}}),children:typeof d=="function"?d({isCurrentTabStop:f,hasTabStop:w!=null}):d})})});K1.displayName=W1;var JM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eN(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tN(e,n,i){const s=eN(e.key,i);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return JM[s]}function Y1(e,n=!1){const i=document.activeElement;for(const s of e)if(s===i||(s.focus({preventScroll:n}),document.activeElement!==i))return}function nN(e,n){return e.map((i,s)=>e[(n+s)%e.length])}var X1=G1,Z1=K1,Jp=["Enter"," "],rN=["ArrowDown","PageUp","Home"],Q1=["ArrowUp","PageDown","End"],iN=[...rN,...Q1],sN={ltr:[...Jp,"ArrowRight"],rtl:[...Jp,"ArrowLeft"]},aN={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ll="Menu",[vl,oN,lN]=Em(Ll),[Rs,J1]=Bn(Ll,[lN,Vi,ud]),dd=Vi(),eS=ud(),[cN,Ds]=Rs(Ll),[uN,Il]=Rs(Ll),tS=e=>{const{__scopeMenu:n,open:i=!1,children:s,dir:l,onOpenChange:h,modal:d=!0}=e,o=dd(n),[c,u]=T.useState(null),m=T.useRef(!1),f=Jt(h),y=Rl(l);return T.useEffect(()=>{const S=()=>{m.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},k=()=>m.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),g.jsx(od,{...o,children:g.jsx(cN,{scope:n,open:i,onOpenChange:f,content:c,onContentChange:u,children:g.jsx(uN,{scope:n,onClose:T.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:m,dir:y,modal:d,children:s})})})};tS.displayName=Ll;var dN="MenuAnchor",Vm=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e,l=dd(i);return g.jsx(jl,{...l,...s,ref:n})});Vm.displayName=dN;var Gm="MenuPortal",[hN,nS]=Rs(Gm,{forceMount:void 0}),rS=e=>{const{__scopeMenu:n,forceMount:i,children:s,container:l}=e,h=Ds(Gm,n);return g.jsx(hN,{scope:n,forceMount:i,children:g.jsx(Gt,{present:i||h.open,children:g.jsx(Va,{asChild:!0,container:l,children:s})})})};rS.displayName=Gm;var Jn="MenuContent",[fN,Wm]=Rs(Jn),iS=T.forwardRef((e,n)=>{const i=nS(Jn,e.__scopeMenu),{forceMount:s=i.forceMount,...l}=e,h=Ds(Jn,e.__scopeMenu),d=Il(Jn,e.__scopeMenu);return g.jsx(vl.Provider,{scope:e.__scopeMenu,children:g.jsx(Gt,{present:s||h.open,children:g.jsx(vl.Slot,{scope:e.__scopeMenu,children:d.modal?g.jsx(pN,{...l,ref:n}):g.jsx(mN,{...l,ref:n})})})})}),pN=T.forwardRef((e,n)=>{const i=Ds(Jn,e.__scopeMenu),s=T.useRef(null),l=Ye(n,s);return T.useEffect(()=>{const h=s.current;if(h)return ed(h)},[]),g.jsx(Km,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})}),mN=T.forwardRef((e,n)=>{const i=Ds(Jn,e.__scopeMenu);return g.jsx(Km,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})}),gN=Fi("MenuContent.ScrollLock"),Km=T.forwardRef((e,n)=>{const{__scopeMenu:i,loop:s=!1,trapFocus:l,onOpenAutoFocus:h,onCloseAutoFocus:d,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:y,onDismiss:S,disableOutsideScroll:k,...w}=e,_=Ds(Jn,i),b=Il(Jn,i),v=dd(i),x=eS(i),E=oN(i),[M,R]=T.useState(null),j=T.useRef(null),D=Ye(n,j,_.onContentChange),O=T.useRef(0),P=T.useRef(""),U=T.useRef(0),q=T.useRef(null),$=T.useRef("right"),K=T.useRef(0),Y=k?Ml:T.Fragment,V=k?{as:gN,allowPinchZoom:!0}:void 0,Z=F=>{var W,H;const N=P.current+F,L=E().filter(ne=>!ne.disabled),B=document.activeElement,z=(W=L.find(ne=>ne.ref.current===B))==null?void 0:W.textValue,X=L.map(ne=>ne.textValue),J=TN(X,N,z),te=(H=L.find(ne=>ne.textValue===J))==null?void 0:H.ref.current;(function ne(ae){P.current=ae,window.clearTimeout(O.current),ae!==""&&(O.current=window.setTimeout(()=>ne(""),1e3))})(N),te&&setTimeout(()=>te.focus())};T.useEffect(()=>()=>window.clearTimeout(O.current),[]),Qu();const Q=T.useCallback(F=>{var L,B;return $.current===((L=q.current)==null?void 0:L.side)&&DN(F,(B=q.current)==null?void 0:B.area)},[]);return g.jsx(fN,{scope:i,searchRef:P,onItemEnter:T.useCallback(F=>{Q(F)&&F.preventDefault()},[Q]),onItemLeave:T.useCallback(F=>{var N;Q(F)||((N=j.current)==null||N.focus(),R(null))},[Q]),onTriggerLeave:T.useCallback(F=>{Q(F)&&F.preventDefault()},[Q]),pointerGraceTimerRef:U,onPointerGraceIntentChange:T.useCallback(F=>{q.current=F},[]),children:g.jsx(Y,{...V,children:g.jsx(Dl,{asChild:!0,trapped:l,onMountAutoFocus:Ce(h,F=>{var N;F.preventDefault(),(N=j.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:g.jsx(qa,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:y,onDismiss:S,children:g.jsx(X1,{asChild:!0,...x,dir:b.dir,orientation:"vertical",loop:s,currentTabStopId:M,onCurrentTabStopIdChange:R,onEntryFocus:Ce(c,F=>{b.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(ld,{role:"menu","aria-orientation":"vertical","data-state":bS(_.open),"data-radix-menu-content":"",dir:b.dir,...v,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:Ce(w.onKeyDown,F=>{const L=F.target.closest("[data-radix-menu-content]")===F.currentTarget,B=F.ctrlKey||F.altKey||F.metaKey,z=F.key.length===1;L&&(F.key==="Tab"&&F.preventDefault(),!B&&z&&Z(F.key));const X=j.current;if(F.target!==X||!iN.includes(F.key))return;F.preventDefault();const te=E().filter(W=>!W.disabled).map(W=>W.ref.current);Q1.includes(F.key)&&te.reverse(),EN(te)}),onBlur:Ce(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(O.current),P.current="")}),onPointerMove:Ce(e.onPointerMove,_l(F=>{const N=F.target,L=K.current!==F.clientX;if(F.currentTarget.contains(N)&&L){const B=F.clientX>K.current?"right":"left";$.current=B,K.current=F.clientX}}))})})})})})})});iS.displayName=Jn;var vN="MenuGroup",Ym=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return g.jsx(je.div,{role:"group",...s,ref:n})});Ym.displayName=vN;var _N="MenuLabel",sS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return g.jsx(je.div,{...s,ref:n})});sS.displayName=_N;var Lu="MenuItem",s0="menu.itemSelect",hd=T.forwardRef((e,n)=>{const{disabled:i=!1,onSelect:s,...l}=e,h=T.useRef(null),d=Il(Lu,e.__scopeMenu),o=Wm(Lu,e.__scopeMenu),c=Ye(n,h),u=T.useRef(!1),m=()=>{const f=h.current;if(!i&&f){const y=new CustomEvent(s0,{bubbles:!0,cancelable:!0});f.addEventListener(s0,S=>s==null?void 0:s(S),{once:!0}),Ux(f,y),y.defaultPrevented?u.current=!1:d.onClose()}};return g.jsx(aS,{...l,ref:c,disabled:i,onClick:Ce(e.onClick,m),onPointerDown:f=>{var y;(y=e.onPointerDown)==null||y.call(e,f),u.current=!0},onPointerUp:Ce(e.onPointerUp,f=>{var y;u.current||(y=f.currentTarget)==null||y.click()}),onKeyDown:Ce(e.onKeyDown,f=>{const y=o.searchRef.current!=="";i||y&&f.key===" "||Jp.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});hd.displayName=Lu;var aS=T.forwardRef((e,n)=>{const{__scopeMenu:i,disabled:s=!1,textValue:l,...h}=e,d=Wm(Lu,i),o=eS(i),c=T.useRef(null),u=Ye(n,c),[m,f]=T.useState(!1),[y,S]=T.useState("");return T.useEffect(()=>{var w;const k=c.current;k&&S(((w=k.textContent)!=null?w:"").trim())},[h.children]),g.jsx(vl.ItemSlot,{scope:i,disabled:s,textValue:l!=null?l:y,children:g.jsx(Z1,{asChild:!0,...o,focusable:!s,children:g.jsx(je.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...h,ref:u,onPointerMove:Ce(e.onPointerMove,_l(k=>{s?d.onItemLeave(k):(d.onItemEnter(k),k.defaultPrevented||k.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,_l(k=>d.onItemLeave(k))),onFocus:Ce(e.onFocus,()=>f(!0)),onBlur:Ce(e.onBlur,()=>f(!1))})})})}),yN="MenuCheckboxItem",oS=T.forwardRef((e,n)=>{const{checked:i=!1,onCheckedChange:s,...l}=e;return g.jsx(hS,{scope:e.__scopeMenu,checked:i,children:g.jsx(hd,{role:"menuitemcheckbox","aria-checked":Iu(i)?"mixed":i,...l,ref:n,"data-state":Zm(i),onSelect:Ce(l.onSelect,()=>s==null?void 0:s(Iu(i)?!0:!i),{checkForDefaultPrevented:!1})})})});oS.displayName=yN;var lS="MenuRadioGroup",[bN,xN]=Rs(lS,{value:void 0,onValueChange:()=>{}}),cS=T.forwardRef((e,n)=>{const{value:i,onValueChange:s,...l}=e,h=Jt(s);return g.jsx(bN,{scope:e.__scopeMenu,value:i,onValueChange:h,children:g.jsx(Ym,{...l,ref:n})})});cS.displayName=lS;var uS="MenuRadioItem",dS=T.forwardRef((e,n)=>{const{value:i,...s}=e,l=xN(uS,e.__scopeMenu),h=i===l.value;return g.jsx(hS,{scope:e.__scopeMenu,checked:h,children:g.jsx(hd,{role:"menuitemradio","aria-checked":h,...s,ref:n,"data-state":Zm(h),onSelect:Ce(s.onSelect,()=>{var d;return(d=l.onValueChange)==null?void 0:d.call(l,i)},{checkForDefaultPrevented:!1})})})});dS.displayName=uS;var Xm="MenuItemIndicator",[hS,SN]=Rs(Xm,{checked:!1}),fS=T.forwardRef((e,n)=>{const{__scopeMenu:i,forceMount:s,...l}=e,h=SN(Xm,i);return g.jsx(Gt,{present:s||Iu(h.checked)||h.checked===!0,children:g.jsx(je.span,{...l,ref:n,"data-state":Zm(h.checked)})})});fS.displayName=Xm;var wN="MenuSeparator",pS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return g.jsx(je.div,{role:"separator","aria-orientation":"horizontal",...s,ref:n})});pS.displayName=wN;var CN="MenuArrow",mS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e,l=dd(i);return g.jsx(cd,{...l,...s,ref:n})});mS.displayName=CN;var kN="MenuSub",[s7,gS]=Rs(kN),al="MenuSubTrigger",vS=T.forwardRef((e,n)=>{const i=Ds(al,e.__scopeMenu),s=Il(al,e.__scopeMenu),l=gS(al,e.__scopeMenu),h=Wm(al,e.__scopeMenu),d=T.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=h,u={__scopeMenu:e.__scopeMenu},m=T.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return T.useEffect(()=>m,[m]),T.useEffect(()=>{const f=o.current;return()=>{window.clearTimeout(f),c(null)}},[o,c]),g.jsx(Vm,{asChild:!0,...u,children:g.jsx(aS,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":l.contentId,"data-state":bS(i.open),...e,ref:Qr(n,l.onTriggerChange),onClick:f=>{var y;(y=e.onClick)==null||y.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,_l(f=>{h.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!i.open&&!d.current&&(h.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{i.onOpenChange(!0),m()},100))})),onPointerLeave:Ce(e.onPointerLeave,_l(f=>{var S,k;m();const y=(S=i.content)==null?void 0:S.getBoundingClientRect();if(y){const w=(k=i.content)==null?void 0:k.dataset.side,_=w==="right",b=_?-5:5,v=y[_?"left":"right"],x=y[_?"right":"left"];h.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x:v,y:y.top},{x,y:y.top},{x,y:y.bottom},{x:v,y:y.bottom}],side:w}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>h.onPointerGraceIntentChange(null),300)}else{if(h.onTriggerLeave(f),f.defaultPrevented)return;h.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,f=>{var S;const y=h.searchRef.current!=="";e.disabled||y&&f.key===" "||sN[s.dir].includes(f.key)&&(i.onOpenChange(!0),(S=i.content)==null||S.focus(),f.preventDefault())})})})});vS.displayName=al;var _S="MenuSubContent",yS=T.forwardRef((e,n)=>{const i=nS(Jn,e.__scopeMenu),{forceMount:s=i.forceMount,...l}=e,h=Ds(Jn,e.__scopeMenu),d=Il(Jn,e.__scopeMenu),o=gS(_S,e.__scopeMenu),c=T.useRef(null),u=Ye(n,c);return g.jsx(vl.Provider,{scope:e.__scopeMenu,children:g.jsx(Gt,{present:s||h.open,children:g.jsx(vl.Slot,{scope:e.__scopeMenu,children:g.jsx(Km,{id:o.contentId,"aria-labelledby":o.triggerId,...l,ref:u,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var f;d.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,m=>{m.target!==o.trigger&&h.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,m=>{d.onClose(),m.preventDefault()}),onKeyDown:Ce(e.onKeyDown,m=>{var S;const f=m.currentTarget.contains(m.target),y=aN[d.dir].includes(m.key);f&&y&&(h.onOpenChange(!1),(S=o.trigger)==null||S.focus(),m.preventDefault())})})})})})});yS.displayName=_S;function bS(e){return e?"open":"closed"}function Iu(e){return e==="indeterminate"}function Zm(e){return Iu(e)?"indeterminate":e?"checked":"unchecked"}function EN(e){const n=document.activeElement;for(const i of e)if(i===n||(i.focus(),document.activeElement!==n))return}function AN(e,n){return e.map((i,s)=>e[(n+s)%e.length])}function TN(e,n,i){const l=n.length>1&&Array.from(n).every(u=>u===n[0])?n[0]:n,h=i?e.indexOf(i):-1;let d=AN(e,Math.max(h,0));l.length===1&&(d=d.filter(u=>u!==i));const c=d.find(u=>u.toLowerCase().startsWith(l.toLowerCase()));return c!==i?c:void 0}function RN(e,n){const{x:i,y:s}=e;let l=!1;for(let h=0,d=n.length-1;h<n.length;d=h++){const o=n[h],c=n[d],u=o.x,m=o.y,f=c.x,y=c.y;m>s!=y>s&&i<(f-u)*(s-m)/(y-m)+u&&(l=!l)}return l}function DN(e,n){if(!n)return!1;const i={x:e.clientX,y:e.clientY};return RN(i,n)}function _l(e){return n=>n.pointerType==="mouse"?e(n):void 0}var MN=tS,NN=Vm,jN=rS,ON=iS,LN=Ym,IN=sS,BN=hd,zN=oS,PN=cS,FN=dS,HN=fS,UN=pS,$N=mS,qN=vS,VN=yS,fd="DropdownMenu",[GN]=Bn(fd,[J1]),hn=J1(),[WN,xS]=GN(fd),SS=e=>{const{__scopeDropdownMenu:n,children:i,dir:s,open:l,defaultOpen:h,onOpenChange:d,modal:o=!0}=e,c=hn(n),u=T.useRef(null),[m,f]=Jr({prop:l,defaultProp:h!=null?h:!1,onChange:d,caller:fd});return g.jsx(WN,{scope:n,triggerId:Ut(),triggerRef:u,contentId:Ut(),open:m,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(y=>!y),[f]),modal:o,children:g.jsx(MN,{...c,open:m,onOpenChange:f,dir:s,modal:o,children:i})})};SS.displayName=fd;var wS="DropdownMenuTrigger",CS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,disabled:s=!1,...l}=e,h=xS(wS,i),d=hn(i);return g.jsx(NN,{asChild:!0,...d,children:g.jsx(je.button,{type:"button",id:h.triggerId,"aria-haspopup":"menu","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":h.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...l,ref:Qr(n,h.triggerRef),onPointerDown:Ce(e.onPointerDown,o=>{!s&&o.button===0&&o.ctrlKey===!1&&(h.onOpenToggle(),h.open||o.preventDefault())}),onKeyDown:Ce(e.onKeyDown,o=>{s||(["Enter"," "].includes(o.key)&&h.onOpenToggle(),o.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});CS.displayName=wS;var KN="DropdownMenuPortal",kS=e=>{const{__scopeDropdownMenu:n,...i}=e,s=hn(n);return g.jsx(jN,{...s,...i})};kS.displayName=KN;var ES="DropdownMenuContent",AS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=xS(ES,i),h=hn(i),d=T.useRef(!1);return g.jsx(ON,{id:l.contentId,"aria-labelledby":l.triggerId,...h,...s,ref:n,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var c;d.current||(c=l.triggerRef.current)==null||c.focus(),d.current=!1,o.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,m=c.button===2||u;(!l.modal||m)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});AS.displayName=ES;var YN="DropdownMenuGroup",XN=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(LN,{...l,...s,ref:n})});XN.displayName=YN;var ZN="DropdownMenuLabel",QN=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(IN,{...l,...s,ref:n})});QN.displayName=ZN;var JN="DropdownMenuItem",TS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(BN,{...l,...s,ref:n})});TS.displayName=JN;var e3="DropdownMenuCheckboxItem",t3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(zN,{...l,...s,ref:n})});t3.displayName=e3;var n3="DropdownMenuRadioGroup",r3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(PN,{...l,...s,ref:n})});r3.displayName=n3;var i3="DropdownMenuRadioItem",s3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(FN,{...l,...s,ref:n})});s3.displayName=i3;var a3="DropdownMenuItemIndicator",o3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(HN,{...l,...s,ref:n})});o3.displayName=a3;var l3="DropdownMenuSeparator",c3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(UN,{...l,...s,ref:n})});c3.displayName=l3;var u3="DropdownMenuArrow",d3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx($N,{...l,...s,ref:n})});d3.displayName=u3;var h3="DropdownMenuSubTrigger",f3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(qN,{...l,...s,ref:n})});f3.displayName=h3;var p3="DropdownMenuSubContent",m3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=hn(i);return g.jsx(VN,{...l,...s,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});m3.displayName=p3;var g3=SS,v3=CS,_3=kS,y3=AS,b3=TS,x3="Label",RS=T.forwardRef((e,n)=>g.jsx(je.label,{...e,ref:n,onMouseDown:i=>{var l;i.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}}));RS.displayName=x3;var S3=RS;function em(e,[n,i]){return Math.min(i,Math.max(n,e))}var pd="Popover",[DS]=Bn(pd,[Vi]),Bl=Vi(),[w3,Gi]=DS(pd),MS=e=>{const{__scopePopover:n,children:i,open:s,defaultOpen:l,onOpenChange:h,modal:d=!1}=e,o=Bl(n),c=T.useRef(null),[u,m]=T.useState(!1),[f,y]=Jr({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:pd});return g.jsx(od,{...o,children:g.jsx(w3,{scope:n,contentId:Ut(),triggerRef:c,open:f,onOpenChange:y,onOpenToggle:T.useCallback(()=>y(S=>!S),[y]),hasCustomAnchor:u,onCustomAnchorAdd:T.useCallback(()=>m(!0),[]),onCustomAnchorRemove:T.useCallback(()=>m(!1),[]),modal:d,children:i})})};MS.displayName=pd;var NS="PopoverAnchor",jS=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Gi(NS,i),h=Bl(i),{onCustomAnchorAdd:d,onCustomAnchorRemove:o}=l;return T.useEffect(()=>(d(),()=>o()),[d,o]),g.jsx(jl,{...h,...s,ref:n})});jS.displayName=NS;var OS="PopoverTrigger",LS=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Gi(OS,i),h=Bl(i),d=Ye(n,l.triggerRef),o=g.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":FS(l.open),...s,ref:d,onClick:Ce(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?o:g.jsx(jl,{asChild:!0,...h,children:o})});LS.displayName=OS;var Qm="PopoverPortal",[C3,k3]=DS(Qm,{forceMount:void 0}),IS=e=>{const{__scopePopover:n,forceMount:i,children:s,container:l}=e,h=Gi(Qm,n);return g.jsx(C3,{scope:n,forceMount:i,children:g.jsx(Gt,{present:i||h.open,children:g.jsx(Va,{asChild:!0,container:l,children:s})})})};IS.displayName=Qm;var Da="PopoverContent",BS=T.forwardRef((e,n)=>{const i=k3(Da,e.__scopePopover),{forceMount:s=i.forceMount,...l}=e,h=Gi(Da,e.__scopePopover);return g.jsx(Gt,{present:s||h.open,children:h.modal?g.jsx(A3,{...l,ref:n}):g.jsx(T3,{...l,ref:n})})});BS.displayName=Da;var E3=Fi("PopoverContent.RemoveScroll"),A3=T.forwardRef((e,n)=>{const i=Gi(Da,e.__scopePopover),s=T.useRef(null),l=Ye(n,s),h=T.useRef(!1);return T.useEffect(()=>{const d=s.current;if(d)return ed(d)},[]),g.jsx(Ml,{as:E3,allowPinchZoom:!0,children:g.jsx(zS,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,d=>{var o;d.preventDefault(),h.current||(o=i.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,d=>{const o=d.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;h.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1})})})}),T3=T.forwardRef((e,n)=>{const i=Gi(Da,e.__scopePopover),s=T.useRef(!1),l=T.useRef(!1);return g.jsx(zS,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var d,o;(d=e.onCloseAutoFocus)==null||d.call(e,h),h.defaultPrevented||(s.current||(o=i.triggerRef.current)==null||o.focus(),h.preventDefault()),s.current=!1,l.current=!1},onInteractOutside:h=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,h),h.defaultPrevented||(s.current=!0,h.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=h.target;((u=i.triggerRef.current)==null?void 0:u.contains(d))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&l.current&&h.preventDefault()}})}),zS=T.forwardRef((e,n)=>{const{__scopePopover:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:h,disableOutsidePointerEvents:d,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:m,...f}=e,y=Gi(Da,i),S=Bl(i);return Qu(),g.jsx(Dl,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:h,children:g.jsx(qa,{asChild:!0,disableOutsidePointerEvents:d,onInteractOutside:m,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>y.onOpenChange(!1),children:g.jsx(ld,{"data-state":FS(y.open),role:"dialog",id:y.contentId,...S,...f,ref:n,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),PS="PopoverClose",R3=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Gi(PS,i);return g.jsx(je.button,{type:"button",...s,ref:n,onClick:Ce(e.onClick,()=>l.onOpenChange(!1))})});R3.displayName=PS;var D3="PopoverArrow",M3=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Bl(i);return g.jsx(cd,{...l,...s,ref:n})});M3.displayName=D3;function FS(e){return e?"open":"closed"}var N3=MS,j3=jS,O3=LS,L3=IS,I3=BS,Jm="Progress",eg=100,[B3]=Bn(Jm),[z3,P3]=B3(Jm),HS=T.forwardRef((e,n)=>{const{__scopeProgress:i,value:s=null,max:l,getValueLabel:h=F3,...d}=e;(l||l===0)&&!a0(l)&&console.error(H3(`${l}`,"Progress"));const o=a0(l)?l:eg;s!==null&&!o0(s,o)&&console.error(U3(`${s}`,"Progress"));const c=o0(s,o)?s:null,u=Bu(c)?h(c,o):void 0;return g.jsx(z3,{scope:i,value:c,max:o,children:g.jsx(je.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":Bu(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":qS(c,o),"data-value":c!=null?c:void 0,"data-max":o,...d,ref:n})})});HS.displayName=Jm;var US="ProgressIndicator",$S=T.forwardRef((e,n)=>{var h;const{__scopeProgress:i,...s}=e,l=P3(US,i);return g.jsx(je.div,{"data-state":qS(l.value,l.max),"data-value":(h=l.value)!=null?h:void 0,"data-max":l.max,...s,ref:n})});$S.displayName=US;function F3(e,n){return`${Math.round(e/n*100)}%`}function qS(e,n){return e==null?"indeterminate":e===n?"complete":"loading"}function Bu(e){return typeof e=="number"}function a0(e){return Bu(e)&&!isNaN(e)&&e>0}function o0(e,n){return Bu(e)&&!isNaN(e)&&e<=n&&e>=0}function H3(e,n){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${n}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${eg}\`.`}function U3(e,n){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${n}\`. The \`value\` prop must be:
439
- - a positive number
440
- - less than the value passed to \`max\` (or ${eg} if no \`max\` prop is set)
441
- - \`null\` or \`undefined\` if the progress is indeterminate.
442
-
443
- Defaulting to \`null\`.`}var $3=HS,q3=$S;function V3(e,n){return T.useReducer((i,s)=>{const l=n[i][s];return l!=null?l:i},e)}var tg="ScrollArea",[VS]=Bn(tg),[G3,er]=VS(tg),GS=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,type:s="hover",dir:l,scrollHideDelay:h=600,...d}=e,[o,c]=T.useState(null),[u,m]=T.useState(null),[f,y]=T.useState(null),[S,k]=T.useState(null),[w,_]=T.useState(null),[b,v]=T.useState(0),[x,E]=T.useState(0),[M,R]=T.useState(!1),[j,D]=T.useState(!1),O=Ye(n,U=>c(U)),P=Rl(l);return g.jsx(G3,{scope:i,type:s,dir:P,scrollHideDelay:h,scrollArea:o,viewport:u,onViewportChange:m,content:f,onContentChange:y,scrollbarX:S,onScrollbarXChange:k,scrollbarXEnabled:M,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:_,scrollbarYEnabled:j,onScrollbarYEnabledChange:D,onCornerWidthChange:v,onCornerHeightChange:E,children:g.jsx(je.div,{dir:P,...d,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});GS.displayName=tg;var WS="ScrollAreaViewport",KS=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,children:s,nonce:l,...h}=e,d=er(WS,i),o=T.useRef(null),c=Ye(n,o,d.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),g.jsx(je.div,{"data-radix-scroll-area-viewport":"",...h,ref:c,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:g.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});KS.displayName=WS;var kr="ScrollAreaScrollbar",YS=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=er(kr,e.__scopeScrollArea),{onScrollbarXEnabledChange:h,onScrollbarYEnabledChange:d}=l,o=e.orientation==="horizontal";return T.useEffect(()=>(o?h(!0):d(!0),()=>{o?h(!1):d(!1)}),[o,h,d]),l.type==="hover"?g.jsx(W3,{...s,ref:n,forceMount:i}):l.type==="scroll"?g.jsx(K3,{...s,ref:n,forceMount:i}):l.type==="auto"?g.jsx(XS,{...s,ref:n,forceMount:i}):l.type==="always"?g.jsx(ng,{...s,ref:n}):null});YS.displayName=kr;var W3=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=er(kr,e.__scopeScrollArea),[h,d]=T.useState(!1);return T.useEffect(()=>{const o=l.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),d(!0)},m=()=>{c=window.setTimeout(()=>d(!1),l.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",m),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",m)}}},[l.scrollArea,l.scrollHideDelay]),g.jsx(Gt,{present:i||h,children:g.jsx(XS,{"data-state":h?"visible":"hidden",...s,ref:n})})}),K3=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=er(kr,e.__scopeScrollArea),h=e.orientation==="horizontal",d=gd(()=>c("SCROLL_END"),100),[o,c]=V3("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return T.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,l.scrollHideDelay,c]),T.useEffect(()=>{const u=l.viewport,m=h?"scrollLeft":"scrollTop";if(u){let f=u[m];const y=()=>{const S=u[m];f!==S&&(c("SCROLL"),d()),f=S};return u.addEventListener("scroll",y),()=>u.removeEventListener("scroll",y)}},[l.viewport,h,c,d]),g.jsx(Gt,{present:i||o!=="hidden",children:g.jsx(ng,{"data-state":o==="hidden"?"hidden":"visible",...s,ref:n,onPointerEnter:Ce(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),XS=T.forwardRef((e,n)=>{const i=er(kr,e.__scopeScrollArea),{forceMount:s,...l}=e,[h,d]=T.useState(!1),o=e.orientation==="horizontal",c=gd(()=>{if(i.viewport){const u=i.viewport.offsetWidth<i.viewport.scrollWidth,m=i.viewport.offsetHeight<i.viewport.scrollHeight;d(o?u:m)}},10);return Ma(i.viewport,c),Ma(i.content,c),g.jsx(Gt,{present:s||h,children:g.jsx(ng,{"data-state":h?"visible":"hidden",...l,ref:n})})}),ng=T.forwardRef((e,n)=>{const{orientation:i="vertical",...s}=e,l=er(kr,e.__scopeScrollArea),h=T.useRef(null),d=T.useRef(0),[o,c]=T.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=tw(o.viewport,o.content),m={...s,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:y=>h.current=y,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:y=>d.current=y};function f(y,S){return ej(y,d.current,o,S)}return i==="horizontal"?g.jsx(Y3,{...m,ref:n,onThumbPositionChange:()=>{if(l.viewport&&h.current){const y=l.viewport.scrollLeft,S=l0(y,o,l.dir);h.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollLeft=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollLeft=f(y,l.dir))}}):i==="vertical"?g.jsx(X3,{...m,ref:n,onThumbPositionChange:()=>{if(l.viewport&&h.current){const y=l.viewport.scrollTop,S=l0(y,o);h.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:y=>{l.viewport&&(l.viewport.scrollTop=y)},onDragScroll:y=>{l.viewport&&(l.viewport.scrollTop=f(y))}}):null}),Y3=T.forwardRef((e,n)=>{const{sizes:i,onSizesChange:s,...l}=e,h=er(kr,e.__scopeScrollArea),[d,o]=T.useState(),c=T.useRef(null),u=Ye(n,c,h.onScrollbarXChange);return T.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),g.jsx(QS,{"data-orientation":"horizontal",...l,ref:u,sizes:i,style:{bottom:0,left:h.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:h.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":md(i)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,f)=>{if(h.viewport){const y=h.viewport.scrollLeft+m.deltaX;e.onWheelScroll(y),rw(y,f)&&m.preventDefault()}},onResize:()=>{c.current&&h.viewport&&d&&s({content:h.viewport.scrollWidth,viewport:h.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Pu(d.paddingLeft),paddingEnd:Pu(d.paddingRight)}})}})}),X3=T.forwardRef((e,n)=>{const{sizes:i,onSizesChange:s,...l}=e,h=er(kr,e.__scopeScrollArea),[d,o]=T.useState(),c=T.useRef(null),u=Ye(n,c,h.onScrollbarYChange);return T.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),g.jsx(QS,{"data-orientation":"vertical",...l,ref:u,sizes:i,style:{top:0,right:h.dir==="ltr"?0:void 0,left:h.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":md(i)+"px",...e.style},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,f)=>{if(h.viewport){const y=h.viewport.scrollTop+m.deltaY;e.onWheelScroll(y),rw(y,f)&&m.preventDefault()}},onResize:()=>{c.current&&h.viewport&&d&&s({content:h.viewport.scrollHeight,viewport:h.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Pu(d.paddingTop),paddingEnd:Pu(d.paddingBottom)}})}})}),[Z3,ZS]=VS(kr),QS=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,sizes:s,hasThumb:l,onThumbChange:h,onThumbPointerUp:d,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:m,onResize:f,...y}=e,S=er(kr,i),[k,w]=T.useState(null),_=Ye(n,O=>w(O)),b=T.useRef(null),v=T.useRef(""),x=S.viewport,E=s.content-s.viewport,M=Jt(m),R=Jt(c),j=gd(f,10);function D(O){if(b.current){const P=O.clientX-b.current.left,U=O.clientY-b.current.top;u({x:P,y:U})}}return T.useEffect(()=>{const O=P=>{const U=P.target;(k==null?void 0:k.contains(U))&&M(P,E)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[x,k,E,M]),T.useEffect(R,[s,R]),Ma(k,j),Ma(S.content,j),g.jsx(Z3,{scope:i,scrollbar:k,hasThumb:l,onThumbChange:Jt(h),onThumbPointerUp:Jt(d),onThumbPositionChange:R,onThumbPointerDown:Jt(o),children:g.jsx(je.div,{...y,ref:_,style:{position:"absolute",...y.style},onPointerDown:Ce(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),b.current=k.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),D(O))}),onPointerMove:Ce(e.onPointerMove,D),onPointerUp:Ce(e.onPointerUp,O=>{const P=O.target;P.hasPointerCapture(O.pointerId)&&P.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=v.current,S.viewport&&(S.viewport.style.scrollBehavior=""),b.current=null})})})}),zu="ScrollAreaThumb",JS=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=ZS(zu,e.__scopeScrollArea);return g.jsx(Gt,{present:i||l.hasThumb,children:g.jsx(Q3,{ref:n,...s})})}),Q3=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,style:s,...l}=e,h=er(zu,i),d=ZS(zu,i),{onThumbPositionChange:o}=d,c=Ye(n,f=>d.onThumbChange(f)),u=T.useRef(void 0),m=gd(()=>{u.current&&(u.current(),u.current=void 0)},100);return T.useEffect(()=>{const f=h.viewport;if(f){const y=()=>{if(m(),!u.current){const S=tj(f,o);u.current=S,o()}};return o(),f.addEventListener("scroll",y),()=>f.removeEventListener("scroll",y)}},[h.viewport,m,o]),g.jsx(je.div,{"data-state":d.hasThumb?"visible":"hidden",...l,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Ce(e.onPointerDownCapture,f=>{const S=f.target.getBoundingClientRect(),k=f.clientX-S.left,w=f.clientY-S.top;d.onThumbPointerDown({x:k,y:w})}),onPointerUp:Ce(e.onPointerUp,d.onThumbPointerUp)})});JS.displayName=zu;var rg="ScrollAreaCorner",ew=T.forwardRef((e,n)=>{const i=er(rg,e.__scopeScrollArea),s=!!(i.scrollbarX&&i.scrollbarY);return i.type!=="scroll"&&s?g.jsx(J3,{...e,ref:n}):null});ew.displayName=rg;var J3=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,...s}=e,l=er(rg,i),[h,d]=T.useState(0),[o,c]=T.useState(0),u=!!(h&&o);return Ma(l.scrollbarX,()=>{var f;const m=((f=l.scrollbarX)==null?void 0:f.offsetHeight)||0;l.onCornerHeightChange(m),c(m)}),Ma(l.scrollbarY,()=>{var f;const m=((f=l.scrollbarY)==null?void 0:f.offsetWidth)||0;l.onCornerWidthChange(m),d(m)}),u?g.jsx(je.div,{...s,ref:n,style:{width:h,height:o,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Pu(e){return e?parseInt(e,10):0}function tw(e,n){const i=e/n;return isNaN(i)?0:i}function md(e){const n=tw(e.viewport,e.content),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=(e.scrollbar.size-i)*n;return Math.max(s,18)}function ej(e,n,i,s="ltr"){const l=md(i),h=l/2,d=n||h,o=l-d,c=i.scrollbar.paddingStart+d,u=i.scrollbar.size-i.scrollbar.paddingEnd-o,m=i.content-i.viewport,f=s==="ltr"?[0,m]:[m*-1,0];return nw([c,u],f)(e)}function l0(e,n,i="ltr"){const s=md(n),l=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,h=n.scrollbar.size-l,d=n.content-n.viewport,o=h-s,c=i==="ltr"?[0,d]:[d*-1,0],u=em(e,c);return nw([0,d],[0,o])(u)}function nw(e,n){return i=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const s=(n[1]-n[0])/(e[1]-e[0]);return n[0]+s*(i-e[0])}}function rw(e,n){return e>0&&e<n}var tj=(e,n=()=>{})=>{let i={left:e.scrollLeft,top:e.scrollTop},s=0;return(function l(){const h={left:e.scrollLeft,top:e.scrollTop},d=i.left!==h.left,o=i.top!==h.top;(d||o)&&n(),i=h,s=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(s)};function gd(e,n){const i=Jt(e),s=T.useRef(0);return T.useEffect(()=>()=>window.clearTimeout(s.current),[]),T.useCallback(()=>{window.clearTimeout(s.current),s.current=window.setTimeout(i,n)},[i,n])}function Ma(e,n){const i=Jt(n);Vt(()=>{let s=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(i)});return l.observe(e),()=>{window.cancelAnimationFrame(s),l.unobserve(e)}}},[e,i])}var nj=GS,rj=KS,ij=ew,sj=[" ","Enter","ArrowUp","ArrowDown"],aj=[" ","Enter"],ks="Select",[vd,_d,oj]=Em(ks),[Ka]=Bn(ks,[oj,Vi]),yd=Vi(),[lj,Wi]=Ka(ks),[cj,uj]=Ka(ks),iw=e=>{const{__scopeSelect:n,children:i,open:s,defaultOpen:l,onOpenChange:h,value:d,defaultValue:o,onValueChange:c,dir:u,name:m,autoComplete:f,disabled:y,required:S,form:k}=e,w=yd(n),[_,b]=T.useState(null),[v,x]=T.useState(null),[E,M]=T.useState(!1),R=Rl(u),[j,D]=Jr({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:ks}),[O,P]=Jr({prop:d,defaultProp:o,onChange:c,caller:ks}),U=T.useRef(null),q=_?k||!!_.closest("form"):!0,[$,K]=T.useState(new Set),Y=Array.from($).map(V=>V.props.value).join(";");return g.jsx(od,{...w,children:g.jsxs(lj,{required:S,scope:n,trigger:_,onTriggerChange:b,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:M,contentId:Ut(),value:O,onValueChange:P,open:j,onOpenChange:D,dir:R,triggerPointerDownPosRef:U,disabled:y,children:[g.jsx(vd.Provider,{scope:n,children:g.jsx(cj,{scope:e.__scopeSelect,onNativeOptionAdd:T.useCallback(V=>{K(Z=>new Set(Z).add(V))},[]),onNativeOptionRemove:T.useCallback(V=>{K(Z=>{const Q=new Set(Z);return Q.delete(V),Q})},[]),children:i})}),q?g.jsxs(Tw,{"aria-hidden":!0,required:S,tabIndex:-1,name:m,autoComplete:f,value:O,onChange:V=>P(V.target.value),disabled:y,form:k,children:[O===void 0?g.jsx("option",{value:""}):null,Array.from($)]},Y):null]})})};iw.displayName=ks;var sw="SelectTrigger",aw=T.forwardRef((e,n)=>{const{__scopeSelect:i,disabled:s=!1,...l}=e,h=yd(i),d=Wi(sw,i),o=d.disabled||s,c=Ye(n,d.onTriggerChange),u=_d(i),m=T.useRef("touch"),[f,y,S]=Dw(w=>{const _=u().filter(x=>!x.disabled),b=_.find(x=>x.value===d.value),v=Mw(_,w,b);v!==void 0&&d.onValueChange(v.value)}),k=w=>{o||(d.onOpenChange(!0),S()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return g.jsx(jl,{asChild:!0,...h,children:g.jsx(je.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":Rw(d.value)?"":void 0,...l,ref:c,onClick:Ce(l.onClick,w=>{w.currentTarget.focus(),m.current!=="mouse"&&k(w)}),onPointerDown:Ce(l.onPointerDown,w=>{m.current=w.pointerType;const _=w.target;_.hasPointerCapture(w.pointerId)&&_.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(k(w),w.preventDefault())}),onKeyDown:Ce(l.onKeyDown,w=>{const _=f.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&y(w.key),!(_&&w.key===" ")&&sj.includes(w.key)&&(k(),w.preventDefault())})})})});aw.displayName=sw;var ow="SelectValue",lw=T.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:l,children:h,placeholder:d="",...o}=e,c=Wi(ow,i),{onValueNodeHasChildrenChange:u}=c,m=h!==void 0,f=Ye(n,c.onValueNodeChange);return Vt(()=>{u(m)},[u,m]),g.jsx(je.span,{...o,ref:f,style:{pointerEvents:"none"},children:Rw(c.value)?g.jsx(g.Fragment,{children:d}):h})});lw.displayName=ow;var dj="SelectIcon",cw=T.forwardRef((e,n)=>{const{__scopeSelect:i,children:s,...l}=e;return g.jsx(je.span,{"aria-hidden":!0,...l,ref:n,children:s||"▼"})});cw.displayName=dj;var hj="SelectPortal",uw=e=>g.jsx(Va,{asChild:!0,...e});uw.displayName=hj;var Es="SelectContent",dw=T.forwardRef((e,n)=>{const i=Wi(Es,e.__scopeSelect),[s,l]=T.useState();if(Vt(()=>{l(new DocumentFragment)},[]),!i.open){const h=s;return h?Al.createPortal(g.jsx(hw,{scope:e.__scopeSelect,children:g.jsx(vd.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),h):null}return g.jsx(fw,{...e,ref:n})});dw.displayName=Es;var sr=10,[hw,Ki]=Ka(Es),fj="SelectContentImpl",pj=Fi("SelectContent.RemoveScroll"),fw=T.forwardRef((e,n)=>{const{__scopeSelect:i,position:s="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:h,onPointerDownOutside:d,side:o,sideOffset:c,align:u,alignOffset:m,arrowPadding:f,collisionBoundary:y,collisionPadding:S,sticky:k,hideWhenDetached:w,avoidCollisions:_,...b}=e,v=Wi(Es,i),[x,E]=T.useState(null),[M,R]=T.useState(null),j=Ye(n,W=>E(W)),[D,O]=T.useState(null),[P,U]=T.useState(null),q=_d(i),[$,K]=T.useState(!1),Y=T.useRef(!1);T.useEffect(()=>{if(x)return ed(x)},[x]),Qu();const V=T.useCallback(W=>{const[H,...ne]=q().map(ue=>ue.ref.current),[ae]=ne.slice(-1),pe=document.activeElement;for(const ue of W)if(ue===pe||(ue==null||ue.scrollIntoView({block:"nearest"}),ue===H&&M&&(M.scrollTop=0),ue===ae&&M&&(M.scrollTop=M.scrollHeight),ue==null||ue.focus(),document.activeElement!==pe))return},[q,M]),Z=T.useCallback(()=>V([D,x]),[V,D,x]);T.useEffect(()=>{$&&Z()},[$,Z]);const{onOpenChange:Q,triggerPointerDownPosRef:F}=v;T.useEffect(()=>{if(x){let W={x:0,y:0};const H=ae=>{var pe,ue,Re,Ie;W={x:Math.abs(Math.round(ae.pageX)-((ue=(pe=F.current)==null?void 0:pe.x)!=null?ue:0)),y:Math.abs(Math.round(ae.pageY)-((Ie=(Re=F.current)==null?void 0:Re.y)!=null?Ie:0))}},ne=ae=>{W.x<=10&&W.y<=10?ae.preventDefault():x.contains(ae.target)||Q(!1),document.removeEventListener("pointermove",H),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",ne,{capture:!0})}}},[x,Q,F]),T.useEffect(()=>{const W=()=>Q(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[Q]);const[N,L]=Dw(W=>{const H=q().filter(pe=>!pe.disabled),ne=H.find(pe=>pe.ref.current===document.activeElement),ae=Mw(H,W,ne);ae&&setTimeout(()=>ae.ref.current.focus())}),B=T.useCallback((W,H,ne)=>{const ae=!Y.current&&!ne;(v.value!==void 0&&v.value===H||ae)&&(O(W),ae&&(Y.current=!0))},[v.value]),z=T.useCallback(()=>x==null?void 0:x.focus(),[x]),X=T.useCallback((W,H,ne)=>{const ae=!Y.current&&!ne;(v.value!==void 0&&v.value===H||ae)&&U(W)},[v.value]),J=s==="popper"?tm:pw,te=J===tm?{side:o,sideOffset:c,align:u,alignOffset:m,arrowPadding:f,collisionBoundary:y,collisionPadding:S,sticky:k,hideWhenDetached:w,avoidCollisions:_}:{};return g.jsx(hw,{scope:i,content:x,viewport:M,onViewportChange:R,itemRefCallback:B,selectedItem:D,onItemLeave:z,itemTextRefCallback:X,focusSelectedItem:Z,selectedItemText:P,position:s,isPositioned:$,searchRef:N,children:g.jsx(Ml,{as:pj,allowPinchZoom:!0,children:g.jsx(Dl,{asChild:!0,trapped:v.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:Ce(l,W=>{var H;(H=v.trigger)==null||H.focus({preventScroll:!0}),W.preventDefault()}),children:g.jsx(qa,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:g.jsx(J,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:W=>W.preventDefault(),...b,...te,onPlaced:()=>K(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ce(b.onKeyDown,W=>{const H=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!H&&W.key.length===1&&L(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ae=q().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const pe=W.target,ue=ae.indexOf(pe);ae=ae.slice(ue+1)}setTimeout(()=>V(ae)),W.preventDefault()}})})})})})})});fw.displayName=fj;var mj="SelectItemAlignedPosition",pw=T.forwardRef((e,n)=>{const{__scopeSelect:i,onPlaced:s,...l}=e,h=Wi(Es,i),d=Ki(Es,i),[o,c]=T.useState(null),[u,m]=T.useState(null),f=Ye(n,j=>m(j)),y=_d(i),S=T.useRef(!1),k=T.useRef(!0),{viewport:w,selectedItem:_,selectedItemText:b,focusSelectedItem:v}=d,x=T.useCallback(()=>{if(h.trigger&&h.valueNode&&o&&u&&w&&_&&b){const j=h.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),O=h.valueNode.getBoundingClientRect(),P=b.getBoundingClientRect();if(h.dir!=="rtl"){const pe=P.left-D.left,ue=O.left-pe,Re=j.left-ue,Ie=j.width+Re,Fe=Math.max(Ie,D.width),lt=window.innerWidth-sr,De=em(ue,[sr,Math.max(sr,lt-Fe)]);o.style.minWidth=Ie+"px",o.style.left=De+"px"}else{const pe=D.right-P.right,ue=window.innerWidth-O.right-pe,Re=window.innerWidth-j.right-ue,Ie=j.width+Re,Fe=Math.max(Ie,D.width),lt=window.innerWidth-sr,De=em(ue,[sr,Math.max(sr,lt-Fe)]);o.style.minWidth=Ie+"px",o.style.right=De+"px"}const U=y(),q=window.innerHeight-sr*2,$=w.scrollHeight,K=window.getComputedStyle(u),Y=parseInt(K.borderTopWidth,10),V=parseInt(K.paddingTop,10),Z=parseInt(K.borderBottomWidth,10),Q=parseInt(K.paddingBottom,10),F=Y+V+$+Q+Z,N=Math.min(_.offsetHeight*5,F),L=window.getComputedStyle(w),B=parseInt(L.paddingTop,10),z=parseInt(L.paddingBottom,10),X=j.top+j.height/2-sr,J=q-X,te=_.offsetHeight/2,W=_.offsetTop+te,H=Y+V+W,ne=F-H;if(H<=X){const pe=U.length>0&&_===U[U.length-1].ref.current;o.style.bottom="0px";const ue=u.clientHeight-w.offsetTop-w.offsetHeight,Re=Math.max(J,te+(pe?z:0)+ue+Z),Ie=H+Re;o.style.height=Ie+"px"}else{const pe=U.length>0&&_===U[0].ref.current;o.style.top="0px";const Re=Math.max(X,Y+w.offsetTop+(pe?B:0)+te)+ne;o.style.height=Re+"px",w.scrollTop=H-X+w.offsetTop}o.style.margin=`${sr}px 0`,o.style.minHeight=N+"px",o.style.maxHeight=q+"px",s==null||s(),requestAnimationFrame(()=>S.current=!0)}},[y,h.trigger,h.valueNode,o,u,w,_,b,h.dir,s]);Vt(()=>x(),[x]);const[E,M]=T.useState();Vt(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const R=T.useCallback(j=>{j&&k.current===!0&&(x(),v==null||v(),k.current=!1)},[x,v]);return g.jsx(vj,{scope:i,contentWrapper:o,shouldExpandOnScrollRef:S,onScrollButtonChange:R,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:g.jsx(je.div,{...l,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});pw.displayName=mj;var gj="SelectPopperPosition",tm=T.forwardRef((e,n)=>{const{__scopeSelect:i,align:s="start",collisionPadding:l=sr,...h}=e,d=yd(i);return g.jsx(ld,{...d,...h,ref:n,align:s,collisionPadding:l,style:{boxSizing:"border-box",...h.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});tm.displayName=gj;var[vj,ig]=Ka(Es,{}),nm="SelectViewport",mw=T.forwardRef((e,n)=>{const{__scopeSelect:i,nonce:s,...l}=e,h=Ki(nm,i),d=ig(nm,i),o=Ye(n,h.onViewportChange),c=T.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),g.jsx(vd.Slot,{scope:i,children:g.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ce(l.onScroll,u=>{const m=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:y}=d;if(y!=null&&y.current&&f){const S=Math.abs(c.current-m.scrollTop);if(S>0){const k=window.innerHeight-sr*2,w=parseFloat(f.style.minHeight),_=parseFloat(f.style.height),b=Math.max(w,_);if(b<k){const v=b+S,x=Math.min(k,v),E=v-x;f.style.height=x+"px",f.style.bottom==="0px"&&(m.scrollTop=E>0?E:0,f.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});mw.displayName=nm;var gw="SelectGroup",[_j,yj]=Ka(gw),vw=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=Ut();return g.jsx(_j,{scope:i,id:l,children:g.jsx(je.div,{role:"group","aria-labelledby":l,...s,ref:n})})});vw.displayName=gw;var _w="SelectLabel",yw=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=yj(_w,i);return g.jsx(je.div,{id:l.id,...s,ref:n})});yw.displayName=_w;var Fu="SelectItem",[bj,bw]=Ka(Fu),xw=T.forwardRef((e,n)=>{const{__scopeSelect:i,value:s,disabled:l=!1,textValue:h,...d}=e,o=Wi(Fu,i),c=Ki(Fu,i),u=o.value===s,[m,f]=T.useState(h!=null?h:""),[y,S]=T.useState(!1),k=Ye(n,v=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,v,s,l)}),w=Ut(),_=T.useRef("touch"),b=()=>{l||(o.onValueChange(s),o.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return g.jsx(bj,{scope:i,value:s,disabled:l,textId:w,isSelected:u,onItemTextChange:T.useCallback(v=>{f(x=>{var E;return x||((E=v==null?void 0:v.textContent)!=null?E:"").trim()})},[]),children:g.jsx(vd.ItemSlot,{scope:i,value:s,disabled:l,textValue:m,children:g.jsx(je.div,{role:"option","aria-labelledby":w,"data-highlighted":y?"":void 0,"aria-selected":u&&y,"data-state":u?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:k,onFocus:Ce(d.onFocus,()=>S(!0)),onBlur:Ce(d.onBlur,()=>S(!1)),onClick:Ce(d.onClick,()=>{_.current!=="mouse"&&b()}),onPointerUp:Ce(d.onPointerUp,()=>{_.current==="mouse"&&b()}),onPointerDown:Ce(d.onPointerDown,v=>{_.current=v.pointerType}),onPointerMove:Ce(d.onPointerMove,v=>{var x;_.current=v.pointerType,l?(x=c.onItemLeave)==null||x.call(c):_.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(d.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:Ce(d.onKeyDown,v=>{var E;((E=c.searchRef)==null?void 0:E.current)!==""&&v.key===" "||(aj.includes(v.key)&&b(),v.key===" "&&v.preventDefault())})})})})});xw.displayName=Fu;var ol="SelectItemText",Sw=T.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:l,...h}=e,d=Wi(ol,i),o=Ki(ol,i),c=bw(ol,i),u=uj(ol,i),[m,f]=T.useState(null),y=Ye(n,b=>f(b),c.onItemTextChange,b=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,b,c.value,c.disabled)}),S=m==null?void 0:m.textContent,k=T.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:S},c.value),[c.disabled,c.value,S]),{onNativeOptionAdd:w,onNativeOptionRemove:_}=u;return Vt(()=>(w(k),()=>_(k)),[w,_,k]),g.jsxs(g.Fragment,{children:[g.jsx(je.span,{id:c.textId,...h,ref:y}),c.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Al.createPortal(h.children,d.valueNode):null]})});Sw.displayName=ol;var ww="SelectItemIndicator",Cw=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return bw(ww,i).isSelected?g.jsx(je.span,{"aria-hidden":!0,...s,ref:n}):null});Cw.displayName=ww;var rm="SelectScrollUpButton",kw=T.forwardRef((e,n)=>{const i=Ki(rm,e.__scopeSelect),s=ig(rm,e.__scopeSelect),[l,h]=T.useState(!1),d=Ye(n,s.onScrollButtonChange);return Vt(()=>{if(i.viewport&&i.isPositioned){let o=function(){const u=c.scrollTop>0;h(u)};const c=i.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[i.viewport,i.isPositioned]),l?g.jsx(Aw,{...e,ref:d,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=i;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});kw.displayName=rm;var im="SelectScrollDownButton",Ew=T.forwardRef((e,n)=>{const i=Ki(im,e.__scopeSelect),s=ig(im,e.__scopeSelect),[l,h]=T.useState(!1),d=Ye(n,s.onScrollButtonChange);return Vt(()=>{if(i.viewport&&i.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<u;h(m)};const c=i.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[i.viewport,i.isPositioned]),l?g.jsx(Aw,{...e,ref:d,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=i;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});Ew.displayName=im;var Aw=T.forwardRef((e,n)=>{const{__scopeSelect:i,onAutoScroll:s,...l}=e,h=Ki("SelectScrollButton",i),d=T.useRef(null),o=_d(i),c=T.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return T.useEffect(()=>()=>c(),[c]),Vt(()=>{var m;const u=o().find(f=>f.ref.current===document.activeElement);(m=u==null?void 0:u.ref.current)==null||m.scrollIntoView({block:"nearest"})},[o]),g.jsx(je.div,{"aria-hidden":!0,...l,ref:n,style:{flexShrink:0,...l.style},onPointerDown:Ce(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:Ce(l.onPointerMove,()=>{var u;(u=h.onItemLeave)==null||u.call(h),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:Ce(l.onPointerLeave,()=>{c()})})}),xj="SelectSeparator",Sj=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return g.jsx(je.div,{"aria-hidden":!0,...s,ref:n})});Sj.displayName=xj;var sm="SelectArrow",wj=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=yd(i),h=Wi(sm,i),d=Ki(sm,i);return h.open&&d.position==="popper"?g.jsx(cd,{...l,...s,ref:n}):null});wj.displayName=sm;var Cj="SelectBubbleInput",Tw=T.forwardRef(({__scopeSelect:e,value:n,...i},s)=>{const l=T.useRef(null),h=Ye(s,l),d=jD(n);return T.useEffect(()=>{const o=l.current;if(!o)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(d!==n&&m){const f=new Event("change",{bubbles:!0});m.call(o,n),o.dispatchEvent(f)}},[d,n]),g.jsx(je.select,{...i,style:{...$x,...i.style},ref:h,defaultValue:n})});Tw.displayName=Cj;function Rw(e){return e===""||e===void 0}function Dw(e){const n=Jt(e),i=T.useRef(""),s=T.useRef(0),l=T.useCallback(d=>{const o=i.current+d;n(o),(function c(u){i.current=u,window.clearTimeout(s.current),u!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(o)},[n]),h=T.useCallback(()=>{i.current="",window.clearTimeout(s.current)},[]);return T.useEffect(()=>()=>window.clearTimeout(s.current),[]),[i,l,h]}function Mw(e,n,i){const l=n.length>1&&Array.from(n).every(u=>u===n[0])?n[0]:n,h=i?e.indexOf(i):-1;let d=kj(e,Math.max(h,0));l.length===1&&(d=d.filter(u=>u!==i));const c=d.find(u=>u.textValue.toLowerCase().startsWith(l.toLowerCase()));return c!==i?c:void 0}function kj(e,n){return e.map((i,s)=>e[(n+s)%e.length])}var Ej=iw,Aj=aw,Tj=lw,Rj=cw,Dj=uw,Mj=dw,Nj=mw,jj=vw,Oj=yw,Lj=xw,Ij=Sw,Bj=Cw,zj=kw,Pj=Ew,Fj="Separator",c0="horizontal",Hj=["horizontal","vertical"],Nw=T.forwardRef((e,n)=>{const{decorative:i,orientation:s=c0,...l}=e,h=Uj(s)?s:c0,o=i?{role:"none"}:{"aria-orientation":h==="vertical"?h:void 0,role:"separator"};return g.jsx(je.div,{"data-orientation":h,...o,...l,ref:n})});Nw.displayName=Fj;function Uj(e){return Hj.includes(e)}var $j=Nw,bd="Tabs",[qj]=Bn(bd,[ud]),jw=ud(),[Vj,sg]=qj(bd),Ow=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,onValueChange:l,defaultValue:h,orientation:d="horizontal",dir:o,activationMode:c="automatic",...u}=e,m=Rl(o),[f,y]=Jr({prop:s,onChange:l,defaultProp:h!=null?h:"",caller:bd});return g.jsx(Vj,{scope:i,baseId:Ut(),value:f,onValueChange:y,orientation:d,dir:m,activationMode:c,children:g.jsx(je.div,{dir:m,"data-orientation":d,...u,ref:n})})});Ow.displayName=bd;var Lw="TabsList",Iw=T.forwardRef((e,n)=>{const{__scopeTabs:i,loop:s=!0,...l}=e,h=sg(Lw,i),d=jw(i);return g.jsx(X1,{asChild:!0,...d,orientation:h.orientation,dir:h.dir,loop:s,children:g.jsx(je.div,{role:"tablist","aria-orientation":h.orientation,...l,ref:n})})});Iw.displayName=Lw;var Bw="TabsTrigger",zw=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,disabled:l=!1,...h}=e,d=sg(Bw,i),o=jw(i),c=Hw(d.baseId,s),u=Uw(d.baseId,s),m=s===d.value;return g.jsx(Z1,{asChild:!0,...o,focusable:!l,active:m,children:g.jsx(je.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":u,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...h,ref:n,onMouseDown:Ce(e.onMouseDown,f=>{!l&&f.button===0&&f.ctrlKey===!1?d.onValueChange(s):f.preventDefault()}),onKeyDown:Ce(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&d.onValueChange(s)}),onFocus:Ce(e.onFocus,()=>{const f=d.activationMode!=="manual";!m&&!l&&f&&d.onValueChange(s)})})})});zw.displayName=Bw;var Pw="TabsContent",Fw=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,forceMount:l,children:h,...d}=e,o=sg(Pw,i),c=Hw(o.baseId,s),u=Uw(o.baseId,s),m=s===o.value,f=T.useRef(m);return T.useEffect(()=>{const y=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(y)},[]),g.jsx(Gt,{present:l||m,children:({present:y})=>g.jsx(je.div,{"data-state":m?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!y,id:u,tabIndex:0,...d,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:y&&h})})});Fw.displayName=Pw;function Hw(e,n){return`${e}-trigger-${n}`}function Uw(e,n){return`${e}-content-${n}`}var Gj=Ow,Wj=Iw,Kj=zw,Yj=Fw,[xd]=Bn("Tooltip",[Vi]),Sd=Vi(),$w="TooltipProvider",Xj=700,am="tooltip.open",[Zj,ag]=xd($w),qw=e=>{const{__scopeTooltip:n,delayDuration:i=Xj,skipDelayDuration:s=300,disableHoverableContent:l=!1,children:h}=e,d=T.useRef(!0),o=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),g.jsx(Zj,{scope:n,isOpenDelayedRef:d,delayDuration:i,onOpen:T.useCallback(()=>{window.clearTimeout(c.current),d.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>d.current=!0,s)},[s]),isPointerInTransitRef:o,onPointerInTransitChange:T.useCallback(u=>{o.current=u},[]),disableHoverableContent:l,children:h})};qw.displayName=$w;var yl="Tooltip",[Qj,zl]=xd(yl),Vw=e=>{const{__scopeTooltip:n,children:i,open:s,defaultOpen:l,onOpenChange:h,disableHoverableContent:d,delayDuration:o}=e,c=ag(yl,e.__scopeTooltip),u=Sd(n),[m,f]=T.useState(null),y=Ut(),S=T.useRef(0),k=d!=null?d:c.disableHoverableContent,w=o!=null?o:c.delayDuration,_=T.useRef(!1),[b,v]=Jr({prop:s,defaultProp:l!=null?l:!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(am))):c.onClose(),h==null||h(j)},caller:yl}),x=T.useMemo(()=>b?_.current?"delayed-open":"instant-open":"closed",[b]),E=T.useCallback(()=>{window.clearTimeout(S.current),S.current=0,_.current=!1,v(!0)},[v]),M=T.useCallback(()=>{window.clearTimeout(S.current),S.current=0,v(!1)},[v]),R=T.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{_.current=!0,v(!0),S.current=0},w)},[w,v]);return T.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),g.jsx(od,{...u,children:g.jsx(Qj,{scope:n,contentId:y,open:b,stateAttribute:x,trigger:m,onTriggerChange:f,onTriggerEnter:T.useCallback(()=>{c.isOpenDelayedRef.current?R():E()},[c.isOpenDelayedRef,R,E]),onTriggerLeave:T.useCallback(()=>{k?M():(window.clearTimeout(S.current),S.current=0)},[M,k]),onOpen:E,onClose:M,disableHoverableContent:k,children:i})})};Vw.displayName=yl;var om="TooltipTrigger",Gw=T.forwardRef((e,n)=>{const{__scopeTooltip:i,...s}=e,l=zl(om,i),h=ag(om,i),d=Sd(i),o=T.useRef(null),c=Ye(n,o,l.onTriggerChange),u=T.useRef(!1),m=T.useRef(!1),f=T.useCallback(()=>u.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),g.jsx(jl,{asChild:!0,...d,children:g.jsx(je.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...s,ref:c,onPointerMove:Ce(e.onPointerMove,y=>{y.pointerType!=="touch"&&!m.current&&!h.isPointerInTransitRef.current&&(l.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{l.onTriggerLeave(),m.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{l.open&&l.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ce(e.onFocus,()=>{u.current||l.onOpen()}),onBlur:Ce(e.onBlur,l.onClose),onClick:Ce(e.onClick,l.onClose)})})});Gw.displayName=om;var og="TooltipPortal",[Jj,eO]=xd(og,{forceMount:void 0}),Ww=e=>{const{__scopeTooltip:n,forceMount:i,children:s,container:l}=e,h=zl(og,n);return g.jsx(Jj,{scope:n,forceMount:i,children:g.jsx(Gt,{present:i||h.open,children:g.jsx(Va,{asChild:!0,container:l,children:s})})})};Ww.displayName=og;var Na="TooltipContent",Kw=T.forwardRef((e,n)=>{const i=eO(Na,e.__scopeTooltip),{forceMount:s=i.forceMount,side:l="top",...h}=e,d=zl(Na,e.__scopeTooltip);return g.jsx(Gt,{present:s||d.open,children:d.disableHoverableContent?g.jsx(Yw,{side:l,...h,ref:n}):g.jsx(tO,{side:l,...h,ref:n})})}),tO=T.forwardRef((e,n)=>{const i=zl(Na,e.__scopeTooltip),s=ag(Na,e.__scopeTooltip),l=T.useRef(null),h=Ye(n,l),[d,o]=T.useState(null),{trigger:c,onClose:u}=i,m=l.current,{onPointerInTransitChange:f}=s,y=T.useCallback(()=>{o(null),f(!1)},[f]),S=T.useCallback((k,w)=>{const _=k.currentTarget,b={x:k.clientX,y:k.clientY},v=sO(b,_.getBoundingClientRect()),x=aO(b,v),E=oO(w.getBoundingClientRect()),M=cO([...x,...E]);o(M),f(!0)},[f]);return T.useEffect(()=>()=>y(),[y]),T.useEffect(()=>{if(c&&m){const k=_=>S(_,m),w=_=>S(_,c);return c.addEventListener("pointerleave",k),m.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",k),m.removeEventListener("pointerleave",w)}}},[c,m,S,y]),T.useEffect(()=>{if(d){const k=w=>{const _=w.target,b={x:w.clientX,y:w.clientY},v=(c==null?void 0:c.contains(_))||(m==null?void 0:m.contains(_)),x=!lO(b,d);v?y():x&&(y(),u())};return document.addEventListener("pointermove",k),()=>document.removeEventListener("pointermove",k)}},[c,m,d,u,y]),g.jsx(Yw,{...e,ref:h})}),[nO,rO]=xd(yl,{isInside:!1}),iO=eR("TooltipContent"),Yw=T.forwardRef((e,n)=>{const{__scopeTooltip:i,children:s,"aria-label":l,onEscapeKeyDown:h,onPointerDownOutside:d,...o}=e,c=zl(Na,i),u=Sd(i),{onClose:m}=c;return T.useEffect(()=>(document.addEventListener(am,m),()=>document.removeEventListener(am,m)),[m]),T.useEffect(()=>{if(c.trigger){const f=y=>{const S=y.target;S!=null&&S.contains(c.trigger)&&m()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,m]),g.jsx(qa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:d,onFocusOutside:f=>f.preventDefault(),onDismiss:m,children:g.jsxs(ld,{"data-state":c.stateAttribute,...u,...o,ref:n,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx(iO,{children:s}),g.jsx(nO,{scope:i,isInside:!0,children:g.jsx(aR,{id:c.contentId,role:"tooltip",children:l||s})})]})})});Kw.displayName=Na;var Xw="TooltipArrow",Zw=T.forwardRef((e,n)=>{const{__scopeTooltip:i,...s}=e,l=Sd(i);return rO(Xw,i).isInside?null:g.jsx(cd,{...l,...s,ref:n})});Zw.displayName=Xw;function sO(e,n){const i=Math.abs(n.top-e.y),s=Math.abs(n.bottom-e.y),l=Math.abs(n.right-e.x),h=Math.abs(n.left-e.x);switch(Math.min(i,s,l,h)){case h:return"left";case l:return"right";case i:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function aO(e,n,i=5){const s=[];switch(n){case"top":s.push({x:e.x-i,y:e.y+i},{x:e.x+i,y:e.y+i});break;case"bottom":s.push({x:e.x-i,y:e.y-i},{x:e.x+i,y:e.y-i});break;case"left":s.push({x:e.x+i,y:e.y-i},{x:e.x+i,y:e.y+i});break;case"right":s.push({x:e.x-i,y:e.y-i},{x:e.x-i,y:e.y+i});break}return s}function oO(e){const{top:n,right:i,bottom:s,left:l}=e;return[{x:l,y:n},{x:i,y:n},{x:i,y:s},{x:l,y:s}]}function lO(e,n){const{x:i,y:s}=e;let l=!1;for(let h=0,d=n.length-1;h<n.length;d=h++){const o=n[h],c=n[d],u=o.x,m=o.y,f=c.x,y=c.y;m>s!=y>s&&i<(f-u)*(s-m)/(y-m)+u&&(l=!l)}return l}function cO(e){const n=e.slice();return n.sort((i,s)=>i.x<s.x?-1:i.x>s.x?1:i.y<s.y?-1:i.y>s.y?1:0),uO(n)}function uO(e){if(e.length<=1)return e.slice();const n=[];for(let s=0;s<e.length;s++){const l=e[s];for(;n.length>=2;){const h=n[n.length-1],d=n[n.length-2];if((h.x-d.x)*(l.y-d.y)>=(h.y-d.y)*(l.x-d.x))n.pop();else break}n.push(l)}n.pop();const i=[];for(let s=e.length-1;s>=0;s--){const l=e[s];for(;i.length>=2;){const h=i[i.length-1],d=i[i.length-2];if((h.x-d.x)*(l.y-d.y)>=(h.y-d.y)*(l.x-d.x))i.pop();else break}i.push(l)}return i.pop(),n.length===1&&i.length===1&&n[0].x===i[0].x&&n[0].y===i[0].y?n:n.concat(i)}var dO=qw,hO=Vw,fO=Gw,pO=Ww,mO=Kw,gO=Zw;const vO=(e,n)=>{const i=new Array(e.length+n.length);for(let s=0;s<e.length;s++)i[s]=e[s];for(let s=0;s<n.length;s++)i[e.length+s]=n[s];return i},_O=(e,n)=>({classGroupId:e,validator:n}),Qw=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),Hu="-",u0=[],yO="arbitrary..",bO=e=>{const n=SO(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return xO(d);const o=d.split(Hu),c=o[0]===""&&o.length>1?1:0;return Jw(o,c,n)},getConflictingClassGroupIds:(d,o)=>{if(o){const c=s[d],u=i[d];return c?u?vO(u,c):c:u||u0}return i[d]||u0}}},Jw=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],h=i.nextPart.get(l);if(h){const u=Jw(e,n+1,h);if(u)return u}const d=i.validators;if(d===null)return;const o=n===0?e.join(Hu):e.slice(n).join(Hu),c=d.length;for(let u=0;u<c;u++){const m=d[u];if(m.validator(o))return m.classGroupId}},xO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),s=n.slice(0,i);return s?yO+s:void 0})(),SO=e=>{const{theme:n,classGroups:i}=e;return wO(i,n)},wO=(e,n)=>{const i=Qw();for(const s in e){const l=e[s];lg(l,i,s,n)}return i},lg=(e,n,i,s)=>{const l=e.length;for(let h=0;h<l;h++){const d=e[h];CO(d,n,i,s)}},CO=(e,n,i,s)=>{if(typeof e=="string"){kO(e,n,i);return}if(typeof e=="function"){EO(e,n,i,s);return}AO(e,n,i,s)},kO=(e,n,i)=>{const s=e===""?n:eC(n,e);s.classGroupId=i},EO=(e,n,i,s)=>{if(TO(e)){lg(e(s),n,i,s);return}n.validators===null&&(n.validators=[]),n.validators.push(_O(i,e))},AO=(e,n,i,s)=>{const l=Object.entries(e),h=l.length;for(let d=0;d<h;d++){const[o,c]=l[d];lg(c,eC(n,o),i,s)}},eC=(e,n)=>{let i=e;const s=n.split(Hu),l=s.length;for(let h=0;h<l;h++){const d=s[h];let o=i.nextPart.get(d);o||(o=Qw(),i.nextPart.set(d,o)),i=o}return i},TO=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,RO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),s=Object.create(null);const l=(h,d)=>{i[h]=d,n++,n>e&&(n=0,s=i,i=Object.create(null))};return{get(h){let d=i[h];if(d!==void 0)return d;if((d=s[h])!==void 0)return l(h,d),d},set(h,d){h in i?i[h]=d:l(h,d)}}},lm="!",d0=":",DO=[],h0=(e,n,i,s,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:s,isExternal:l}),MO=e=>{const{prefix:n,experimentalParseClassName:i}=e;let s=l=>{const h=[];let d=0,o=0,c=0,u;const m=l.length;for(let w=0;w<m;w++){const _=l[w];if(d===0&&o===0){if(_===d0){h.push(l.slice(c,w)),c=w+1;continue}if(_==="/"){u=w;continue}}_==="["?d++:_==="]"?d--:_==="("?o++:_===")"&&o--}const f=h.length===0?l:l.slice(c);let y=f,S=!1;f.endsWith(lm)?(y=f.slice(0,-1),S=!0):f.startsWith(lm)&&(y=f.slice(1),S=!0);const k=u&&u>c?u-c:void 0;return h0(h,S,y,k)};if(n){const l=n+d0,h=s;s=d=>d.startsWith(l)?h(d.slice(l.length)):h0(DO,!1,d,void 0,!0)}if(i){const l=s;s=h=>i({className:h,parseClassName:l})}return s},NO=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,s)=>{n.set(i,1e6+s)}),i=>{const s=[];let l=[];for(let h=0;h<i.length;h++){const d=i[h],o=d[0]==="[",c=n.has(d);o||c?(l.length>0&&(l.sort(),s.push(...l),l=[]),s.push(d)):l.push(d)}return l.length>0&&(l.sort(),s.push(...l)),s}},jO=e=>({cache:RO(e.cacheSize),parseClassName:MO(e),sortModifiers:NO(e),...bO(e)}),OO=/\s+/,LO=(e,n)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:l,sortModifiers:h}=n,d=[],o=e.trim().split(OO);let c="";for(let u=o.length-1;u>=0;u-=1){const m=o[u],{isExternal:f,modifiers:y,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:w}=i(m);if(f){c=m+(c.length>0?" "+c:c);continue}let _=!!w,b=s(_?k.substring(0,w):k);if(!b){if(!_){c=m+(c.length>0?" "+c:c);continue}if(b=s(k),!b){c=m+(c.length>0?" "+c:c);continue}_=!1}const v=y.length===0?"":y.length===1?y[0]:h(y).join(":"),x=S?v+lm:v,E=x+b;if(d.indexOf(E)>-1)continue;d.push(E);const M=l(b,_);for(let R=0;R<M.length;++R){const j=M[R];d.push(x+j)}c=m+(c.length>0?" "+c:c)}return c},IO=(...e)=>{let n=0,i,s,l="";for(;n<e.length;)(i=e[n++])&&(s=tC(i))&&(l&&(l+=" "),l+=s);return l},tC=e=>{if(typeof e=="string")return e;let n,i="";for(let s=0;s<e.length;s++)e[s]&&(n=tC(e[s]))&&(i&&(i+=" "),i+=n);return i},BO=(e,...n)=>{let i,s,l,h;const d=c=>{const u=n.reduce((m,f)=>f(m),e());return i=jO(u),s=i.cache.get,l=i.cache.set,h=o,o(c)},o=c=>{const u=s(c);if(u)return u;const m=LO(c,i);return l(c,m),m};return h=d,(...c)=>h(IO(...c))},zO=[],Ht=e=>{const n=i=>i[e]||zO;return n.isThemeGetter=!0,n},nC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,PO=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,FO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,UO=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$O=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qO=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ji=e=>PO.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),Oi=e=>!!e&&Number.isInteger(Number(e)),pp=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),Gr=e=>FO.test(e),iC=()=>!0,VO=e=>HO.test(e)&&!UO.test(e),cg=()=>!1,GO=e=>$O.test(e),WO=e=>qO.test(e),KO=e=>!Ee(e)&&!Ae(e),YO=e=>Yi(e,oC,cg),Ee=e=>nC.test(e),ys=e=>Yi(e,lC,VO),f0=e=>Yi(e,r5,Ke),XO=e=>Yi(e,uC,iC),ZO=e=>Yi(e,cC,cg),p0=e=>Yi(e,sC,cg),QO=e=>Yi(e,aC,WO),pu=e=>Yi(e,dC,GO),Ae=e=>rC.test(e),el=e=>Ms(e,lC),JO=e=>Ms(e,cC),m0=e=>Ms(e,sC),e5=e=>Ms(e,oC),t5=e=>Ms(e,aC),mu=e=>Ms(e,dC,!0),n5=e=>Ms(e,uC,!0),Yi=(e,n,i)=>{const s=nC.exec(e);return s?s[1]?n(s[1]):i(s[2]):!1},Ms=(e,n,i=!1)=>{const s=rC.exec(e);return s?s[1]?n(s[1]):i:!1},sC=e=>e==="position"||e==="percentage",aC=e=>e==="image"||e==="url",oC=e=>e==="length"||e==="size"||e==="bg-size",lC=e=>e==="length",r5=e=>e==="number",cC=e=>e==="family-name",uC=e=>e==="number"||e==="weight",dC=e=>e==="shadow",i5=()=>{const e=Ht("color"),n=Ht("font"),i=Ht("text"),s=Ht("font-weight"),l=Ht("tracking"),h=Ht("leading"),d=Ht("breakpoint"),o=Ht("container"),c=Ht("spacing"),u=Ht("radius"),m=Ht("shadow"),f=Ht("inset-shadow"),y=Ht("text-shadow"),S=Ht("drop-shadow"),k=Ht("blur"),w=Ht("perspective"),_=Ht("aspect"),b=Ht("ease"),v=Ht("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...E(),Ae,Ee],R=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],D=()=>[Ae,Ee,c],O=()=>[ji,"full","auto",...D()],P=()=>[Oi,"none","subgrid",Ae,Ee],U=()=>["auto",{span:["full",Oi,Ae,Ee]},Oi,Ae,Ee],q=()=>[Oi,"auto",Ae,Ee],$=()=>["auto","min","max","fr",Ae,Ee],K=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...D()],Z=()=>[ji,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],Q=()=>[ji,"screen","full","dvw","lvw","svw","min","max","fit",...D()],F=()=>[ji,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],N=()=>[e,Ae,Ee],L=()=>[...E(),m0,p0,{position:[Ae,Ee]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",e5,YO,{size:[Ae,Ee]}],X=()=>[pp,el,ys],J=()=>["","none","full",u,Ae,Ee],te=()=>["",Ke,el,ys],W=()=>["solid","dashed","dotted","double"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[Ke,pp,m0,p0],ae=()=>["","none",k,Ae,Ee],pe=()=>["none",Ke,Ae,Ee],ue=()=>["none",Ke,Ae,Ee],Re=()=>[Ke,Ae,Ee],Ie=()=>[ji,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gr],breakpoint:[Gr],color:[iC],container:[Gr],"drop-shadow":[Gr],ease:["in","out","in-out"],font:[KO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gr],shadow:[Gr],spacing:["px",Ke],text:[Gr],"text-shadow":[Gr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ji,Ee,Ae,_]}],container:["container"],columns:[{columns:[Ke,Ee,Ae,o]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[Oi,"auto",Ae,Ee]}],basis:[{basis:[ji,"full","auto",o,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,ji,"auto","initial","none",Ee]}],grow:[{grow:["",Ke,Ae,Ee]}],shrink:[{shrink:["",Ke,Ae,Ee]}],order:[{order:[Oi,"first","last","none",Ae,Ee]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...K(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...K()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":K()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...Q()]}],"min-inline-size":[{"min-inline":["auto",...Q()]}],"max-inline-size":[{"max-inline":["none",...Q()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[o,"screen",...Z()]}],"min-w":[{"min-w":[o,"screen","none",...Z()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[d]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",i,el,ys]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,n5,XO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",pp,Ee]}],"font-family":[{font:[JO,ZO,n]}],"font-features":[{"font-features":[Ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ae,Ee]}],"line-clamp":[{"line-clamp":[Ke,"none",Ae,f0]}],leading:[{leading:[h,...D()]}],"list-image":[{"list-image":["none",Ae,Ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,Ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ae,ys]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ae,Ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ae,Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Oi,Ae,Ee],radial:["",Ae,Ee],conic:[Oi,Ae,Ee]},t5,QO]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-bs":[{"border-bs":te()}],"border-w-be":[{"border-be":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ae,Ee]}],"outline-w":[{outline:["",Ke,el,ys]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",m,mu,pu]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",f,mu,pu]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Ke,ys]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",y,mu,pu]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Ke,Ae,Ee]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Ae,Ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,Ee]}],filter:[{filter:["","none",Ae,Ee]}],blur:[{blur:ae()}],brightness:[{brightness:[Ke,Ae,Ee]}],contrast:[{contrast:[Ke,Ae,Ee]}],"drop-shadow":[{"drop-shadow":["","none",S,mu,pu]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",Ke,Ae,Ee]}],"hue-rotate":[{"hue-rotate":[Ke,Ae,Ee]}],invert:[{invert:["",Ke,Ae,Ee]}],saturate:[{saturate:[Ke,Ae,Ee]}],sepia:[{sepia:["",Ke,Ae,Ee]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,Ee]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ae,Ee]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ae,Ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ae,Ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ae,Ee]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ae,Ee]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ae,Ee]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ae,Ee]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ae,Ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,Ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ae,Ee]}],ease:[{ease:["linear","initial",b,Ae,Ee]}],delay:[{delay:[Ke,Ae,Ee]}],animate:[{animate:["none",v,Ae,Ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Ae,Ee]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":["scale-3d"],skew:[{skew:Re()}],"skew-x":[{"skew-x":Re()}],"skew-y":[{"skew-y":Re()}],transform:[{transform:[Ae,Ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ie()}],"translate-x":[{"translate-x":Ie()}],"translate-y":[{"translate-y":Ie()}],"translate-z":[{"translate-z":Ie()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ae,Ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ae,Ee]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[Ke,el,ys,f0]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},s5=BO(i5);function be(...e){return s5(Xu(e))}const a5=$a("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Te({className:e,variant:n="default",size:i="default",asChild:s=!1,...l}){const h=s?Tl:"button";return g.jsx(h,{"data-slot":"button","data-variant":n,"data-size":i,className:be(a5({variant:n,size:i,className:e})),...l})}function Pl(){return{fetchWithAuth:T.useCallback(async(n,i={},s)=>{const{serverUrl:l,token:h}=s||{};let d=n;n.startsWith("/")&&l&&(d=`http://${l}${n}`);const o=new Headers(i.headers||{});return h&&o.set("Authorization",`Bearer ${h}`),fetch(d,{...i,headers:o})},[])}}function Ya({...e}){return g.jsx(jm,{"data-slot":"dialog",...e})}function o5({...e}){return g.jsx(Om,{"data-slot":"dialog-portal",...e})}function l5({...e}){return g.jsx(nd,{"data-slot":"dialog-close",...e})}function c5({className:e,...n}){return g.jsx(Lm,{"data-slot":"dialog-overlay",className:be("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...n})}function Xa({className:e,children:n,showCloseButton:i=!0,...s}){return g.jsxs(o5,{children:[g.jsx(c5,{}),g.jsxs(Im,{"data-slot":"dialog-content",className:be("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s,children:[n,i&&g.jsx(nd,{"data-slot":"dialog-close",asChild:!0,children:g.jsxs(Te,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[g.jsx(Yr,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Za({className:e,...n}){return g.jsx("div",{"data-slot":"dialog-header",className:be("flex flex-col gap-2",e),...n})}function wd({className:e,showCloseButton:n=!1,children:i,...s}){return g.jsxs("div",{"data-slot":"dialog-footer",className:be("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...s,children:[i,n&&g.jsx(nd,{asChild:!0,children:g.jsx(Te,{variant:"outline",children:"Close"})})]})}function Qa({className:e,...n}){return g.jsx(S1,{"data-slot":"dialog-title",className:be("text-base leading-none font-medium",e),...n})}function Fl({className:e,...n}){return g.jsx(w1,{"data-slot":"dialog-description",className:be("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...n})}function Cu({className:e,type:n,...i}){return g.jsx("input",{type:n,"data-slot":"input",className:be("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...i})}const $i=T.forwardRef(({className:e,children:n,...i},s)=>g.jsxs(nj,{"data-slot":"scroll-area",className:be("relative overflow-hidden",e),...i,children:[g.jsx(rj,{ref:s,"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] outline-none",style:{WebkitOverflowScrolling:"touch"},children:n}),g.jsx(u5,{}),g.jsx(ij,{})]}));$i.displayName="ScrollArea";function u5({className:e,orientation:n="vertical",...i}){return g.jsx(YS,{"data-slot":"scroll-area-scrollbar","data-orientation":n,orientation:n,className:be("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",e),...i,children:g.jsx(JS,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function d5(e){const i=e.replace(/\\/g,"/").split("/");return i.pop(),i.join("/")||"/"}function h5({open:e,onOpenChange:n,onSelect:i,initialPath:s,title:l="Select Folder"}){const[h,d]=T.useState(s||""),[o,c]=T.useState([]),[u,m]=T.useState(!1),[f,y]=T.useState(0),[S,k]=T.useState(null),[w,_]=T.useState(""),b=T.useRef(null),v=T.useRef(null),{fetchWithAuth:x}=Pl(),{activeServer:E}=Ua(),M=T.useCallback(async q=>{m(!0),k(null),y(0),_("");try{const $=await x(`/api/fs/browse?path=${encodeURIComponent(q)}`,{},{serverUrl:E==null?void 0:E.url,token:E==null?void 0:E.token}),K=await $.json();if(!$.ok)throw new Error(K.message||"Failed to browse directory");const Y=K.files.filter(V=>V.type==="directory");c(Y),d(K.currentPath)}catch($){k($ instanceof Error?$.message:"Failed to load directory"),c([])}finally{m(!1)}},[x,E]);T.useEffect(()=>{e&&M(s||"")},[e,s,M]),T.useEffect(()=>{y(0)},[w]);const R=o.filter(q=>q.name.toLowerCase().includes(w.toLowerCase())),j=()=>{const q=d5(h);q!==h&&M(q)},D=()=>{h&&(i(h),n(!1))},O=q=>{const $=h?`${h}/${q.name}`:q.name;M($)},P=q=>{if(R.length!==0)switch(q.key){case"ArrowDown":q.preventDefault(),y($=>Math.min($+1,R.length-1));break;case"ArrowUp":q.preventDefault(),y($=>Math.max($-1,0));break;case"Enter":q.preventDefault(),R[f]&&O(R[f]);break;case"Escape":w&&(q.preventDefault(),_(""));break}};T.useEffect(()=>{if(v.current&&R.length>0){const q=v.current.children[f];q&&q.scrollIntoView({block:"nearest"})}},[f,R.length]),T.useEffect(()=>{e&&setTimeout(()=>{var q;return(q=b.current)==null?void 0:q.focus()},100)},[e]);const U=(q,$=50)=>{if(q.length<=$)return q;const K=q.split("/");return K.length<=2?q:".../"+K.slice(-2).join("/")};return g.jsx(Ya,{open:e,onOpenChange:n,children:g.jsxs(Xa,{className:"sm:max-w-lg",onKeyDown:P,children:[g.jsx(Za,{children:g.jsx(Qa,{children:l})}),g.jsxs("div",{className:"space-y-3",children:[g.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[g.jsx(Te,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:j,disabled:u||!h,children:g.jsx(vA,{className:"w-4 h-4"})}),g.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:h,children:U(h)||"Home"})]}),g.jsxs("div",{className:"relative",children:[g.jsx(km,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),g.jsx(Cu,{ref:b,placeholder:"Filter folders...",value:w,onChange:q=>_(q.target.value),className:"pl-8"})]}),g.jsx($i,{className:"h-64 border rounded-md",children:u?g.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[g.jsx(Zn,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):S?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[g.jsx("span",{className:"text-destructive",children:S}),g.jsx(Te,{variant:"ghost",size:"sm",onClick:()=>M(h),className:"mt-2",children:"Retry"})]}):R.length===0?g.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[g.jsx(zi,{className:"w-8 h-8 mb-2 opacity-50"}),w?"No matching folders":"No folders in this directory"]}):g.jsx("div",{className:"p-1",ref:v,children:R.map((q,$)=>g.jsxs("button",{onClick:()=>{y($)},onDoubleClick:()=>O(q),className:be("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",$===f&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[g.jsx(zi,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:q.name}),$===f&&g.jsx(Xr,{className:"w-4 h-4 text-primary"})]},q.path))})}),S&&g.jsx("p",{className:"text-xs text-destructive",children:S})]}),g.jsxs(wd,{children:[g.jsx(Te,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),g.jsx(Te,{onClick:D,disabled:!h||u,children:"Use This Folder"})]})]})})}var g0=1,f5=.9,p5=.8,m5=.17,mp=.1,gp=.999,g5=.9999,v5=.99,_5=/[\\\/_+.#"@\[\(\{&]/,y5=/[\\\/_+.#"@\[\(\{&]/g,b5=/[\s-]/,hC=/[\s-]/g;function cm(e,n,i,s,l,h,d){if(h===n.length)return l===e.length?g0:v5;var o=`${l},${h}`;if(d[o]!==void 0)return d[o];for(var c=s.charAt(h),u=i.indexOf(c,l),m=0,f,y,S,k;u>=0;)f=cm(e,n,i,s,u+1,h+1,d),f>m&&(u===l?f*=g0:_5.test(e.charAt(u-1))?(f*=p5,S=e.slice(l,u-1).match(y5),S&&l>0&&(f*=Math.pow(gp,S.length))):b5.test(e.charAt(u-1))?(f*=f5,k=e.slice(l,u-1).match(hC),k&&l>0&&(f*=Math.pow(gp,k.length))):(f*=m5,l>0&&(f*=Math.pow(gp,u-l))),e.charAt(u)!==n.charAt(h)&&(f*=g5)),(f<mp&&i.charAt(u-1)===s.charAt(h+1)||s.charAt(h+1)===s.charAt(h)&&i.charAt(u-1)!==s.charAt(h))&&(y=cm(e,n,i,s,u+1,h+2,d),y*mp>f&&(f=y*mp)),f>m&&(m=f),u=i.indexOf(c,u+1);return d[o]=m,m}function v0(e){return e.toLowerCase().replace(hC," ")}function x5(e,n,i){return e=i&&i.length>0?`${e+" "+i.join(" ")}`:e,cm(e,n,v0(e),v0(n),0,0,{})}var tl='[cmdk-group=""]',vp='[cmdk-group-items=""]',S5='[cmdk-group-heading=""]',fC='[cmdk-item=""]',_0=`${fC}:not([aria-disabled="true"])`,um="cmdk-item-select",ya="data-value",w5=(e,n,i)=>x5(e,n,i),pC=T.createContext(void 0),Hl=()=>T.useContext(pC),mC=T.createContext(void 0),ug=()=>T.useContext(mC),gC=T.createContext(void 0),vC=T.forwardRef((e,n)=>{let i=ba(()=>{var B,z;return{search:"",value:(z=(B=e.value)!=null?B:e.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=ba(()=>new Set),l=ba(()=>new Map),h=ba(()=>new Map),d=ba(()=>new Set),o=_C(e),{label:c,children:u,value:m,onValueChange:f,filter:y,shouldFilter:S,loop:k,disablePointerSelection:w=!1,vimBindings:_=!0,...b}=e,v=Ut(),x=Ut(),E=Ut(),M=T.useRef(null),R=O5();As(()=>{if(m!==void 0){let B=m.trim();i.current.value=B,j.emit()}},[m]),As(()=>{R(6,$)},[]);let j=T.useMemo(()=>({subscribe:B=>(d.current.add(B),()=>d.current.delete(B)),snapshot:()=>i.current,setState:(B,z,X)=>{var J,te,W,H;if(!Object.is(i.current[B],z)){if(i.current[B]=z,B==="search")q(),P(),R(1,U);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ne=document.getElementById(E);ne?ne.focus():(J=document.getElementById(v))==null||J.focus()}if(R(7,()=>{var ne;i.current.selectedItemId=(ne=K())==null?void 0:ne.id,j.emit()}),X||R(5,$),((te=o.current)==null?void 0:te.value)!==void 0){let ne=z!=null?z:"";(H=(W=o.current).onValueChange)==null||H.call(W,ne);return}}j.emit()}},emit:()=>{d.current.forEach(B=>B())}}),[]),D=T.useMemo(()=>({value:(B,z,X)=>{var J;z!==((J=h.current.get(B))==null?void 0:J.value)&&(h.current.set(B,{value:z,keywords:X}),i.current.filtered.items.set(B,O(z,X)),R(2,()=>{P(),j.emit()}))},item:(B,z)=>(s.current.add(B),z&&(l.current.has(z)?l.current.get(z).add(B):l.current.set(z,new Set([B]))),R(3,()=>{q(),P(),i.current.value||U(),j.emit()}),()=>{h.current.delete(B),s.current.delete(B),i.current.filtered.items.delete(B);let X=K();R(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===B&&U(),j.emit()})}),group:B=>(l.current.has(B)||l.current.set(B,new Set),()=>{h.current.delete(B),l.current.delete(B)}),filter:()=>o.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:E,labelId:x,listInnerRef:M}),[]);function O(B,z){var X,J;let te=(J=(X=o.current)==null?void 0:X.filter)!=null?J:w5;return B?te(B,i.current.search,z):0}function P(){if(!i.current.search||o.current.shouldFilter===!1)return;let B=i.current.filtered.items,z=[];i.current.filtered.groups.forEach(J=>{let te=l.current.get(J),W=0;te.forEach(H=>{let ne=B.get(H);W=Math.max(ne,W)}),z.push([J,W])});let X=M.current;Y().sort((J,te)=>{var W,H;let ne=J.getAttribute("id"),ae=te.getAttribute("id");return((W=B.get(ae))!=null?W:0)-((H=B.get(ne))!=null?H:0)}).forEach(J=>{let te=J.closest(vp);te?te.appendChild(J.parentElement===te?J:J.closest(`${vp} > *`)):X.appendChild(J.parentElement===X?J:J.closest(`${vp} > *`))}),z.sort((J,te)=>te[1]-J[1]).forEach(J=>{var te;let W=(te=M.current)==null?void 0:te.querySelector(`${tl}[${ya}="${encodeURIComponent(J[0])}"]`);W==null||W.parentElement.appendChild(W)})}function U(){let B=Y().find(X=>X.getAttribute("aria-disabled")!=="true"),z=B==null?void 0:B.getAttribute(ya);j.setState("value",z||void 0)}function q(){var B,z,X,J;if(!i.current.search||o.current.shouldFilter===!1){i.current.filtered.count=s.current.size;return}i.current.filtered.groups=new Set;let te=0;for(let W of s.current){let H=(z=(B=h.current.get(W))==null?void 0:B.value)!=null?z:"",ne=(J=(X=h.current.get(W))==null?void 0:X.keywords)!=null?J:[],ae=O(H,ne);i.current.filtered.items.set(W,ae),ae>0&&te++}for(let[W,H]of l.current)for(let ne of H)if(i.current.filtered.items.get(ne)>0){i.current.filtered.groups.add(W);break}i.current.filtered.count=te}function $(){var B,z,X;let J=K();J&&(((B=J.parentElement)==null?void 0:B.firstChild)===J&&((X=(z=J.closest(tl))==null?void 0:z.querySelector(S5))==null||X.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function K(){var B;return(B=M.current)==null?void 0:B.querySelector(`${fC}[aria-selected="true"]`)}function Y(){var B;return Array.from(((B=M.current)==null?void 0:B.querySelectorAll(_0))||[])}function V(B){let z=Y()[B];z&&j.setState("value",z.getAttribute(ya))}function Z(B){var z;let X=K(),J=Y(),te=J.findIndex(H=>H===X),W=J[te+B];(z=o.current)!=null&&z.loop&&(W=te+B<0?J[J.length-1]:te+B===J.length?J[0]:J[te+B]),W&&j.setState("value",W.getAttribute(ya))}function Q(B){let z=K(),X=z==null?void 0:z.closest(tl),J;for(;X&&!J;)X=B>0?N5(X,tl):j5(X,tl),J=X==null?void 0:X.querySelector(_0);J?j.setState("value",J.getAttribute(ya)):Z(B)}let F=()=>V(Y().length-1),N=B=>{B.preventDefault(),B.metaKey?F():B.altKey?Q(1):Z(1)},L=B=>{B.preventDefault(),B.metaKey?V(0):B.altKey?Q(-1):Z(-1)};return T.createElement(je.div,{ref:n,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:B=>{var z;(z=b.onKeyDown)==null||z.call(b,B);let X=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||X))switch(B.key){case"n":case"j":{_&&B.ctrlKey&&N(B);break}case"ArrowDown":{N(B);break}case"p":case"k":{_&&B.ctrlKey&&L(B);break}case"ArrowUp":{L(B);break}case"Home":{B.preventDefault(),V(0);break}case"End":{B.preventDefault(),F();break}case"Enter":{B.preventDefault();let J=K();if(J){let te=new Event(um);J.dispatchEvent(te)}}}}},T.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:I5},c),Cd(e,B=>T.createElement(mC.Provider,{value:j},T.createElement(pC.Provider,{value:D},B))))}),C5=T.forwardRef((e,n)=>{var i,s;let l=Ut(),h=T.useRef(null),d=T.useContext(gC),o=Hl(),c=_C(e),u=(s=(i=c.current)==null?void 0:i.forceMount)!=null?s:d==null?void 0:d.forceMount;As(()=>{if(!u)return o.item(l,d==null?void 0:d.id)},[u]);let m=yC(l,h,[e.value,e.children,h],e.keywords),f=ug(),y=qi(R=>R.value&&R.value===m.current),S=qi(R=>u||o.filter()===!1?!0:R.search?R.filtered.items.get(l)>0:!0);T.useEffect(()=>{let R=h.current;if(!(!R||e.disabled))return R.addEventListener(um,k),()=>R.removeEventListener(um,k)},[S,e.onSelect,e.disabled]);function k(){var R,j;w(),(j=(R=c.current).onSelect)==null||j.call(R,m.current)}function w(){f.setState("value",m.current,!0)}if(!S)return null;let{disabled:_,value:b,onSelect:v,forceMount:x,keywords:E,...M}=e;return T.createElement(je.div,{ref:Qr(h,n),...M,id:l,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!y,"data-disabled":!!_,"data-selected":!!y,onPointerMove:_||o.getDisablePointerSelection()?void 0:w,onClick:_?void 0:k},e.children)}),k5=T.forwardRef((e,n)=>{let{heading:i,children:s,forceMount:l,...h}=e,d=Ut(),o=T.useRef(null),c=T.useRef(null),u=Ut(),m=Hl(),f=qi(S=>l||m.filter()===!1?!0:S.search?S.filtered.groups.has(d):!0);As(()=>m.group(d),[]),yC(d,o,[e.value,e.heading,c]);let y=T.useMemo(()=>({id:d,forceMount:l}),[l]);return T.createElement(je.div,{ref:Qr(o,n),...h,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},i&&T.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},i),Cd(e,S=>T.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?u:void 0},T.createElement(gC.Provider,{value:y},S))))}),E5=T.forwardRef((e,n)=>{let{alwaysRender:i,...s}=e,l=T.useRef(null),h=qi(d=>!d.search);return!i&&!h?null:T.createElement(je.div,{ref:Qr(l,n),...s,"cmdk-separator":"",role:"separator"})}),A5=T.forwardRef((e,n)=>{let{onValueChange:i,...s}=e,l=e.value!=null,h=ug(),d=qi(u=>u.search),o=qi(u=>u.selectedItemId),c=Hl();return T.useEffect(()=>{e.value!=null&&h.setState("search",e.value)},[e.value]),T.createElement(je.input,{ref:n,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:l?e.value:d,onChange:u=>{l||h.setState("search",u.target.value),i==null||i(u.target.value)}})}),T5=T.forwardRef((e,n)=>{let{children:i,label:s="Suggestions",...l}=e,h=T.useRef(null),d=T.useRef(null),o=qi(u=>u.selectedItemId),c=Hl();return T.useEffect(()=>{if(d.current&&h.current){let u=d.current,m=h.current,f,y=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let S=u.offsetHeight;m.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return y.observe(u),()=>{cancelAnimationFrame(f),y.unobserve(u)}}},[]),T.createElement(je.div,{ref:Qr(h,n),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":s,id:c.listId},Cd(e,u=>T.createElement("div",{ref:Qr(d,c.listInnerRef),"cmdk-list-sizer":""},u)))}),R5=T.forwardRef((e,n)=>{let{open:i,onOpenChange:s,overlayClassName:l,contentClassName:h,container:d,...o}=e;return T.createElement(jm,{open:i,onOpenChange:s},T.createElement(Om,{container:d},T.createElement(Lm,{"cmdk-overlay":"",className:l}),T.createElement(Im,{"aria-label":e.label,"cmdk-dialog":"",className:h},T.createElement(vC,{ref:n,...o}))))}),D5=T.forwardRef((e,n)=>qi(i=>i.filtered.count===0)?T.createElement(je.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),M5=T.forwardRef((e,n)=>{let{progress:i,children:s,label:l="Loading...",...h}=e;return T.createElement(je.div,{ref:n,...h,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":l},Cd(e,d=>T.createElement("div",{"aria-hidden":!0},d)))}),Ns=Object.assign(vC,{List:T5,Item:C5,Input:A5,Group:k5,Separator:E5,Dialog:R5,Empty:D5,Loading:M5});function N5(e,n){let i=e.nextElementSibling;for(;i;){if(i.matches(n))return i;i=i.nextElementSibling}}function j5(e,n){let i=e.previousElementSibling;for(;i;){if(i.matches(n))return i;i=i.previousElementSibling}}function _C(e){let n=T.useRef(e);return As(()=>{n.current=e}),n}var As=typeof window>"u"?T.useEffect:T.useLayoutEffect;function ba(e){let n=T.useRef();return n.current===void 0&&(n.current=e()),n}function qi(e){let n=ug(),i=()=>e(n.snapshot());return T.useSyncExternalStore(n.subscribe,i,i)}function yC(e,n,i,s=[]){let l=T.useRef(),h=Hl();return As(()=>{var d;let o=(()=>{var u;for(let m of i){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(u=m.current.textContent)==null?void 0:u.trim():l.current}})(),c=s.map(u=>u.trim());h.value(e,o,c),(d=n.current)==null||d.setAttribute(ya,o),l.current=o}),l}var O5=()=>{let[e,n]=T.useState(),i=ba(()=>new Map);return As(()=>{i.current.forEach(s=>s()),i.current=new Map},[e]),(s,l)=>{i.current.set(s,l),n({})}};function L5(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Cd({asChild:e,children:n},i){return e&&T.isValidElement(n)?T.cloneElement(L5(n),{ref:n.ref},i(n.props.children)):i(n)}var I5={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function B5({className:e,...n}){return g.jsx("textarea",{"data-slot":"textarea",className:be("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}function z5({className:e,...n}){return g.jsx("div",{"data-slot":"input-group",role:"group",className:be("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...n})}const P5=$a("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function F5({className:e,align:n="inline-start",...i}){return g.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":n,className:be(P5({align:n}),e),onClick:s=>{var l,h;s.target.closest("button")||(h=(l=s.currentTarget.parentElement)==null?void 0:l.querySelector("input"))==null||h.focus()},...i})}function dg({className:e,...n}){return g.jsx(Ns,{"data-slot":"command",className:be("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...n})}function bC({className:e,...n}){return g.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:g.jsxs(z5,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[g.jsx(Ns.Input,{"data-slot":"command-input",className:be("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n}),g.jsx(F5,{children:g.jsx(km,{className:"size-4 shrink-0 opacity-50"})})]})})}function hg({className:e,...n}){return g.jsx(Ns.List,{"data-slot":"command-list",className:be("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...n})}function fg({className:e,...n}){return g.jsx(Ns.Empty,{"data-slot":"command-empty",className:be("py-6 text-center text-sm",e),...n})}function bl({className:e,...n}){return g.jsx(Ns.Group,{"data-slot":"command-group",className:be("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...n})}function xC({className:e,...n}){return g.jsx(Ns.Separator,{"data-slot":"command-separator",className:be("-mx-1 h-px bg-border",e),...n})}function Ea({className:e,children:n,...i}){return g.jsxs(Ns.Item,{"data-slot":"command-item",className:be("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...i,children:[n,g.jsx(Xr,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function kd({...e}){return g.jsx(N3,{"data-slot":"popover",...e})}function pg({...e}){return g.jsx(O3,{"data-slot":"popover-trigger",...e})}function Ed({className:e,align:n="center",sideOffset:i=4,...s}){return g.jsx(L3,{children:g.jsx(I3,{"data-slot":"popover-content",align:n,sideOffset:i,className:be("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s})})}function H5({...e}){return g.jsx(j3,{"data-slot":"popover-anchor",...e})}function U5({workspaces:e,activeWorkspace:n,onSelectWorkspace:i,onCreateVirtualWorkspace:s,onCreatePhysicalWorkspace:l,isWorkspaceFavorited:h,onToggleFavorite:d}){const[o,c]=T.useState(!1),[u,m]=T.useState(!1);return g.jsxs(g.Fragment,{children:[g.jsxs(kd,{open:o,onOpenChange:c,children:[g.jsx(pg,{asChild:!0,children:g.jsxs(Te,{variant:"outline",role:"combobox","aria-expanded":o,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[g.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[n!=null&&n.isVirtual?g.jsx(qp,{className:"size-4 flex-shrink-0 text-muted-foreground"}):g.jsx(zi,{className:"size-4 flex-shrink-0 text-muted-foreground"}),g.jsx("span",{className:"truncate",children:(n==null?void 0:n.name)||"Select workspace"})]}),g.jsx(Mx,{className:"ml-auto size-4 shrink-0 opacity-50"})]})}),g.jsx(Ed,{className:"w-[240px] p-0 max-h-[80vh]",children:g.jsxs(dg,{children:[g.jsx(bC,{placeholder:"Search workspace..."}),g.jsxs(hg,{className:"max-h-[50vh] overflow-y-auto",children:[g.jsx(fg,{children:"No workspace found."}),g.jsx(bl,{heading:"Workspaces",children:e.map(f=>g.jsxs(Ea,{onSelect:()=>{i(f),c(!1)},className:"justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[f.isVirtual?g.jsx(qp,{className:"size-4 text-muted-foreground"}):g.jsx(zi,{className:"size-4 text-muted-foreground"}),g.jsx("span",{children:f.name})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:y=>{y.stopPropagation(),d(f.id,f.name)},title:h(f.id)?"Remove from favorites":"Add to favorites",children:h(f.id)?g.jsx(Rb,{className:"size-4 fill-primary text-primary"}):g.jsx(Rb,{className:"size-4 text-muted-foreground"})}),g.jsx(Xr,{className:be("size-4",(n==null?void 0:n.id)===f.id?"opacity-100":"opacity-0")})]})]},f.id))}),g.jsx(xC,{}),g.jsxs(bl,{children:[g.jsxs(Ea,{onSelect:()=>{s(),c(!1)},children:[g.jsx(Ha,{className:"size-4","data-icon":"inline-start"}),"Create virtual workspace"]}),g.jsxs(Ea,{onSelect:()=>{c(!1),m(!0)},children:[g.jsx(zi,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]})]})]})]})})]}),g.jsx(h5,{open:u,onOpenChange:m,onSelect:f=>{l(f),m(!1)},title:"Select Workspace Folder"})]})}function $5({onOpenAddServer:e,onServerSwitch:n}){const[i,s]=T.useState(!1),{servers:l,activeServer:h,switchServer:d}=Ua();return g.jsxs(kd,{open:i,onOpenChange:s,children:[g.jsx(pg,{asChild:!0,children:g.jsxs(Te,{variant:"outline",role:"combobox","aria-expanded":i,"aria-label":"Select server",className:"w-full justify-between h-9",children:[g.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[g.jsx(Ss,{className:"size-4 flex-shrink-0 text-muted-foreground"}),g.jsx("span",{className:"truncate",children:(h==null?void 0:h.name)||"Select server"})]}),g.jsx(Mx,{className:"ml-auto size-4 shrink-0 opacity-50"})]})}),g.jsx(Ed,{className:"w-[240px] p-0 max-h-[80vh]",children:g.jsxs(dg,{children:[g.jsx(bC,{placeholder:"Search server..."}),g.jsxs(hg,{className:"max-h-[50vh] overflow-y-auto",children:[g.jsx(fg,{children:"No server found."}),g.jsx(bl,{heading:"Servers",children:l.map(o=>g.jsxs(Ea,{onSelect:()=>{d(o.id),n==null||n(),s(!1)},className:"justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Ss,{className:"size-4 text-muted-foreground"}),g.jsx("span",{children:o.name})]}),g.jsx(Xr,{className:be("size-4",(h==null?void 0:h.id)===o.id?"opacity-100":"opacity-0")})]},o.id))}),g.jsx(xC,{}),g.jsx(bl,{children:g.jsxs(Ea,{onSelect:()=>{e(),s(!1)},children:[g.jsx(Ha,{className:"size-4","data-icon":"inline-start"}),"Add Server..."]})})]})]})})]})}const _p=640;function Ul(){const[e,n]=T.useState(void 0);return T.useEffect(()=>{const i=window.matchMedia(`(max-width: ${_p-1}px)`),s=()=>{n(window.innerWidth<_p)};return i.addEventListener("change",s),n(window.innerWidth<_p),()=>i.removeEventListener("change",s)},[]),!!e}function ll({className:e,orientation:n="horizontal",decorative:i=!0,...s}){return g.jsx($j,{"data-slot":"separator",decorative:i,orientation:n,className:be("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...s})}function Ad({...e}){return g.jsx(jm,{"data-slot":"sheet",...e})}function q5({...e}){return g.jsx(ND,{"data-slot":"sheet-trigger",...e})}function V5({...e}){return g.jsx(Om,{"data-slot":"sheet-portal",...e})}function G5({className:e,...n}){return g.jsx(Lm,{"data-slot":"sheet-overlay",className:be("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...n})}function Td({className:e,children:n,side:i="right",showCloseButton:s=!0,style:l,...h}){return g.jsxs(V5,{children:[g.jsx(G5,{}),g.jsxs(Im,{"data-slot":"sheet-content","data-side":i,className:be("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",e),style:(()=>{const d=i==="left"||i==="right"?{top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)"}:i==="top"?{top:"env(safe-area-inset-top, 0)"}:i==="bottom"?{bottom:"env(safe-area-inset-bottom, 0)"}:void 0;return d?{...d,...l}:l})(),...h,children:[n,s&&g.jsx(nd,{"data-slot":"sheet-close",asChild:!0,children:g.jsxs(Te,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[g.jsx(Yr,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Rd({className:e,...n}){return g.jsx("div",{"data-slot":"sheet-header",className:be("flex flex-col gap-0.5 p-4",e),...n})}function Dd({className:e,...n}){return g.jsx(S1,{"data-slot":"sheet-title",className:be("text-base font-medium text-foreground",e),...n})}function W5({className:e,...n}){return g.jsx(w1,{"data-slot":"sheet-description",className:be("text-sm text-muted-foreground",e),...n})}function xl({delayDuration:e=0,...n}){return g.jsx(dO,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function ja({...e}){return g.jsx(hO,{"data-slot":"tooltip",...e})}function Oa({...e}){return g.jsx(fO,{"data-slot":"tooltip-trigger",...e})}function La({className:e,sideOffset:n=0,children:i,...s}){return g.jsx(pO,{children:g.jsxs(mO,{"data-slot":"tooltip-content",sideOffset:n,className:be("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s,children:[i,g.jsx(gO,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const K5="sidebar_state",Y5=3600*24*7,X5="16rem",Z5="18rem",Q5="3rem",J5="b",SC=T.createContext(null);function mg(){const e=T.useContext(SC);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function e4({defaultOpen:e=!0,open:n,onOpenChange:i,className:s,style:l,children:h,...d}){const o=Ul(),[c,u]=T.useState(!1),[m,f]=T.useState(e),y=n!=null?n:m,S=T.useCallback(b=>{const v=typeof b=="function"?b(y):b;i?i(v):f(v),document.cookie=`${K5}=${v}; path=/; max-age=${Y5}`},[i,y]),k=T.useCallback(()=>o?u(b=>!b):S(b=>!b),[o,S,u]);T.useEffect(()=>{const b=v=>{v.key===J5&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[k]);const w=y?"expanded":"collapsed",_=T.useMemo(()=>({state:w,open:y,setOpen:S,isMobile:o,openMobile:c,setOpenMobile:u,toggleSidebar:k}),[w,y,S,o,c,u,k]);return g.jsx(SC.Provider,{value:_,children:g.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":X5,"--sidebar-width-icon":Q5,...l},className:be("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",s),...d,children:h})})}function t4({side:e="left",variant:n="sidebar",collapsible:i="offcanvas",className:s,children:l,dir:h,...d}){const{isMobile:o,state:c,openMobile:u,setOpenMobile:m}=mg();return i==="none"?g.jsx("div",{"data-slot":"sidebar",className:be("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",s),...d,children:l}):o?g.jsx(Ad,{open:u,onOpenChange:m,...d,children:g.jsxs(Td,{dir:h,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Z5},side:e,children:[g.jsxs(Rd,{className:"sr-only",children:[g.jsx(Dd,{children:"Sidebar"}),g.jsx(W5,{children:"Displays the mobile sidebar."})]}),g.jsx("div",{className:"flex h-full w-full flex-col",style:{paddingTop:"env(safe-area-inset-top, 0)"},children:l})]})}):g.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?i:"","data-variant":n,"data-side":e,"data-slot":"sidebar",children:[g.jsx("div",{"data-slot":"sidebar-gap",className:be("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),g.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:be("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),style:{top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},...d,children:g.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:l})})]})}function y0({className:e,onClick:n,...i}){const{toggleSidebar:s}=mg();return g.jsxs(Te,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:be(e),onClick:l=>{n==null||n(l),s()},...i,children:[g.jsx(cT,{}),g.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function n4({className:e,...n}){return g.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:be("flex flex-col gap-2 p-2",e),...n})}function r4({className:e,...n}){return g.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:be("flex flex-col gap-2 p-2",e),...n})}function i4({className:e,...n}){return g.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:be("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n})}function ul({className:e,...n}){return g.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:be("relative flex w-full min-w-0 flex-col p-2",e),...n})}function dl({className:e,asChild:n=!1,...i}){const s=n?Tl:"div";return g.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:be("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",e),...i})}function hl({className:e,...n}){return g.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:be("w-full text-sm",e),...n})}function Sa({className:e,...n}){return g.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:be("flex w-full min-w-0 flex-col gap-0",e),...n})}function xs({className:e,...n}){return g.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:be("group/menu-item relative",e),...n})}const s4=$a("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Aa({asChild:e=!1,isActive:n=!1,variant:i="default",size:s="default",tooltip:l,className:h,...d}){const o=e?Tl:"button",{isMobile:c,state:u}=mg(),m=g.jsx(o,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":n,className:be(s4({variant:i,size:s}),h),...d});return l?(typeof l=="string"&&(l={children:l}),g.jsxs(ja,{children:[g.jsx(Oa,{asChild:!0,children:m}),g.jsx(La,{side:"right",align:"center",hidden:u!=="collapsed"||c,...l})]})):m}function a4({className:e,asChild:n=!1,showOnHover:i=!1,...s}){const l=n?Tl:"button";return g.jsx(l,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:be("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",i&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",e),...s})}function o4({className:e,...n}){return g.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:be("ml-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5 group-data-[collapsible=icon]:hidden",e),...n})}function Ia({...e}){return g.jsx(bR,{"data-slot":"collapsible",...e})}function Ba({...e}){return g.jsx(Wx,{"data-slot":"collapsible-trigger",...e})}function za({...e}){return g.jsx(Kx,{"data-slot":"collapsible-content",...e})}function l4({...e}){return g.jsx(g3,{"data-slot":"dropdown-menu",...e})}function c4({...e}){return g.jsx(v3,{"data-slot":"dropdown-menu-trigger",...e})}function u4({className:e,align:n="start",sideOffset:i=4,...s}){return g.jsx(_3,{children:g.jsx(y3,{"data-slot":"dropdown-menu-content",sideOffset:i,align:n,className:be("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...s})})}function yp({className:e,inset:n,variant:i="default",...s}){return g.jsx(b3,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":i,className:be("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...s})}const b0=Yn.memo(function({isClosed:n,onReopen:i,onClose:s,onDelete:l}){return g.jsxs(l4,{children:[g.jsx(c4,{asChild:!0,children:g.jsxs(a4,{showOnHover:!0,children:[g.jsx(NA,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Session actions"})]})}),g.jsx(u4,{align:"end",children:n?g.jsxs(g.Fragment,{children:[g.jsxs(yp,{onClick:i,children:[g.jsx(vT,{className:"size-4"}),"Restore"]}),g.jsxs(yp,{onClick:l,className:"text-destructive focus:text-destructive",children:[g.jsx(El,{className:"size-4"}),"Delete permanently"]})]}):g.jsxs(yp,{onClick:s,children:[g.jsx(Yr,{className:"size-4"}),"Archive"]})})]})}),x0=Yn.memo(function({status:n,isStreaming:i,runningAt:s}){return i||n==="running"||!!s?g.jsx(Zn,{className:"size-3.5 animate-spin shrink-0"}):n==="error"?g.jsx(Yu,{className:"size-3.5 shrink-0"}):g.jsx(kl,{className:"size-3.5 shrink-0"})}),dm=Yn.memo(function e({session:n,allSessions:i,isActive:s,currentSessionId:l,streamingSessionId:h,onResumeSession:d,onCloseSession:o,onReopenSession:c,onDeleteSession:u}){const m=T.useMemo(()=>i.filter(w=>w.parentId===n.id),[i,n.id]),f=m.length>0,y=n.status==="closed",S=T.useMemo(()=>m.some(w=>w.id===l),[m,l]),k=n.id===h;return f?g.jsx(xl,{delayDuration:300,children:g.jsx(Ia,{defaultOpen:s||S,className:"group/collapsible",children:g.jsxs(xs,{children:[g.jsxs("div",{className:"flex items-center w-full",children:[g.jsx(Ba,{asChild:!0,children:g.jsx("button",{className:"flex items-center justify-center rounded-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0 size-7 p-1","aria-label":"Toggle child sessions",children:g.jsx(Zr,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),g.jsx(Aa,{isActive:s,onClick:()=>d(n.id),className:"flex-1 min-w-0",children:g.jsxs(ja,{children:[g.jsx(Oa,{asChild:!0,children:g.jsxs("span",{className:"truncate flex items-center gap-2",children:[g.jsx(x0,{status:n.subagentStatus,isStreaming:k,runningAt:n.runningAt}),n.title||"Untitled"]})}),g.jsx(La,{side:"right",className:"max-w-xs",children:n.title||"Untitled"})]})}),g.jsx(b0,{isClosed:y,onReopen:()=>c(n.id),onClose:()=>o(n.id),onDelete:()=>u(n.id)})]}),g.jsx(za,{children:g.jsx(o4,{children:m.map(w=>g.jsx(e,{session:w,allSessions:i,isActive:l===w.id,currentSessionId:l,streamingSessionId:h,onResumeSession:d,onCloseSession:o,onReopenSession:c,onDeleteSession:u},w.id))})})]})})}):g.jsx(xl,{delayDuration:300,children:g.jsx(xs,{children:g.jsxs("div",{className:"flex items-center w-full",children:[g.jsx("div",{className:"shrink-0 size-7 p-1"}),g.jsx(Aa,{isActive:s,onClick:()=>d(n.id),className:"flex-1 min-w-0",children:g.jsxs(ja,{children:[g.jsx(Oa,{asChild:!0,children:g.jsxs("span",{className:"truncate flex items-center gap-2",children:[g.jsx(x0,{status:n.subagentStatus,isStreaming:k,runningAt:n.runningAt}),n.title||"Untitled"]})}),g.jsx(La,{side:"right",className:"max-w-xs",children:n.title||"Untitled"})]})}),g.jsx(b0,{isClosed:y,onReopen:()=>c(n.id),onClose:()=>o(n.id),onDelete:()=>u(n.id)})]})})})}),d4=$a("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function xn({className:e,variant:n="default",asChild:i=!1,...s}){const l=i?Tl:"span";return g.jsx(l,{"data-slot":"badge","data-variant":n,className:be(d4({variant:n}),e),...s})}const h4=Yn.memo(function({allSessions:n,currentSession:i,currentSessionId:s,streamingSessionId:l,favoritedWorkspaceIds:h,workspaces:d,activeWorkspace:o,onSelectWorkspace:c,onResumeSession:u,onCloseSession:m,onReopenSession:f,onDeleteSession:y,onCreateSessionInWorkspace:S,connected:k}){const w=T.useMemo(()=>{const b=new Map(d.map(v=>[v.id,v]));return h.map(v=>b.get(v)).filter(v=>v!==void 0)},[d,h]),_=T.useMemo(()=>{const b=new Map;for(const v of w){const x=n.filter(E=>E.workspaceId===v.id&&E.status==="active"&&E.parentId===null).sort((E,M)=>new Date(M.updatedAt).getTime()-new Date(E.updatedAt).getTime());b.set(v.id,x)}return b},[n,w]);return w.length===0?g.jsxs(ul,{children:[g.jsx(dl,{children:"Overview"}),g.jsx(hl,{children:g.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}):g.jsxs(ul,{children:[g.jsx(dl,{children:"Overview"}),g.jsx(hl,{children:w.map(b=>{const v=b.id===(o==null?void 0:o.id),x=_.get(b.id)||[];return g.jsx(Ia,{defaultOpen:v,className:"group/collapsible",children:g.jsxs(ul,{children:[g.jsx(dl,{asChild:!0,children:g.jsxs(Ba,{className:"flex items-center justify-between w-full",onClick:()=>c(b),children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(Zr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),b.isVirtual?g.jsx(qp,{className:"size-3.5"}):g.jsx(zi,{className:"size-3.5"}),g.jsx("span",{className:"truncate",children:b.name})]}),g.jsx(xn,{variant:"secondary",children:x.length})]})}),g.jsx(za,{children:g.jsxs(hl,{children:[g.jsx(Sa,{children:g.jsx(xs,{children:g.jsxs(Aa,{onClick:()=>S(b.id),disabled:!k,className:"w-full",children:[g.jsx(Ha,{className:"size-4","data-icon":"inline-start"}),g.jsx("span",{children:"New Chat"})]})})}),g.jsx(Sa,{children:x.length===0?g.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):x.map(E=>g.jsx(dm,{session:E,allSessions:n,isActive:(i==null?void 0:i.id)===E.id,currentSessionId:s,streamingSessionId:l,onResumeSession:u,onCloseSession:m,onReopenSession:f,onDeleteSession:y},E.id))})]})})]})},b.id)})})]})});function f4({sessions:e,currentSession:n,currentSessionId:i,streamingSessionId:s,connected:l,workspaces:h,activeWorkspace:d,allSessions:o,viewMode:c,favoritedWorkspaceIds:u,onCreateSession:m,onResumeSession:f,onCloseSession:y,onReopenSession:S,onDeleteSession:k,onSelectWorkspace:w,onCreateVirtualWorkspace:_,onCreatePhysicalWorkspace:b,onCreateSessionInWorkspace:v,onOpenSettings:x,onOpenMCP:E,onOpenAddServer:M,onServerSwitch:R}){const{quickConnections:j,addToQuickConnections:D,activeServer:O}=Ua(),{activeSessions:P,archivedSessions:U}=T.useMemo(()=>{const K=e.filter(Y=>!Y.parentId);return{activeSessions:K.filter(Y=>Y.status==="active"),archivedSessions:K.filter(Y=>Y.status==="closed")}},[e]),q=K=>j.some(Y=>Y.workspaceId===K&&Y.serverId===(O==null?void 0:O.id)),$=(K,Y)=>{O&&D(O.id,O.name,K,Y)};return g.jsxs(t4,{collapsible:"offcanvas",children:[g.jsxs(n4,{children:[g.jsxs("div",{className:"p-2 space-y-2",children:[g.jsx($5,{onOpenAddServer:M,onServerSwitch:R}),c!=="overview"&&g.jsx(U5,{workspaces:h,activeWorkspace:d,onSelectWorkspace:w,onCreateVirtualWorkspace:_,onCreatePhysicalWorkspace:b,isWorkspaceFavorited:q,onToggleFavorite:$})]}),c!=="overview"&&g.jsx(Sa,{children:g.jsx(xs,{children:g.jsxs(Aa,{onClick:m,disabled:!l,className:"w-full",children:[g.jsx(Ha,{className:"size-4","data-icon":"inline-start"}),g.jsx("span",{children:"New Chat"})]})})})]}),g.jsx(i4,{children:c==="overview"?g.jsx(h4,{allSessions:o,currentSession:n,currentSessionId:i,streamingSessionId:s,favoritedWorkspaceIds:u,workspaces:h,activeWorkspace:d,onSelectWorkspace:w,onResumeSession:f,onCloseSession:y,onReopenSession:S,onDeleteSession:k,onCreateSessionInWorkspace:v,connected:l}):g.jsxs(g.Fragment,{children:[P.length>0&&g.jsx(Ia,{defaultOpen:!0,className:"group/collapsible",children:g.jsxs(ul,{children:[g.jsx(dl,{asChild:!0,children:g.jsxs(Ba,{className:"flex items-center justify-between w-full",children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(Zr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),g.jsx(xn,{variant:"secondary",children:P.length})]})}),g.jsx(za,{children:g.jsx(hl,{children:g.jsx(Sa,{children:P.map(K=>g.jsx(dm,{session:K,allSessions:e,isActive:(n==null?void 0:n.id)===K.id,currentSessionId:i,streamingSessionId:s,onResumeSession:f,onCloseSession:y,onReopenSession:S,onDeleteSession:k},K.id))})})})]})}),U.length>0&&g.jsx(Ia,{defaultOpen:!0,className:"group/collapsible",children:g.jsxs(ul,{children:[g.jsx(dl,{asChild:!0,children:g.jsxs(Ba,{className:"flex items-center justify-between w-full",children:[g.jsxs("span",{className:"flex items-center gap-2",children:[g.jsx(Zr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),g.jsx(xn,{variant:"secondary",children:U.length})]})}),g.jsx(za,{children:g.jsx(hl,{children:g.jsx(Sa,{children:U.map(K=>g.jsx(dm,{session:K,allSessions:e,isActive:(n==null?void 0:n.id)===K.id,currentSessionId:i,streamingSessionId:s,onResumeSession:f,onCloseSession:y,onReopenSession:S,onDeleteSession:k},K.id))})})})]})}),P.length===0&&U.length===0&&g.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["No sessions yet.",g.jsx("br",{}),"Start a new chat to begin."]})]})}),g.jsx(r4,{className:"pb-4",children:g.jsxs(Sa,{children:[g.jsx(xs,{children:g.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[l?g.jsx(zT,{className:"size-3.5 text-success"}):g.jsx(Ix,{className:"size-3.5 text-destructive"}),g.jsx("span",{className:"text-xs text-muted-foreground",children:l?"Connected":"Disconnected"})]})}),g.jsx(xs,{children:g.jsxs(Aa,{onClick:E,children:[g.jsx(Ss,{className:"size-4","data-icon":"inline-start"}),g.jsx("span",{children:"MCP Servers"})]})}),g.jsx(xs,{children:g.jsx("div",{className:"flex items-center gap-1",children:g.jsxs(Aa,{onClick:x,children:[g.jsx(jx,{className:"size-4","data-icon":"inline-start"}),g.jsx("span",{children:"Settings"})]})})})]})})]})}const p4={".ts":{icon:_r,color:"text-blue-500"},".tsx":{icon:_r,color:"text-blue-500"},".js":{icon:_r,color:"text-yellow-500"},".jsx":{icon:_r,color:"text-yellow-500"},".json":{icon:_r,color:"text-yellow-600"},".md":{icon:_r,color:"text-gray-500"},".css":{icon:_r,color:"text-purple-500"},".html":{icon:_r,color:"text-orange-500"}};function wC({entry:e,workspaceId:n,parentPath:i,depth:s,onFileSelect:l,showHidden:h=!0,serverUrl:d,apiToken:o}){const{fetchWithAuth:c}=Pl(),[u,m]=T.useState(!1),[f,y]=T.useState([]),[S,k]=T.useState(!1),[w,_]=T.useState(!1),b=i?`${i}/${e.path}`:e.path,v=e.type==="directory",x=async()=>{if(!(w||S)){k(!0);try{const P=await(await c(`/api/workspaces/${n}/files?path=${encodeURIComponent(b)}&showHidden=${h}`,{},{serverUrl:d,token:o})).json();y(P.files||[]),_(!0)}catch(O){console.error("Failed to load children:",O)}finally{k(!1)}}},E=O=>{m(O),O&&v&&x()},M=()=>{!v&&l&&l({...e,path:b})},R=e.extension?p4[e.extension]:null,j=v?u?Gp:zi:(R==null?void 0:R.icon)||_r,D=v?"text-amber-500":(R==null?void 0:R.color)||"text-muted-foreground";return v?g.jsxs(Ia,{open:u,onOpenChange:E,children:[g.jsx(Ba,{asChild:!0,children:g.jsxs("button",{className:be("flex items-center gap-1.5 w-full px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${s*12+6}px`},children:[S?g.jsx(Zn,{className:"w-3 h-3 animate-spin flex-shrink-0"}):g.jsx(Zr,{className:be("w-3 h-3 flex-shrink-0 transition-transform",u&&"rotate-90")}),g.jsx(j,{className:be("w-4 h-4 flex-shrink-0",D)}),g.jsx("span",{className:"truncate",children:e.name})]})}),g.jsx(za,{children:f.map(O=>g.jsx(wC,{entry:O,workspaceId:n,parentPath:b,depth:s+1,onFileSelect:l,showHidden:h,serverUrl:d,apiToken:o},`${b}/${O.path}`))})]}):g.jsxs("button",{onClick:M,className:be("flex items-center gap-1.5 w-full px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${s*12+6}px`},children:[g.jsx(j,{className:be("w-4 h-4 flex-shrink-0",D)}),g.jsx("span",{className:"truncate",children:e.name})]})}function S0({workspaceId:e,serverUrl:n,apiToken:i,onFileSelect:s,showHidden:l=!0}){const[h,d]=T.useState([]),[o,c]=T.useState(""),[u,m]=T.useState(!0),[f,y]=T.useState(null),{fetchWithAuth:S}=Pl(),k=T.useCallback(async()=>{m(!0),y(null);try{const w=await S(`/api/workspaces/${e}/files?showHidden=${l}`,{},{serverUrl:n,token:i}),_=await w.json();if(!w.ok)throw new Error(_.message||"Failed to load files");d(_.files),c(_.currentPath)}catch(w){y(w instanceof Error?w.message:"Failed to load files")}finally{m(!1)}},[e,l,S,n,i]);return T.useEffect(()=>{k()},[k]),u?g.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[g.jsx(Zn,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):f?g.jsxs("div",{className:"p-4 text-sm text-destructive",children:[f,g.jsx(Te,{variant:"ghost",size:"sm",onClick:k,className:"ml-2",children:g.jsx(wa,{className:"w-3 h-3"})})]}):h.length===0?g.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",g.jsx(Te,{variant:"ghost",size:"sm",onClick:k,className:"ml-2",children:g.jsx(wa,{className:"w-3 h-3"})})]}):g.jsx($i,{className:"h-full",children:g.jsxs("div",{className:"p-2",children:[g.jsxs("div",{className:"flex items-center justify-between mb-2 px-1",children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Files"}),g.jsx(Te,{variant:"ghost",size:"icon",className:"h-5 w-5",onClick:k,children:g.jsx(wa,{className:"w-3 h-3"})})]}),g.jsx("div",{className:"space-y-0.5",children:h.map(w=>g.jsx(wC,{entry:w,workspaceId:e,parentPath:o,depth:0,onFileSelect:s,showHidden:l,serverUrl:n,apiToken:i},w.path))})]})})}function m4({workspaceId:e,searchQuery:n,selectedIndex:i,onSelect:s,onFilesChange:l,showHidden:h=!0,serverUrl:d,apiToken:o}){const[c,u]=T.useState([]),[m,f]=T.useState(!1),[y,S]=T.useState(n),{fetchWithAuth:k}=Pl();return T.useEffect(()=>{const w=setTimeout(()=>{S(n)},150);return()=>clearTimeout(w)},[n]),T.useEffect(()=>{if(!y||y.length<2){u([]),l([]);return}f(!0);const w=new AbortController;return k(`/api/workspaces/${e}/files?search=${encodeURIComponent(y)}&showHidden=${h}`,{signal:w.signal},{serverUrl:d,token:o}).then(_=>_.json()).then(_=>{const b=_.files||[];u(b),l(b)}).catch(_=>{_.name!=="AbortError"&&console.error("File search failed:",_)}).finally(()=>f(!1)),()=>w.abort()},[e,y,l,h,k,d,o]),!n||n.length<2?g.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}):m?g.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[g.jsx(Zn,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}):c.length===0?g.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',n,'"']}):g.jsxs("div",{className:"p-1",children:[c.map((w,_)=>g.jsxs("button",{onClick:()=>s(w),className:be("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",_===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[w.type==="directory"?g.jsx(zi,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):g.jsx(_r,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),g.jsx("span",{className:"truncate flex-1",children:w.path}),w.extension&&g.jsx("span",{className:"text-xs text-muted-foreground",children:w.extension})]},w.path)),g.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[c.length," result",c.length!==1?"s":""," •",g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"})," navigate",g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"})," select",g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"})," close"]})]})}function g4({workspaceId:e,serverUrl:n,apiToken:i,isOpen:s,onClose:l}){const h=Ul();return e?h?g.jsx(Ad,{open:s,onOpenChange:d=>!d&&l(),children:g.jsxs(Td,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[g.jsx(Rd,{className:"sr-only",children:g.jsx(Dd,{children:"Files"})}),g.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[g.jsx("span",{className:"font-semibold text-sm",children:"Files"}),g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:l,children:g.jsx(Yr,{className:"w-4 h-4"})})]}),g.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",style:{paddingBottom:"max(1.5rem, env(safe-area-inset-bottom, 0))"},children:g.jsx($i,{className:"flex-1 min-h-0 pb-8",children:g.jsx(S0,{workspaceId:e,serverUrl:n,apiToken:i,showHidden:!0},e)})})]})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:be("relative w-64 bg-transparent transition-[width] duration-200 ease-linear",!s&&"w-0")}),g.jsxs("div",{className:be("fixed right-0 z-10 w-64 bg-sidebar border-l border-border flex flex-col overflow-hidden","transform transition-transform duration-200 ease-linear",!s&&"translate-x-full"),style:{top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},children:[g.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[g.jsx("span",{className:"font-semibold text-sm",children:"Files"}),g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:l,children:g.jsx(Yr,{className:"w-4 h-4"})})]}),g.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",style:{paddingBottom:"max(1.5rem, env(safe-area-inset-bottom, 0))"},children:g.jsx($i,{className:"flex-1 min-h-0",children:g.jsx(S0,{workspaceId:e,serverUrl:n,apiToken:i,showHidden:!0},e)})})]})]}):null}var bp={exports:{}},w0;function v4(){return w0||(w0=1,(function(e,n){(function(i,s){e.exports=s()})(globalThis,(()=>(()=>{var i={4567:function(d,o,c){var u=this&&this.__decorate||function(v,x,E,M){var R,j=arguments.length,D=j<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,M);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(j<3?R(D):j>3?R(x,E,D):R(x,E))||D);return j>3&&D&&Object.defineProperty(x,E,D),D},m=this&&this.__param||function(v,x){return function(E,M){x(E,M,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=c(9042),y=c(9924),S=c(844),k=c(4725),w=c(2585),_=c(3656);let b=o.AccessibilityManager=class extends S.Disposable{constructor(v,x,E,M){super(),this._terminal=v,this._coreBrowserService=E,this._renderService=M,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new 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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
444
- `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,_.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let x=0;x<v;x++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
445
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.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,x){this._liveRegionDebouncer.refresh(v,x,this._terminal.rows)}_renderRows(v,x){const E=this._terminal.buffer,M=E.lines.length.toString();for(let R=v;R<=x;R++){const j=E.lines.get(E.ydisp+R),D=[],O=(j==null?void 0:j.translateToString(!0,void 0,void 0,D))||"",P=(E.ydisp+R+1).toString(),U=this._rowElements[R];U&&(O.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=O,this._rowColumns.set(U,D)),U.setAttribute("aria-posinset",P),U.setAttribute("aria-setsize",M))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,x){const E=v.target,M=this._rowElements[x===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==M)return;let R,j;if(x===0?(R=E,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(R=this._rowElements.shift(),j=E,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),j.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const D=this._createAccessibilityTreeNode();this._rowElements.unshift(D),this._rowContainer.insertAdjacentElement("afterbegin",D)}else{const D=this._createAccessibilityTreeNode();this._rowElements.push(D),this._rowContainer.appendChild(D)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){var O,P;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 x={node:v.anchorNode,offset:v.anchorOffset},E={node:v.focusNode,offset:v.focusOffset};if((x.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===E.node&&x.offset>E.offset)&&([x,E]=[E,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const M=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(M)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:M,offset:(P=(O=M.textContent)==null?void 0:O.length)!=null?P:0}),!this._rowContainer.contains(E.node))return;const R=({node:U,offset:q})=>{const $=U instanceof Text?U.parentNode:U;let K=parseInt($==null?void 0:$.getAttribute("aria-posinset"),10)-1;if(isNaN(K))return console.warn("row is invalid. Race condition?"),null;const Y=this._rowColumns.get($);if(!Y)return console.warn("columns is null. Race condition?"),null;let V=q<Y.length?Y[q]:Y.slice(-1)[0]+1;return V>=this._terminal.cols&&(++K,V=0),{row:K,column:V}},j=R(x),D=R(E);if(j&&D){if(j.row>D.row||j.row===D.row&&j.column>=D.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(D.row-j.row)*this._terminal.cols-j.column+D.column)}}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);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`}};o.AccessibilityManager=b=u([m(1,w.IInstantiationService),m(2,k.ICoreBrowserService),m(3,k.IRenderService)],b)},3614:(d,o)=>{function c(y){return y.replace(/\r?\n/g,"\r")}function u(y,S){return S?"\x1B[200~"+y+"\x1B[201~":y}function m(y,S,k,w){y=u(y=c(y),k.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(y,!0),S.value=""}function f(y,S,k){const w=k.getBoundingClientRect(),_=y.clientX-w.left-10,b=y.clientY-w.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${_}px`,S.style.top=`${b}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=u,o.copyHandler=function(y,S){y.clipboardData&&y.clipboardData.setData("text/plain",S.selectionText),y.preventDefault()},o.handlePasteEvent=function(y,S,k,w){y.stopPropagation(),y.clipboardData&&m(y.clipboardData.getData("text/plain"),S,k,w)},o.paste=m,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(y,S,k,w,_){f(y,S,k),_&&w.rightClickSelect(y),S.value=w.selectionText,S.select()}},7239:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=c(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(m,f,y){this._css.set(m,f,y)}getCss(m,f){return this._css.get(m,f)}setColor(m,f,y){this._color.set(m,f,y)}getColor(m,f){return this._color.get(m,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,u,m,f){c.addEventListener(u,m,f);let y=!1;return{dispose:()=>{y||(y=!0,c.removeEventListener(u,m,f))}}}},3551:function(d,o,c){var u=this&&this.__decorate||function(b,v,x,E){var M,R=arguments.length,j=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,v,x,E);else for(var D=b.length-1;D>=0;D--)(M=b[D])&&(j=(R<3?M(j):R>3?M(v,x,j):M(v,x))||j);return R>3&&j&&Object.defineProperty(v,x,j),j},m=this&&this.__param||function(b,v){return function(x,E){v(x,E,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=c(3656),y=c(8460),S=c(844),k=c(2585),w=c(4725);let _=o.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(b,v,x,E,M){super(),this._element=b,this._mouseService=v,this._renderService=x,this._bufferService=E,this._linkProviderService=M,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,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const v=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const x=b.composedPath();for(let E=0;E<x.length;E++){const M=x[E];if(M.classList.contains("xterm"))break;if(M.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,v){var E,M;this._activeProviderReplies&&v||((E=this._activeProviderReplies)==null||E.forEach((R=>{R==null||R.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let x=!1;for(const[R,j]of this._linkProviderService.linkProviders.entries())v?(M=this._activeProviderReplies)!=null&&M.get(R)&&(x=this._checkLinkProviderResult(R,b,x)):j.provideLinks(b.y,(D=>{var P,U;if(this._isMouseOut)return;const O=D==null?void 0:D.map((q=>({link:q})));(P=this._activeProviderReplies)==null||P.set(R,O),x=this._checkLinkProviderResult(R,b,x),((U=this._activeProviderReplies)==null?void 0:U.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,v){const x=new Set;for(let E=0;E<v.size;E++){const M=v.get(E);if(M)for(let R=0;R<M.length;R++){const j=M[R],D=j.link.range.start.y<b?0:j.link.range.start.x,O=j.link.range.end.y>b?this._bufferService.cols:j.link.range.end.x;for(let P=D;P<=O;P++){if(x.has(P)){M.splice(R--,1);break}x.add(P)}}}}_checkLinkProviderResult(b,v,x){var R;if(!this._activeProviderReplies)return x;const E=this._activeProviderReplies.get(b);let M=!1;for(let j=0;j<b;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(M=!0);if(!M&&E){const j=E.find((D=>this._linkAtPosition(D.link,v)));j&&(x=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let j=0;j<this._activeProviderReplies.size;j++){const D=(R=this._activeProviderReplies.get(j))==null?void 0:R.find((O=>this._linkAtPosition(O.link,v)));if(D){x=!0,this._handleNewLink(D);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const v=this._positionFromMouseEvent(b,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,v){this._currentLink&&this._lastMouseEvent&&(!b||!v||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(b.link,v)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var x,E;return(E=(x=this._currentLink)==null?void 0:x.state)==null?void 0:E.decorations.pointerCursor},set:x=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,E;return(E=(x=this._currentLink)==null?void 0:x.state)==null?void 0:E.decorations.underline},set:x=>{var E,M,R;(E=this._currentLink)!=null&&E.state&&((R=(M=this._currentLink)==null?void 0:M.state)==null?void 0:R.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((x=>{if(!this._currentLink)return;const E=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,M=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=M&&(this._clearCurrentLink(E,M),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(b,v,x){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(x,v.text)}_fireUnderlineEvent(b,v){const x=b.range,E=this._bufferService.buffer.ydisp,M=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-E-1,x.end.x,x.end.y-E-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(M)}_linkLeave(b,v,x){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(x,v.text)}_linkAtPosition(b,v){const x=b.range.start.y*this._bufferService.cols+b.range.start.x,E=b.range.end.y*this._bufferService.cols+b.range.end.x,M=v.y*this._bufferService.cols+v.x;return x<=M&&M<=E}_positionFromMouseEvent(b,v,x){const E=x.getCoords(b,v,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,v,x,E,M){return{x1:b,y1:v,x2:x,y2:E,cols:this._bufferService.cols,fg:M}}};o.Linkifier=_=u([m(1,w.IMouseService),m(2,w.IRenderService),m(3,k.IBufferService),m(4,w.ILinkProviderService)],_)},9042:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,o,c){var u=this&&this.__decorate||function(w,_,b,v){var x,E=arguments.length,M=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,_,b,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(M=(E<3?x(M):E>3?x(_,b,M):x(_,b))||M);return E>3&&M&&Object.defineProperty(_,b,M),M},m=this&&this.__param||function(w,_){return function(b,v){_(b,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=c(511),y=c(2585);let S=o.OscLinkProvider=class{constructor(w,_,b){this._bufferService=w,this._optionsService=_,this._oscLinkService=b}provideLinks(w,_){var O;const b=this._bufferService.buffer.lines.get(w-1);if(!b)return void _(void 0);const v=[],x=this._optionsService.rawOptions.linkHandler,E=new f.CellData,M=b.getTrimmedLength();let R=-1,j=-1,D=!1;for(let P=0;P<M;P++)if(j!==-1||b.hasContent(P)){if(b.loadCell(P,E),E.hasExtendedAttrs()&&E.extended.urlId){if(j===-1){j=P,R=E.extended.urlId;continue}D=E.extended.urlId!==R}else j!==-1&&(D=!0);if(D||j!==-1&&P===M-1){const U=(O=this._oscLinkService.getLinkData(R))==null?void 0:O.uri;if(U){const q={start:{x:j+1,y:w},end:{x:P+(D||P!==M-1?0:1),y:w}};let $=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const K=new URL(U);["http:","https:"].includes(K.protocol)||($=!0)}catch{$=!0}$||v.push({text:U,range:q,activate:(K,Y)=>x?x.activate(K,Y,q):k(0,Y),hover:(K,Y)=>{var V;return(V=x==null?void 0:x.hover)==null?void 0:V.call(x,K,Y,q)},leave:(K,Y)=>{var V;return(V=x==null?void 0:x.leave)==null?void 0:V.call(x,K,Y,q)}})}D=!1,E.hasExtendedAttrs()&&E.extended.urlId?(j=P,R=E.extended.urlId):(j=-1,R=-1)}}_(v)}};function k(w,_){if(confirm(`Do you want to navigate to ${_}?
446
-
447
- WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=S=u([m(0,y.IBufferService),m(1,y.IOptionsService),m(2,y.IOscLinkService)],S)},6193:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,u){this._renderCallback=c,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,u,m){this._rowCount=m,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=c(3614),m=c(3656),f=c(3551),y=c(9042),S=c(3730),k=c(1680),w=c(3107),_=c(5744),b=c(2950),v=c(1296),x=c(428),E=c(4269),M=c(5114),R=c(8934),j=c(3230),D=c(9312),O=c(4725),P=c(6731),U=c(8055),q=c(8969),$=c(8460),K=c(844),Y=c(6114),V=c(8437),Z=c(2584),Q=c(7399),F=c(5941),N=c(9074),L=c(2585),B=c(5435),z=c(4567),X=c(779);class J extends q.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(W={}){super(W),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new $.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new $.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new $.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new $.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new $.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new $.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new $.EventEmitter),this._onBlur=this.register(new $.EventEmitter),this._onA11yCharEmitter=this.register(new $.EventEmitter),this._onA11yTabEmitter=this.register(new $.EventEmitter),this._onWillOpen=this.register(new $.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(N.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(X.LinkProviderService),this._instantiationService.setService(O.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,ne)=>this.refresh(H,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,$.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,$.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,K.toDisposable)((()=>{var H,ne;this._customKeyEventHandler=void 0,(ne=(H=this.element)==null?void 0:H.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(W){if(this._themeService)for(const H of W){let ne,ae="";switch(H.index){case 256:ne="foreground",ae="10";break;case 257:ne="background",ae="11";break;case 258:ne="cursor",ae="12";break;default:ne="ansi",ae="4;"+H.index}switch(H.type){case 0:const pe=U.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${Z.C0.ESC}]${ae};${(0,F.toRgbString)(pe)}${Z.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((ue=>ue.ansi[H.index]=U.channels.toColor(...H.color)));else{const ue=ne;this._themeService.modifyColors((Re=>Re[ue]=U.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Z.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 W=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(W);if(!H)return;const ne=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,pe=H.getWidth(ne),ue=this._renderService.dimensions.css.cell.width*pe,Re=this.buffer.y*this._renderService.dimensions.css.cell.height,Ie=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ie+"px",this.textarea.style.top=Re+"px",this.textarea.style.width=ue+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,u.copyHandler)(H,this._selectionService)})));const W=H=>(0,u.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,m.addDisposableDomListener)(this.element,"paste",W)),Y.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,u.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,u.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,u.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(W=>this._keyUp(W)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(W=>this._keyDown(W)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(W=>this._keyPress(W)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(W=>this._compositionHelper.compositionupdate(W)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(W=>this._inputEvent(W)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(W){var ne,ae,pe;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ne=this.element)==null?void 0:ne.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(ue=>this.updateCursorStyle(ue)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(M.CoreBrowserService,this.textarea,(ae=W.ownerDocument.defaultView)!=null?ae:window,((pe=this._document)!=null?pe:typeof window<"u")?window.document:null)),this._instantiationService.setService(O.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(ue=>this._handleTextAreaFocus(ue)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(O.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(P.ThemeService),this._instantiationService.setService(O.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(O.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(j.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(O.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ue=>this._onRender.fire(ue)))),this.onResize((ue=>this._renderService.resize(ue.cols,ue.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(O.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ue=>this.scrollLines(ue.amount,ue.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(D.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(O.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ue=>this.scrollLines(ue.amount,ue.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ue=>this._renderService.handleSelectionChanged(ue.start,ue.end,ue.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ue=>{this.textarea.value=ue,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ue=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(ue=>this._selectionService.handleMouseDown(ue)))),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(z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ue=>this._handleScreenReaderModeOptionChange(ue)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ue=>{!this._overviewRulerRenderer&&ue&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(v.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,H=this.element;function ne(ue){const Re=W._mouseService.getMouseReportCoords(ue,W.screenElement);if(!Re)return!1;let Ie,Fe;switch(ue.overrideType||ue.type){case"mousemove":Fe=32,ue.buttons===void 0?(Ie=3,ue.button!==void 0&&(Ie=ue.button<3?ue.button:3)):Ie=1&ue.buttons?0:4&ue.buttons?1:2&ue.buttons?2:3;break;case"mouseup":Fe=0,Ie=ue.button<3?ue.button:3;break;case"mousedown":Fe=1,Ie=ue.button<3?ue.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(ue)===!1||W.viewport.getLinesScrolled(ue)===0)return!1;Fe=ue.deltaY<0?0:1,Ie=4;break;default:return!1}return!(Fe===void 0||Ie===void 0||Ie>4)&&W.coreMouseService.triggerMouseEvent({col:Re.col,row:Re.row,x:Re.x,y:Re.y,button:Ie,action:Fe,ctrl:ue.ctrlKey,alt:ue.altKey,shift:ue.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:ue=>(ne(ue),ue.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(ue)),wheel:ue=>(ne(ue),this.cancel(ue,!0)),mousedrag:ue=>{ue.buttons&&ne(ue)},mousemove:ue=>{ue.buttons||ne(ue)}};this.register(this.coreMouseService.onProtocolChange((ue=>{ue?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ue)),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&ue?ae.mousemove||(H.addEventListener("mousemove",pe.mousemove),ae.mousemove=pe.mousemove):(H.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&ue?ae.wheel||(H.addEventListener("wheel",pe.wheel,{passive:!1}),ae.wheel=pe.wheel):(H.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&ue?ae.mouseup||(ae.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&ue?ae.mousedrag||(ae.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(H,"mousedown",(ue=>{if(ue.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ue))return ne(ue),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(ue)}))),this.register((0,m.addDisposableDomListener)(H,"wheel",(ue=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ue)===!1)return!1;if(!this.buffer.hasScrollback){const Re=this.viewport.getLinesScrolled(ue);if(Re===0)return;const Ie=Z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ue.deltaY<0?"A":"B");let Fe="";for(let lt=0;lt<Math.abs(Re);lt++)Fe+=Ie;return this.coreService.triggerDataEvent(Fe,!0),this.cancel(ue,!0)}return this.viewport.handleWheel(ue)?this.cancel(ue):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(H,"touchstart",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ue),this.cancel(ue)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(H,"touchmove",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ue)?void 0:this.cancel(ue)}),{passive:!1}))}refresh(W,H){var ne;(ne=this._renderService)==null||ne.refreshRows(W,H)}updateCursorStyle(W){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(W)?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(W,H,ne=0){var ae;ne===1?(super.scrollLines(W,H,ne),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.scrollLines(W)}paste(W){(0,u.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,H,ne){this._selectionService.setSelection(W,H,ne)}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 W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,H){var ne;(ne=this._selectionService)==null||ne.selectLines(W,H)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!H&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,Q.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),ne.type===3||ne.type===2){const ae=this.rows-1;return this.scrollLines(ne.type===2?-ae:ae),this.cancel(W,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(ne.cancel&&this.cancel(W,!0),!ne.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==Z.C0.ETX&&ne.key!==Z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,H){const ne=W.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||W.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||W.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?ne:ne&&(!H.keyCode||H.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)H=W.charCode;else if(W.which===null||W.which===void 0)H=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;H=W.which}return!(!H||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=W.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(W),!0}return!1}resize(W,H){W!==this.cols||H!==this.rows?super.resize(W,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,H){var ne,ae;(ne=this._charSizeService)==null||ne.measure(),(ae=this.viewport)==null||ae.syncScrollArea(!0)}clear(){var W;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var H,ne;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.reset(),this._decorationService.reset(),(ne=this.viewport)==null||ne.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(Z.C0.ESC+"[I"):this.coreService.triggerDataEvent(Z.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Z.C0.ESC}[4;${ne};${H}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),pe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Z.C0.ESC}[6;${pe};${ae}t`)}}cancel(W,H){if(this.options.cancelEvents||H)return W.preventDefault(),W.stopPropagation(),!1}}o.Terminal=J},9924:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,m){this._rowCount=m,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=f-this._lastRefreshMs,S=this._debounceThresholdMS-y;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(d,o,c){var u=this&&this.__decorate||function(b,v,x,E){var M,R=arguments.length,j=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,v,x,E);else for(var D=b.length-1;D>=0;D--)(M=b[D])&&(j=(R<3?M(j):R>3?M(v,x,j):M(v,x))||j);return R>3&&j&&Object.defineProperty(v,x,j),j},m=this&&this.__param||function(b,v){return function(x,E){v(x,E,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const f=c(3656),y=c(4725),S=c(8460),k=c(844),w=c(2585);let _=o.Viewport=class extends k.Disposable{constructor(b,v,x,E,M,R,j,D){super(),this._viewportElement=b,this._scrollArea=v,this._bufferService=x,this._optionsService=E,this._charSizeService=M,this._renderService=R,this._coreBrowserService=j,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 S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((O=>this._renderDimensions=O))),this._handleThemeChange(D.colors),this.register(D.onChangeColors((O=>this._handleThemeChange(O)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.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(b){if(b)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 b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){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 b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<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(b,v){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&x<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const v=this._getPixelsScrolled(b);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(b,v))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const v=b*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:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let v=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?v*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._currentRowHeight*this._bufferService.rows),v}getBufferElements(b,v){var D;let x,E="";const M=[],R=v!=null?v:this._bufferService.buffer.lines.length,j=this._bufferService.buffer.lines;for(let O=b;O<R;O++){const P=j.get(O);if(!P)continue;const U=(D=j.get(O+1))==null?void 0:D.isWrapped;if(E+=P.translateToString(!U),!U||O===j.length-1){const q=document.createElement("div");q.textContent=E,M.push(q),E.length>0&&(x=q),E=""}}return{bufferElements:M,cursorElement:x}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let v=this._applyScrollModifier(b.deltaY,b);return b.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):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._bufferService.rows),v}_applyScrollModifier(b,v){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&v.altKey||x==="ctrl"&&v.ctrlKey||x==="shift"&&v.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const v=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,v!==0&&(this._viewportElement.scrollTop+=v,this._bubbleScroll(b,v))}};o.Viewport=_=u([m(2,w.IBufferService),m(3,w.IOptionsService),m(4,y.ICharSizeService),m(5,y.IRenderService),m(6,y.ICoreBrowserService),m(7,y.IThemeService)],_)},3107:function(d,o,c){var u=this&&this.__decorate||function(w,_,b,v){var x,E=arguments.length,M=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,_,b,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(M=(E<3?x(M):E>3?x(_,b,M):x(_,b))||M);return E>3&&M&&Object.defineProperty(_,b,M),M},m=this&&this.__param||function(w,_){return function(b,v){_(b,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const f=c(4725),y=c(844),S=c(2585);let k=o.BufferDecorationRenderer=class extends y.Disposable{constructor(w,_,b,v,x){super(),this._screenElement=w,this._bufferService=_,this._coreBrowserService=b,this._decorationService=v,this._renderService=x,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,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 w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var v,x;const _=this._coreBrowserService.mainDocument.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",((v=w==null?void 0:w.options)==null?void 0:v.layer)==="top"),_.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=(x=w.options.x)!=null?x:0;return b&&b>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(w,_),_}_refreshStyle(w){const _=w.marker.line-this._bufferService.buffers.active.ydisp;if(_<0||_>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let b=this._decorationElements.get(w);b||(b=this._createElement(w),w.element=b,this._decorationElements.set(w,b),this._container.appendChild(b),w.onDispose((()=>{this._decorationElements.delete(w),b.remove()}))),b.style.top=_*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(b)}}_refreshXPosition(w,_=w.element){var v;if(!_)return;const b=(v=w.options.x)!=null?v:0;(w.options.anchor||"left")==="right"?_.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":_.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var _;(_=this._decorationElements.get(w))==null||_.remove(),this._decorationElements.delete(w),w.dispose()}};o.BufferDecorationRenderer=k=u([m(1,S.IBufferService),m(2,f.ICoreBrowserService),m(3,S.IDecorationService),m(4,f.IRenderService)],k)},5871:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,u){return u>=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,m){return u>=c.startBufferLine-this._linePadding[m||"full"]&&u<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(d,o,c){var u=this&&this.__decorate||function(x,E,M,R){var j,D=arguments.length,O=D<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,E,M,R);else for(var P=x.length-1;P>=0;P--)(j=x[P])&&(O=(D<3?j(O):D>3?j(E,M,O):j(E,M))||O);return D>3&&O&&Object.defineProperty(E,M,O),O},m=this&&this.__param||function(x,E){return function(M,R){E(M,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const f=c(5871),y=c(4725),S=c(844),k=c(2585),w={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let v=o.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(x,E,M,R,j,D,O){var U;super(),this._viewportElement=x,this._screenElement=E,this._bufferService=M,this._decorationService=R,this._renderService=j,this._optionsService=D,this._coreBrowserService=O,this._colorZoneStore=new f.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(),(U=this._viewportElement.parentElement)==null||U.insertBefore(this._canvas,this._viewportElement);const P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var q;(q=this._canvas)==null||q.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 x=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=x,_.center=E,_.right=x,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=_.left,b.right=_.left+_.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(x,12),6)*this._coreBrowserService.dpr);w.left=E,w.center=E,w.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const x=this._colorZoneStore.zones;for(const E of x)E.position!=="full"&&this._renderColorZone(E);for(const E of x)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(b[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-w[x.position||"full"]/2),_[x.position||"full"],Math.round((this._canvas.height-1)*((x.endBufferLine-x.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[x.position||"full"]))}_queueRefresh(x,E){this._shouldUpdateDimensions=x||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=v=u([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,y.IRenderService),m(5,k.IOptionsService),m(6,y.ICoreBrowserService)],v)},2950:function(d,o,c){var u=this&&this.__decorate||function(w,_,b,v){var x,E=arguments.length,M=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,_,b,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(M=(E<3?x(M):E>3?x(_,b,M):x(_,b))||M);return E>3&&M&&Object.defineProperty(_,b,M),M},m=this&&this.__param||function(w,_){return function(b,v){_(b,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const f=c(4725),y=c(2585),S=c(2584);let k=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,_,b,v,x,E){this._textarea=w,this._compositionView=_,this._bufferService=b,this._optionsService=v,this._coreService=x,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const _={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,_.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(_.start,_.end):this._textarea.value.substring(_.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const _=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(_,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const _=this._textarea.value,b=_.replace(w,"");this._dataAlreadySent=b,_.length>w.length?this._coreService.triggerDataEvent(b,!0):_.length<w.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):_.length===w.length&&_!==w&&this._coreService.triggerDataEvent(_,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const _=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.css.cell.height,v=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,x=_*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=x+"px",this._compositionView.style.top=v+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=x+"px",this._textarea.style.top=v+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=k=u([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,y.ICoreService),m(5,f.IRenderService)],k)},9806:(d,o)=>{function c(u,m,f){const y=f.getBoundingClientRect(),S=u.getComputedStyle(f),k=parseInt(S.getPropertyValue("padding-left")),w=parseInt(S.getPropertyValue("padding-top"));return[m.clientX-y.left-k,m.clientY-y.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(u,m,f,y,S,k,w,_,b){if(!k)return;const v=c(u,m,f);return v?(v[0]=Math.ceil((v[0]+(b?w/2:0))/w),v[1]=Math.ceil(v[1]/_),v[0]=Math.min(Math.max(v[0],1),y+(b?1:0)),v[1]=Math.min(Math.max(v[1],1),S),v):void 0}},9504:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=c(2584);function m(_,b,v,x){const E=_-f(_,v),M=b-f(b,v),R=Math.abs(E-M)-(function(j,D,O){let P=0;const U=j-f(j,O),q=D-f(D,O);for(let $=0;$<Math.abs(U-q);$++){const K=y(j,D)==="A"?-1:1,Y=O.buffer.lines.get(U+K*$);Y!=null&&Y.isWrapped&&P++}return P})(_,b,v);return w(R,k(y(_,b),x))}function f(_,b){let v=0,x=b.buffer.lines.get(_),E=x==null?void 0:x.isWrapped;for(;E&&_>=0&&_<b.rows;)v++,x=b.buffer.lines.get(--_),E=x==null?void 0:x.isWrapped;return v}function y(_,b){return _>b?"A":"B"}function S(_,b,v,x,E,M){let R=_,j=b,D="";for(;R!==v||j!==x;)R+=E?1:-1,E&&R>M.cols-1?(D+=M.buffer.translateBufferLineToString(j,!1,_,R),R=0,_=0,j++):!E&&R<0&&(D+=M.buffer.translateBufferLineToString(j,!1,0,_+1),R=M.cols-1,_=R,j--);return D+M.buffer.translateBufferLineToString(j,!1,_,R)}function k(_,b){const v=b?"O":"[";return u.C0.ESC+v+_}function w(_,b){_=Math.floor(_);let v="";for(let x=0;x<_;x++)v+=b;return v}o.moveToCellSequence=function(_,b,v,x){const E=v.buffer.x,M=v.buffer.y;if(!v.buffer.hasScrollback)return(function(D,O,P,U,q,$){return m(O,U,q,$).length===0?"":w(S(D,O,D,O-f(O,q),!1,q).length,k("D",$))})(E,M,0,b,v,x)+m(M,b,v,x)+(function(D,O,P,U,q,$){let K;K=m(O,U,q,$).length>0?U-f(U,q):O;const Y=U,V=(function(Z,Q,F,N,L,B){let z;return z=m(F,N,L,B).length>0?N-f(N,L):Q,Z<F&&z<=N||Z>=F&&z<N?"C":"D"})(D,O,P,U,q,$);return w(S(D,K,P,Y,V==="C",q).length,k(V,$))})(E,M,_,b,v,x);let R;if(M===b)return R=E>_?"D":"C",w(Math.abs(E-_),k(R,x));R=M>b?"D":"C";const j=Math.abs(M-b);return w((function(D,O){return O.cols-D})(M>b?_:E,v)+(j-1)*v.cols+1+((M>b?E:_)-1),k(R,x))}},1296:function(d,o,c){var u=this&&this.__decorate||function($,K,Y,V){var Z,Q=arguments.length,F=Q<3?K:V===null?V=Object.getOwnPropertyDescriptor(K,Y):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate($,K,Y,V);else for(var N=$.length-1;N>=0;N--)(Z=$[N])&&(F=(Q<3?Z(F):Q>3?Z(K,Y,F):Z(K,Y))||F);return Q>3&&F&&Object.defineProperty(K,Y,F),F},m=this&&this.__param||function($,K){return function(Y,V){K(Y,V,$)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const f=c(3787),y=c(2550),S=c(2223),k=c(6171),w=c(6052),_=c(4725),b=c(8055),v=c(8460),x=c(844),E=c(2585),M="xterm-dom-renderer-owner-",R="xterm-rows",j="xterm-fg-",D="xterm-bg-",O="xterm-focus",P="xterm-selection";let U=1,q=o.DomRenderer=class extends x.Disposable{constructor($,K,Y,V,Z,Q,F,N,L,B,z,X,J){super(),this._terminal=$,this._document=K,this._element=Y,this._screenElement=V,this._viewportElement=Z,this._helperContainer=Q,this._linkifier2=F,this._charSizeService=L,this._optionsService=B,this._bufferService=z,this._coreBrowserService=X,this._themeService=J,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new v.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(P),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((te=>this._injectCss(te)))),this._injectCss(this._themeService.colors),this._rowFactory=N.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(M+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((te=>this._handleLinkHover(te)))),this.register(this._linkifier2.onHideLinkUnderline((te=>this._handleLinkLeave(te)))),this.register((0,x.toDisposable)((()=>{this._element.classList.remove(M+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new 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 $=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*$,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*$),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/$),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/$),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 Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss($){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${R} { color: ${$.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${R} .xterm-dim { color: ${b.color.multiplyOpacity($.foreground,.5).css};}`,K+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Z=`blink_block_${this._terminalClass}`;K+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${V} { 50% { box-shadow: none; }}`,K+=`@keyframes ${Z} { 0% { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css}; } 50% { background-color: inherit; color: ${$.cursor.css}; }}`,K+=`${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${$.cursor.css} !important; color: ${$.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${$.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${$.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${$.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${P} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${P} div { position: absolute; background-color: ${$.selectionBackgroundOpaque.css};}${this._terminalSelector} .${P} div { position: absolute; background-color: ${$.selectionInactiveBackgroundOpaque.css};}`;for(const[Q,F]of $.ansi.entries())K+=`${this._terminalSelector} .${j}${Q} { color: ${F.css}; }${this._terminalSelector} .${j}${Q}.xterm-dim { color: ${b.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${D}${Q} { background-color: ${F.css}; }`;K+=`${this._terminalSelector} .${j}${S.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque($.background).css}; }${this._terminalSelector} .${j}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque($.background),.5).css}; }${this._terminalSelector} .${D}${S.INVERTED_DEFAULT_COLOR} { background-color: ${$.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const $=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${$}px`,this._rowFactory.defaultSpacing=$}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements($,K){for(let Y=this._rowElements.length;Y<=K;Y++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize($,K){this._refreshRowElements($,K),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(O),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(O),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged($,K,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged($,K,Y),this.renderRows(0,this._bufferService.rows-1),!$||!K)return;this._selectionRenderModel.update(this._terminal,$,K,Y);const V=this._selectionRenderModel.viewportStartRow,Z=this._selectionRenderModel.viewportEndRow,Q=this._selectionRenderModel.viewportCappedStartRow,F=this._selectionRenderModel.viewportCappedEndRow;if(Q>=this._bufferService.rows||F<0)return;const N=this._document.createDocumentFragment();if(Y){const L=$[0]>K[0];N.appendChild(this._createSelectionElement(Q,L?K[0]:$[0],L?$[0]:K[0],F-Q+1))}else{const L=V===Q?$[0]:0,B=Q===Z?K[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(Q,L,B));const z=F-Q-1;if(N.appendChild(this._createSelectionElement(Q+1,0,this._bufferService.cols,z)),Q!==F){const X=Z===F?K[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(F,0,X))}}this._selectionContainer.appendChild(N)}_createSelectionElement($,K,Y,V=1){const Z=this._document.createElement("div"),Q=K*this.dimensions.css.cell.width;let F=this.dimensions.css.cell.width*(Y-K);return Q+F>this.dimensions.css.canvas.width&&(F=this.dimensions.css.canvas.width-Q),Z.style.height=V*this.dimensions.css.cell.height+"px",Z.style.top=$*this.dimensions.css.cell.height+"px",Z.style.left=`${Q}px`,Z.style.width=`${F}px`,Z}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 $ of this._rowElements)$.replaceChildren()}renderRows($,K){const Y=this._bufferService.buffer,V=Y.ybase+Y.y,Z=Math.min(Y.x,this._bufferService.cols-1),Q=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=$;L<=K;L++){const B=L+Y.ydisp,z=this._rowElements[L],X=Y.lines.get(B);if(!z||!X)break;z.replaceChildren(...this._rowFactory.createRow(X,B,B===V,F,N,Z,Q,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${M}${this._terminalClass}`}_handleLinkHover($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!0)}_handleLinkLeave($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!1)}_setCellUnderline($,K,Y,V,Z,Q){Y<0&&($=0),V<0&&(K=0);const F=this._bufferService.rows-1;Y=Math.max(Math.min(Y,F),0),V=Math.max(Math.min(V,F),0),Z=Math.min(Z,this._bufferService.cols);const N=this._bufferService.buffer,L=N.ybase+N.y,B=Math.min(N.x,Z-1),z=this._optionsService.rawOptions.cursorBlink,X=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let te=Y;te<=V;++te){const W=te+N.ydisp,H=this._rowElements[te],ne=N.lines.get(W);if(!H||!ne)break;H.replaceChildren(...this._rowFactory.createRow(ne,W,W===L,X,J,B,z,this.dimensions.css.cell.width,this._widthCache,Q?te===Y?$:0:-1,Q?(te===V?K:Z)-1:-1))}}};o.DomRenderer=q=u([m(7,E.IInstantiationService),m(8,_.ICharSizeService),m(9,E.IOptionsService),m(10,E.IBufferService),m(11,_.ICoreBrowserService),m(12,_.IThemeService)],q)},3787:function(d,o,c){var u=this&&this.__decorate||function(R,j,D,O){var P,U=arguments.length,q=U<3?j:O===null?O=Object.getOwnPropertyDescriptor(j,D):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(R,j,D,O);else for(var $=R.length-1;$>=0;$--)(P=R[$])&&(q=(U<3?P(q):U>3?P(j,D,q):P(j,D))||q);return U>3&&q&&Object.defineProperty(j,D,q),q},m=this&&this.__param||function(R,j){return function(D,O){j(D,O,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const f=c(2223),y=c(643),S=c(511),k=c(2585),w=c(8055),_=c(4725),b=c(4269),v=c(6171),x=c(3734);let E=o.DomRendererRowFactory=class{constructor(R,j,D,O,P,U,q){this._document=R,this._characterJoinerService=j,this._optionsService=D,this._coreBrowserService=O,this._coreService=P,this._decorationService=U,this._themeService=q,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,j,D){this._selectionStart=R,this._selectionEnd=j,this._columnSelectMode=D}createRow(R,j,D,O,P,U,q,$,K,Y,V){const Z=[],Q=this._characterJoinerService.getJoinedCharacters(j),F=this._themeService.colors;let N,L=R.getNoBgTrimmedLength();D&&L<U+1&&(L=U+1);let B=0,z="",X=0,J=0,te=0,W=!1,H=0,ne=!1,ae=0;const pe=[],ue=Y!==-1&&V!==-1;for(let Re=0;Re<L;Re++){R.loadCell(Re,this._workCell);let Ie=this._workCell.getWidth();if(Ie===0)continue;let Fe=!1,lt=Re,De=this._workCell;if(Q.length>0&&Re===Q[0][0]){Fe=!0;const Xe=Q.shift();De=new b.JoinedCellData(this._workCell,R.translateToString(!0,Xe[0],Xe[1]),Xe[1]-Xe[0]),lt=Xe[1]-1,Ie=De.getWidth()}const en=this._isCellInSelection(Re,j),Wt=D&&Re===U,fn=ue&&Re>=Y&&Re<=V;let Kt=!1;this._decorationService.forEachDecorationAtCell(Re,j,void 0,(Xe=>{Kt=!0}));let ur=De.getChars()||y.WHITESPACE_CELL_CHAR;if(ur===" "&&(De.isUnderline()||De.isOverline())&&(ur=" "),ae=Ie*$-K.get(ur,De.isBold(),De.isItalic()),N){if(B&&(en&&ne||!en&&!ne&&De.bg===X)&&(en&&ne&&F.selectionForeground||De.fg===J)&&De.extended.ext===te&&fn===W&&ae===H&&!Wt&&!Fe&&!Kt){De.isInvisible()?z+=y.WHITESPACE_CELL_CHAR:z+=ur,B++;continue}B&&(N.textContent=z),N=this._document.createElement("span"),B=0,z=""}else N=this._document.createElement("span");if(X=De.bg,J=De.fg,te=De.extended.ext,W=fn,H=ae,ne=en,Fe&&U>=Re&&U<=lt&&(U=Re),!this._coreService.isCursorHidden&&Wt&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&pe.push("xterm-cursor-blink"),pe.push(O==="bar"?"xterm-cursor-bar":O==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(P)switch(P){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(De.isBold()&&pe.push("xterm-bold"),De.isItalic()&&pe.push("xterm-italic"),De.isDim()&&pe.push("xterm-dim"),z=De.isInvisible()?y.WHITESPACE_CELL_CHAR:De.getChars()||y.WHITESPACE_CELL_CHAR,De.isUnderline()&&(pe.push(`xterm-underline-${De.extended.underlineStyle}`),z===" "&&(z=" "),!De.isUnderlineColorDefault()))if(De.isUnderlineColorRGB())N.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(De.getUnderlineColor()).join(",")})`;else{let Xe=De.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&De.isBold()&&Xe<8&&(Xe+=8),N.style.textDecorationColor=F.ansi[Xe].css}De.isOverline()&&(pe.push("xterm-overline"),z===" "&&(z=" ")),De.isStrikethrough()&&pe.push("xterm-strikethrough"),fn&&(N.style.textDecoration="underline");let $t=De.getFgColor(),gt=De.getFgColorMode(),Mt=De.getBgColor(),he=De.getBgColorMode();const xe=!!De.isInverse();if(xe){const Xe=$t;$t=Mt,Mt=Xe;const zt=gt;gt=he,he=zt}let Oe,Pe,qe,wt=!1;switch(this._decorationService.forEachDecorationAtCell(Re,j,void 0,(Xe=>{Xe.options.layer!=="top"&&wt||(Xe.backgroundColorRGB&&(he=50331648,Mt=Xe.backgroundColorRGB.rgba>>8&16777215,Oe=Xe.backgroundColorRGB),Xe.foregroundColorRGB&&(gt=50331648,$t=Xe.foregroundColorRGB.rgba>>8&16777215,Pe=Xe.foregroundColorRGB),wt=Xe.options.layer==="top")})),!wt&&en&&(Oe=this._coreBrowserService.isFocused?F.selectionBackgroundOpaque:F.selectionInactiveBackgroundOpaque,Mt=Oe.rgba>>8&16777215,he=50331648,wt=!0,F.selectionForeground&&(gt=50331648,$t=F.selectionForeground.rgba>>8&16777215,Pe=F.selectionForeground)),wt&&pe.push("xterm-decoration-top"),he){case 16777216:case 33554432:qe=F.ansi[Mt],pe.push(`xterm-bg-${Mt}`);break;case 50331648:qe=w.channels.toColor(Mt>>16,Mt>>8&255,255&Mt),this._addStyle(N,`background-color:#${M((Mt>>>0).toString(16),"0",6)}`);break;default:xe?(qe=F.foreground,pe.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):qe=F.background}switch(Oe||De.isDim()&&(Oe=w.color.multiplyOpacity(qe,.5)),gt){case 16777216:case 33554432:De.isBold()&&$t<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($t+=8),this._applyMinimumContrast(N,qe,F.ansi[$t],De,Oe,void 0)||pe.push(`xterm-fg-${$t}`);break;case 50331648:const Xe=w.channels.toColor($t>>16&255,$t>>8&255,255&$t);this._applyMinimumContrast(N,qe,Xe,De,Oe,Pe)||this._addStyle(N,`color:#${M($t.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(N,qe,F.foreground,De,Oe,Pe)||xe&&pe.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}pe.length&&(N.className=pe.join(" "),pe.length=0),Wt||Fe||Kt?N.textContent=z:B++,ae!==this.defaultSpacing&&(N.style.letterSpacing=`${ae}px`),Z.push(N),Re=lt}return N&&B&&(N.textContent=z),Z}_applyMinimumContrast(R,j,D,O,P,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(O.getCode()))return!1;const q=this._getContrastCache(O);let $;if(P||U||($=q.getColor(j.rgba,D.rgba)),$===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(O.isDim()?2:1);$=w.color.ensureContrastRatio(P||j,U||D,K),q.setColor((P||j).rgba,(U||D).rgba,$!=null?$:null)}return!!$&&(this._addStyle(R,`color:${$.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,j){R.setAttribute("style",`${R.getAttribute("style")||""}${j};`)}_isCellInSelection(R,j){const D=this._selectionStart,O=this._selectionEnd;return!(!D||!O)&&(this._columnSelectMode?D[0]<=O[0]?R>=D[0]&&j>=D[1]&&R<O[0]&&j<=O[1]:R<D[0]&&j>=D[1]&&R>=O[0]&&j<=O[1]:j>D[1]&&j<O[1]||D[1]===O[1]&&j===D[1]&&R>=D[0]&&R<O[0]||D[1]<O[1]&&j===O[1]&&R<O[0]||D[1]<O[1]&&j===D[1]&&R>=D[0])}};function M(R,j,D){for(;R.length<D;)R=j+R;return R}o.DomRendererRowFactory=E=u([m(1,_.ICharacterJoinerService),m(2,k.IOptionsService),m(3,_.ICoreBrowserService),m(4,k.ICoreService),m(5,k.IDecorationService),m(6,_.IThemeService)],E)},2550:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=c.createElement("span");m.classList.add("xterm-char-measure-element");const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const y=c.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[m,f,y,S],this._container.appendChild(m),this._container.appendChild(f),this._container.appendChild(y),this._container.appendChild(S),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,u,m,f){c===this._font&&u===this._fontSize&&m===this._weight&&f===this._weightBold||(this._font=c,this._fontSize=u,this._weight=m,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(c,u,m){let f=0;if(!u&&!m&&c.length===1&&(f=c.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const k=this._measure(c,0);return k>0&&(this._flat[f]=k),k}let y=c;u&&(y+="B"),m&&(y+="I");let S=this._holey.get(y);if(S===void 0){let k=0;u&&(k|=1),m&&(k|=2),S=this._measure(c,k),S>0&&this._holey.set(y,S)}return S}_measure(c,u){const m=this._measureElements[u];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(d,o)=>{function c(m){return 57508<=m&&m<=57558}function u(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},o.isEmoji=u,o.allowRescaling=function(m,f,y,S){return f===1&&y>Math.ceil(1.5*S)&&m!==void 0&&m>255&&!u(m)&&!c(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},o.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(f){return 9472<=f&&f<=9631})(m)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(m,f,y=0){return(m-(2*Math.round(f)-y))%(2*Math.round(f))}},6052:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,f,y,S=!1){if(this.selectionStart=f,this.selectionEnd=y,!f||!y||f[0]===y[0]&&f[1]===y[1])return void this.clear();const k=m.buffers.active.ydisp,w=f[1]-k,_=y[1]-k,b=Math.max(w,0),v=Math.min(_,m.rows-1);b>=m.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=w,this.viewportEndRow=_,this.viewportCappedStartRow=b,this.viewportCappedEndRow=v,this.startCol=f[0],this.endCol=y[0])}isCellSelected(m,f,y){return!!this.hasSelection&&(y-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&y>=this.viewportCappedStartRow&&f<this.endCol&&y<=this.viewportCappedEndRow:f<this.startCol&&y>=this.viewportCappedStartRow&&f>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&f>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,o,c){var u=this&&this.__decorate||function(v,x,E,M){var R,j=arguments.length,D=j<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,M);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(j<3?R(D):j>3?R(x,E,D):R(x,E))||D);return j>3&&D&&Object.defineProperty(x,E,D),D},m=this&&this.__param||function(v,x){return function(E,M){x(E,M,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const f=c(2585),y=c(8460),S=c(844);let k=o.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(v,x,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new _(v,x,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())}};o.CharSizeService=k=u([m(2,f.IOptionsService)],k);class w extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(x,E){x!==void 0&&x>0&&E!==void 0&&E>0&&(this._result.width=x,this._result.height=E)}}class _ extends w{constructor(x,E,M){super(),this._document=x,this._parentElement=E,this._optionsService=M,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends w{constructor(x){super(),this._optionsService=x,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const x=this._ctx.measureText("W");return this._validateAndSet(x.width,x.fontBoundingBoxAscent+x.fontBoundingBoxDescent),this._result}}},4269:function(d,o,c){var u=this&&this.__decorate||function(b,v,x,E){var M,R=arguments.length,j=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,v,x,E);else for(var D=b.length-1;D>=0;D--)(M=b[D])&&(j=(R<3?M(j):R>3?M(v,x,j):M(v,x))||j);return R>3&&j&&Object.defineProperty(v,x,j),j},m=this&&this.__param||function(b,v){return function(x,E){v(x,E,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const f=c(3734),y=c(643),S=c(511),k=c(2585);class w extends f.AttributeData{constructor(v,x,E){super(),this.content=0,this.combinedData="",this.fg=v.fg,this.bg=v.bg,this.combinedData=x,this._width=E}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()]}}o.JoinedCellData=w;let _=o.CharacterJoinerService=class CC{constructor(v){this._bufferService=v,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(v){const x={id:this._nextCharacterJoinerId++,handler:v};return this._characterJoiners.push(x),x.id}deregister(v){for(let x=0;x<this._characterJoiners.length;x++)if(this._characterJoiners[x].id===v)return this._characterJoiners.splice(x,1),!0;return!1}getJoinedCharacters(v){if(this._characterJoiners.length===0)return[];const x=this._bufferService.buffer.lines.get(v);if(!x||x.length===0)return[];const E=[],M=x.translateToString(!0);let R=0,j=0,D=0,O=x.getFg(0),P=x.getBg(0);for(let U=0;U<x.getTrimmedLength();U++)if(x.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==O||this._workCell.bg!==P){if(U-R>1){const q=this._getJoinedRanges(M,D,j,x,R);for(let $=0;$<q.length;$++)E.push(q[$])}R=U,D=j,O=this._workCell.fg,P=this._workCell.bg}j+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const U=this._getJoinedRanges(M,D,j,x,R);for(let q=0;q<U.length;q++)E.push(U[q])}return E}_getJoinedRanges(v,x,E,M,R){const j=v.substring(x,E);let D=[];try{D=this._characterJoiners[0].handler(j)}catch(O){console.error(O)}for(let O=1;O<this._characterJoiners.length;O++)try{const P=this._characterJoiners[O].handler(j);for(let U=0;U<P.length;U++)CC._mergeRanges(D,P[U])}catch(P){console.error(P)}return this._stringRangesToCellRanges(D,M,R),D}_stringRangesToCellRanges(v,x,E){let M=0,R=!1,j=0,D=v[M];if(D){for(let O=E;O<this._bufferService.cols;O++){const P=x.getWidth(O),U=x.getString(O).length||y.WHITESPACE_CELL_CHAR.length;if(P!==0){if(!R&&D[0]<=j&&(D[0]=O,R=!0),D[1]<=j){if(D[1]=O,D=v[++M],!D)break;D[0]<=j?(D[0]=O,R=!0):R=!1}j+=U}}D&&(D[1]=this._bufferService.cols)}}static _mergeRanges(v,x){let E=!1;for(let M=0;M<v.length;M++){const R=v[M];if(E){if(x[1]<=R[0])return v[M-1][1]=x[1],v;if(x[1]<=R[1])return v[M-1][1]=Math.max(x[1],R[1]),v.splice(M,1),v;v.splice(M,1),M--}else{if(x[1]<=R[0])return v.splice(M,0,x),v;if(x[1]<=R[1])return R[0]=Math.min(x[0],R[0]),v;x[0]<R[1]&&(R[0]=Math.min(x[0],R[0]),E=!0)}}return E?v[v.length-1][1]=x[1]:v.push(x),v}};o.CharacterJoinerService=_=u([m(0,k.IBufferService)],_)},5114:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=c(844),m=c(8460),f=c(3656);class y extends u.Disposable{constructor(w,_,b){super(),this._textarea=w,this._window=_,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((v=>this._screenDprMonitor.setWindow(v)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=y;class S extends u.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.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:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=c(844);class m extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const S=this.linkProviders.indexOf(y);S!==-1&&this.linkProviders.splice(S,1)}}}}o.LinkProviderService=m},8934:function(d,o,c){var u=this&&this.__decorate||function(k,w,_,b){var v,x=arguments.length,E=x<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,_):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(k,w,_,b);else for(var M=k.length-1;M>=0;M--)(v=k[M])&&(E=(x<3?v(E):x>3?v(w,_,E):v(w,_))||E);return x>3&&E&&Object.defineProperty(w,_,E),E},m=this&&this.__param||function(k,w){return function(_,b){w(_,b,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const f=c(4725),y=c(9806);let S=o.MouseService=class{constructor(k,w){this._renderService=k,this._charSizeService=w}getCoords(k,w,_,b,v){return(0,y.getCoords)(window,k,w,_,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,v)}getMouseReportCoords(k,w){const _=(0,y.getCoordsRelativeToElement)(window,k,w);if(this._charSizeService.hasValidSize)return _[0]=Math.min(Math.max(_[0],0),this._renderService.dimensions.css.canvas.width-1),_[1]=Math.min(Math.max(_[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(_[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(_[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(_[0]),y:Math.floor(_[1])}}};o.MouseService=S=u([m(0,f.IRenderService),m(1,f.ICharSizeService)],S)},3230:function(d,o,c){var u=this&&this.__decorate||function(v,x,E,M){var R,j=arguments.length,D=j<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,M);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(j<3?R(D):j>3?R(x,E,D):R(x,E))||D);return j>3&&D&&Object.defineProperty(x,E,D),D},m=this&&this.__param||function(v,x){return function(E,M){x(E,M,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const f=c(6193),y=c(4725),S=c(8460),k=c(844),w=c(7226),_=c(2585);let b=o.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,x,E,M,R,j,D,O){super(),this._rowCount=v,this._charSizeService=M,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((P,U)=>this._renderRows(P,U)),D),this.register(this._renderDebouncer),this.register(D.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(j.onResize((()=>this._fullRefresh()))),this.register(j.buffers.onBufferActivate((()=>{var P;return(P=this._renderer.value)==null?void 0:P.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(j.cols,j.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(j.buffer.y,j.buffer.y,!0)))),this.register(O.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(D.window,x),this.register(D.onWindowChange((P=>this._registerIntersectionObserver(P,x))))}_registerIntersectionObserver(v,x){if("IntersectionObserver"in v){const E=new v.IntersectionObserver((M=>this._handleIntersectionChange(M[M.length-1])),{threshold:0});E.observe(x),this._observerDisposable.value=(0,k.toDisposable)((()=>E.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,x,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(v,x,this._rowCount))}_renderRows(v,x){this._renderer.value&&(v=Math.min(v,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(v,x),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:x}),this._onRender.fire({start:v,end:x}),this._isNextRenderRedrawOnly=!0)}resize(v,x){this._rowCount=x,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((x=>this.refreshRows(x.start,x.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,x;this._renderer.value&&((x=(v=this._renderer.value).clearTextureAtlas)==null||x.call(v),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(v,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(v,x)})):this._renderer.value.handleResize(v,x),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,x,E){var M;this._selectionState.start=v,this._selectionState.end=x,this._selectionState.columnSelectMode=E,(M=this._renderer.value)==null||M.handleSelectionChanged(v,x,E)}handleCursorMove(){var v;(v=this._renderer.value)==null||v.handleCursorMove()}clear(){var v;(v=this._renderer.value)==null||v.clear()}};o.RenderService=b=u([m(2,_.IOptionsService),m(3,y.ICharSizeService),m(4,_.IDecorationService),m(5,_.IBufferService),m(6,y.ICoreBrowserService),m(7,y.IThemeService)],b)},9312:function(d,o,c){var u=this&&this.__decorate||function(D,O,P,U){var q,$=arguments.length,K=$<3?O:U===null?U=Object.getOwnPropertyDescriptor(O,P):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(D,O,P,U);else for(var Y=D.length-1;Y>=0;Y--)(q=D[Y])&&(K=($<3?q(K):$>3?q(O,P,K):q(O,P))||K);return $>3&&K&&Object.defineProperty(O,P,K),K},m=this&&this.__param||function(D,O){return function(P,U){O(P,U,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const f=c(9806),y=c(9504),S=c(456),k=c(4725),w=c(8460),_=c(844),b=c(6114),v=c(4841),x=c(511),E=c(2585),M=" ",R=new RegExp(M,"g");let j=o.SelectionService=class extends _.Disposable{constructor(D,O,P,U,q,$,K,Y,V){super(),this._element=D,this._screenElement=O,this._linkifier=P,this._bufferService=U,this._coreService=q,this._mouseService=$,this._optionsService=K,this._renderService=Y,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new x.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Z=>this._handleMouseMove(Z),this._mouseUpListener=Z=>this._handleMouseUp(Z),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Z=>this._handleTrim(Z))),this.register(this._bufferService.buffers.onBufferActivate((Z=>this._handleBufferActivate(Z)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,_.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const D=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!D||!O||D[0]===O[0]&&D[1]===O[1])}get selectionText(){const D=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;if(!D||!O)return"";const P=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(D[0]===O[0])return"";const q=D[0]<O[0]?D[0]:O[0],$=D[0]<O[0]?O[0]:D[0];for(let K=D[1];K<=O[1];K++){const Y=P.translateBufferLineToString(K,!0,q,$);U.push(Y)}}else{const q=D[1]===O[1]?O[0]:void 0;U.push(P.translateBufferLineToString(D[1],!0,D[0],q));for(let $=D[1]+1;$<=O[1]-1;$++){const K=P.lines.get($),Y=P.translateBufferLineToString($,!0);K!=null&&K.isWrapped?U[U.length-1]+=Y:U.push(Y)}if(D[1]!==O[1]){const $=P.lines.get(O[1]),K=P.translateBufferLineToString(O[1],!0,0,O[0]);$&&$.isWrapped?U[U.length-1]+=K:U.push(K)}}return U.map((q=>q.replace(R," "))).join(b.isWindows?`\r
448
- `:`
449
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(D){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&D&&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(D){const O=this._getMouseBufferCoords(D),P=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(P&&U&&O)&&this._areCoordsInSelection(O,P,U)}isCellInSelection(D,O){const P=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!P||!U)&&this._areCoordsInSelection([D,O],P,U)}_areCoordsInSelection(D,O,P){return D[1]>O[1]&&D[1]<P[1]||O[1]===P[1]&&D[1]===O[1]&&D[0]>=O[0]&&D[0]<P[0]||O[1]<P[1]&&D[1]===P[1]&&D[0]<P[0]||O[1]<P[1]&&D[1]===O[1]&&D[0]>=O[0]}_selectWordAtCursor(D,O){var q,$;const P=($=(q=this._linkifier.currentLink)==null?void 0:q.link)==null?void 0:$.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(D);return!!U&&(this._selectWordAt(U,O),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(D,O){this._model.clearSelection(),D=Math.max(D,0),O=Math.min(O,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,D],this._model.selectionEnd=[this._bufferService.cols,O],this.refresh(),this._onSelectionChange.fire()}_handleTrim(D){this._model.handleTrim(D)&&this.refresh()}_getMouseBufferCoords(D){const O=this._mouseService.getCoords(D,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(O)return O[0]--,O[1]--,O[1]+=this._bufferService.buffer.ydisp,O}_getMouseEventScrollAmount(D){let O=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,D,this._screenElement)[1];const P=this._renderService.dimensions.css.canvas.height;return O>=0&&O<=P?0:(O>P&&(O-=P),O=Math.min(Math.max(O,-50),50),O/=50,O/Math.abs(O)+Math.round(14*O))}shouldForceSelection(D){return b.isMac?D.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:D.shiftKey}handleMouseDown(D){if(this._mouseDownTimeStamp=D.timeStamp,(D.button!==2||!this.hasSelection)&&D.button===0){if(!this._enabled){if(!this.shouldForceSelection(D))return;D.stopPropagation()}D.preventDefault(),this._dragScrollAmount=0,this._enabled&&D.shiftKey?this._handleIncrementalClick(D):D.detail===1?this._handleSingleClick(D):D.detail===2?this._handleDoubleClick(D):D.detail===3&&this._handleTripleClick(D),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(D){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(D))}_handleSingleClick(D){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(D)?3:0,this._model.selectionStart=this._getMouseBufferCoords(D),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const O=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);O&&O.length!==this._model.selectionStart[0]&&O.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(D){this._selectWordAtCursor(D,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(D){const O=this._getMouseBufferCoords(D);O&&(this._activeSelectionMode=2,this._selectLineAt(O[1]))}shouldColumnSelect(D){return D.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(D){if(D.stopImmediatePropagation(),!this._model.selectionStart)return;const O=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(D),!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(D),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const P=this._bufferService.buffer;if(this._model.selectionEnd[1]<P.lines.length){const U=P.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}O&&O[0]===this._model.selectionEnd[0]&&O[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 D=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(D.ydisp+this._bufferService.rows,D.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=D.ydisp),this.refresh()}}_handleMouseUp(D){const O=D.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&O<500&&D.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const P=this._mouseService.getCoords(D,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(P&&P[0]!==void 0&&P[1]!==void 0){const U=(0,y.moveToCellSequence)(P[0]-1,P[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const D=this._model.finalSelectionStart,O=this._model.finalSelectionEnd,P=!(!D||!O||D[0]===O[0]&&D[1]===O[1]);P?D&&O&&(this._oldSelectionStart&&this._oldSelectionEnd&&D[0]===this._oldSelectionStart[0]&&D[1]===this._oldSelectionStart[1]&&O[0]===this._oldSelectionEnd[0]&&O[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(D,O,P)):this._oldHasSelection&&this._fireOnSelectionChange(D,O,P)}_fireOnSelectionChange(D,O,P){this._oldSelectionStart=D,this._oldSelectionEnd=O,this._oldHasSelection=P,this._onSelectionChange.fire()}_handleBufferActivate(D){this.clearSelection(),this._trimListener.dispose(),this._trimListener=D.activeBuffer.lines.onTrim((O=>this._handleTrim(O)))}_convertViewportColToCharacterIndex(D,O){let P=O;for(let U=0;O>=U;U++){const q=D.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?P--:q>1&&O!==U&&(P+=q-1)}return P}setSelection(D,O,P){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[D,O],this._model.selectionStartLength=P,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(D){this._isClickInSelection(D)||(this._selectWordAtCursor(D,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(D,O,P=!0,U=!0){if(D[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,$=q.lines.get(D[1]);if(!$)return;const K=q.translateBufferLineToString(D[1],!1);let Y=this._convertViewportColToCharacterIndex($,D[0]),V=Y;const Z=D[0]-Y;let Q=0,F=0,N=0,L=0;if(K.charAt(Y)===" "){for(;Y>0&&K.charAt(Y-1)===" ";)Y--;for(;V<K.length&&K.charAt(V+1)===" ";)V++}else{let X=D[0],J=D[0];$.getWidth(X)===0&&(Q++,X--),$.getWidth(J)===2&&(F++,J++);const te=$.getString(J).length;for(te>1&&(L+=te-1,V+=te-1);X>0&&Y>0&&!this._isCharWordSeparator($.loadCell(X-1,this._workCell));){$.loadCell(X-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(Q++,X--):W>1&&(N+=W-1,Y-=W-1),Y--,X--}for(;J<$.length&&V+1<K.length&&!this._isCharWordSeparator($.loadCell(J+1,this._workCell));){$.loadCell(J+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(F++,J++):W>1&&(L+=W-1,V+=W-1),V++,J++}}V++;let B=Y+Z-Q+N,z=Math.min(this._bufferService.cols,V-Y+Q+F-N-L);if(O||K.slice(Y,V).trim()!==""){if(P&&B===0&&$.getCodePoint(0)!==32){const X=q.lines.get(D[1]-1);if(X&&$.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,D[1]-1],!1,!0,!1);if(J){const te=this._bufferService.cols-J.start;B-=te,z+=te}}}if(U&&B+z===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){const X=q.lines.get(D[1]+1);if(X!=null&&X.isWrapped&&X.getCodePoint(0)!==32){const J=this._getWordAt([0,D[1]+1],!1,!1,!0);J&&(z+=J.length)}}return{start:B,length:z}}}_selectWordAt(D,O){const P=this._getWordAt(D,O);if(P){for(;P.start<0;)P.start+=this._bufferService.cols,D[1]--;this._model.selectionStart=[P.start,D[1]],this._model.selectionStartLength=P.length}}_selectToWordAt(D){const O=this._getWordAt(D,!0);if(O){let P=D[1];for(;O.start<0;)O.start+=this._bufferService.cols,P--;if(!this._model.areSelectionValuesReversed())for(;O.start+O.length>this._bufferService.cols;)O.length-=this._bufferService.cols,P++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?O.start:O.start+O.length,P]}}_isCharWordSeparator(D){return D.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(D.getChars())>=0}_selectLineAt(D){const O=this._bufferService.buffer.getWrappedRangeForLine(D),P={start:{x:0,y:O.first},end:{x:this._bufferService.cols-1,y:O.last}};this._model.selectionStart=[0,O.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,v.getRangeLength)(P,this._bufferService.cols)}};o.SelectionService=j=u([m(3,E.IBufferService),m(4,E.ICoreService),m(5,k.IMouseService),m(6,E.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],j)},4725:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=c(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(d,o,c){var u=this&&this.__decorate||function(j,D,O,P){var U,q=arguments.length,$=q<3?D:P===null?P=Object.getOwnPropertyDescriptor(D,O):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(j,D,O,P);else for(var K=j.length-1;K>=0;K--)(U=j[K])&&($=(q<3?U($):q>3?U(D,O,$):U(D,O))||$);return q>3&&$&&Object.defineProperty(D,O,$),$},m=this&&this.__param||function(j,D){return function(O,P){D(O,P,j)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const f=c(7239),y=c(8055),S=c(8460),k=c(844),w=c(2585),_=y.css.toColor("#ffffff"),b=y.css.toColor("#000000"),v=y.css.toColor("#ffffff"),x=y.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const j=[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")],D=[0,95,135,175,215,255];for(let O=0;O<216;O++){const P=D[O/36%6|0],U=D[O/6%6|0],q=D[O%6];j.push({css:y.channels.toCss(P,U,q),rgba:y.channels.toRgba(P,U,q)})}for(let O=0;O<24;O++){const P=8+10*O;j.push({css:y.channels.toCss(P,P,P),rgba:y.channels.toRgba(P,P,P)})}return j})());let M=o.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(j){super(),this._optionsService=j,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:_,background:b,cursor:v,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:y.color.blend(b,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:y.color.blend(b,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(j={}){const D=this._colors;if(D.foreground=R(j.foreground,_),D.background=R(j.background,b),D.cursor=R(j.cursor,v),D.cursorAccent=R(j.cursorAccent,x),D.selectionBackgroundTransparent=R(j.selectionBackground,E),D.selectionBackgroundOpaque=y.color.blend(D.background,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundTransparent=R(j.selectionInactiveBackground,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundOpaque=y.color.blend(D.background,D.selectionInactiveBackgroundTransparent),D.selectionForeground=j.selectionForeground?R(j.selectionForeground,y.NULL_COLOR):void 0,D.selectionForeground===y.NULL_COLOR&&(D.selectionForeground=void 0),y.color.isOpaque(D.selectionBackgroundTransparent)&&(D.selectionBackgroundTransparent=y.color.opacity(D.selectionBackgroundTransparent,.3)),y.color.isOpaque(D.selectionInactiveBackgroundTransparent)&&(D.selectionInactiveBackgroundTransparent=y.color.opacity(D.selectionInactiveBackgroundTransparent,.3)),D.ansi=o.DEFAULT_ANSI_COLORS.slice(),D.ansi[0]=R(j.black,o.DEFAULT_ANSI_COLORS[0]),D.ansi[1]=R(j.red,o.DEFAULT_ANSI_COLORS[1]),D.ansi[2]=R(j.green,o.DEFAULT_ANSI_COLORS[2]),D.ansi[3]=R(j.yellow,o.DEFAULT_ANSI_COLORS[3]),D.ansi[4]=R(j.blue,o.DEFAULT_ANSI_COLORS[4]),D.ansi[5]=R(j.magenta,o.DEFAULT_ANSI_COLORS[5]),D.ansi[6]=R(j.cyan,o.DEFAULT_ANSI_COLORS[6]),D.ansi[7]=R(j.white,o.DEFAULT_ANSI_COLORS[7]),D.ansi[8]=R(j.brightBlack,o.DEFAULT_ANSI_COLORS[8]),D.ansi[9]=R(j.brightRed,o.DEFAULT_ANSI_COLORS[9]),D.ansi[10]=R(j.brightGreen,o.DEFAULT_ANSI_COLORS[10]),D.ansi[11]=R(j.brightYellow,o.DEFAULT_ANSI_COLORS[11]),D.ansi[12]=R(j.brightBlue,o.DEFAULT_ANSI_COLORS[12]),D.ansi[13]=R(j.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),D.ansi[14]=R(j.brightCyan,o.DEFAULT_ANSI_COLORS[14]),D.ansi[15]=R(j.brightWhite,o.DEFAULT_ANSI_COLORS[15]),j.extendedAnsi){const O=Math.min(D.ansi.length-16,j.extendedAnsi.length);for(let P=0;P<O;P++)D.ansi[P+16]=R(j.extendedAnsi[P],o.DEFAULT_ANSI_COLORS[P+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(j){this._restoreColor(j),this._onChangeColors.fire(this.colors)}_restoreColor(j){if(j!==void 0)switch(j){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[j]=this._restoreColors.ansi[j]}else for(let D=0;D<this._restoreColors.ansi.length;++D)this._colors.ansi[D]=this._restoreColors.ansi[D]}modifyColors(j){j(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(j,D){if(j!==void 0)try{return y.css.toColor(j)}catch{}return D}o.ThemeService=M=u([m(0,w.IOptionsService)],M)},6349:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=c(8460),m=c(844);class f extends m.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const k=new Array(S);for(let w=0;w<Math.min(S,this.length);w++)k[w]=this._array[this._getCyclicIndex(w)];this._array=k,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let k=this._length;k<S;k++)this._array[k]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,k){this._array[this._getCyclicIndex(S)]=k}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,k,...w){if(k){for(let _=S;_<this._length-k;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+k)];this._length-=k,this.onDeleteEmitter.fire({index:S,amount:k})}for(let _=this._length-1;_>=S;_--)this._array[this._getCyclicIndex(_+w.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<w.length;_++)this._array[this._getCyclicIndex(S+_)]=w[_];if(w.length&&this.onInsertEmitter.fire({index:S,amount:w.length}),this._length+w.length>this._maxLength){const _=this._length+w.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=w.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,k,w){if(!(k<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let b=k-1;b>=0;b--)this.set(S+b+w,this.get(S+b));const _=S+k+w-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<k;_++)this.set(S+_+w,this.get(S+_))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}o.CircularList=f},1439:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(u,m=5){if(typeof u!="object")return u;const f=Array.isArray(u)?[]:{};for(const y in u)f[y]=m<=1?u[y]:u[y]&&c(u[y],m-1);return f}},8055:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,u=0,m=0,f=0;var y,S,k,w,_;function b(x){const E=x.toString(16);return E.length<2?"0"+E:E}function v(x,E){return x<E?(E+.05)/(x+.05):(x+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(x){x.toCss=function(E,M,R,j){return j!==void 0?`#${b(E)}${b(M)}${b(R)}${b(j)}`:`#${b(E)}${b(M)}${b(R)}`},x.toRgba=function(E,M,R,j=255){return(E<<24|M<<16|R<<8|j)>>>0},x.toColor=function(E,M,R,j){return{css:x.toCss(E,M,R,j),rgba:x.toRgba(E,M,R,j)}}})(y||(o.channels=y={})),(function(x){function E(M,R){return f=Math.round(255*R),[c,u,m]=_.toChannels(M.rgba),{css:y.toCss(c,u,m,f),rgba:y.toRgba(c,u,m,f)}}x.blend=function(M,R){if(f=(255&R.rgba)/255,f===1)return{css:R.css,rgba:R.rgba};const j=R.rgba>>24&255,D=R.rgba>>16&255,O=R.rgba>>8&255,P=M.rgba>>24&255,U=M.rgba>>16&255,q=M.rgba>>8&255;return c=P+Math.round((j-P)*f),u=U+Math.round((D-U)*f),m=q+Math.round((O-q)*f),{css:y.toCss(c,u,m),rgba:y.toRgba(c,u,m)}},x.isOpaque=function(M){return(255&M.rgba)==255},x.ensureContrastRatio=function(M,R,j){const D=_.ensureContrastRatio(M.rgba,R.rgba,j);if(D)return y.toColor(D>>24&255,D>>16&255,D>>8&255)},x.opaque=function(M){const R=(255|M.rgba)>>>0;return[c,u,m]=_.toChannels(R),{css:y.toCss(c,u,m),rgba:R}},x.opacity=E,x.multiplyOpacity=function(M,R){return f=255&M.rgba,E(M,f*R/255)},x.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}})(S||(o.color=S={})),(function(x){let E,M;try{const R=document.createElement("canvas");R.width=1,R.height=1;const j=R.getContext("2d",{willReadFrequently:!0});j&&(E=j,E.globalCompositeOperation="copy",M=E.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),m=parseInt(R.slice(3,4).repeat(2),16),y.toColor(c,u,m);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),m=parseInt(R.slice(3,4).repeat(2),16),f=parseInt(R.slice(4,5).repeat(2),16),y.toColor(c,u,m,f);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const j=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(j)return c=parseInt(j[1]),u=parseInt(j[2]),m=parseInt(j[3]),f=Math.round(255*(j[5]===void 0?1:parseFloat(j[5]))),y.toColor(c,u,m,f);if(!E||!M)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=M,E.fillStyle=R,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,u,m,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(c,u,m,f),css:R}}})(k||(o.css=k={})),(function(x){function E(M,R,j){const D=M/255,O=R/255,P=j/255;return .2126*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}x.relativeLuminance=function(M){return E(M>>16&255,M>>8&255,255&M)},x.relativeLuminance2=E})(w||(o.rgb=w={})),(function(x){function E(R,j,D){const O=R>>24&255,P=R>>16&255,U=R>>8&255;let q=j>>24&255,$=j>>16&255,K=j>>8&255,Y=v(w.relativeLuminance2(q,$,K),w.relativeLuminance2(O,P,U));for(;Y<D&&(q>0||$>0||K>0);)q-=Math.max(0,Math.ceil(.1*q)),$-=Math.max(0,Math.ceil(.1*$)),K-=Math.max(0,Math.ceil(.1*K)),Y=v(w.relativeLuminance2(q,$,K),w.relativeLuminance2(O,P,U));return(q<<24|$<<16|K<<8|255)>>>0}function M(R,j,D){const O=R>>24&255,P=R>>16&255,U=R>>8&255;let q=j>>24&255,$=j>>16&255,K=j>>8&255,Y=v(w.relativeLuminance2(q,$,K),w.relativeLuminance2(O,P,U));for(;Y<D&&(q<255||$<255||K<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),$=Math.min(255,$+Math.ceil(.1*(255-$))),K=Math.min(255,K+Math.ceil(.1*(255-K))),Y=v(w.relativeLuminance2(q,$,K),w.relativeLuminance2(O,P,U));return(q<<24|$<<16|K<<8|255)>>>0}x.blend=function(R,j){if(f=(255&j)/255,f===1)return j;const D=j>>24&255,O=j>>16&255,P=j>>8&255,U=R>>24&255,q=R>>16&255,$=R>>8&255;return c=U+Math.round((D-U)*f),u=q+Math.round((O-q)*f),m=$+Math.round((P-$)*f),y.toRgba(c,u,m)},x.ensureContrastRatio=function(R,j,D){const O=w.relativeLuminance(R>>8),P=w.relativeLuminance(j>>8);if(v(O,P)<D){if(P<O){const $=E(R,j,D),K=v(O,w.relativeLuminance($>>8));if(K<D){const Y=M(R,j,D);return K>v(O,w.relativeLuminance(Y>>8))?$:Y}return $}const U=M(R,j,D),q=v(O,w.relativeLuminance(U>>8));if(q<D){const $=E(R,j,D);return q>v(O,w.relativeLuminance($>>8))?U:$}return U}},x.reduceLuminance=E,x.increaseLuminance=M,x.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(_||(o.rgba=_={})),o.toPaddedHex=b,o.contrastRatio=v},8969:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=c(844),m=c(2585),f=c(4348),y=c(7866),S=c(744),k=c(7302),w=c(6975),_=c(8460),b=c(1753),v=c(1480),x=c(7994),E=c(9282),M=c(5435),R=c(5981),j=c(2660);let D=!1;class O extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new _.EventEmitter),this._onScroll.event((U=>{var q;(q=this._onScrollApi)==null||q.fire(U.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(U){for(const q in U)this.optionsService.options[q]=U[q]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new _.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new k.OptionsService(U)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(y.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(j.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,_.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,_.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,_.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,_.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((q=>{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((q=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((q,$)=>this._inputHandler.parse(q,$)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,q){this._writeBuffer.write(U,q)}writeSync(U,q){this._logService.logLevel<=m.LogLevelEnum.WARN&&!D&&(this._logService.warn("writeSync is unreliable and will be removed soon."),D=!0),this._writeBuffer.writeSync(U,q)}input(U,q=!0){this.coreService.triggerDataEvent(U,q)}resize(U,q){isNaN(U)||isNaN(q)||(U=Math.max(U,S.MINIMUM_COLS),q=Math.max(q,S.MINIMUM_ROWS),this._bufferService.resize(U,q))}scroll(U,q=!1){this._bufferService.scroll(U,q)}scrollLines(U,q,$){this._bufferService.scrollLines(U,q,$)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const q=U-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(U,q){return this._inputHandler.registerEscHandler(U,q)}registerDcsHandler(U,q){return this._inputHandler.registerDcsHandler(U,q)}registerCsiHandler(U,q){return this._inputHandler.registerCsiHandler(U,q)}registerOscHandler(U,q){return this._inputHandler.registerOscHandler(U,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?U=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const q of U)q.dispose()}))}}}o.CoreTerminal=O},8460:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const m=[];for(let f=0;f<this._listeners.length;f++)m.push(this._listeners[f]);for(let f=0;f<m.length;f++)m[f].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,u){return c((m=>u.fire(m)))},o.runAndSubscribe=function(c,u){return u(void 0),c((m=>u(m)))}},5435:function(d,o,c){var u=this&&this.__decorate||function(Q,F,N,L){var B,z=arguments.length,X=z<3?F:L===null?L=Object.getOwnPropertyDescriptor(F,N):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(Q,F,N,L);else for(var J=Q.length-1;J>=0;J--)(B=Q[J])&&(X=(z<3?B(X):z>3?B(F,N,X):B(F,N))||X);return z>3&&X&&Object.defineProperty(F,N,X),X},m=this&&this.__param||function(Q,F){return function(N,L){F(N,L,Q)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const f=c(2584),y=c(7116),S=c(2015),k=c(844),w=c(482),_=c(8437),b=c(8460),v=c(643),x=c(511),E=c(3734),M=c(2585),R=c(1480),j=c(6242),D=c(6351),O=c(5941),P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function q(Q,F){if(Q>24)return F.setWinLines||!1;switch(Q){case 1:return!!F.restoreWin;case 2:return!!F.minimizeWin;case 3:return!!F.setWinPosition;case 4:return!!F.setWinSizePixels;case 5:return!!F.raiseWin;case 6:return!!F.lowerWin;case 7:return!!F.refreshWin;case 8:return!!F.setWinSizeChars;case 9:return!!F.maximizeWin;case 10:return!!F.fullscreenWin;case 11:return!!F.getWinState;case 13:return!!F.getWinPosition;case 14:return!!F.getWinSizePixels;case 15:return!!F.getScreenSizePixels;case 16:return!!F.getCellSizePixels;case 18:return!!F.getWinSizeChars;case 19:return!!F.getScreenSizeChars;case 20:return!!F.getIconTitle;case 21:return!!F.getWinTitle;case 22:return!!F.pushTitle;case 23:return!!F.popTitle;case 24:return!!F.setWinLines}return!1}var $;(function(Q){Q[Q.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Q[Q.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})($||(o.WindowsOptionsReportType=$={}));let K=0;class Y extends k.Disposable{getAttrData(){return this._curAttrData}constructor(F,N,L,B,z,X,J,te,W=new S.EscapeSequenceParser){super(),this._bufferService=F,this._charsetService=N,this._coreService=L,this._logService=B,this._optionsService=z,this._oscLinkService=X,this._coreMouseService=J,this._unicodeService=te,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new x.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ne.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ne,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ne,data:ae})})),this._parser.setDcsHandlerFallback(((H,ne,ae)=>{ne==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ne,payload:ae})})),this._parser.setPrintHandler(((H,ne,ae)=>this.print(H,ne,ae))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new j.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new j.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new j.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new j.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new j.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new j.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new j.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new j.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new j.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new j.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new j.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new j.OscHandler((H=>this.restoreCursorColor(H)))),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 H in y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new D.DcsHandler(((H,ne)=>this.requestStatusString(H,ne))))}_preserveStack(F,N,L,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=F,this._parseStack.cursorStartY=N,this._parseStack.decodedLength=L,this._parseStack.position=B}_logSlowResolvingAsync(F){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([F,new Promise(((N,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((N=>{if(N!=="#SLOW_TIMEOUT")throw N;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(F,N){let L,B=this._activeBuffer.x,z=this._activeBuffer.y,X=0;const J=this._parseStack.paused;if(J){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,N))return this._logSlowResolvingAsync(L),L;B=this._parseStack.cursorStartX,z=this._parseStack.cursorStartY,this._parseStack.paused=!1,F.length>U&&(X=this._parseStack.position+U)}if(this._logService.logLevel<=M.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof F=="string"?` "${F}"`:` "${Array.prototype.map.call(F,(H=>String.fromCharCode(H))).join("")}"`),typeof F=="string"?F.split("").map((H=>H.charCodeAt(0))):F),this._parseBuffer.length<F.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(F.length,U))),J||this._dirtyRowTracker.clearRange(),F.length>U)for(let H=X;H<F.length;H+=U){const ne=H+U<F.length?H+U:F.length,ae=typeof F=="string"?this._stringDecoder.decode(F.substring(H,ne),this._parseBuffer):this._utf8Decoder.decode(F.subarray(H,ne),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,ae))return this._preserveStack(B,z,ae,H),this._logSlowResolvingAsync(L),L}else if(!J){const H=typeof F=="string"?this._stringDecoder.decode(F,this._parseBuffer):this._utf8Decoder.decode(F,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,z,H,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===B&&this._activeBuffer.y===z||this._onCursorMove.fire();const te=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(te,this._bufferService.rows-1))}print(F,N,L){let B,z;const X=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,te=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,ne=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-N>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let pe=this._parser.precedingJoinState;for(let ue=N;ue<L;++ue){if(B=F[ue],B<127&&X){const lt=X[String.fromCharCode(B)];lt&&(B=lt.charCodeAt(0))}const Re=this._unicodeService.charProperties(B,pe);z=R.UnicodeService.extractWidth(Re);const Ie=R.UnicodeService.extractShouldJoin(Re),Fe=Ie?R.UnicodeService.extractWidth(pe):0;if(pe=Re,J&&this._onA11yChar.fire((0,w.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+z-Fe>te){if(W){const lt=ae;let De=this._activeBuffer.x-Fe;for(this._activeBuffer.x=Fe,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Fe>0&&ae instanceof _.BufferLine&&ae.copyCellsFrom(lt,De,0,Fe,!1);De<te;)lt.setCellFromCodepoint(De++,0,1,ne)}else if(this._activeBuffer.x=te-1,z===2)continue}if(Ie&&this._activeBuffer.x){const lt=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-lt,B,z);for(let De=z-Fe;--De>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(H&&(ae.insertCells(this._activeBuffer.x,z-Fe,this._activeBuffer.getNullCell(ne)),ae.getWidth(te-1)===2&&ae.setCellFromCodepoint(te-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,ne)),ae.setCellFromCodepoint(this._activeBuffer.x++,B,z,ne),z>0)for(;--z;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=pe,this._activeBuffer.x<te&&L-N>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(F,N){return F.final!=="t"||F.prefix||F.intermediates?this._parser.registerCsiHandler(F,N):this._parser.registerCsiHandler(F,(L=>!q(L.params[0],this._optionsService.rawOptions.windowOptions)||N(L)))}registerDcsHandler(F,N){return this._parser.registerDcsHandler(F,new D.DcsHandler(N))}registerEscHandler(F,N){return this._parser.registerEscHandler(F,N)}registerOscHandler(F,N){return this._parser.registerOscHandler(F,new j.OscHandler(N))}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 F;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&&((F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&F.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const F=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-F),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(F=this._bufferService.cols-1){this._activeBuffer.x=Math.min(F,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(F,N){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=F,this._activeBuffer.y=this._activeBuffer.scrollTop+N):(this._activeBuffer.x=F,this._activeBuffer.y=N),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(F,N){this._restrictCursor(),this._setCursor(this._activeBuffer.x+F,this._activeBuffer.y+N)}cursorUp(F){const N=this._activeBuffer.y-this._activeBuffer.scrollTop;return N>=0?this._moveCursor(0,-Math.min(N,F.params[0]||1)):this._moveCursor(0,-(F.params[0]||1)),!0}cursorDown(F){const N=this._activeBuffer.scrollBottom-this._activeBuffer.y;return N>=0?this._moveCursor(0,Math.min(N,F.params[0]||1)):this._moveCursor(0,F.params[0]||1),!0}cursorForward(F){return this._moveCursor(F.params[0]||1,0),!0}cursorBackward(F){return this._moveCursor(-(F.params[0]||1),0),!0}cursorNextLine(F){return this.cursorDown(F),this._activeBuffer.x=0,!0}cursorPrecedingLine(F){return this.cursorUp(F),this._activeBuffer.x=0,!0}cursorCharAbsolute(F){return this._setCursor((F.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(F){return this._setCursor(F.length>=2?(F.params[1]||1)-1:0,(F.params[0]||1)-1),!0}charPosAbsolute(F){return this._setCursor((F.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(F){return this._moveCursor(F.params[0]||1,0),!0}linePosAbsolute(F){return this._setCursor(this._activeBuffer.x,(F.params[0]||1)-1),!0}vPositionRelative(F){return this._moveCursor(0,F.params[0]||1),!0}hVPosition(F){return this.cursorPosition(F),!0}tabClear(F){const N=F.params[0];return N===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:N===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=F.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=F.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(F){const N=F.params[0];return N===1&&(this._curAttrData.bg|=536870912),N!==2&&N!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(F,N,L,B=!1,z=!1){const X=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);X.replaceCells(N,L,this._activeBuffer.getNullCell(this._eraseAttrData()),z),B&&(X.isWrapped=!1)}_resetBufferLine(F,N=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),N),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+F),L.isWrapped=!1)}eraseInDisplay(F,N=!1){let L;switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);L<this._bufferService.rows;L++)this._resetBufferLine(L,N);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,N),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,N);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,N);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(F,N=!1){switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,N);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,N)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(F){this._restrictCursor();let N=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;N--;)this._activeBuffer.lines.splice(z-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(F){this._restrictCursor();let N=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;N--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(F){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.insertCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(F){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.deleteCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(F){let N=F.params[0]||1;for(;N--;)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(F){let N=F.params[0]||1;for(;N--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(_.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=F.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.deleteCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=F.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.insertCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=F.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.insertCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(F){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=F.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.deleteCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(F){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(F.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(F){const N=this._parser.precedingJoinState;if(!N)return!0;const L=F.params[0]||1,B=R.UnicodeService.extractWidth(N),z=this._activeBuffer.x-B,X=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(z),J=new Uint32Array(X.length*L);let te=0;for(let H=0;H<X.length;){const ne=X.codePointAt(H)||0;J[te++]=ne,H+=ne>65535?2:1}let W=te;for(let H=1;H<L;++H)J.copyWithin(W,0,te),W+=te;return this.print(J,0,W),!0}sendDeviceAttributesPrimary(F){return F.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(F){return F.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(F.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(F){return(this._optionsService.rawOptions.termName+"").indexOf(F)===0}setMode(F){for(let N=0;N<F.length;N++)switch(F.params[N]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(F){for(let N=0;N<F.length;N++)switch(F.params[N]){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(F){for(let N=0;N<F.length;N++)switch(F.params[N]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(F){for(let N=0;N<F.length;N++)switch(F.params[N]){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(),F.params[N]===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(F,N){const L=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:z}=this._coreMouseService,X=this._coreService,{buffers:J,cols:te}=this._bufferService,{active:W,alt:H}=J,ne=this._optionsService.rawOptions,ae=Ie=>Ie?1:2,pe=F.params[0];return ue=pe,Re=N?pe===2?4:pe===4?ae(X.modes.insertMode):pe===12?3:pe===20?ae(ne.convertEol):0:pe===1?ae(L.applicationCursorKeys):pe===3?ne.windowOptions.setWinLines?te===80?2:te===132?1:0:0:pe===6?ae(L.origin):pe===7?ae(L.wraparound):pe===8?3:pe===9?ae(B==="X10"):pe===12?ae(ne.cursorBlink):pe===25?ae(!X.isCursorHidden):pe===45?ae(L.reverseWraparound):pe===66?ae(L.applicationKeypad):pe===67?4:pe===1e3?ae(B==="VT200"):pe===1002?ae(B==="DRAG"):pe===1003?ae(B==="ANY"):pe===1004?ae(L.sendFocus):pe===1005?4:pe===1006?ae(z==="SGR"):pe===1015?4:pe===1016?ae(z==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ae(W===H):pe===2004?ae(L.bracketedPasteMode):0,X.triggerDataEvent(`${f.C0.ESC}[${N?"":"?"}${ue};${Re}$y`),!0;var ue,Re}_updateAttrColor(F,N,L,B,z){return N===2?(F|=50331648,F&=-16777216,F|=E.AttributeData.fromColorRGB([L,B,z])):N===5&&(F&=-50331904,F|=33554432|255&L),F}_extractColor(F,N,L){const B=[0,0,-1,0,0,0];let z=0,X=0;do{if(B[X+z]=F.params[N+X],F.hasSubParams(N+X)){const J=F.getSubParams(N+X);let te=0;do B[1]===5&&(z=1),B[X+te+1+z]=J[te];while(++te<J.length&&te+X+1+z<B.length);break}if(B[1]===5&&X+z>=2||B[1]===2&&X+z>=5)break;B[1]&&(z=1)}while(++X+N<F.length&&X+z<B.length);for(let J=2;J<B.length;++J)B[J]===-1&&(B[J]=0);switch(B[0]){case 38:L.fg=this._updateAttrColor(L.fg,B[1],B[3],B[4],B[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,B[1],B[3],B[4],B[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,B[1],B[3],B[4],B[5])}return X}_processUnderline(F,N){N.extended=N.extended.clone(),(!~F||F>5)&&(F=1),N.extended.underlineStyle=F,N.fg|=268435456,F===0&&(N.fg&=-268435457),N.updateExtended()}_processSGR0(F){F.fg=_.DEFAULT_ATTR_DATA.fg,F.bg=_.DEFAULT_ATTR_DATA.bg,F.extended=F.extended.clone(),F.extended.underlineStyle=0,F.extended.underlineColor&=-67108864,F.updateExtended()}charAttributes(F){if(F.length===1&&F.params[0]===0)return this._processSGR0(this._curAttrData),!0;const N=F.length;let L;const B=this._curAttrData;for(let z=0;z<N;z++)L=F.params[z],L>=30&&L<=37?(B.fg&=-50331904,B.fg|=16777216|L-30):L>=40&&L<=47?(B.bg&=-50331904,B.bg|=16777216|L-40):L>=90&&L<=97?(B.fg&=-50331904,B.fg|=16777224|L-90):L>=100&&L<=107?(B.bg&=-50331904,B.bg|=16777224|L-100):L===0?this._processSGR0(B):L===1?B.fg|=134217728:L===3?B.bg|=67108864:L===4?(B.fg|=268435456,this._processUnderline(F.hasSubParams(z)?F.getSubParams(z)[0]:1,B)):L===5?B.fg|=536870912:L===7?B.fg|=67108864:L===8?B.fg|=1073741824:L===9?B.fg|=2147483648:L===2?B.bg|=134217728:L===21?this._processUnderline(2,B):L===22?(B.fg&=-134217729,B.bg&=-134217729):L===23?B.bg&=-67108865:L===24?(B.fg&=-268435457,this._processUnderline(0,B)):L===25?B.fg&=-536870913:L===27?B.fg&=-67108865:L===28?B.fg&=-1073741825:L===29?B.fg&=2147483647:L===39?(B.fg&=-67108864,B.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):L===49?(B.bg&=-67108864,B.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?z+=this._extractColor(F,z,B):L===53?B.bg|=1073741824:L===55?B.bg&=-1073741825:L===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):L===100?(B.fg&=-67108864,B.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(F){switch(F.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const N=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${N};${L}R`)}return!0}deviceStatusPrivate(F){if(F.params[0]===6){const N=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${N};${L}R`)}return!0}softReset(F){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(F){const N=F.params[0]||1;switch(N){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 L=N%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(F){const N=F.params[0]||1;let L;return(F.length<2||(L=F.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>N&&(this._activeBuffer.scrollTop=N-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(F){if(!q(F.params[0],this._optionsService.rawOptions.windowOptions))return!0;const N=F.length>1?F.params[1]:0;switch(F.params[0]){case 14:N!==2&&this._onRequestWindowsOptionsReport.fire($.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire($.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:N!==0&&N!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),N!==0&&N!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:N!==0&&N!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),N!==0&&N!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(F){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(F){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(F){return this._windowTitle=F,this._onTitleChange.fire(F),!0}setIconName(F){return this._iconName=F,!0}setOrReportIndexedColor(F){const N=[],L=F.split(";");for(;L.length>1;){const B=L.shift(),z=L.shift();if(/^\d+$/.exec(B)){const X=parseInt(B);if(Z(X))if(z==="?")N.push({type:0,index:X});else{const J=(0,O.parseColor)(z);J&&N.push({type:1,index:X,color:J})}}}return N.length&&this._onColor.fire(N),!0}setHyperlink(F){const N=F.split(";");return!(N.length<2)&&(N[1]?this._createHyperlink(N[0],N[1]):!N[0]&&this._finishHyperlink())}_createHyperlink(F,N){this._getCurrentLinkId()&&this._finishHyperlink();const L=F.split(":");let B;const z=L.findIndex((X=>X.startsWith("id=")));return z!==-1&&(B=L[z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:N}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(F,N){const L=F.split(";");for(let B=0;B<L.length&&!(N>=this._specialColors.length);++B,++N)if(L[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[N]}]);else{const z=(0,O.parseColor)(L[B]);z&&this._onColor.fire([{type:1,index:this._specialColors[N],color:z}])}return!0}setOrReportFgColor(F){return this._setOrReportSpecialColor(F,0)}setOrReportBgColor(F){return this._setOrReportSpecialColor(F,1)}setOrReportCursorColor(F){return this._setOrReportSpecialColor(F,2)}restoreIndexedColor(F){if(!F)return this._onColor.fire([{type:2}]),!0;const N=[],L=F.split(";");for(let B=0;B<L.length;++B)if(/^\d+$/.exec(L[B])){const z=parseInt(L[B]);Z(z)&&N.push({type:2,index:z})}return N.length&&this._onColor.fire(N),!0}restoreFgColor(F){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(F){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(F){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(F){return F.length!==2?(this.selectDefaultCharset(),!0):(F[0]==="/"||this._charsetService.setgCharset(P[F[0]],y.CHARSETS[F[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 F=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,F,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(F){return this._charsetService.setgLevel(F),!0}screenAlignmentPattern(){const F=new x.CellData;F.content=4194373,F.fg=this._curAttrData.fg,F.bg=this._curAttrData.bg,this._setCursor(0,0);for(let N=0;N<this._bufferService.rows;++N){const L=this._activeBuffer.ybase+this._activeBuffer.y+N,B=this._activeBuffer.lines.get(L);B&&(B.fill(F),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(F,N){const L=this._bufferService.buffer,B=this._optionsService.rawOptions;return(z=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${z}${f.C0.ESC}\\`),!0))(F==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:F==='"p'?'P1$r61;1"p':F==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:F==="m"?"P1$r0m":F===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(F,N){this._dirtyRowTracker.markRangeDirty(F,N)}}o.InputHandler=Y;let V=class{constructor(Q){this._bufferService=Q,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Q){Q<this.start?this.start=Q:Q>this.end&&(this.end=Q)}markRangeDirty(Q,F){Q>F&&(K=Q,Q=F,F=K),Q<this.start&&(this.start=Q),F>this.end&&(this.end=F)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Z(Q){return 0<=Q&&Q<256}V=u([m(0,M.IBufferService)],V)},844:(d,o)=>{function c(u){for(const m of u)m.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const m=this._disposables.indexOf(u);m!==-1&&this._disposables.splice(m,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var m;this._isDisposed||u===this._value||((m=this._value)==null||m.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=c,o.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,f,y){this._data[m]||(this._data[m]={}),this._data[m][f]=y}get(m,f){return this._data[m]?this._data[m][f]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(u,m,f,y,S){this._data.get(u,m)||this._data.set(u,m,new c),this._data.get(u,m).set(f,y,S)}get(u,m,f,y){var S;return(S=this._data.get(u,m))==null?void 0:S.get(f,y)}clear(){this._data.clear()}}},6114:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const m=this._getKey(u);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(u){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===u)}forEachByKey(u,m){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===u)}values(){return[...this._array].values()}_search(u){let m=0,f=this._array.length-1;for(;f>=m;){let y=m+f>>1;const S=this._getKey(this._array[y]);if(S>u)f=y-1;else{if(!(S<u)){for(;y>0&&this._getKey(this._array[y-1])===u;)y--;return y}m=y+1}}return m}}},7226:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let k=0,w=0,_=S.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),w=Math.max(k,w),b=S.timeRemaining(),1.5*w>b)return _-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-k))}ms`),void this._start();_=b}this.clear()}}class f extends m{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const k=Date.now()+S;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}o.PriorityTaskQueue=f,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:f,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=c(643);o.updateWindowsModeWrappedState=function(m){const f=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),y=f==null?void 0:f.get(m.cols-1),S=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);S&&y&&(S.isWrapped=y[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&y[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new c;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,y=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=y}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=c(6349),m=c(7226),f=c(3734),y=c(8437),S=c(4634),k=c(511),w=c(643),_=c(4863),b=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(v,x,E){this._hasScrollback=v,this._optionsService=x,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.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 f.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 f.ExtendedAttrs),this._whitespaceCell}getBlankLine(v,x){return new y.BufferLine(this._bufferService.cols,this.getNullCell(v),x)}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 x=v+this._optionsService.rawOptions.scrollback;return x>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:x}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=y.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)this.lines.push(this.getBlankLine(v))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(v,x){const E=this.getNullCell(y.DEFAULT_ATTR_DATA);let M=0;const R=this._getCorrectBufferLength(x);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<v)for(let D=0;D<this.lines.length;D++)M+=+this.lines.get(D).resize(v,E);let j=0;if(this._rows<x)for(let D=this._rows;D<x;D++)this.lines.length<x+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,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+j+1?(this.ybase--,j++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(v,E)));else for(let D=this._rows;D>x;D--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const D=this.lines.length-R;D>0&&(this.lines.trimStart(D),this.ybase=Math.max(this.ybase-D,0),this.ydisp=Math.max(this.ydisp-D,0),this.savedY=Math.max(this.savedY-D,0)),this.lines.maxLength=R}this.x=Math.min(this.x,v-1),this.y=Math.min(this.y,x-1),j&&(this.y+=j),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(v,x),this._cols>v))for(let j=0;j<this.lines.length;j++)M+=+this.lines.get(j).resize(v,E);this._cols=v,this._rows=x,this._memoryCleanupQueue.clear(),M>.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 x=0;for(;this._memoryCleanupPosition<this.lines.length;)if(x+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),x>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,x){this._cols!==v&&(v>this._cols?this._reflowLarger(v,x):this._reflowSmaller(v,x))}_reflowLarger(v,x){const E=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(E.length>0){const M=(0,S.reflowLargerCreateNewLayout)(this.lines,E);(0,S.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(v,x,M.countRemoved)}}_reflowLargerAdjustViewport(v,x,E){const M=this.getNullCell(y.DEFAULT_ATTR_DATA);let R=E;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<x&&this.lines.push(new y.BufferLine(v,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(v,x){const E=this.getNullCell(y.DEFAULT_ATTR_DATA),M=[];let R=0;for(let j=this.lines.length-1;j>=0;j--){let D=this.lines.get(j);if(!D||!D.isWrapped&&D.getTrimmedLength()<=v)continue;const O=[D];for(;D.isWrapped&&j>0;)D=this.lines.get(--j),O.unshift(D);const P=this.ybase+this.y;if(P>=j&&P<j+O.length)continue;const U=O[O.length-1].getTrimmedLength(),q=(0,S.reflowSmallerGetNewLineLengths)(O,this._cols,v),$=q.length-O.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+$):Math.max(0,this.lines.length-this.lines.maxLength+$);const Y=[];for(let L=0;L<$;L++){const B=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);Y.push(B)}Y.length>0&&(M.push({start:j+O.length+R,newLines:Y}),R+=Y.length),O.push(...Y);let V=q.length-1,Z=q[V];Z===0&&(V--,Z=q[V]);let Q=O.length-$-1,F=U;for(;Q>=0;){const L=Math.min(F,Z);if(O[V]===void 0)break;if(O[V].copyCellsFrom(O[Q],F-L,Z-L,L,!0),Z-=L,Z===0&&(V--,Z=q[V]),F-=L,F===0){Q--;const B=Math.max(Q,0);F=(0,S.getWrappedLineTrimmedLength)(O,B,this._cols)}}for(let L=0;L<O.length;L++)q[L]<v&&O[L].setCell(q[L],E);let N=$-K;for(;N-- >0;)this.ybase===0?this.y<x-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-x&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+$,this.ybase+x-1)}if(M.length>0){const j=[],D=[];for(let V=0;V<this.lines.length;V++)D.push(this.lines.get(V));const O=this.lines.length;let P=O-1,U=0,q=M[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let $=0;for(let V=Math.min(this.lines.maxLength-1,O+R-1);V>=0;V--)if(q&&q.start>P+$){for(let Z=q.newLines.length-1;Z>=0;Z--)this.lines.set(V--,q.newLines[Z]);V++,j.push({index:P+1,amount:q.newLines.length}),$+=q.newLines.length,q=M[++U]}else this.lines.set(V,D[P--]);let K=0;for(let V=j.length-1;V>=0;V--)j[V].index+=K,this.lines.onInsertEmitter.fire(j[V]),K+=j[V].amount;const Y=Math.max(0,O+R-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(v,x,E=0,M){const R=this.lines.get(v);return R?R.translateToString(x,E,M):""}getWrappedRangeForLine(v){let x=v,E=v;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:x,last:E}}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 x=0;x<this.markers.length;x++)this.markers[x].line===v&&(this.markers[x].dispose(),this.markers.splice(x--,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 x=new _.Marker(v);return this.markers.push(x),x.register(this.lines.onTrim((E=>{x.line-=E,x.line<0&&x.dispose()}))),x.register(this.lines.onInsert((E=>{x.line>=E.index&&(x.line+=E.amount)}))),x.register(this.lines.onDelete((E=>{x.line>=E.index&&x.line<E.index+E.amount&&x.dispose(),x.line>E.index&&(x.line-=E.amount)}))),x.register(x.onDispose((()=>this._removeMarker(x)))),x}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),1)}}},8437:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=c(3734),m=c(511),f=c(643),y=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let S=0;class k{constructor(_,b,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const x=b||m.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let E=0;E<_;++E)this.setCell(E,x);this.length=_}get(_){const b=this._data[3*_+0],v=2097151&b;return[this._data[3*_+1],2097152&b?this._combined[_]:v?(0,y.stringFromCodePoint)(v):"",b>>22,2097152&b?this._combined[_].charCodeAt(this._combined[_].length-1):v]}set(_,b){this._data[3*_+1]=b[f.CHAR_DATA_ATTR_INDEX],b[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=b[1],this._data[3*_+0]=2097152|_|b[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=b[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(_){return this._data[3*_+0]>>22}hasWidth(_){return 12582912&this._data[3*_+0]}getFg(_){return this._data[3*_+1]}getBg(_){return this._data[3*_+2]}hasContent(_){return 4194303&this._data[3*_+0]}getCodePoint(_){const b=this._data[3*_+0];return 2097152&b?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&b}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const b=this._data[3*_+0];return 2097152&b?this._combined[_]:2097151&b?(0,y.stringFromCodePoint)(2097151&b):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,b){return S=3*_,b.content=this._data[S+0],b.fg=this._data[S+1],b.bg=this._data[S+2],2097152&b.content&&(b.combinedData=this._combined[_]),268435456&b.bg&&(b.extended=this._extendedAttrs[_]),b}setCell(_,b){2097152&b.content&&(this._combined[_]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[_]=b.extended),this._data[3*_+0]=b.content,this._data[3*_+1]=b.fg,this._data[3*_+2]=b.bg}setCellFromCodepoint(_,b,v,x){268435456&x.bg&&(this._extendedAttrs[_]=x.extended),this._data[3*_+0]=b|v<<22,this._data[3*_+1]=x.fg,this._data[3*_+2]=x.bg}addCodepointToCell(_,b,v){let x=this._data[3*_+0];2097152&x?this._combined[_]+=(0,y.stringFromCodePoint)(b):2097151&x?(this._combined[_]=(0,y.stringFromCodePoint)(2097151&x)+(0,y.stringFromCodePoint)(b),x&=-2097152,x|=2097152):x=b|4194304,v&&(x&=-12582913,x|=v<<22),this._data[3*_+0]=x}insertCells(_,b,v){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),b<this.length-_){const x=new m.CellData;for(let E=this.length-_-b-1;E>=0;--E)this.setCell(_+b+E,this.loadCell(_+E,x));for(let E=0;E<b;++E)this.setCell(_+E,v)}else for(let x=_;x<this.length;++x)this.setCell(x,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(_,b,v){if(_%=this.length,b<this.length-_){const x=new m.CellData;for(let E=0;E<this.length-_-b;++E)this.setCell(_+E,this.loadCell(_+b+E,x));for(let E=this.length-b;E<this.length;++E)this.setCell(E,v)}else for(let x=_;x<this.length;++x)this.setCell(x,v);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,v)}replaceCells(_,b,v,x=!1){if(x)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,v),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,v);_<b&&_<this.length;)this.isProtected(_)||this.setCell(_,v),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,v);_<b&&_<this.length;)this.setCell(_++,v)}resize(_,b){if(_===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const v=3*_;if(_>this.length){if(this._data.buffer.byteLength>=4*v)this._data=new Uint32Array(this._data.buffer,0,v);else{const x=new Uint32Array(v);x.set(this._data),this._data=x}for(let x=this.length;x<_;++x)this.setCell(x,b)}else{this._data=this._data.subarray(0,v);const x=Object.keys(this._combined);for(let M=0;M<x.length;M++){const R=parseInt(x[M],10);R>=_&&delete this._combined[R]}const E=Object.keys(this._extendedAttrs);for(let M=0;M<E.length;M++){const R=parseInt(E[M],10);R>=_&&delete this._extendedAttrs[R]}}return this.length=_,4*v*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const _=new Uint32Array(this._data.length);return _.set(this._data),this._data=_,1}return 0}fill(_,b=!1){if(b)for(let v=0;v<this.length;++v)this.isProtected(v)||this.setCell(v,_);else{this._combined={},this._extendedAttrs={};for(let v=0;v<this.length;++v)this.setCell(v,_)}}copyFrom(_){this.length!==_.length?this._data=new Uint32Array(_._data):this._data.set(_._data),this.length=_.length,this._combined={};for(const b in _._combined)this._combined[b]=_._combined[b];this._extendedAttrs={};for(const b in _._extendedAttrs)this._extendedAttrs[b]=_._extendedAttrs[b];this.isWrapped=_.isWrapped}clone(){const _=new k(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const b in this._combined)_._combined[b]=this._combined[b];for(const b in this._extendedAttrs)_._extendedAttrs[b]=this._extendedAttrs[b];return _.isWrapped=this.isWrapped,_}getTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0])return _+(this._data[3*_+0]>>22);return 0}getNoBgTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0]||50331648&this._data[3*_+2])return _+(this._data[3*_+0]>>22);return 0}copyCellsFrom(_,b,v,x,E){const M=_._data;if(E)for(let j=x-1;j>=0;j--){for(let D=0;D<3;D++)this._data[3*(v+j)+D]=M[3*(b+j)+D];268435456&M[3*(b+j)+2]&&(this._extendedAttrs[v+j]=_._extendedAttrs[b+j])}else for(let j=0;j<x;j++){for(let D=0;D<3;D++)this._data[3*(v+j)+D]=M[3*(b+j)+D];268435456&M[3*(b+j)+2]&&(this._extendedAttrs[v+j]=_._extendedAttrs[b+j])}const R=Object.keys(_._combined);for(let j=0;j<R.length;j++){const D=parseInt(R[j],10);D>=b&&(this._combined[D-b+v]=_._combined[D])}}translateToString(_,b,v,x){b=b!=null?b:0,v=v!=null?v:this.length,_&&(v=Math.min(v,this.getTrimmedLength())),x&&(x.length=0);let E="";for(;b<v;){const M=this._data[3*b+0],R=2097151&M,j=2097152&M?this._combined[b]:R?(0,y.stringFromCodePoint)(R):f.WHITESPACE_CELL_CHAR;if(E+=j,x)for(let D=0;D<j.length;++D)x.push(b);b+=M>>22||1}return x&&x.push(b),E}}o.BufferLine=k},4841:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,u){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(d,o)=>{function c(u,m,f){if(m===u.length-1)return u[m].getTrimmedLength();const y=!u[m].hasContent(f-1)&&u[m].getWidth(f-1)===1,S=u[m+1].getWidth(0)===2;return y&&S?f-1:f}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,m,f,y,S){const k=[];for(let w=0;w<u.length-1;w++){let _=w,b=u.get(++_);if(!b.isWrapped)continue;const v=[u.get(w)];for(;_<u.length&&b.isWrapped;)v.push(b),b=u.get(++_);if(y>=w&&y<_){w+=v.length-1;continue}let x=0,E=c(v,x,m),M=1,R=0;for(;M<v.length;){const D=c(v,M,m),O=D-R,P=f-E,U=Math.min(O,P);v[x].copyCellsFrom(v[M],R,E,U,!1),E+=U,E===f&&(x++,E=0),R+=U,R===D&&(M++,R=0),E===0&&x!==0&&v[x-1].getWidth(f-1)===2&&(v[x].copyCellsFrom(v[x-1],f-1,E++,1,!1),v[x-1].setCell(f-1,S))}v[x].replaceCells(E,f,S);let j=0;for(let D=v.length-1;D>0&&(D>x||v[D].getTrimmedLength()===0);D--)j++;j>0&&(k.push(w+v.length-j),k.push(j)),w+=v.length-1}return k},o.reflowLargerCreateNewLayout=function(u,m){const f=[];let y=0,S=m[y],k=0;for(let w=0;w<u.length;w++)if(S===w){const _=m[++y];u.onDeleteEmitter.fire({index:w-k,amount:_}),w+=_-1,k+=_,S=m[++y]}else f.push(w);return{layout:f,countRemoved:k}},o.reflowLargerApplyNewLayout=function(u,m){const f=[];for(let y=0;y<m.length;y++)f.push(u.get(m[y]));for(let y=0;y<f.length;y++)u.set(y,f[y]);u.length=m.length},o.reflowSmallerGetNewLineLengths=function(u,m,f){const y=[],S=u.map(((b,v)=>c(u,v,m))).reduce(((b,v)=>b+v));let k=0,w=0,_=0;for(;_<S;){if(S-_<f){y.push(S-_);break}k+=f;const b=c(u,w,m);k>b&&(k-=b,w++);const v=u[w].getWidth(k-1)===2;v&&k--;const x=v?f-1:f;y.push(x),_+=x}return y},o.getWrappedLineTrimmedLength=c},5295:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=c(8460),m=c(844),f=c(9092);class y extends m.Disposable{constructor(k,w){super(),this._optionsService=k,this._bufferService=w,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,w){this._normal.resize(k,w),this._alt.resize(k,w),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}o.BufferSet=y},511:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=c(482),m=c(643),f=c(3734);class y extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const w=new y;return w.setFromCharData(k),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const _=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const b=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(_-55296)+b-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=y},643:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=c(8460),m=c(844);class f{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}o.Marker=f,f._nextId=1},7116:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,o)=>{var c,u,m;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
450
- `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(c||(o.C0=c={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(u||(o.C1=u={})),(function(f){f.ST=`${c.ESC}\\`})(m||(o.C1_ESCAPED=m={}))},7399:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=c(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(f,y,S,k){const w={type:0,cancel:!1,key:void 0},_=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=y?u.C0.ESC+"OA":u.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=y?u.C0.ESC+"OD":u.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=y?u.C0.ESC+"OC":u.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=y?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":u.C0.DEL,f.altKey&&(w.key=u.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=u.C0.ESC+"[Z";break}w.key=u.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,w.cancel=!0;break;case 27:w.key=u.C0.ESC,f.altKey&&(w.key=u.C0.ESC+u.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;_?(w.key=u.C0.ESC+"[1;"+(_+1)+"D",w.key===u.C0.ESC+"[1;3D"&&(w.key=u.C0.ESC+(S?"b":"[1;5D"))):w.key=y?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(f.metaKey)break;_?(w.key=u.C0.ESC+"[1;"+(_+1)+"C",w.key===u.C0.ESC+"[1;3C"&&(w.key=u.C0.ESC+(S?"f":"[1;5C"))):w.key=y?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(f.metaKey)break;_?(w.key=u.C0.ESC+"[1;"+(_+1)+"A",S||w.key!==u.C0.ESC+"[1;3A"||(w.key=u.C0.ESC+"[1;5A")):w.key=y?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(f.metaKey)break;_?(w.key=u.C0.ESC+"[1;"+(_+1)+"B",S||w.key!==u.C0.ESC+"[1;3B"||(w.key=u.C0.ESC+"[1;5B")):w.key=y?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=u.C0.ESC+"[2~");break;case 46:w.key=_?u.C0.ESC+"[3;"+(_+1)+"~":u.C0.ESC+"[3~";break;case 36:w.key=_?u.C0.ESC+"[1;"+(_+1)+"H":y?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:w.key=_?u.C0.ESC+"[1;"+(_+1)+"F":y?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=u.C0.ESC+"[5;"+(_+1)+"~":w.key=u.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=u.C0.ESC+"[6;"+(_+1)+"~":w.key=u.C0.ESC+"[6~";break;case 112:w.key=_?u.C0.ESC+"[1;"+(_+1)+"P":u.C0.ESC+"OP";break;case 113:w.key=_?u.C0.ESC+"[1;"+(_+1)+"Q":u.C0.ESC+"OQ";break;case 114:w.key=_?u.C0.ESC+"[1;"+(_+1)+"R":u.C0.ESC+"OR";break;case 115:w.key=_?u.C0.ESC+"[1;"+(_+1)+"S":u.C0.ESC+"OS";break;case 116:w.key=_?u.C0.ESC+"[15;"+(_+1)+"~":u.C0.ESC+"[15~";break;case 117:w.key=_?u.C0.ESC+"[17;"+(_+1)+"~":u.C0.ESC+"[17~";break;case 118:w.key=_?u.C0.ESC+"[18;"+(_+1)+"~":u.C0.ESC+"[18~";break;case 119:w.key=_?u.C0.ESC+"[19;"+(_+1)+"~":u.C0.ESC+"[19~";break;case 120:w.key=_?u.C0.ESC+"[20;"+(_+1)+"~":u.C0.ESC+"[20~";break;case 121:w.key=_?u.C0.ESC+"[21;"+(_+1)+"~":u.C0.ESC+"[21~";break;case 122:w.key=_?u.C0.ESC+"[23;"+(_+1)+"~":u.C0.ESC+"[23~";break;case 123:w.key=_?u.C0.ESC+"[24;"+(_+1)+"~":u.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(S&&!k||!f.altKey||f.metaKey)!S||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=u.C0.US),f.key==="@"&&(w.key=u.C0.NUL)):f.keyCode===65&&(w.type=1);else{const b=m[f.keyCode],v=b==null?void 0:b[f.shiftKey?1:0];if(v)w.key=u.C0.ESC+v;else if(f.keyCode>=65&&f.keyCode<=90){const x=f.ctrlKey?f.keyCode-64:f.keyCode+32;let E=String.fromCharCode(x);f.shiftKey&&(E=E.toUpperCase()),w.key=u.C0.ESC+E}else if(f.keyCode===32)w.key=u.C0.ESC+(f.ctrlKey?u.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let x=f.code.slice(3,4);f.shiftKey||(x=x.toLowerCase()),w.key=u.C0.ESC+x,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=u.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=u.C0.DEL:f.keyCode===219?w.key=u.C0.ESC:f.keyCode===220?w.key=u.C0.FS:f.keyCode===221&&(w.key=u.C0.GS)}return w}},482:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,u=0,m=c.length){let f="";for(let y=u;y<m;++y){let S=c[y];S>65535?(S-=65536,f+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):f+=String.fromCharCode(S)}return f},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const m=c.length;if(!m)return 0;let f=0,y=0;if(this._interim){const S=c.charCodeAt(y++);56320<=S&&S<=57343?u[f++]=1024*(this._interim-55296)+S-56320+65536:(u[f++]=this._interim,u[f++]=S),this._interim=0}for(let S=y;S<m;++S){const k=c.charCodeAt(S);if(55296<=k&&k<=56319){if(++S>=m)return this._interim=k,f;const w=c.charCodeAt(S);56320<=w&&w<=57343?u[f++]=1024*(k-55296)+w-56320+65536:(u[f++]=k,u[f++]=w)}else k!==65279&&(u[f++]=k)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const m=c.length;if(!m)return 0;let f,y,S,k,w=0,_=0,b=0;if(this.interim[0]){let E=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let R,j=0;for(;(R=63&this.interim[++j])&&j<4;)M<<=6,M|=R;const D=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,O=D-j;for(;b<O;){if(b>=m)return 0;if(R=c[b++],(192&R)!=128){b--,E=!0;break}this.interim[j++]=R,M<<=6,M|=63&R}E||(D===2?M<128?b--:u[w++]=M:D===3?M<2048||M>=55296&&M<=57343||M===65279||(u[w++]=M):M<65536||M>1114111||(u[w++]=M)),this.interim.fill(0)}const v=m-4;let x=b;for(;x<m;){for(;!(!(x<v)||128&(f=c[x])||128&(y=c[x+1])||128&(S=c[x+2])||128&(k=c[x+3]));)u[w++]=f,u[w++]=y,u[w++]=S,u[w++]=k,x+=4;if(f=c[x++],f<128)u[w++]=f;else if((224&f)==192){if(x>=m)return this.interim[0]=f,w;if(y=c[x++],(192&y)!=128){x--;continue}if(_=(31&f)<<6|63&y,_<128){x--;continue}u[w++]=_}else if((240&f)==224){if(x>=m)return this.interim[0]=f,w;if(y=c[x++],(192&y)!=128){x--;continue}if(x>=m)return this.interim[0]=f,this.interim[1]=y,w;if(S=c[x++],(192&S)!=128){x--;continue}if(_=(15&f)<<12|(63&y)<<6|63&S,_<2048||_>=55296&&_<=57343||_===65279)continue;u[w++]=_}else if((248&f)==240){if(x>=m)return this.interim[0]=f,w;if(y=c[x++],(192&y)!=128){x--;continue}if(x>=m)return this.interim[0]=f,this.interim[1]=y,w;if(S=c[x++],(192&S)!=128){x--;continue}if(x>=m)return this.interim[0]=f,this.interim[1]=y,this.interim[2]=S,w;if(k=c[x++],(192&k)!=128){x--;continue}if(_=(7&f)<<18|(63&y)<<12|(63&S)<<6|63&k,_<65536||_>1114111)continue;u[w++]=_}}return w}}},225:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=c(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;o.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let S=0;S<m.length;++S)y.fill(0,m[S][0],m[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?y[S]:(function(k,w){let _,b=0,v=w.length-1;if(k<w[0][0]||k>w[v][1])return!1;for(;v>=b;)if(_=b+v>>1,k>w[_][1])b=_+1;else{if(!(k<w[_][0]))return!0;v=_-1}return!1})(S,f)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,k){let w=this.wcwidth(S),_=w===0&&k!==0;if(_){const b=u.UnicodeService.extractWidth(k);b===0?_=!1:b>w&&(w=b)}return u.UnicodeService.createPropertyValue(0,w,_)}}},5981:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=c(8460),m=c(844);class f extends m.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const _=this._callbacks.shift();_&&_()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,k){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(k)}_innerWrite(S=0,k=!0){const w=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],b=this._action(_,k);if(b){const x=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void b.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(x)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=_.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=f},5941:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function m(f,y){const S=f.toString(16),k=S.length<2?"0"+S:S;switch(y){case 4:return S[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}o.parseColor=function(f){if(!f)return;let y=f.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const S=c.exec(y);if(S){const k=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/k*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/k*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/k*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),u.exec(y)&&[3,6,9,12].includes(y.length))){const S=y.length/3,k=[0,0,0];for(let w=0;w<3;++w){const _=parseInt(y.slice(S*w,S*w+S),16);k[w]=S===1?_<<4:S===2?_:S===3?_>>4:_>>8}return k}},o.toRgbString=function(f,y=16){const[S,k,w]=f;return`rgb:${m(S,y)}/${m(k,y)}/${m(w,y)}`}},5770:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=c(482),m=c(8742),f=c(5770),y=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(k,w){this._handlers[k]===void 0&&(this._handlers[k]=[]);const _=this._handlers[k];return _.push(w),{dispose:()=>{const b=_.indexOf(w);b!==-1&&_.splice(b,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(k,w){if(this.reset(),this._ident=k,this._active=this._handlers[k]||y,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(k,w,_){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(k,w,_);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(k,w,_))}unhook(k,w=!0){if(this._active.length){let _=!1,b=this._active.length-1,v=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,_=w,v=this._stack.fallThrough,this._stack.paused=!1),!v&&_===!1){for(;b>=0&&(_=this._active[b].unhook(k),_!==!0);b--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,_;b--}for(;b>=0;b--)if(_=this._active[b].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",k);this._active=y,this._ident=0}};const S=new m.Params;S.addParam(0),o.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=S,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():S,this._data="",this._hitLimit=!1}put(k,w,_){this._hitLimit||(this._data+=(0,u.utf32ToString)(k,w,_),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let w=!1;if(this._hitLimit)w=!1;else if(k&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((_=>(this._params=S,this._data="",this._hitLimit=!1,_)));return this._params=S,this._data="",this._hitLimit=!1,w}}},2015:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=c(844),m=c(8742),f=c(6242),y=c(6351);class S{constructor(b){this.table=new Uint8Array(b)}setDefault(b,v){this.table.fill(b<<4|v)}add(b,v,x,E){this.table[v<<8|b]=x<<4|E}addMany(b,v,x,E){for(let M=0;M<b.length;M++)this.table[v<<8|b[M]]=x<<4|E}}o.TransitionTable=S;const k=160;o.VT500_TRANSITION_TABLE=(function(){const _=new S(4095),b=Array.apply(null,Array(256)).map(((j,D)=>D)),v=(j,D)=>b.slice(j,D),x=v(32,127),E=v(0,24);E.push(25),E.push.apply(E,v(28,32));const M=v(0,14);let R;for(R in _.setDefault(1,0),_.addMany(x,0,2,0),M)_.addMany([24,26,153,154],R,3,0),_.addMany(v(128,144),R,3,0),_.addMany(v(144,152),R,3,0),_.add(156,R,0,0),_.add(27,R,11,1),_.add(157,R,4,8),_.addMany([152,158,159],R,0,7),_.add(155,R,11,3),_.add(144,R,11,9);return _.addMany(E,0,3,0),_.addMany(E,1,3,1),_.add(127,1,0,1),_.addMany(E,8,0,8),_.addMany(E,3,3,3),_.add(127,3,0,3),_.addMany(E,4,3,4),_.add(127,4,0,4),_.addMany(E,6,3,6),_.addMany(E,5,3,5),_.add(127,5,0,5),_.addMany(E,2,3,2),_.add(127,2,0,2),_.add(93,1,4,8),_.addMany(x,8,5,8),_.add(127,8,5,8),_.addMany([156,27,24,26,7],8,6,0),_.addMany(v(28,32),8,0,8),_.addMany([88,94,95],1,0,7),_.addMany(x,7,0,7),_.addMany(E,7,0,7),_.add(156,7,0,0),_.add(127,7,0,7),_.add(91,1,11,3),_.addMany(v(64,127),3,7,0),_.addMany(v(48,60),3,8,4),_.addMany([60,61,62,63],3,9,4),_.addMany(v(48,60),4,8,4),_.addMany(v(64,127),4,7,0),_.addMany([60,61,62,63],4,0,6),_.addMany(v(32,64),6,0,6),_.add(127,6,0,6),_.addMany(v(64,127),6,0,0),_.addMany(v(32,48),3,9,5),_.addMany(v(32,48),5,9,5),_.addMany(v(48,64),5,0,6),_.addMany(v(64,127),5,7,0),_.addMany(v(32,48),4,9,5),_.addMany(v(32,48),1,9,2),_.addMany(v(32,48),2,9,2),_.addMany(v(48,127),2,10,0),_.addMany(v(48,80),1,10,0),_.addMany(v(81,88),1,10,0),_.addMany([89,90,92],1,10,0),_.addMany(v(96,127),1,10,0),_.add(80,1,11,9),_.addMany(E,9,0,9),_.add(127,9,0,9),_.addMany(v(28,32),9,0,9),_.addMany(v(32,48),9,9,12),_.addMany(v(48,60),9,8,10),_.addMany([60,61,62,63],9,9,10),_.addMany(E,11,0,11),_.addMany(v(32,128),11,0,11),_.addMany(v(28,32),11,0,11),_.addMany(E,10,0,10),_.add(127,10,0,10),_.addMany(v(28,32),10,0,10),_.addMany(v(48,60),10,8,10),_.addMany([60,61,62,63],10,0,11),_.addMany(v(32,48),10,9,12),_.addMany(E,12,0,12),_.add(127,12,0,12),_.addMany(v(28,32),12,0,12),_.addMany(v(32,48),12,9,12),_.addMany(v(48,64),12,0,11),_.addMany(v(64,127),12,12,13),_.addMany(v(64,127),10,12,13),_.addMany(v(64,127),9,12,13),_.addMany(E,13,13,13),_.addMany(x,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(k,0,2,0),_.add(k,8,5,8),_.add(k,6,0,6),_.add(k,11,0,11),_.add(k,13,13,13),_})();class w extends u.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,x,E)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,x)=>{},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,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,v=[64,126]){let x=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=b.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<b.intermediates.length;++M){const R=b.intermediates.charCodeAt(M);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=R}}if(b.final.length!==1)throw new Error("final must be a single byte");const E=b.final.charCodeAt(0);if(v[0]>E||E>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return x<<=8,x|=E,x}identToString(b){const v=[];for(;b;)v.push(String.fromCharCode(255&b)),b>>=8;return v.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,v){const x=this._identifier(b,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const E=this._escHandlers[x];return E.push(v),{dispose:()=>{const M=E.indexOf(v);M!==-1&&E.splice(M,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,v){this._executeHandlers[b.charCodeAt(0)]=v}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,v){const x=this._identifier(b);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const E=this._csiHandlers[x];return E.push(v),{dispose:()=>{const M=E.indexOf(v);M!==-1&&E.splice(M,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,v){return this._dcsParser.registerHandler(this._identifier(b),v)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,v){return this._oscParser.registerHandler(b,v)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,v,x,E,M){this._parseStack.state=b,this._parseStack.handlers=v,this._parseStack.handlerPos=x,this._parseStack.transition=E,this._parseStack.chunkPos=M}parse(b,v,x){let E,M=0,R=0,j=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,j=this._parseStack.chunkPos+1;else{if(x===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const D=this._parseStack.handlers;let O=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&O>-1){for(;O>=0&&(E=D[O](this._params),E!==!0);O--)if(E instanceof Promise)return this._parseStack.handlerPos=O,E}this._parseStack.handlers=[];break;case 4:if(x===!1&&O>-1){for(;O>=0&&(E=D[O](),E!==!0);O--)if(E instanceof Promise)return this._parseStack.handlerPos=O,E}this._parseStack.handlers=[];break;case 6:if(M=b[this._parseStack.chunkPos],E=this._dcsParser.unhook(M!==24&&M!==26,x),E)return E;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=b[this._parseStack.chunkPos],E=this._oscParser.end(M!==24&&M!==26,x),E)return E;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,j=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let D=j;D<v;++D){switch(M=b[D],R=this._transitions.table[this.currentState<<8|(M<160?M:k)],R>>4){case 2:for(let $=D+1;;++$){if($>=v||(M=b[$])<32||M>126&&M<k){this._printHandler(b,D,$),D=$-1;break}if(++$>=v||(M=b[$])<32||M>126&&M<k){this._printHandler(b,D,$),D=$-1;break}if(++$>=v||(M=b[$])<32||M>126&&M<k){this._printHandler(b,D,$),D=$-1;break}if(++$>=v||(M=b[$])<32||M>126&&M<k){this._printHandler(b,D,$),D=$-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:D,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const O=this._csiHandlers[this._collect<<8|M];let P=O?O.length-1:-1;for(;P>=0&&(E=O[P](this._params),E!==!0);P--)if(E instanceof Promise)return this._preserveStack(3,O,P,R,D),E;P<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++D<v&&(M=b[D])>47&&M<60);D--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const U=this._escHandlers[this._collect<<8|M];let q=U?U.length-1:-1;for(;q>=0&&(E=U[q](),E!==!0);q--)if(E instanceof Promise)return this._preserveStack(4,U,q,R,D),E;q<0&&this._escHandlerFb(this._collect<<8|M),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|M,this._params);break;case 13:for(let $=D+1;;++$)if($>=v||(M=b[$])===24||M===26||M===27||M>127&&M<k){this._dcsParser.put(b,D,$),D=$-1;break}break;case 14:if(E=this._dcsParser.unhook(M!==24&&M!==26),E)return this._preserveStack(6,[],0,R,D),E;M===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let $=D+1;;$++)if($>=v||(M=b[$])<32||M>127&&M<k){this._oscParser.put(b,D,$),D=$-1;break}break;case 6:if(E=this._oscParser.end(M!==24&&M!==26),E)return this._preserveStack(5,[],0,R,D),E;M===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}o.EscapeSequenceParser=w},6242:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=c(5770),m=c(482),f=[];o.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,S){this._handlers[y]===void 0&&(this._handlers[y]=[]);const k=this._handlers[y];return k.push(S),{dispose:()=>{const w=k.indexOf(S);w!==-1&&k.splice(w,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=f}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=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,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,S,k){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(y,S,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(y,S,k))}start(){this.reset(),this._state=1}put(y,S,k){if(this._state!==3){if(this._state===1)for(;S<k;){const w=y[S++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&k-S>0&&this._put(y,S,k)}}end(y,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,w=this._active.length-1,_=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,k=S,_=this._stack.fallThrough,this._stack.paused=!1),!_&&k===!1){for(;w>=0&&(k=this._active[w].end(y),k!==!0);w--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,k;w--}for(;w>=0;w--)if(k=this._active[w].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",y);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,S,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(y,S,k),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let S=!1;if(this._hitLimit)S=!1;else if(y&&(S=this._handler(this._data),S instanceof Promise))return S.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,S}}},8742:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class u{static fromArray(f){const y=new u;if(!f.length)return y;for(let S=Array.isArray(f[0])?1:0;S<f.length;++S){const k=f[S];if(Array.isArray(k))for(let w=0;w<k.length;++w)y.addSubParam(k[w]);else y.addParam(k)}return y}constructor(f=32,y=32){if(this.maxLength=f,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(y),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new u(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let y=0;y<this.length;++y){f.push(this.params[y]);const S=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-S>0&&f.push(Array.prototype.slice.call(this._subParams,S,k))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>c?c:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>c?c:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const y=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];return S-y>0?this._subParams.subarray(y,S):null}getSubParamsAll(){const f={};for(let y=0;y<this.length;++y){const S=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-S>0&&(f[y]=this._subParams.slice(S,k))}return f}addDigit(f){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,k=S[y-1];S[y-1]=~k?Math.min(10*k+f,c):f}}o.Params=u},5741:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const m={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(m),u.dispose=()=>this._wrappedAddonDispose(m),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){u=m;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(u,1)}}},8771:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=c(3785),m=c(511);o.BufferApiView=class{constructor(f,y){this._buffer=f,this.type=y}init(f){return this._buffer=f,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(f){const y=this._buffer.lines.get(f);if(y)return new u.BufferLineApiView(y)}getNullCell(){return new m.CellData}}},3785:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=c(511);o.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,f){if(!(m<0||m>=this._line.length))return f?(this._line.loadCell(m,f),f):this._line.loadCell(m,new u.CellData)}translateToString(m,f,y){return this._line.translateToString(m,f,y)}}},8285:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=c(8771),m=c(8460),f=c(844);class y extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=y},7975:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,(m=>u(m.toArray())))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,((m,f)=>u(m,f.toArray())))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(d,o,c){var u=this&&this.__decorate||function(_,b,v,x){var E,M=arguments.length,R=M<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,b,v,x);else for(var j=_.length-1;j>=0;j--)(E=_[j])&&(R=(M<3?E(R):M>3?E(b,v,R):E(b,v))||R);return M>3&&R&&Object.defineProperty(b,v,R),R},m=this&&this.__param||function(_,b){return function(v,x){b(v,x,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=c(8460),y=c(844),S=c(5295),k=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(_){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(_.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(_.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(_,this))}resize(_,b){this.cols=_,this.rows=b,this.buffers.resize(_,b),this._onResize.fire({cols:_,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,b=!1){const v=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===_.fg&&x.getBg(0)===_.bg||(x=v.getBlankLine(_,b),this._cachedBlankLine=x),x.isWrapped=b;const E=v.ybase+v.scrollTop,M=v.ybase+v.scrollBottom;if(v.scrollTop===0){const R=v.lines.isFull;M===v.lines.length-1?R?v.lines.recycle().copyFrom(x):v.lines.push(x.clone()):v.lines.splice(M+1,0,x.clone()),R?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const R=M-E+1;v.lines.shiftElements(E+1,R-1,-1),v.lines.set(M,x.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(_,b,v){const x=this.buffer;if(_<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else _+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const E=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+_,x.ybase),0),E!==x.ydisp&&(b||this._onScroll.fire(x.ydisp))}};o.BufferService=w=u([m(0,k.IOptionsService)],w)},7994:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(d,o,c){var u=this&&this.__decorate||function(x,E,M,R){var j,D=arguments.length,O=D<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,M):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,E,M,R);else for(var P=x.length-1;P>=0;P--)(j=x[P])&&(O=(D<3?j(O):D>3?j(E,M,O):j(E,M))||O);return D>3&&O&&Object.defineProperty(E,M,O),O},m=this&&this.__param||function(x,E){return function(M,R){E(M,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=c(2585),y=c(8460),S=c(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:x=>x.button!==4&&x.action===1&&(x.ctrl=!1,x.alt=!1,x.shift=!1,!0)},VT200:{events:19,restrict:x=>x.action!==32},DRAG:{events:23,restrict:x=>x.action!==32||x.button!==3},ANY:{events:31,restrict:x=>!0}};function w(x,E){let M=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(M|=64,M|=x.action):(M|=3&x.button,4&x.button&&(M|=64),8&x.button&&(M|=128),x.action===32?M|=32:x.action!==0||E||(M|=3)),M}const _=String.fromCharCode,b={DEFAULT:x=>{const E=[w(x,!1)+32,x.col+32,x.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${_(E[0])}${_(E[1])}${_(E[2])}`},SGR:x=>{const E=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${w(x,!0)};${x.col};${x.row}${E}`},SGR_PIXELS:x=>{const E=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${w(x,!0)};${x.x};${x.y}${E}`}};let v=o.CoreMouseService=class extends S.Disposable{constructor(x,E){super(),this._bufferService=x,this._coreService=E,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 M of Object.keys(k))this.addProtocol(M,k[M]);for(const M of Object.keys(b))this.addEncoding(M,b[M]);this.reset()}addProtocol(x,E){this._protocols[x]=E}addEncoding(x,E){this._encodings[x]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(x){if(!this._protocols[x])throw new Error(`unknown protocol "${x}"`);this._activeProtocol=x,this._onProtocolChange.fire(this._protocols[x].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(x){if(!this._encodings[x])throw new Error(`unknown encoding "${x}"`);this._activeEncoding=x}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(x){if(x.col<0||x.col>=this._bufferService.cols||x.row<0||x.row>=this._bufferService.rows||x.button===4&&x.action===32||x.button===3&&x.action!==32||x.button!==4&&(x.action===2||x.action===3)||(x.col++,x.row++,x.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,x,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(x))return!1;const E=this._encodings[this._activeEncoding](x);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=x,!0}explainEvents(x){return{down:!!(1&x),up:!!(2&x),drag:!!(4&x),move:!!(8&x),wheel:!!(16&x)}}_equalEvents(x,E,M){if(M){if(x.x!==E.x||x.y!==E.y)return!1}else if(x.col!==E.col||x.row!==E.row)return!1;return x.button===E.button&&x.action===E.action&&x.ctrl===E.ctrl&&x.alt===E.alt&&x.shift===E.shift}};o.CoreMouseService=v=u([m(0,f.IBufferService),m(1,f.ICoreService)],v)},6975:function(d,o,c){var u=this&&this.__decorate||function(v,x,E,M){var R,j=arguments.length,D=j<3?x:M===null?M=Object.getOwnPropertyDescriptor(x,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,M);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(j<3?R(D):j>3?R(x,E,D):R(x,E))||D);return j>3&&D&&Object.defineProperty(x,E,D),D},m=this&&this.__param||function(v,x){return function(E,M){x(E,M,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=c(1439),y=c(8460),S=c(844),k=c(2585),w=Object.freeze({insertMode:!1}),_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends S.Disposable{constructor(v,x,E){super(),this._bufferService=v,this._logService=x,this._optionsService=E,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,f.clone)(w),this.decPrivateModes=(0,f.clone)(_)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(_)}triggerDataEvent(v,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),x&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((x=>x.charCodeAt(0))))),this._onBinary.fire(v))}};o.CoreService=b=u([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],b)},9074:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=c(8055),m=c(8460),f=c(844),y=c(6106);let S=0,k=0;class w extends f.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 m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(v){if(v.marker.isDisposed)return;const x=new _(v);if(x){const E=x.marker.onDispose((()=>x.dispose()));x.onDispose((()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),E.dispose())})),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,x,E){var j,D,O;let M=0,R=0;for(const P of this._decorations.getKeyIterator(x))M=(j=P.options.x)!=null?j:0,R=M+((D=P.options.width)!=null?D:1),v>=M&&v<R&&(!E||((O=P.options.layer)!=null?O:"bottom")===E)&&(yield P)}forEachDecorationAtCell(v,x,E,M){this._decorations.forEachByKey(x,(R=>{var j,D,O;S=(j=R.options.x)!=null?j:0,k=S+((D=R.options.width)!=null?D:1),v>=S&&v<k&&(!E||((O=R.options.layer)!=null?O:"bottom")===E)&&M(R)}))}}o.DecorationService=w;class _ extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(v){super(),this.options=v,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=v.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=c(2585),m=c(8343);class f{constructor(...S){this._entries=new Map;for(const[k,w]of S)this.set(k,w)}set(S,k){const w=this._entries.get(S);return this._entries.set(S,k),w}forEach(S){for(const[k,w]of this._entries.entries())S(k,w)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}o.ServiceCollection=f,o.InstantiationService=class{constructor(){this._services=new f,this._services.set(u.IInstantiationService,this)}setService(y,S){this._services.set(y,S)}getService(y){return this._services.get(y)}createInstance(y,...S){const k=(0,m.getServiceDependencies)(y).sort(((b,v)=>b.index-v.index)),w=[];for(const b of k){const v=this._services.get(b.id);if(!v)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${b.id}.`);w.push(v)}const _=k.length>0?k[0].index:S.length;if(S.length!==_)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${_+1} conflicts with ${S.length} static arguments`);return new y(...S,...w)}}},7866:function(d,o,c){var u=this&&this.__decorate||function(_,b,v,x){var E,M=arguments.length,R=M<3?b:x===null?x=Object.getOwnPropertyDescriptor(b,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,b,v,x);else for(var j=_.length-1;j>=0;j--)(E=_[j])&&(R=(M<3?E(R):M>3?E(b,v,R):E(b,v))||R);return M>3&&R&&Object.defineProperty(b,v,R),R},m=this&&this.__param||function(_,b){return function(v,x){b(v,x,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=c(844),y=c(2585),S={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 k,w=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let b=0;b<_.length;b++)typeof _[b]=="function"&&(_[b]=_[b]())}_log(_,b,v){this._evalLazyOptionalParams(v),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...v)}trace(_,...b){var v,x;this._logLevel<=y.LogLevelEnum.TRACE&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.trace.bind(this._optionsService.options.logger))!=null?x:console.log,_,b)}debug(_,...b){var v,x;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.debug.bind(this._optionsService.options.logger))!=null?x:console.log,_,b)}info(_,...b){var v,x;this._logLevel<=y.LogLevelEnum.INFO&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.info.bind(this._optionsService.options.logger))!=null?x:console.info,_,b)}warn(_,...b){var v,x;this._logLevel<=y.LogLevelEnum.WARN&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.warn.bind(this._optionsService.options.logger))!=null?x:console.warn,_,b)}error(_,...b){var v,x;this._logLevel<=y.LogLevelEnum.ERROR&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.error.bind(this._optionsService.options.logger))!=null?x:console.error,_,b)}};o.LogService=w=u([m(0,y.IOptionsService)],w),o.setTraceLogger=function(_){k=_},o.traceCall=function(_,b,v){if(typeof v.value!="function")throw new Error("not supported");const x=v.value;v.value=function(...E){if(k.logLevel!==y.LogLevelEnum.TRACE)return x.apply(this,E);k.trace(`GlyphRenderer#${x.name}(${E.map((R=>JSON.stringify(R))).join(", ")})`);const M=x.apply(this,E);return k.trace(`GlyphRenderer#${x.name} return`,M),M}}},7302:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=c(8460),m=c(844),f=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.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 S extends m.Disposable{constructor(w){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...o.DEFAULT_OPTIONS};for(const b in w)if(b in _)try{const v=w[b];_[b]=this._sanitizeAndValidateOption(b,v)}catch(v){console.error(v)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,_){return this.onOptionChange((b=>{b===w&&_(this.rawOptions[w])}))}onMultipleOptionChange(w,_){return this.onOptionChange((b=>{w.indexOf(b)!==-1&&_()}))}_setupOptions(){const w=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},_=(b,v)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);v=this._sanitizeAndValidateOption(b,v),this.rawOptions[b]!==v&&(this.rawOptions[b]=v,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const v={get:w.bind(this,b),set:_.bind(this,b)};Object.defineProperty(this.options,b,v)}}_sanitizeAndValidateOption(w,_){switch(w){case"cursorStyle":if(_||(_=o.DEFAULT_OPTIONS[w]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${w}`);break;case"wordSeparator":_||(_=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=y.includes(_)?_:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${w} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${w} must be numeric, value: ${_}`);break;case"windowsPty":_=_!=null?_:{}}return _}}o.OptionsService=S},2660:function(d,o,c){var u=this&&this.__decorate||function(S,k,w,_){var b,v=arguments.length,x=v<3?k:_===null?_=Object.getOwnPropertyDescriptor(k,w):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(S,k,w,_);else for(var E=S.length-1;E>=0;E--)(b=S[E])&&(x=(v<3?b(x):v>3?b(k,w,x):b(k,w))||x);return v>3&&x&&Object.defineProperty(k,w,x),x},m=this&&this.__param||function(S,k){return function(w,_){k(w,_,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const f=c(2585);let y=o.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const k=this._bufferService.buffer;if(S.id===void 0){const E=k.addMarker(k.ybase+k.y),M={data:S,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(M,E))),this._dataByLinkId.set(M.id,M),M.id}const w=S,_=this._getEntryIdKey(w),b=this._entriesWithId.get(_);if(b)return this.addLineToLink(b.id,k.ybase+k.y),b.id;const v=k.addMarker(k.ybase+k.y),x={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(x,v))),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.id}addLineToLink(S,k){const w=this._dataByLinkId.get(S);if(w&&w.lines.every((_=>_.line!==k))){const _=this._bufferService.buffer.addMarker(k);w.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(w,_)))}}getLinkData(S){var k;return(k=this._dataByLinkId.get(S))==null?void 0:k.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,k){const w=S.lines.indexOf(k);w!==-1&&(S.lines.splice(w,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};o.OscLinkService=y=u([m(0,f.IBufferService)],y)},8343:(d,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(m){return m[u]||[]},o.createDecorator=function(m){if(o.serviceRegistry.has(m))return o.serviceRegistry.get(m);const f=function(y,S,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,_,b){_[c]===_?_[u].push({id:w,index:b}):(_[u]=[{id:w,index:b}],_[c]=_)})(f,y,k)};return f.toString=()=>m,o.serviceRegistry.set(m,f),f}},2585:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=c(8343);var m;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(m||(o.LogLevelEnum=m={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(d,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=c(8460),m=c(225);class f{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,k,w=!1){return(16777215&S)<<3|(3&k)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const S=new m.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let k=0,w=0;const _=S.length;for(let b=0;b<_;++b){let v=S.charCodeAt(b);if(55296<=v&&v<=56319){if(++b>=_)return k+this.wcwidth(v);const M=S.charCodeAt(b);56320<=M&&M<=57343?v=1024*(v-55296)+M-56320+65536:k+=this.wcwidth(M)}const x=this.charProperties(v,w);let E=f.extractWidth(x);f.extractShouldJoin(x)&&(E-=f.extractWidth(w)),k+=E,w=x}return k}charProperties(S,k){return this._activeProvider.charProperties(S,k)}}o.UnicodeService=f}},s={};function l(d){var o=s[d];if(o!==void 0)return o.exports;var c=s[d]={exports:{}};return i[d].call(c.exports,c,c.exports,l),c.exports}var h={};return(()=>{var d=h;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const o=l(9042),c=l(3236),u=l(844),m=l(5741),f=l(8285),y=l(7975),S=l(7090),k=["cols","rows"];class w extends u.Disposable{constructor(b){super(),this._core=this.register(new c.Terminal(b)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],x=(E,M)=>{this._checkReadonlyOptions(E),this._core.options[E]=M};for(const E in this._core.options){const M={get:v.bind(this,E),set:x.bind(this,E)};Object.defineProperty(this._publicOptions,E,M)}}_checkReadonlyOptions(b){if(k.includes(b))throw new Error(`Option "${b}" 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 S.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=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:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const v in b)this._publicOptions[v]=b[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,v=!0){this._core.input(b,v)}resize(b,v){this._verifyIntegers(b,v),this._core.resize(b,v)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){var v,x,E;return this._checkProposedApi(),this._verifyPositiveIntegers((v=b.x)!=null?v:0,(x=b.width)!=null?x:0,(E=b.height)!=null?E:0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,v,x){this._verifyIntegers(b,v,x),this._core.select(b,v,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,v){this._verifyIntegers(b,v),this._core.selectLines(b,v)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,v){this._core.write(b,v)}writeln(b,v){this._core.write(b),this._core.write(`\r
451
- `,v)}paste(b){this._core.paste(b)}refresh(b,v){this._verifyIntegers(b,v),this._core.refresh(b,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const v of b)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const v of b)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}d.Terminal=w})(),h})()))})(bp)),bp.exports}var _4=v4(),xp={exports:{}},C0;function y4(){return C0||(C0=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const h=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(h._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,h=l._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),f=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),y=u-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(y/h.css.cell.width)),rows:Math.max(1,Math.floor(f/h.css.cell.height))}}}})(),i})()))})(xp)),xp.exports}var b4=y4(),Sp={exports:{}},k0;function x4(){return k0||(k0=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={6:(d,o)=>{function c(m){try{const f=new URL(m),y=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return m.toLocaleLowerCase().startsWith(y.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(m,f,y,S={}){this._terminal=m,this._regex=f,this._handler=y,this._options=S}provideLinks(m,f){const y=u.computeLink(m,this._regex,this._terminal,this._handler);f(this._addCallbacks(y))}_addCallbacks(m){return m.map((f=>(f.leave=this._options.leave,f.hover=(y,S)=>{if(this._options.hover){const{range:k}=f;this._options.hover(y,S,k)}},f)))}};class u{static computeLink(f,y,S,k){const w=new RegExp(y.source,(y.flags||"")+"g"),[_,b]=u._getWindowedLineStrings(f-1,S),v=_.join("");let x;const E=[];for(;x=w.exec(v);){const M=x[0];if(!c(M))continue;const[R,j]=u._mapStrIdx(S,b,0,x.index),[D,O]=u._mapStrIdx(S,R,j,M.length);if(R===-1||j===-1||D===-1||O===-1)continue;const P={start:{x:j+1,y:R+1},end:{x:O,y:D+1}};E.push({range:P,text:M,activate:k})}return E}static _getWindowedLineStrings(f,y){let S,k=f,w=f,_=0,b="";const v=[];if(S=y.buffer.active.getLine(f)){const x=S.translateToString(!0);if(S.isWrapped&&x[0]!==" "){for(_=0;(S=y.buffer.active.getLine(--k))&&_<2048&&(b=S.translateToString(!0),_+=b.length,v.push(b),S.isWrapped&&b.indexOf(" ")===-1););v.reverse()}for(v.push(x),_=0;(S=y.buffer.active.getLine(++w))&&S.isWrapped&&_<2048&&(b=S.translateToString(!0),_+=b.length,v.push(b),b.indexOf(" ")===-1););}return[v,k]}static _mapStrIdx(f,y,S,k){const w=f.buffer.active,_=w.getNullCell();let b=S;for(;k;){const v=w.getLine(y);if(!v)return[-1,-1];for(let x=b;x<v.length;++x){v.getCell(x,_);const E=_.getChars();if(_.getWidth()&&(k-=E.length||1,x===v.length-1&&E==="")){const M=w.getLine(y+1);M&&M.isWrapped&&(M.getCell(0,_),_.getWidth()===2&&(k+=1))}if(k<0)return[y,x]}y++,b=0}return[y,b]}}o.LinkComputer=u}},s={};function l(d){var o=s[d];if(o!==void 0)return o.exports;var c=s[d]={exports:{}};return i[d](c,c.exports,l),c.exports}var h={};return(()=>{var d=h;Object.defineProperty(d,"__esModule",{value:!0}),d.WebLinksAddon=void 0;const o=l(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(m,f){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}d.WebLinksAddon=class{constructor(m=u,f={}){this._handler=m,this._options=f}activate(m){this._terminal=m;const f=this._options,y=f.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,y,this._handler,f))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),h})()))})(Sp)),Sp.exports}var S4=x4();const Li={INPUT:1,RESIZE:2,CLOSE:3,OUTPUT:4,EXIT:5,ERROR:6,INIT_ACK:7,TITLE:8};function wp(e,n){const i=new Uint8Array(1+n.length);return i[0]=e,i.set(n,1),i}function w4(e,n){const{serverUrl:i,apiToken:s,cwd:l}=n,h=T.useRef(null),d=T.useRef(null),o=T.useRef(null),c=T.useRef("disconnected"),u=T.useRef(!1),m=T.useRef(0),f=T.useRef(n.onStatusChange),y=T.useRef(n.onExit),S=T.useRef(n.onSessionInit),k=T.useRef(n.onTitleChange);T.useEffect(()=>{f.current=n.onStatusChange,y.current=n.onExit,S.current=n.onSessionInit,k.current=n.onTitleChange});const w=T.useRef(i),_=T.useRef(s),b=T.useRef(l),v=T.useRef(n.serverSessionId);T.useEffect(()=>{w.current=i,_.current=s,b.current=l,v.current=n.serverSessionId});const x=T.useCallback(O=>{var P;c.current=O,(P=f.current)==null||P.call(f,O)},[]),E=T.useCallback(()=>{if(u.current)return;const O=++m.current,P=o.current;P&&(P.onopen=null,P.onclose=null,P.onmessage=null,P.onerror=null,P.close(),o.current=null),x("connecting");const U=v.current,q=U?`ws://${w.current}/ws/terminal?token=${_.current}&cwd=${encodeURIComponent(b.current)}&sessionId=${U}`:`ws://${w.current}/ws/terminal?token=${_.current}&cwd=${encodeURIComponent(b.current)}`,$=new WebSocket(q);$.binaryType="arraybuffer",$.onopen=()=>{if(m.current!==O){$.close();return}if(o.current=$,h.current&&d.current)try{d.current.fit()}catch{}},$.onmessage=K=>{var Q,F,N,L,B,z,X,J;if(m.current!==O||!(K.data instanceof ArrayBuffer))return;const Y=new Uint8Array(K.data);if(Y.length<1)return;const V=Y[0],Z=Y.slice(1);switch(V){case Li.OUTPUT:{const te=new TextDecoder().decode(Z);(Q=h.current)==null||Q.write(te);break}case Li.EXIT:{const{exitCode:te}=JSON.parse(new TextDecoder().decode(Z));x("exited"),(F=h.current)==null||F.writeln(`\r
452
- [Process exited with code ${te}]`),(N=y.current)==null||N.call(y,te),$.close();break}case Li.ERROR:{const{message:te}=JSON.parse(new TextDecoder().decode(Z));x("disconnected"),(L=h.current)==null||L.writeln(`\r
453
- [Error: ${te}]`);break}case Li.INIT_ACK:{const te=JSON.parse(new TextDecoder().decode(Z));(B=S.current)==null||B.call(S,te),te.isReconnect&&te.status==="exited"?(x("exited"),(z=h.current)==null||z.writeln(`\r
454
- [Process exited with code ${te.exitCode} while disconnected]`),(X=y.current)==null||X.call(y,te.exitCode)):x("connected");break}case Li.TITLE:{const{title:te}=JSON.parse(new TextDecoder().decode(Z));(J=k.current)==null||J.call(k,te);break}}},$.onclose=()=>{var K;m.current===O&&(o.current=null,c.current==="connecting"?(x("disconnected"),(K=h.current)==null||K.writeln(`\r
455
- [Connection failed]`)):c.current==="connected"&&x("disconnected"))},$.onerror=()=>{}},[x]);T.useEffect(()=>{const O=e();if(!O){console.log("[useTerminal] MAIN EFFECT: no container, returning early");return}M.current=!0,u.current=!1;const P=new _4.Terminal({cursorBlink:!0,cursorStyle:"bar",fontSize:13,fontFamily:"'Menlo', 'Monaco', 'Courier New', monospace",scrollback:1e3,allowProposedApi:!0,theme:{background:"var(--background)",foreground:"var(--foreground)",cursor:"var(--foreground)",selectionBackground:"var(--accent)"}}),U=new b4.FitAddon,q=new S4.WebLinksAddon;P.loadAddon(U),P.loadAddon(q);let $=!1;const K=requestAnimationFrame(()=>{if(!($||!O.isConnected))if(P.open(O),P.cols<=1||P.rows<=1){const Y=()=>{if(!$){try{if(U.fit(),P.cols>1&&P.rows>1)return}catch{}requestAnimationFrame(Y)}};requestAnimationFrame(Y)}else try{U.fit()}catch{}});return h.current=P,d.current=U,P.onData(Y=>{const V=o.current;if(!V||V.readyState!==WebSocket.OPEN)return;const Z=new TextEncoder().encode(Y);V.send(wp(Li.INPUT,Z))}),P.onResize(({cols:Y,rows:V})=>{const Z=o.current;if(!Z||Z.readyState!==WebSocket.OPEN)return;const Q=new TextEncoder().encode(JSON.stringify({cols:Y,rows:V}));Z.send(wp(Li.RESIZE,Q))}),E(),()=>{$=!0,cancelAnimationFrame(K),u.current=!0;const Y=o.current;Y&&(Y.onopen=null,Y.onclose=null,Y.onmessage=null,Y.onerror=null,Y.close(),o.current=null),P.dispose(),h.current=null,d.current=null}},[e,E]);const M=T.useRef(!0);T.useEffect(()=>{if(M.current){M.current=!1;return}const O=o.current;O&&(O.close(),o.current=null),!u.current&&h.current&&E()},[i,s,l,E]);const R=T.useCallback(()=>{var O;try{(O=d.current)==null||O.fit()}catch{}},[]),j=T.useCallback(()=>{var O;(O=h.current)==null||O.focus()},[]),D=T.useCallback(()=>{var P;const O=o.current;if(O){try{O.send(wp(Li.CLOSE,new Uint8Array(0)))}catch{}O.close(),o.current=null}(P=h.current)==null||P.dispose(),h.current=null,d.current=null,u.current=!0},[]);return{fit:R,focus:j,destroy:D}}function C4({serverUrl:e,apiToken:n,cwd:i,serverSessionId:s,onStatusChange:l,onExit:h,onSessionInit:d,onTitleChange:o}){const c=T.useRef(null),u=T.useCallback(()=>c.current,[]),{fit:m,focus:f}=w4(u,{serverUrl:e,apiToken:n,cwd:i,serverSessionId:s,onStatusChange:l,onExit:h,onSessionInit:d,onTitleChange:o});return T.useEffect(()=>{const y=c.current;if(!y)return;const S=new ResizeObserver(()=>{requestAnimationFrame(()=>m())});return S.observe(y),()=>{S.disconnect()}},[m]),T.useEffect(()=>{const y=c.current;if(!y)return;let S=0;const k=10,w=setInterval(()=>{if(S++,S>k){clearInterval(w);return}y.offsetParent!==null&&(clearInterval(w),requestAnimationFrame(()=>m()))},100);return()=>{clearInterval(w)}},[m]),g.jsx("div",{ref:c,className:"w-full h-full",onFocus:f})}function k4(){const[e,n]=T.useState(()=>({height:typeof window<"u"?window.innerHeight:0,offsetTop:0,scale:1}));return T.useEffect(()=>{const i=window.visualViewport;if(!i)return;const s=()=>{n({height:i.height,offsetTop:i.offsetTop,scale:i.scale})};return s(),i.addEventListener("resize",s),i.addEventListener("scroll",s),()=>{i.removeEventListener("resize",s),i.removeEventListener("scroll",s)}},[]),e}const E4=5,A4=300,T4=200,R4=.7;function D4({workspaceId:e,workspacePath:n,workspaceName:i,serverUrl:s,apiToken:l,isOpen:h,onClose:d}){var F,N,L;const o=Ul(),c=k4(),[u,m]=T.useState(new Map),[f,y]=T.useState(new Map),[S,k]=T.useState(A4),w=T.useRef(!1),_=T.useRef(0),b=T.useRef(0),v=T.useRef(new Set),x=e?(F=u.get(e))!=null?F:[]:[],E=e?f.get(e):void 0,R=(e&&(L=(N=u.get(e))==null?void 0:N.length)!=null?L:0)<E4,j=T.useCallback(async B=>{if(!(!s||!l||v.current.has(B))){v.current.add(B);try{const z=await fetch(`http://${s}/api/workspaces/${B}/terminals`,{headers:{Authorization:`Bearer ${l}`}});if(!z.ok)return;const X=await z.json();if(!X.sessions||X.sessions.length===0)return;const J=X.sessions.map(te=>({id:crypto.randomUUID(),serverSessionId:te.id,workspaceId:B,workspacePath:te.cwd,title:te.title,status:"disconnected"}));m(te=>{var pe;const W=(pe=te.get(B))!=null?pe:[],H=new Set(W.map(ue=>ue.serverSessionId).filter(Boolean)),ne=J.filter(ue=>!H.has(ue.serverSessionId));if(ne.length===0)return te;if(W.length>0){for(const ue of ne)fetch(`http://${s}/api/workspaces/${B}/terminals/${ue.serverSessionId}`,{method:"DELETE",headers:{Authorization:`Bearer ${l}`}}).catch(()=>{});return te}const ae=new Map(te);return ae.set(B,[...W,...ne]),ae}),y(te=>{const W=new Map(te);return W.has(B)||W.set(B,J[0].id),W})}catch(z){console.log("[TerminalPanel] fetchExistingSessions FAILED",z)}finally{v.current.delete(B)}}},[s,l]);T.useEffect(()=>{!e||!h||j(e)},[e,h,j]);const D=T.useCallback((B,z)=>{m(X=>{const J=new Map(X);for(const[te,W]of J.entries()){const H=W.map(ne=>ne.id===B?{...ne,status:z}:ne);H.some(ne=>ne.id===B)&&J.set(te,H)}return J})},[]),O=T.useCallback((B,z)=>{m(X=>{const J=new Map(X);for(const[te,W]of J.entries()){const H=W.map(ne=>ne.id===B?{...ne,serverSessionId:z.sessionId,title:z.title||ne.title}:ne);H.some(ne=>ne.id===B)&&J.set(te,H)}return J})},[]),P=T.useCallback((B,z)=>{m(X=>{const J=new Map(X);for(const[te,W]of J.entries()){const H=W.map(ne=>ne.id===B?{...ne,title:z}:ne);H.some(ne=>ne.id===B)&&J.set(te,H)}return J})},[]),U=T.useCallback(()=>{if(!e||!n||!R)return;const B={id:crypto.randomUUID(),serverSessionId:null,workspaceId:e,workspacePath:n,title:"main",status:"connecting"};m(z=>{var te;const X=new Map(z),J=(te=X.get(e))!=null?te:[];return X.set(e,[...J,B]),X}),y(z=>{const X=new Map(z);return X.set(e,B.id),X})},[e,n,R]),q=T.useCallback(B=>{const z=[...u.values()].flat().find(X=>X.id===B);z!=null&&z.serverSessionId&&s&&l&&fetch(`http://${s}/api/workspaces/${z.workspaceId}/terminals/${z.serverSessionId}`,{method:"DELETE",headers:{Authorization:`Bearer ${l}`}}).catch(()=>{}),m(X=>{const J=new Map(X);for(const[te,W]of J.entries()){const H=W.filter(ne=>ne.id!==B);H.length<W.length&&J.set(te,H)}return J}),y(X=>{var te,W;const J=new Map(X);for(const[H,ne]of J.entries())if(ne===B){const ae=(W=(te=u.get(H))==null?void 0:te.filter(pe=>pe.id!==B))!=null?W:[];ae.length>0?J.set(H,ae[ae.length-1].id):J.delete(H)}return J})},[u,s,l]),$=T.useCallback(B=>{B.preventDefault(),w.current=!0;const z="touches"in B?B.touches[0].clientY:B.clientY;_.current=z,b.current=S;const X=te=>{if(!w.current)return;const W="touches"in te?te.touches[0].clientY:te.clientY,H=_.current-W,ne=window.innerHeight*R4,ae=Math.min(Math.max(b.current+H,T4),ne);k(ae)},J=()=>{w.current=!1,document.removeEventListener("mousemove",X),document.removeEventListener("mouseup",J),document.removeEventListener("touchmove",X),document.removeEventListener("touchend",J)};document.addEventListener("mousemove",X),document.addEventListener("mouseup",J),document.addEventListener("touchmove",X,{passive:!1}),document.addEventListener("touchend",J)},[S]);if(!e||!n||!s||!l)return g.jsx("div",{className:"flex items-center justify-center h-[300px] border-t border-border bg-background text-muted-foreground text-sm",children:"Select a workspace to use the terminal."});const Y=`[${i||n.split("/").pop()||"ws"}]`,V=B=>{switch(B){case"connecting":return"bg-warning";case"connected":return"bg-success";case"disconnected":return"bg-muted-foreground";case"exited":return"bg-error"}},Z=()=>g.jsxs("div",{className:"flex items-center gap-0.5 overflow-x-auto px-1 min-h-[32px]",children:[x.map(B=>g.jsxs("div",{className:be("group flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer rounded-sm whitespace-nowrap border border-transparent",B.id===E?"bg-accent text-accent-foreground border-border":"text-muted-foreground hover:bg-muted"),onClick:()=>y(z=>{const X=new Map(z);return X.set(e,B.id),X}),children:[g.jsx("span",{className:be("w-1.5 h-1.5 rounded-full shrink-0",V(B.status))}),g.jsxs("span",{children:[Y," ",B.title]}),g.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-destructive transition-opacity ml-0.5",onClick:z=>{z.stopPropagation(),q(B.id)},children:g.jsx(Yr,{className:"w-3 h-3"})})]},B.id)),R&&g.jsx(Te,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:U,title:"New terminal tab",children:g.jsx(Ha,{className:"w-3.5 h-3.5"})})]}),Q=()=>g.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:[x.map(B=>g.jsx("div",{className:be("w-full h-full",B.id!==E?"invisible absolute inset-0 pointer-events-none":"relative"),children:g.jsx(M4,{tab:B,serverUrl:s,apiToken:l,onStatusChange:z=>D(B.id,z),onSessionInit:z=>O(B.id,z),onTitleChange:z=>P(B.id,z)},B.id)},B.id)),x.length===0&&g.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No terminal sessions"})]});if(o){const z=c.height<window.innerHeight*.85?`calc(${c.height}px - env(safe-area-inset-top, 0px))`:Math.min(window.innerHeight*.7,c.height);return h?g.jsx(Ad,{open:h,onOpenChange:X=>!X&&d(),children:g.jsxs(Td,{side:"top",className:"p-0 bg-background [&>button]:hidden flex flex-col",style:{height:z},children:[g.jsx(Rd,{className:"sr-only",children:g.jsx(Dd,{children:"Terminal"})}),g.jsxs("div",{className:"flex items-center justify-between p-2 border-b border-border shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Db,{className:"w-4 h-4"}),g.jsx("span",{className:"font-semibold text-sm",children:"Terminal"})]}),g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:d,children:g.jsx(Yr,{className:"w-4 h-4"})})]}),Z(),Q()]})}):null}return g.jsxs("div",{className:be(!h&&"hidden"),children:[g.jsx("div",{className:"w-full cursor-ns-resize flex items-center justify-center border-t border-border bg-background select-none shrink-0",style:{height:4},onMouseDown:$,onTouchStart:$,children:g.jsx("div",{className:"w-10 h-0.5 bg-muted-foreground/30 rounded-full"})}),g.jsxs("div",{className:"flex flex-col border-t border-border bg-background overflow-hidden shrink-0",style:{height:S},children:[g.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Db,{className:"w-3.5 h-3.5 text-muted-foreground"}),g.jsx("span",{className:"font-medium text-xs text-muted-foreground",children:"Terminal"})]}),g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:d,children:g.jsx(Yr,{className:"w-3.5 h-3.5"})})]}),Z(),Q()]})]})}function M4({tab:e,serverUrl:n,apiToken:i,onStatusChange:s,onSessionInit:l,onTitleChange:h}){const d=T.useRef(s),o=T.useRef(l),c=T.useRef(h);T.useEffect(()=>{d.current=s,o.current=l,c.current=h});const u=T.useCallback(y=>{d.current(y)},[]),m=T.useCallback(y=>{o.current(y)},[]),f=T.useCallback(y=>{c.current(y)},[]);return g.jsx(C4,{serverUrl:n,apiToken:i,cwd:e.workspacePath,serverSessionId:e.serverSessionId,onStatusChange:u,onSessionInit:m,onTitleChange:f})}const N4=$a("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function ku({className:e,variant:n,...i}){return g.jsx("div",{"data-slot":"alert",role:"alert",className:be(N4({variant:n}),e),...i})}function Eu({className:e,...n}){return g.jsx("div",{"data-slot":"alert-description",className:be("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",e),...n})}function j4({className:e,value:n,...i}){return g.jsx($3,{"data-slot":"progress",className:be("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",e),...i,children:g.jsx(q3,{"data-slot":"progress-indicator",className:"size-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(n||0)}%)`}})})}function gu(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"k":e.toString()}function O4(e){return e>=60?"critical":e>=40?"warning":"normal"}function L4({totalTokens:e=0,contextWindow:n=0,modelName:i="",compact:s=!1}){const l=e===0?0:n,h=l===0?0:Math.min(100,Math.round(e/l*100)),d=O4(h);return s?g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsxs("span",{className:"text-xs font-mono",children:[gu(e),"/",gu(l)]}),g.jsx(xl,{children:g.jsxs(ja,{children:[g.jsx(Oa,{asChild:!0,children:g.jsx(Ab,{className:"size-3 text-muted-foreground cursor-help"})}),g.jsxs(La,{side:"bottom",children:[g.jsxs("p",{className:"text-xs",children:["Model: ",i]}),g.jsxs("p",{className:"text-xs",children:[h,"% of context window used"]})]})]})})]}):g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-xs text-muted-foreground",children:"Tokens:"}),g.jsxs("span",{className:"text-xs font-mono",children:[gu(e),"/",gu(l)]})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(j4,{value:h,className:be("h-1 w-20",d==="critical"&&"[&>div]:bg-destructive",d==="warning"&&"[&>div]:bg-warning",d==="normal"&&"[&>div]:bg-primary")}),g.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["(",h,"%)"]})]})]}),g.jsx(xl,{children:g.jsxs(ja,{children:[g.jsx(Oa,{asChild:!0,children:g.jsx(Ab,{className:"size-3.5 text-muted-foreground cursor-help"})}),g.jsx(La,{side:"bottom",children:g.jsxs("p",{className:"text-xs",children:["Model: ",i]})})]})})]})}function kC({...e}){return g.jsx(Ej,{"data-slot":"select",...e})}function I4({className:e,...n}){return g.jsx(jj,{"data-slot":"select-group",className:be("scroll-my-1 p-1",e),...n})}function Uu({...e}){return g.jsx(Tj,{"data-slot":"select-value",...e})}function EC({className:e,size:n="default",children:i,...s}){return g.jsxs(Aj,{"data-slot":"select-trigger","data-size":n,className:be("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...s,children:[i,g.jsx(Rj,{asChild:!0,children:g.jsx(Fa,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function AC({className:e,children:n,position:i="item-aligned",align:s="center",...l}){return g.jsx(Dj,{children:g.jsxs(Mj,{"data-slot":"select-content","data-align-trigger":i==="item-aligned",className:be("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:i,align:s,...l,children:[g.jsx(z4,{}),g.jsx(Nj,{"data-position":i,className:be("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",i==="popper"&&""),children:n}),g.jsx(P4,{})]})})}function B4({className:e,...n}){return g.jsx(Oj,{"data-slot":"select-label",className:be("px-1.5 py-1 text-xs text-muted-foreground",e),...n})}function TC({className:e,children:n,...i}){return g.jsxs(Lj,{"data-slot":"select-item",className:be("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...i,children:[g.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:g.jsx(Bj,{children:g.jsx(Xr,{className:"pointer-events-none"})})}),g.jsx(Ij,{children:n})]})}function z4({className:e,...n}){return g.jsx(zj,{"data-slot":"select-scroll-up-button",className:be("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:g.jsx(bA,{})})}function P4({className:e,...n}){return g.jsx(Pj,{"data-slot":"select-scroll-down-button",className:be("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:g.jsx(Fa,{})})}function Pi({className:e,...n}){return g.jsx(S3,{"data-slot":"label",className:be("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...n})}function F4(e){switch(e){case"budget":return"$";case"standard":return"$$";case"premium":return"$$$";default:return""}}function H4({models:e,selectedModelId:n,onChangeModel:i,disabled:s,iconOnly:l=!1}){const h=e.reduce((o,c)=>(o[c.providerName]||(o[c.providerName]=[]),o[c.providerName].push(c),o),{}),d=o=>{const c=e.find(u=>u.id===o);c&&i(o,c.providerId)};return g.jsxs("div",{className:"flex items-center gap-2",children:[!l&&g.jsx(Pi,{className:"text-xs text-muted-foreground",children:"Model:"}),g.jsxs(kC,{value:n||"",onValueChange:d,disabled:s,children:[g.jsx(EC,{className:l?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[180px] h-8 text-sm",children:l?g.jsxs(g.Fragment,{children:[g.jsx(DA,{className:"size-4"}),g.jsx(Uu,{className:"sr-only"})]}):g.jsx(Uu,{placeholder:"Select model"})}),g.jsx(AC,{children:Object.entries(h).map(([o,c])=>g.jsxs(I4,{children:[g.jsx(B4,{children:o}),c.map(u=>g.jsx(TC,{value:u.id,children:g.jsxs("span",{className:"flex items-center gap-2",children:[u.name,g.jsx("span",{className:"text-muted-foreground text-xs",children:F4(u.tier)})]})},u.id))]},o))})]})]})}function U4({preconfigs:e,selectedPreconfigId:n,onChangePreconfig:i,disabled:s,iconOnly:l=!1}){return g.jsxs("div",{className:"flex items-center gap-2",children:[!l&&g.jsx(Pi,{className:"text-xs text-muted-foreground",children:"Config:"}),g.jsxs(kC,{value:n||"",onValueChange:i,disabled:s,children:[g.jsx(EC,{className:l?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[140px] h-8 text-sm",children:l?g.jsxs(g.Fragment,{children:[g.jsx(jx,{className:"size-4"}),g.jsx(Uu,{className:"sr-only"})]}):g.jsx(Uu,{placeholder:"Select config"})}),g.jsx(AC,{children:e.map(h=>g.jsxs(TC,{value:h.id,children:[h.name,h.isDefault&&g.jsx("span",{className:"ml-2 text-muted-foreground text-xs",children:"(default)"})]},h.id))})]})]})}function $4({session:e,preconfigs:n,models:i,usage:s,modelName:l,onChangePreconfig:h,onChangeModel:d,onRename:o,onNavigateBack:c,isStreaming:u,onInterrupt:m,onCompact:f,isCompacting:y,canCompact:S}){var P;const[k,w]=T.useState(!1),[_,b]=T.useState(e.title||""),v=T.useRef(null),x=Ul();T.useEffect(()=>{k&&v.current&&(v.current.focus(),v.current.select())},[k]);const E=()=>{b(e.title||""),w(!0)},M=()=>{const U=_.trim();U&&U!==e.title&&o(e.id,U),w(!1)},R=U=>{U.key==="Enter"?M():U.key==="Escape"&&(b(e.title||""),w(!1))},j=e.selectedModel||((P=n.find(U=>U.id===e.preconfigId))==null?void 0:P.model)||l,D=i.find(U=>U.id===j),O=D==null?void 0:D.contextWindow;return g.jsxs("header",{className:"flex flex-col border-b border-border bg-card",children:[g.jsx("div",{className:"flex items-center justify-start px-4 py-2",children:g.jsxs("div",{className:"flex items-center gap-3",children:[e.parentId&&c&&g.jsxs(Te,{variant:"ghost",size:"sm",onClick:c,className:"h-7",children:[g.jsx(uA,{className:"size-4","data-icon":"inline-start"}),"Back"]}),k?g.jsx("input",{ref:v,type:"text",value:_,onChange:U=>b(U.target.value),onBlur:M,onKeyDown:R,className:"text-lg font-semibold bg-background border border-primary rounded px-2 py-0.5 outline-none min-w-0 flex-1",autoFocus:!0}):g.jsx("h2",{className:"text-lg font-semibold cursor-pointer px-2 py-0.5 -mx-2 rounded hover:bg-accent transition-colors",onDoubleClick:E,children:e.title||"Untitled Session"}),g.jsx(xn,{variant:"outline",className:"font-mono text-xs",children:e.id.slice(0,8)}),e.status==="closed"&&g.jsxs(xn,{variant:"secondary",children:[g.jsx(lA,{className:"size-3","data-icon":"inline-start"}),"Archived"]})]})}),g.jsx(ll,{}),g.jsxs("div",{className:"inline-flex align-middle items-center gap-3 sm:gap-4 px-4 py-2 flex-wrap",children:[g.jsx(L4,{promptTokens:s.promptTokens,completionTokens:s.completionTokens,totalTokens:s.totalTokens,contextWindow:O,modelName:l,compact:x}),g.jsx(ll,{orientation:"vertical",className:"hidden sm:block"}),g.jsx(H4,{models:i,selectedModelId:j,onChangeModel:d,disabled:e.status==="closed"||!!e.parentId,iconOnly:x}),g.jsx(U4,{preconfigs:n,selectedPreconfigId:e.preconfigId,onChangePreconfig:h,disabled:e.status==="closed"||!!e.parentId,iconOnly:x}),g.jsx(ll,{orientation:"vertical",className:"hidden sm:block"}),f&&g.jsxs(Te,{variant:"outline",size:x?"icon":"sm",onClick:f,disabled:u||y||!S,title:y?"Compacting...":"Compact older messages",children:[g.jsx(rT,{className:"size-4"}),!x&&g.jsx("span",{className:"ml-1",children:y?"Compacting...":"Compact"})]}),g.jsx(ll,{orientation:"vertical",className:"hidden sm:block"}),g.jsxs(Te,{variant:u?"destructive":"outline",size:x?"icon":"sm",onClick:m,disabled:!m,className:u?"":"opacity-60 hover:opacity-100",title:u?"Interrupt operation":"Interrupt (no active operation)",children:[g.jsx(Lx,{className:"size-4"}),!x&&g.jsx("span",{className:"ml-1",children:"Stop"})]})]})]})}function E0({open:e,onOpenChange:n,title:i,description:s,confirmLabel:l="Confirm",cancelLabel:h="Cancel",onConfirm:d,variant:o="default"}){const c=()=>{d(),n(!1)};return g.jsx(Ya,{open:e,onOpenChange:n,children:g.jsxs(Xa,{showCloseButton:!1,children:[g.jsxs(Za,{children:[g.jsx(Qa,{children:i}),g.jsx(Fl,{children:s})]}),g.jsxs(wd,{children:[g.jsx(l5,{asChild:!0,children:g.jsx(Te,{variant:"outline",children:h})}),g.jsx(Te,{onClick:c,variant:o==="destructive"?"destructive":"default",children:l})]})]})})}function q4({message:e,textContent:n,children:i,isQueued:s=!1,onRemove:l,onRevert:h,canRevert:d=!1,onFork:o,canFork:c=!1}){const[u,m]=T.useState(!1),[f,y]=T.useState(!1),[S,k]=T.useState(!1),w=e.role==="user",_=async()=>{const b=n||"";await navigator.clipboard.writeText(b),m(!0),setTimeout(()=>m(!1),2e3)};return g.jsxs("div",{className:be("flex flex-col gap-1 mb-4 animate-slide-up min-w-0",w?"items-end":"items-start"),children:[g.jsx("div",{className:be("flex items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground",w?"mr-3":"ml-3"),children:w?g.jsxs(g.Fragment,{children:[!s&&g.jsxs(g.Fragment,{children:[d&&h&&g.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>y(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Revert to this point",children:g.jsx(jT,{className:"size-3"})}),c&&o&&g.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>k(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Fork from this point",children:g.jsx(VA,{className:"size-3"})}),g.jsx(Te,{variant:"ghost",size:"icon",onClick:_,className:"size-5 text-muted-foreground hover:text-foreground",children:u?g.jsx(Xr,{className:"size-3"}):g.jsx(Tu,{className:"size-3"})})]}),g.jsx(LT,{className:"size-3"}),e.role]}):g.jsxs(g.Fragment,{children:[g.jsx(hA,{className:"size-3"}),e.role,g.jsx(Te,{variant:"ghost",size:"icon",onClick:_,className:"size-5 text-muted-foreground hover:text-foreground",children:u?g.jsx(Xr,{className:"size-3"}):g.jsx(Tu,{className:"size-3"})})]})}),g.jsxs("div",{className:be("rounded-2xl px-4 py-3 max-w-full relative group min-w-0 overflow-hidden",s?"bg-muted border-2 border-dashed border-muted-foreground/30 opacity-80":w?"bg-primary text-primary-foreground rounded-br-md":"bg-card text-card-foreground border border-border rounded-bl-md"),children:[s&&g.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 pb-2 border-b border-muted-foreground/20",children:[g.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[g.jsx(Nx,{className:"size-3 animate-pulse"}),g.jsx("span",{children:"Pending"})]}),l&&g.jsx(Te,{variant:"ghost",size:"icon",onClick:l,className:"size-6 text-muted-foreground hover:text-destructive hover:bg-destructive/10",title:"Remove from queue",children:g.jsx(Yr,{className:"size-3"})})]}),g.jsx("div",{className:"min-w-0",children:i})]}),g.jsx(E0,{open:f,onOpenChange:y,title:"Revert Conversation",description:"This will delete this message and all messages after it. Are you sure you want to continue?",confirmLabel:"Revert",cancelLabel:"Cancel",onConfirm:()=>{h==null||h()},variant:"destructive"}),g.jsx(E0,{open:S,onOpenChange:k,title:"Fork Conversation",description:"This will create a new session with messages up to and including this point. The original session will be unchanged.",confirmLabel:"Fork",cancelLabel:"Cancel",onConfirm:()=>{o==null||o()}})]})}var V4=Object.create,Md=Object.defineProperty,G4=Object.defineProperties,W4=Object.getOwnPropertyDescriptor,K4=Object.getOwnPropertyDescriptors,RC=Object.getOwnPropertyNames,$u=Object.getOwnPropertySymbols,Y4=Object.getPrototypeOf,gg=Object.prototype.hasOwnProperty,DC=Object.prototype.propertyIsEnumerable,A0=(e,n,i)=>n in e?Md(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,wr=(e,n)=>{for(var i in n||(n={}))gg.call(n,i)&&A0(e,i,n[i]);if($u)for(var i of $u(n))DC.call(n,i)&&A0(e,i,n[i]);return e},Nd=(e,n)=>G4(e,K4(n)),MC=(e,n)=>{var i={};for(var s in e)gg.call(e,s)&&n.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&$u)for(var s of $u(e))n.indexOf(s)<0&&DC.call(e,s)&&(i[s]=e[s]);return i},X4=(e,n)=>function(){return n||(0,e[RC(e)[0]])((n={exports:{}}).exports,n),n.exports},Z4=(e,n)=>{for(var i in n)Md(e,i,{get:n[i],enumerable:!0})},Q4=(e,n,i,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of RC(n))!gg.call(e,l)&&l!==i&&Md(e,l,{get:()=>n[l],enumerable:!(s=W4(n,l))||s.enumerable});return e},J4=(e,n,i)=>(i=e!=null?V4(Y4(e)):{},Q4(!e||!e.__esModule?Md(i,"default",{value:e,enumerable:!0}):i,e)),eL=X4({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,n){var i=(function(){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,h={},d={util:{encode:function k(w){return w instanceof o?new o(w.type,k(w.content),w.alias):Array.isArray(w)?w.map(k):w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++l}),k.__id},clone:function k(w,_){_=_||{};var b,v;switch(d.util.type(w)){case"Object":if(v=d.util.objId(w),_[v])return _[v];b={},_[v]=b;for(var x in w)w.hasOwnProperty(x)&&(b[x]=k(w[x],_));return b;case"Array":return v=d.util.objId(w),_[v]?_[v]:(b=[],_[v]=b,w.forEach(function(E,M){b[M]=k(E,_)}),b);default:return w}},getLanguage:function(k){for(;k;){var w=s.exec(k.className);if(w)return w[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,w){k.className=k.className.replace(RegExp(s,"gi"),""),k.classList.add("language-"+w)},isActive:function(k,w,_){for(var b="no-"+w;k;){var v=k.classList;if(v.contains(w))return!0;if(v.contains(b))return!1;k=k.parentElement}return!!_}},languages:{plain:h,plaintext:h,text:h,txt:h,extend:function(k,w){var _=d.util.clone(d.languages[k]);for(var b in w)_[b]=w[b];return _},insertBefore:function(k,w,_,b){b=b||d.languages;var v=b[k],x={};for(var E in v)if(v.hasOwnProperty(E)){if(E==w)for(var M in _)_.hasOwnProperty(M)&&(x[M]=_[M]);_.hasOwnProperty(E)||(x[E]=v[E])}var R=b[k];return b[k]=x,d.languages.DFS(d.languages,function(j,D){D===R&&j!=k&&(this[j]=x)}),x},DFS:function k(w,_,b,v){v=v||{};var x=d.util.objId;for(var E in w)if(w.hasOwnProperty(E)){_.call(w,E,w[E],b||E);var M=w[E],R=d.util.type(M);R==="Object"&&!v[x(M)]?(v[x(M)]=!0,k(M,_,null,v)):R==="Array"&&!v[x(M)]&&(v[x(M)]=!0,k(M,_,E,v))}}},plugins:{},highlight:function(k,w,_){var b={code:k,grammar:w,language:_};if(d.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=d.tokenize(b.code,b.grammar),d.hooks.run("after-tokenize",b),o.stringify(d.util.encode(b.tokens),b.language)},tokenize:function(k,w){var _=w.rest;if(_){for(var b in _)w[b]=_[b];delete w.rest}var v=new m;return f(v,v.head,k),u(k,v,w,v.head,0),S(v)},hooks:{all:{},add:function(k,w){var _=d.hooks.all;_[k]=_[k]||[],_[k].push(w)},run:function(k,w){var _=d.hooks.all[k];if(!(!_||!_.length))for(var b=0,v;v=_[b++];)v(w)}},Token:o};function o(k,w,_,b){this.type=k,this.content=w,this.alias=_,this.length=(b||"").length|0}o.stringify=function k(w,_){if(typeof w=="string")return w;if(Array.isArray(w)){var b="";return w.forEach(function(R){b+=k(R,_)}),b}var v={type:w.type,content:k(w.content,_),tag:"span",classes:["token",w.type],attributes:{},language:_},x=w.alias;x&&(Array.isArray(x)?Array.prototype.push.apply(v.classes,x):v.classes.push(x)),d.hooks.run("wrap",v);var E="";for(var M in v.attributes)E+=" "+M+'="'+(v.attributes[M]||"").replace(/"/g,"&quot;")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+E+">"+v.content+"</"+v.tag+">"};function c(k,w,_,b){k.lastIndex=w;var v=k.exec(_);if(v&&b&&v[1]){var x=v[1].length;v.index+=x,v[0]=v[0].slice(x)}return v}function u(k,w,_,b,v,x){for(var E in _)if(!(!_.hasOwnProperty(E)||!_[E])){var M=_[E];M=Array.isArray(M)?M:[M];for(var R=0;R<M.length;++R){if(x&&x.cause==E+","+R)return;var j=M[R],D=j.inside,O=!!j.lookbehind,P=!!j.greedy,U=j.alias;if(P&&!j.pattern.global){var q=j.pattern.toString().match(/[imsuy]*$/)[0];j.pattern=RegExp(j.pattern.source,q+"g")}for(var $=j.pattern||j,K=b.next,Y=v;K!==w.tail&&!(x&&Y>=x.reach);Y+=K.value.length,K=K.next){var V=K.value;if(w.length>k.length)return;if(!(V instanceof o)){var Z=1,Q;if(P){if(Q=c($,Y,k,O),!Q||Q.index>=k.length)break;var B=Q.index,F=Q.index+Q[0].length,N=Y;for(N+=K.value.length;B>=N;)K=K.next,N+=K.value.length;if(N-=K.value.length,Y=N,K.value instanceof o)continue;for(var L=K;L!==w.tail&&(N<F||typeof L.value=="string");L=L.next)Z++,N+=L.value.length;Z--,V=k.slice(Y,N),Q.index-=Y}else if(Q=c($,0,V,O),!Q)continue;var B=Q.index,z=Q[0],X=V.slice(0,B),J=V.slice(B+z.length),te=Y+V.length;x&&te>x.reach&&(x.reach=te);var W=K.prev;X&&(W=f(w,W,X),Y+=X.length),y(w,W,Z);var H=new o(E,D?d.tokenize(z,D):z,U,z);if(K=f(w,W,H),J&&f(w,K,J),Z>1){var ne={cause:E+","+R,reach:te};u(k,w,_,K.prev,Y,ne),x&&ne.reach>x.reach&&(x.reach=ne.reach)}}}}}}function m(){var k={value:null,prev:null,next:null},w={value:null,prev:k,next:null};k.next=w,this.head=k,this.tail=w,this.length=0}function f(k,w,_){var b=w.next,v={value:_,prev:w,next:b};return w.next=v,b.prev=v,k.length++,v}function y(k,w,_){for(var b=w.next,v=0;v<_&&b!==k.tail;v++)b=b.next;w.next=b,b.prev=w,k.length-=v}function S(k){for(var w=[],_=k.head.next;_!==k.tail;)w.push(_.value),_=_.next;return w}return d})();n.exports=i,i.default=i}}),ye=J4(eL());ye.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},ye.languages.markup.tag.inside["attr-value"].inside.entity=ye.languages.markup.entity,ye.languages.markup.doctype.inside["internal-subset"].inside=ye.languages.markup,ye.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(ye.languages.markup.tag,"addInlined",{value:function(e,s){var i={},i=(i["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ye.languages[s]},i.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}}),s=(i["language-"+s]={pattern:/[\s\S]+/,inside:ye.languages[s]},{});s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},ye.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(ye.languages.markup.tag,"addAttribute",{value:function(e,n){ye.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:ye.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ye.languages.html=ye.languages.markup,ye.languages.mathml=ye.languages.markup,ye.languages.svg=ye.languages.markup,ye.languages.xml=ye.languages.extend("markup",{}),ye.languages.ssml=ye.languages.xml,ye.languages.atom=ye.languages.xml,ye.languages.rss=ye.languages.xml,(function(e){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},i=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s="(?:[^\\\\-]|"+i.source+")",s=RegExp(s+"-"+s),l={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:i,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:i}},"special-escape":n,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":l}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:i,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":l}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(ye),ye.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},ye.languages.javascript=ye.languages.extend("clike",{"class-name":[ye.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),ye.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ye.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:ye.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:ye.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ye.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ye.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:ye.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ye.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:ye.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),ye.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ye.languages.markup&&(ye.languages.markup.tag.addInlined("script","javascript"),ye.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),ye.languages.js=ye.languages.javascript,ye.languages.actionscript=ye.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ye.languages.actionscript["class-name"].alias="function",delete ye.languages.actionscript.parameter,delete ye.languages.actionscript["literal-property"],ye.languages.markup&&ye.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ye.languages.markup}}),(function(e){var n=/#(?!\{).+/,i={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:n,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:i}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:i}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:i}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript})(ye),(function(e){var n=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(n,"addSupport",{value:function(i,s){(i=typeof i=="string"?[i]:i).forEach(function(l){var h=function(f){f.inside||(f.inside={}),f.inside.rest=s},d="doc-comment";if(o=e.languages[l]){var o,c=o[d];if((c=c||(o=e.languages.insertBefore(l,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[d])instanceof RegExp&&(c=o[d]={pattern:c}),Array.isArray(c))for(var u=0,m=c.length;u<m;u++)c[u]instanceof RegExp&&(c[u]={pattern:c[u]}),h(c[u]);else h(c)}})}}),n.addSupport(["java","javascript","php"],n)})(ye),(function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,n=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(ye),(function(e){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,n=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:n={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=n,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,number:i})})(ye),(function(e){var n=/[*&][^\s[\]{},]+/,i=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+i.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+i.source+")?)",l=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),h=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function d(o,c){c=(c||"").replace(/m/g,"")+"m";var u=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<value>>/g,function(){return o});return RegExp(u,c)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<key>>/g,function(){return"(?:"+l+"|"+h+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:d(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:d(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:d(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:d(h),lookbehind:!0,greedy:!0},number:{pattern:d(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:i,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(ye),(function(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function i(u){return u=u.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+u+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),h=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,d=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+h+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+h+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+h+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:i(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:i(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:i(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:i(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(u){["url","bold","italic","strike","code-snippet"].forEach(function(m){u!==m&&(e.languages.markdown[u].inside.content.inside[m]=e.languages.markdown[m])})}),e.hooks.add("after-tokenize",function(u){u.language!=="markdown"&&u.language!=="md"||(function m(f){if(f&&typeof f!="string")for(var y=0,S=f.length;y<S;y++){var k,w=f[y];w.type!=="code"?m(w.content):(k=w.content[1],w=w.content[3],k&&w&&k.type==="code-language"&&w.type==="code-block"&&typeof k.content=="string"&&(k=k.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),k="language-"+(k=(/[a-z][\w-]*/i.exec(k)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,k]:w.alias.push(k):w.alias=[k]))}})(u.tokens)}),e.hooks.add("wrap",function(u){if(u.type==="code-block"){for(var m="",f=0,y=u.classes.length;f<y;f++){var S=u.classes[f],S=/language-(.+)/.exec(S);if(S){m=S[1];break}}var k,w=e.languages[m];w?u.content=e.highlight((function(_){return _=_.replace(d,""),_=_.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(b,v){var x;return(v=v.toLowerCase())[0]==="#"?(x=v[1]==="x"?parseInt(v.slice(2),16):Number(v.slice(1)),c(x)):o[v]||b})})(u.content),w,m):m&&m!=="none"&&e.plugins.autoloader&&(k="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),u.attributes.id=k,e.plugins.autoloader.loadLanguages(m,function(){var _=document.getElementById(k);_&&(_.innerHTML=e.highlight(_.textContent,e.languages[m],m))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),o={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(ye),ye.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:ye.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},ye.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var n=e.tokens.filter(function(k){return typeof k!="string"&&k.type!=="comment"&&k.type!=="scalar"}),i=0;i<n.length;){var s=n[i++];if(s.type==="keyword"&&s.content==="mutation"){var l=[];if(f(["definition-mutation","punctuation"])&&m(1).content==="("){i+=2;var h=y(/^\($/,/^\)$/);if(h===-1)continue;for(;i<h;i++){var d=m(0);d.type==="variable"&&(S(d,"variable-input"),l.push(d.content))}i=h+1}if(f(["punctuation","property-query"])&&m(0).content==="{"&&(i++,S(m(0),"property-mutation"),0<l.length)){var o=y(/^\{$/,/^\}$/);if(o!==-1)for(var c=i;c<o;c++){var u=n[c];u.type==="variable"&&0<=l.indexOf(u.content)&&S(u,"variable-input")}}}}function m(k){return n[i+k]}function f(k,w){w=w||0;for(var _=0;_<k.length;_++){var b=m(_+w);if(!b||b.type!==k[_])return}return 1}function y(k,w){for(var _=1,b=i;b<n.length;b++){var v=n[b],x=v.content;if(v.type==="punctuation"&&typeof x=="string"){if(k.test(x))_++;else if(w.test(x)&&--_===0)return b}}return-1}function S(k,w){var _=k.alias;_?Array.isArray(_)||(k.alias=_=[_]):k.alias=_=[],_.push(w)}}),ye.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var n=e.languages.javascript["template-string"],i=n.pattern.source,s=n.inside.interpolation,l=s.inside["interpolation-punctuation"],h=s.pattern.source;function d(f,y){if(e.languages[f])return{pattern:RegExp("((?:"+y+")\\s*)"+i),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:f}}}}function o(f,y,S){return f={code:f,grammar:y,language:S},e.hooks.run("before-tokenize",f),f.tokens=e.tokenize(f.code,f.grammar),e.hooks.run("after-tokenize",f),f.tokens}function c(f,y,S){var _=e.tokenize(f,{interpolation:{pattern:RegExp(h),lookbehind:!0}}),k=0,w={},_=o(_.map(function(v){if(typeof v=="string")return v;for(var x,E,v=v.content;f.indexOf((E=k++,x="___"+S.toUpperCase()+"_"+E+"___"))!==-1;);return w[x]=v,x}).join(""),y,S),b=Object.keys(w);return k=0,(function v(x){for(var E=0;E<x.length;E++){if(k>=b.length)return;var M,R,j,D,O,P,U,q=x[E];typeof q=="string"||typeof q.content=="string"?(M=b[k],(U=(P=typeof q=="string"?q:q.content).indexOf(M))!==-1&&(++k,R=P.substring(0,U),O=w[M],j=void 0,(D={})["interpolation-punctuation"]=l,(D=e.tokenize(O,D)).length===3&&((j=[1,1]).push.apply(j,o(D[1],e.languages.javascript,"javascript")),D.splice.apply(D,j)),j=new e.Token("interpolation",D,s.alias,O),D=P.substring(U+M.length),O=[],R&&O.push(R),O.push(j),D&&(v(P=[D]),O.push.apply(O,P)),typeof q=="string"?(x.splice.apply(x,[E,1].concat(O)),E+=O.length-1):q.content=O)):(U=q.content,Array.isArray(U)?v(U):v([U]))}})(_),new e.Token(S,_,"language-"+S,f)}e.languages.javascript["template-string"]=[d("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),d("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),d("svg",/\bsvg/.source),d("markdown",/\b(?:markdown|md)/.source),d("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),d("sql",/\bsql/.source),n].filter(Boolean);var u={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function m(f){return typeof f=="string"?f:Array.isArray(f)?f.map(m).join(""):m(f.content)}e.hooks.add("after-tokenize",function(f){f.language in u&&(function y(S){for(var k=0,w=S.length;k<w;k++){var _,b,v,x=S[k];typeof x!="string"&&(_=x.content,Array.isArray(_)?x.type==="template-string"?(x=_[1],_.length===3&&typeof x!="string"&&x.type==="embedded-code"&&(b=m(x),x=x.alias,x=Array.isArray(x)?x[0]:x,v=e.languages[x])&&(_[1]=c(b,v,x))):y(_):typeof _!="string"&&y([_]))}})(f.tokens)})})(ye),(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),e.languages.ts=e.languages.typescript})(ye),(function(e){var n=e.languages.javascript,i=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,s="(@(?:arg|argument|param|property)\\s+(?:"+i+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(s+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(s+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:n,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return i})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+i),lookbehind:!0,inside:{string:n.string,number:n.number,boolean:n.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:n,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)})(ye),(function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(ye),ye.languages.n4js=ye.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),ye.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ye.languages.n4jsd=ye.languages.n4js,(function(e){function n(d,o){return RegExp(d.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),o)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:n(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:n(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:n(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var i=["function","function-variable","method","method-variable","property-access"],s=0;s<i.length;s++){var h=i[s],l=e.languages.javascript[h],h=(l=e.util.type(l)==="RegExp"?e.languages.javascript[h]={pattern:l}:l).inside||{};(l.inside=h)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(ye),(function(e){var n=e.util.clone(e.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,l=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function h(c,u){return c=c.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return l}),RegExp(c,u)}l=h(l).source,e.languages.jsx=e.languages.extend("markup",n),e.languages.jsx.tag.pattern=h(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=n.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:h(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:h(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function d(c){for(var u=[],m=0;m<c.length;m++){var f=c[m],y=!1;typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?0<u.length&&u[u.length-1].tagName===o(f.content[0].content[1])&&u.pop():f.content[f.content.length-1].content!=="/>"&&u.push({tagName:o(f.content[0].content[1]),openedBraces:0}):0<u.length&&f.type==="punctuation"&&f.content==="{"?u[u.length-1].openedBraces++:0<u.length&&0<u[u.length-1].openedBraces&&f.type==="punctuation"&&f.content==="}"?u[u.length-1].openedBraces--:y=!0),(y||typeof f=="string")&&0<u.length&&u[u.length-1].openedBraces===0&&(y=o(f),m<c.length-1&&(typeof c[m+1]=="string"||c[m+1].type==="plain-text")&&(y+=o(c[m+1]),c.splice(m+1,1)),0<m&&(typeof c[m-1]=="string"||c[m-1].type==="plain-text")&&(y=o(c[m-1])+y,c.splice(m-1,1),m--),c[m]=new e.Token("plain-text",y,null,y)),f.content&&typeof f.content!="string"&&d(f.content)}}var o=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(o).join(""):""};e.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||d(c.tokens)})})(ye),(function(e){var n=e.util.clone(e.languages.typescript),n=(e.languages.tsx=e.languages.extend("jsx",n),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0})(ye),ye.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},ye.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ye.languages.swift}),(function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(ye),ye.languages.c=ye.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),ye.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ye.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},ye.languages.c.string],char:ye.languages.c.char,comment:ye.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:ye.languages.c}}}}),ye.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete ye.languages.c.boolean,ye.languages.objectivec=ye.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete ye.languages.objectivec["class-name"],ye.languages.objc=ye.languages.objectivec,ye.languages.reason=ye.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),ye.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete ye.languages.reason.function,(function(e){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,i=0;i<2;i++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(ye),ye.languages.go=ye.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),ye.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ye.languages.go["class-name"],(function(e){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,i=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return i})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(ye),ye.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},ye.languages.python["string-interpolation"].inside.interpolation.inside.rest=ye.languages.python,ye.languages.py=ye.languages.python,ye.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},ye.languages.webmanifest=ye.languages.json;var Sl={};Z4(Sl,{dracula:()=>nL,duotoneDark:()=>iL,duotoneLight:()=>aL,github:()=>lL,gruvboxMaterialDark:()=>BL,gruvboxMaterialLight:()=>PL,jettwaveDark:()=>RL,jettwaveLight:()=>ML,nightOwl:()=>uL,nightOwlLight:()=>hL,oceanicNext:()=>pL,okaidia:()=>gL,oneDark:()=>jL,oneLight:()=>LL,palenight:()=>_L,shadesOfPurple:()=>bL,synthwave84:()=>SL,ultramin:()=>CL,vsDark:()=>NC,vsLight:()=>AL});var tL={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},nL=tL,rL={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},iL=rL,sL={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},aL=sL,oL={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},lL=oL,cL={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},uL=cL,dL={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},hL=dL,Nn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},fL={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Nn.keyword}},{types:["attr-value"],style:{color:Nn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Nn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Nn.primitive}},{types:["boolean"],style:{color:Nn.boolean}},{types:["tag"],style:{color:Nn.tag}},{types:["string"],style:{color:Nn.string}},{types:["punctuation"],style:{color:Nn.string}},{types:["selector","char","builtin","inserted"],style:{color:Nn.char}},{types:["function"],style:{color:Nn.function}},{types:["operator","entity","url","variable"],style:{color:Nn.variable}},{types:["keyword"],style:{color:Nn.keyword}},{types:["atrule","class-name"],style:{color:Nn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},pL=fL,mL={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},gL=mL,vL={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},_L=vL,yL={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},bL=yL,xL={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},SL=xL,wL={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},CL=wL,kL={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},NC=kL,EL={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},AL=EL,TL={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},RL=TL,DL={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},ML=DL,NL={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},jL=NL,OL={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},LL=OL,IL={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},BL=IL,zL={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},PL=zL,FL=e=>T.useCallback(n=>{var i=n,{className:s,style:l,line:h}=i,d=MC(i,["className","style","line"]);const o=Nd(wr({},d),{className:Xu("token-line",s)});return typeof e=="object"&&"plain"in e&&(o.style=e.plain),typeof l=="object"&&(o.style=wr(wr({},o.style||{}),l)),o},[e]),HL=e=>{const n=T.useCallback(({types:i,empty:s})=>{if(e!=null){{if(i.length===1&&i[0]==="plain")return s!=null?{display:"inline-block"}:void 0;if(i.length===1&&s!=null)return e[i[0]]}return Object.assign(s!=null?{display:"inline-block"}:{},...i.map(l=>e[l]))}},[e]);return T.useCallback(i=>{var s=i,{token:l,className:h,style:d}=s,o=MC(s,["token","className","style"]);const c=Nd(wr({},o),{className:Xu("token",...l.types,h),children:l.content,style:n(l)});return d!=null&&(c.style=wr(wr({},c.style||{}),d)),c},[n])},UL=/\r\n|\r|\n/,T0=e=>{e.length===0?e.push({types:["plain"],content:`
456
- `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
457
- `,e[0].empty=!0)},R0=(e,n)=>{const i=e.length;return i>0&&e[i-1]===n?e:e.concat(n)},$L=e=>{const n=[[]],i=[e],s=[0],l=[e.length];let h=0,d=0,o=[];const c=[o];for(;d>-1;){for(;(h=s[d]++)<l[d];){let u,m=n[d];const y=i[d][h];if(typeof y=="string"?(m=d>0?m:["plain"],u=y):(m=R0(m,y.type),y.alias&&(m=R0(m,y.alias)),u=y.content),typeof u!="string"){d++,n.push(m),i.push(u),s.push(0),l.push(u.length);continue}const S=u.split(UL),k=S.length;o.push({types:m,content:S[0]});for(let w=1;w<k;w++)T0(o),c.push(o=[]),o.push({types:m,content:S[w]})}d--,n.pop(),i.pop(),s.pop(),l.pop()}return T0(o),c},D0=$L,qL=({prism:e,code:n,grammar:i,language:s})=>T.useMemo(()=>{if(i==null)return D0([n]);const l={code:n,grammar:i,language:s,tokens:[]};return e.hooks.run("before-tokenize",l),l.tokens=e.tokenize(n,i),e.hooks.run("after-tokenize",l),D0(l.tokens)},[n,i,s,e]),VL=(e,n)=>{const{plain:i}=e,s=e.styles.reduce((l,h)=>{const{languages:d,style:o}=h;return d&&!d.includes(n)||h.types.forEach(c=>{const u=wr(wr({},l[c]),o);l[c]=u}),l},{});return s.root=i,s.plain=Nd(wr({},i),{backgroundColor:void 0}),s},GL=VL,WL=({children:e,language:n,code:i,theme:s,prism:l})=>{const h=n.toLowerCase(),d=GL(s,h),o=FL(d),c=HL(d),u=l.languages[h],m=qL({prism:l,language:h,code:i,grammar:u});return e({tokens:m,className:`prism-code language-${h}`,style:d!=null?d.root:{},getLineProps:o,getTokenProps:c})},vg=e=>T.createElement(WL,Nd(wr({},e),{prism:e.prism||ye,theme:e.theme||NC,code:e.code,language:e.language}));/*! Bundled license information:
458
-
459
- prismjs/prism.js:
460
- (**
461
- * Prism: Lightweight, robust, elegant syntax highlighting
462
- *
463
- * @license MIT <https://opensource.org/licenses/MIT>
464
- * @author Lea Verou <https://lea.verou.me>
465
- * @namespace
466
- * @public
467
- *)
468
- */function KL(e){var s;const n=(s=e.split(".").pop())==null?void 0:s.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",go:"go",rs:"rust",sh:"bash",yaml:"yaml",yml:"yaml"}[n||""]||n||"text"}function YL({type:e,content:n,lineNumber:i,newLineNumber:s,language:l}){const h=be("flex font-mono text-xs",e==="added"&&"bg-green-500/20",e==="removed"&&"bg-red-500/20",e==="context"&&"bg-muted/30"),d=be("font-bold w-4 select-none",e==="added"&&"text-green-400",e==="removed"&&"text-red-400",e==="context"&&"text-muted-foreground/50");return g.jsxs("div",{className:h,children:[g.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:i!=null?i:""}),g.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:s!=null?s:""}),g.jsxs("span",{className:"pl-2 flex-1 whitespace-pre flex",children:[g.jsxs("span",{className:d,children:[e==="added"&&"+",e==="removed"&&"-",e==="context"&&" "]}),g.jsx(vg,{theme:Sl.oneDark,code:n,language:l,children:({tokens:o,getTokenProps:c})=>g.jsx(g.Fragment,{children:o.map((u,m)=>g.jsx("span",{children:u.map((f,y)=>g.jsx("span",{...c({token:f})},y))},m))})})]})]})}function M0({hunks:e,path:n,language:i,additions:s,deletions:l}){const[h,d]=T.useState(!0),o=i||KL(n);return g.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[g.jsx("button",{onClick:()=>d(!h),className:"px-1 py-1 hover:bg-muted rounded",children:h?g.jsx(Fa,{className:"size-3"}):g.jsx(Zr,{className:"size-3"})}),g.jsx(Cm,{className:"size-3"}),g.jsx("span",{className:"font-mono pr-2",children:n}),s!==void 0&&l!==void 0&&g.jsxs("span",{className:"ml-auto mr-2 text-muted-foreground",children:["+",s," -",l]})]}),h&&g.jsx("div",{style:{backgroundColor:"#282c34"},children:e.map((c,u)=>g.jsx("div",{className:"divide-y divide-white/5",children:c.changes.map((m,f)=>g.jsx(YL,{...m,language:o},f))},u))})]})})}function XL(e){var s;const n=(s=e.split(".").pop())==null?void 0:s.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",go:"go",rs:"rust",sh:"bash",yaml:"yaml",yml:"yaml"}[n||""]||n||"text"}const ZL=({content:e,path:n,language:i,created:s,highlightLines:l=[]})=>{const[h,d]=T.useState(!0),o=i||XL(n),c=new Set(l);return g.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[g.jsx("button",{onClick:()=>d(!h),className:"flex items-center gap-2 px-2 py-1 hover:bg-muted",children:h?g.jsx(Fa,{className:"size-3"}):g.jsx(Zr,{className:"size-3"})}),g.jsx(Cm,{className:"size-3"}),g.jsx("span",{className:"font-mono pr-2",children:n}),s===!1?g.jsxs("span",{className:"flex items-center gap-1 text-warning ml-auto mr-2",children:[g.jsx(cl,{className:"size-3"}),"Overwrote"]}):g.jsxs("span",{className:"flex items-center gap-1 text-success ml-auto mr-2",children:[g.jsx(Xr,{className:"size-3"}),"Created"]})]}),h&&g.jsx("div",{style:{backgroundColor:"#282c34"},children:g.jsx(vg,{theme:Sl.oneDark,code:e,language:o,children:({tokens:u,getTokenProps:m})=>g.jsx(g.Fragment,{children:u.map((f,y)=>g.jsxs("div",{className:`flex font-mono text-xs ${c.has(y+1)?"bg-yellow-500/20":""}`,children:[g.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:y+1}),g.jsx("span",{className:"pl-2 flex-1 whitespace-pre",children:f.map((S,k)=>g.jsx("span",{...m({token:S})},k))})]},y))})})})]})})};function QL({message:e="Success"}){return g.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[g.jsx(kl,{className:"size-4"}),g.jsx("span",{className:"break-all",children:e})]})}const JL={edit:PA,plus:Ha,trash:El,search:km};function e6({text:e}){const[n,i]=T.useState(!1),s=async()=>{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)};return g.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:n?g.jsx("span",{className:"text-success text-xs",children:"Copied!"}):g.jsx(Tu,{className:"size-3"})})}function t6({title:e,groups:n,files:i,total:s}){const h=n||(i?[{label:"Files",files:i||[],icon:void 0}]:[]);return h.length===0?null:g.jsxs("div",{className:"flex flex-col gap-3",children:[e&&g.jsxs("div",{className:"text-sm font-medium text-foreground",children:[e,s!==void 0&&g.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",s," files)"]})]}),h.map((d,o)=>g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[d.icon&&g.jsx("span",{className:"flex items-center",children:(()=>{const c=JL[d.icon];return g.jsx(c,{className:"size-3"})})()}),g.jsx("span",{children:d.label}),g.jsxs("span",{className:"text-muted-foreground/50",children:["(",d.files.length,")"]})]}),g.jsx("div",{className:"flex flex-col gap-0.5 pl-5",children:d.files.map((c,u)=>g.jsxs("div",{className:"flex items-center gap-2 text-xs group",children:[g.jsx(Cm,{className:"size-3 text-muted-foreground shrink-0"}),g.jsx("span",{className:"font-mono text-foreground/80 truncate",children:c.path}),c.line!==void 0&&g.jsxs("span",{className:"text-muted-foreground shrink-0",children:[":",c.line]}),c.action&&g.jsx("span",{className:be("text-xs px-1 rounded shrink-0",c.action==="created"&&"bg-success/20 text-success",c.action==="modified"&&"bg-warning/20 text-warning",c.action==="deleted"&&"bg-destructive/20 text-destructive"),children:c.action}),g.jsx(e6,{text:c.path})]},u))})]},o))]})}function n6({command:e,stdout:n,stderr:i,exitCode:s}){const l=s===0;return g.jsxs("div",{className:"visualization-container border border-white/10 rounded-md overflow-hidden",children:[g.jsxs("div",{className:"bg-muted px-3 py-2 flex items-center justify-between",children:[g.jsxs("div",{className:"font-mono text-xs text-muted-foreground truncate flex-1 mr-2",children:[g.jsx("span",{className:"text-muted-foreground",children:"$ "}),g.jsx("span",{className:"text-foreground",children:e})]}),g.jsxs("span",{className:`text-xs font-mono px-2 py-0.5 rounded ${l?"bg-muted text-muted-foreground":"bg-red-500/20 text-red-400"}`,children:["[",s,"]"]})]}),(n||i)&&g.jsxs("div",{className:"bg-black px-3 py-2 font-mono text-xs overflow-x-auto",children:[n&&g.jsx("pre",{className:"text-gray-300 whitespace-pre-wrap",children:n}),i&&g.jsx("pre",{className:"text-red-400 whitespace-pre-wrap mt-1",children:i})]})]})}const r6={pending:{icon:EA,color:"text-muted-foreground"},in_progress:{icon:Zn,color:"text-warning",animate:!0},completed:{icon:kl,color:"text-success"},cancelled:{icon:Yu,color:"text-destructive"}},i6={high:{label:"high",className:"bg-destructive/20 text-destructive"},medium:{label:"",className:""},low:{label:"low",className:"text-muted-foreground"}};function s6({title:e,items:n}){if(n.length===0)return null;const i=n.filter(s=>s.status==="completed").length;return n.filter(s=>s.status==="in_progress").length,n.filter(s=>s.status==="pending").length,g.jsxs("div",{className:"flex flex-col gap-3 w-full overflow-hidden",children:[(e||n.length>0)&&g.jsxs("div",{className:"text-sm font-medium text-foreground",children:[e||"Todo List",g.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",n.length,")"]}),i>0&&g.jsxs("span",{className:"ml-2 text-success text-xs",children:[i," completed"]})]}),g.jsx("div",{className:"flex flex-col gap-1 w-full",children:n.map((s,l)=>{const h=r6[s.status],d=h.icon,o=i6[s.priority];return g.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[g.jsx(d,{className:be("size-4 shrink-0",h.color,h.animate&&"animate-spin")}),g.jsx("span",{className:be("flex-1 break-all",s.status==="completed"&&"line-through text-muted-foreground",s.status==="cancelled"&&"text-muted-foreground"),children:s.content}),o.label&&s.priority==="high"&&g.jsx("span",{className:be("text-xs px-1.5 py-0.5 rounded shrink-0",o.className),children:o.label}),s.priority==="low"&&s.status!=="completed"&&s.status!=="cancelled"&&g.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o.label})]},l)})})]})}function a6({visualization:e}){if(!e)return null;switch(e.type){case"diff":return g.jsx(M0,{path:e.path,hunks:e.hunks,language:e.language,additions:e.additions,deletions:e.deletions,matchInfo:e.matchInfo});case"diffs":return g.jsx("div",{className:"space-y-3",children:e.items.map((n,i)=>g.jsx(M0,{path:n.path,hunks:n.hunks,language:n.language,additions:n.additions,deletions:n.deletions,matchInfo:n.matchInfo},`${n.path}-${i}`))});case"code":return g.jsx(ZL,{path:e.path,content:e.content,language:e.language,created:e.created,highlightLines:e.highlightLines});case"file-list":return g.jsx(t6,{title:e.title,groups:e.groups,files:e.files,total:e.total});case"table":return g.jsx("pre",{className:"text-xs bg-muted/50 border rounded-md p-2 overflow-x-auto",children:JSON.stringify(e.rows,null,2)});case"markdown":return g.jsx("div",{className:"prose prose-sm dark:prose-invert",children:e.content});case"none":return g.jsx(QL,{message:e.message});case"shell-output":return g.jsx(n6,{command:e.command,stdout:e.stdout,stderr:e.stderr,exitCode:e.exitCode});case"todo-list":return g.jsx(s6,{title:e.title,items:e.items});default:return null}}function o6(e){switch(e){case"pending":return g.jsx(Nx,{className:"size-3 text-warning"});case"running":return g.jsx(Zn,{className:"size-3 text-warning animate-spin"});case"completed":return g.jsx(kl,{className:"size-3 text-success"});case"error":return g.jsx(Yu,{className:"size-3 text-destructive"});default:return null}}function l6(e){if(e&&typeof e=="object"&&"_visualization"in e)return e._visualization}function c6({part:e,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s}){const[l,h]=T.useState(!1),[d,o]=T.useState(!1),c=e.state,u=c.status,m=u==="completed"&&"output"in c?l6(c.output):void 0,f=u==="pending"?n.find(w=>w.toolCallId===e.callId):void 0;let y=null;if(e.name==="task"){if("childSessionId"in c&&c.childSessionId)y=c.childSessionId;else if(u==="completed"&&"output"in c){const _=(typeof c.output=="string"?c.output:"").match(/task_id:\s*([a-f0-9-]{36})/i);_&&(y=_[1])}}const S=async()=>{if("output"in c){const w=typeof c.output=="string"?c.output:JSON.stringify(c.output,null,2);await navigator.clipboard.writeText(w),o(!0),setTimeout(()=>o(!1),2e3)}},k=(()=>{try{const w=JSON.stringify(c.input);return w.length>50?w.slice(0,47)+"...":w}catch{return String(c.input)}})();return g.jsxs("div",{className:"my-1",children:[g.jsxs(Ia,{open:l,onOpenChange:h,children:[g.jsx(Ba,{asChild:!0,children:g.jsxs("div",{className:"flex items-center gap-2 py-1 cursor-pointer hover:text-foreground transition-colors text-muted-foreground",children:[l?g.jsx(Fa,{className:"size-4 text-muted-foreground"}):g.jsx(Zr,{className:"size-4 text-muted-foreground"}),g.jsx(FT,{className:"size-3"}),g.jsx("span",{className:"text-xs truncate max-w-[120px] sm:max-w-none",children:e.name}),!l&&g.jsx("span",{className:"text-xs text-muted-foreground font-mono truncate flex-1 min-w-0 sm:max-w-[200px] hidden sm:block",children:k}),g.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[o6(u),y&&s&&g.jsxs(Te,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 sm:w-auto sm:px-2",onClick:w=>{w.stopPropagation(),s(y)},title:"View session",children:[g.jsx(Vp,{className:"size-3"}),g.jsx("span",{className:"hidden sm:inline ml-1",children:"View"})]})]})]})}),g.jsx(za,{children:g.jsxs("div",{className:"pl-5 pb-2 flex flex-col gap-2",children:[g.jsxs("div",{children:[g.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Input"}),g.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words",children:JSON.stringify(c.input,null,2)})]}),(u==="running"||u==="completed")&&y&&s&&g.jsxs(Te,{variant:"outline",className:"w-full",size:"sm",onClick:()=>s(y),children:[g.jsx(Vp,{className:"size-4","data-icon":"inline-start"}),u==="running"?"Watch Subagent":"View Session"]}),u==="completed"&&"output"in c&&g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center justify-between mb-1",children:[g.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:"Output"}),g.jsx(Te,{variant:"ghost",size:"icon",onClick:S,className:"size-6",children:d?g.jsx(Xr,{className:"size-3 text-success"}):g.jsx(Tu,{className:"size-3"})})]}),g.jsx("pre",{className:"text-xs bg-success/10 border border-success/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words",children:typeof c.output=="string"?c.output:JSON.stringify(c.output,null,2)})]}),u==="error"&&"error"in c&&g.jsxs("div",{children:[g.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Error"}),g.jsx("pre",{className:"text-xs bg-destructive/10 border border-destructive/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words text-destructive",children:c.error})]})]})})]}),u==="pending"&&f&&g.jsxs("div",{className:"border border-warning/50 bg-warning/10 rounded-md p-3 flex flex-col gap-3 mt-2",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Mb,{className:"size-4 text-warning"}),g.jsx(xn,{variant:"outline",className:"text-warning border-warning",children:f.permissionType}),g.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:f.permissionKey})]}),f.message&&g.jsx("p",{className:"text-sm",children:f.message}),f.dangerous&&g.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive font-medium",children:[g.jsx(Mb,{className:"size-4"}),"This operation is marked as dangerous"]}),g.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[g.jsx(Te,{variant:"outline",size:"sm",onClick:()=>i(e.callId,!1,!1),children:"Deny"}),g.jsx(Te,{variant:"secondary",size:"sm",onClick:()=>i(e.callId,!0,!1),children:"Approve"}),g.jsx(Te,{size:"sm",onClick:()=>i(e.callId,!0,!0),children:"Always Allow"})]})]}),u==="completed"&&m&&g.jsx("div",{className:"mt-2",children:g.jsx(a6,{visualization:m})})]})}function u6({prompts:e,query:n,selectedIndex:i,onSelect:s}){const l=e.filter(h=>h.name.toLowerCase().includes(n.toLowerCase()));return l.length===0?g.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No prompts matching "/',n,'"']}):g.jsxs("div",{className:"p-1",children:[l.map((h,d)=>g.jsxs("button",{onClick:()=>s(h),className:be("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",d===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[g.jsx(tT,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"font-mono text-xs",children:["/",h.name]}),g.jsx("div",{className:"text-xs text-muted-foreground truncate",children:h.description})]})]},h.name)),g.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[l.length," prompt",l.length!==1?"s":""," •",g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"})," navigate",g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"})," select",g.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"})," close"]})]})}function d6({workspaceId:e,debounceMs:n=150}){const[i,s]=T.useState(""),[l,h]=T.useState(!1),[d,o]=T.useState([]),c=T.useCallback(f=>{const y={type:"file",path:f.path,display:f.name};return o(S=>[...S,y]),h(!1),s(""),y},[]),u=T.useCallback((f,y,S)=>{const k=f.lastIndexOf("@",y);if(k===-1)return{text:f,cursorPos:y};const w=f.slice(0,k)+`@${S.path}`+f.slice(y),_=k+S.path.length+1;return{text:w,cursorPos:_}},[]),m=T.useCallback(f=>{const y=/@([^\s@]+)/g,S=[];let k;for(;(k=y.exec(f))!==null;){const w=k[1];d.some(_=>_.path===w)&&!S.some(_=>_.path===w)&&S.push({type:"file",path:w,display:w.split("/").pop()||w})}return S},[d]);return{query:i,setQuery:s,showAutocomplete:l,setShowAutocomplete:h,mentions:d,handleFileSelect:c,insertMention:u,extractMentions:m}}function h6(e,n){return n?e.content.includes("ARG")?e.content.replace("ARG",n):`${e.content}
469
- ${n}`:e.content}function f6(e){const n=e.trimStart();if(!n.startsWith("/"))return null;const i=n.indexOf(" ");return i===-1?{command:n.slice(1),rest:""}:{command:n.slice(1,i),rest:n.slice(i+1).trim()}}function p6({onSendMessage:e,disabled:n,isStreaming:i,onStopStreaming:s,placeholder:l="Type a message...",workspaceId:h,serverUrl:d,apiToken:o,prompts:c=[]}){const[u,m]=T.useState(""),[f,y]=T.useState(0),[S,k]=T.useState([]),[w,_]=T.useState(0),[b,v]=T.useState("none"),[x,E]=T.useState(""),M=T.useRef(null),{query:R,setQuery:j,showAutocomplete:D,setShowAutocomplete:O,handleFileSelect:P,insertMention:U}=d6({workspaceId:h||""});T.useEffect(()=>{_(0)},[S,x,c]),T.useEffect(()=>{const L=M.current;L&&(L.style.height="auto",L.style.height=`${Math.min(L.scrollHeight,150)}px`)},[u]);const q=c.filter(L=>L.name.toLowerCase().includes(x.toLowerCase())),$=b==="prompts"&&c.length>0,K=b==="files"&&D&&!!h,Y=T.useCallback(L=>{const B=L.target.value,z=L.target.selectionStart||0;m(B),y(z);const X=B.lastIndexOf("/",z);if(X!==-1){const te=X>0?B[X-1]:`
470
- `,W=B.slice(X+1,z);if((te===`
471
- `||te===" "||te==="")&&!W.includes(" ")){E(W),v("prompts");return}}const J=B.lastIndexOf("@",z);if(J!==-1){const te=B.slice(J+1,z);if(!te.includes(" ")){j(te),O(!0),v("files");return}}v("none"),O(!1)},[j,O]),V=T.useCallback(L=>{const B=P(L),z=U(u,f,B);m(z.text),v("none"),O(!1),k([]),setTimeout(()=>{M.current&&(M.current.focus(),M.current.setSelectionRange(z.cursorPos,z.cursorPos))},0)},[u,f,P,U,O]),Z=T.useCallback(L=>{const B=u.lastIndexOf("/",f),z=u.slice(0,B),X=u.slice(B+1),J=X.indexOf(" "),te=J!==-1?X.slice(J):"",W=`${z}/${L.name}${te}`,H=B+1+L.name.length+0;m(W),v("none"),setTimeout(()=>{M.current&&(M.current.focus(),M.current.setSelectionRange(H,H))},0)},[u,f]),Q=L=>{if(L==null||L.preventDefault(),!u.trim()||n)return;const B=f6(u);if(B){const z=c.find(X=>X.name===B.command);if(z){const X=h6(z,B.rest);e(X),m("");return}}e(u.trim()),m("")},F=L=>{if($&&q.length>0)switch(L.key){case"ArrowDown":L.preventDefault(),_(B=>Math.min(B+1,q.length-1));return;case"ArrowUp":L.preventDefault(),_(B=>Math.max(B-1,0));return;case"Enter":if(L.shiftKey)return;L.preventDefault(),q[w]&&Z(q[w]);return;case"Tab":L.preventDefault(),q[w]&&Z(q[w]);return;case"Escape":L.preventDefault(),v("none");return}if(K&&S.length>0)switch(L.key){case"ArrowDown":L.preventDefault(),_(B=>Math.min(B+1,S.length-1));return;case"ArrowUp":L.preventDefault(),_(B=>Math.max(B-1,0));return;case"Enter":L.preventDefault(),S[w]&&V(S[w]);return;case"Escape":L.preventDefault(),O(!1),v("none");return;case"Tab":L.preventDefault(),S[w]&&V(S[w]);return}L.key==="Enter"&&!L.shiftKey&&(L.preventDefault(),Q())},N=T.useCallback(L=>{k(L)},[]);return i&&s?g.jsx("div",{className:"p-4 border-t border-border bg-card",children:g.jsxs("div",{className:"flex items-center justify-center gap-3",children:[g.jsxs("div",{className:"animate-pulse flex items-center gap-2 text-muted-foreground",children:[g.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce"}),g.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.1s]"}),g.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.2s]"}),g.jsx("span",{className:"text-sm ml-2",children:"Generating..."})]}),g.jsxs(Te,{variant:"outline",size:"sm",onClick:s,children:[g.jsx(Lx,{className:"size-4","data-icon":"inline-start"}),"Stop"]})]})}):g.jsxs("form",{onSubmit:Q,className:"p-4 border-t border-border bg-card",children:[g.jsxs("div",{className:"flex gap-3 items-end",children:[g.jsx("div",{className:"flex-1 relative",children:g.jsxs(kd,{open:$||K,onOpenChange:L=>{L||(v("none"),O(!1))},children:[g.jsx(H5,{asChild:!0,children:g.jsx(B5,{ref:M,value:u,onChange:Y,onKeyDown:F,placeholder:l,disabled:n,className:be("min-h-[44px] max-h-[150px] resize-none pr-12","focus-visible:ring-1"),rows:1})}),g.jsx(Ed,{className:"w-72 p-0",align:"start",side:"top",sideOffset:8,onOpenAutoFocus:L=>L.preventDefault(),onCloseAutoFocus:L=>L.preventDefault(),children:K?g.jsx(m4,{workspaceId:h||"",searchQuery:R,selectedIndex:w,onSelect:V,onFilesChange:N,serverUrl:d,apiToken:o}):g.jsx(u6,{prompts:c,query:x,selectedIndex:w,onSelect:Z})})]})}),g.jsx(Te,{type:"submit",disabled:!u.trim()||n,size:"default",className:"h-11",children:g.jsx(bT,{className:"size-4"})})]}),g.jsxs("div",{className:"mt-2 text-xs text-muted-foreground text-center flex items-center justify-center gap-1",children:[g.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"/"}),g.jsx("span",{children:"prompts"}),g.jsx("span",{className:"mx-2",children:"•"}),g.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Enter"}),g.jsx("span",{children:"to send"}),g.jsx("span",{className:"mx-2",children:"•"}),g.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Shift + Enter"}),g.jsx("span",{children:"for new line"})]})]})}function m6(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const g6=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v6=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_6={};function N0(e,n){return(_6.jsx?v6:g6).test(e)}const y6=/[ \t\n\f\r]/g;function b6(e){return typeof e=="object"?e.type==="text"?j0(e.value):!1:j0(e)}function j0(e){return e.replace(y6,"")===""}class $l{constructor(n,i,s){this.normal=i,this.property=n,s&&(this.space=s)}}$l.prototype.normal={};$l.prototype.property={};$l.prototype.space=void 0;function jC(e,n){const i={},s={};for(const l of e)Object.assign(i,l.property),Object.assign(s,l.normal);return new $l(i,s,n)}function hm(e){return e.toLowerCase()}class Sn{constructor(n,i){this.attribute=i,this.property=n}}Sn.prototype.attribute="";Sn.prototype.booleanish=!1;Sn.prototype.boolean=!1;Sn.prototype.commaOrSpaceSeparated=!1;Sn.prototype.commaSeparated=!1;Sn.prototype.defined=!1;Sn.prototype.mustUseProperty=!1;Sn.prototype.number=!1;Sn.prototype.overloadedBoolean=!1;Sn.prototype.property="";Sn.prototype.spaceSeparated=!1;Sn.prototype.space=void 0;let x6=0;const We=js(),Bt=js(),fm=js(),Se=js(),yt=js(),Ta=js(),jn=js();function js(){return 2**++x6}const pm=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:Bt,commaOrSpaceSeparated:jn,commaSeparated:Ta,number:Se,overloadedBoolean:fm,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),Cp=Object.keys(pm);class _g extends Sn{constructor(n,i,s,l){let h=-1;if(super(n,i),O0(this,"space",l),typeof s=="number")for(;++h<Cp.length;){const d=Cp[h];O0(this,Cp[h],(s&pm[d])===pm[d])}}}_g.prototype.defined=!0;function O0(e,n,i){i&&(e[n]=i)}function Ja(e){const n={},i={};for(const[s,l]of Object.entries(e.properties)){const h=new _g(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(h.mustUseProperty=!0),n[s]=h,i[hm(s)]=s,i[hm(h.attribute)]=s}return new $l(n,i,e.space)}const OC=Ja({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:Se,ariaColIndex:Se,ariaColSpan:Se,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:yt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:Se,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:Se,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:yt,ariaRowCount:Se,ariaRowIndex:Se,ariaRowSpan:Se,ariaSelected:Bt,ariaSetSize:Se,ariaSort:null,ariaValueMax:Se,ariaValueMin:Se,ariaValueNow:Se,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function LC(e,n){return n in e?e[n]:n}function IC(e,n){return LC(e,n.toLowerCase())}const S6=Ja({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ta,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:We,allowPaymentRequest:We,allowUserMedia:We,alt:null,as:null,async:We,autoCapitalize:null,autoComplete:yt,autoFocus:We,autoPlay:We,blocking:yt,capture:null,charSet:null,checked:We,cite:null,className:yt,cols:Se,colSpan:null,content:null,contentEditable:Bt,controls:We,controlsList:yt,coords:Se|Ta,crossOrigin:null,data:null,dateTime:null,decoding:null,default:We,defer:We,dir:null,dirName:null,disabled:We,download:fm,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:We,formTarget:null,headers:yt,height:Se,hidden:fm,high:Se,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:We,inputMode:null,integrity:null,is:null,isMap:We,itemId:null,itemProp:yt,itemRef:yt,itemScope:We,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:We,low:Se,manifest:null,max:null,maxLength:Se,media:null,method:null,min:null,minLength:Se,multiple:We,muted:We,name:null,nonce:null,noModule:We,noValidate:We,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:We,optimum:Se,pattern:null,ping:yt,placeholder:null,playsInline:We,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:We,referrerPolicy:null,rel:yt,required:We,reversed:We,rows:Se,rowSpan:Se,sandbox:yt,scope:null,scoped:We,seamless:We,selected:We,shadowRootClonable:We,shadowRootDelegatesFocus:We,shadowRootMode:null,shape:null,size:Se,sizes:null,slot:null,span:Se,spellCheck:Bt,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:We,useMap:null,value:Bt,width:Se,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,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:We,declare:We,event:null,face:null,frame:null,frameBorder:null,hSpace:Se,leftMargin:Se,link:null,longDesc:null,lowSrc:null,marginHeight:Se,marginWidth:Se,noResize:We,noHref:We,noShade:We,noWrap:We,object:null,profile:null,prompt:null,rev:null,rightMargin:Se,rules:null,scheme:null,scrolling:Bt,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:We,disableRemotePlayback:We,prefix:null,property:null,results:Se,security:null,unselectable:null},space:"html",transform:IC}),w6=Ja({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:jn,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:yt,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:We,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:Ta,g2:Ta,glyphName:Ta,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:jn,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:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Se,pointsAtY:Se,pointsAtZ:Se,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jn,rev:jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jn,requiredFeatures:jn,requiredFonts:jn,requiredFormats:jn,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:jn,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:jn,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:jn,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:LC}),BC=Ja({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),zC=Ja({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:IC}),PC=Ja({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),C6={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"},k6=/[A-Z]/g,L0=/-[a-z]/g,E6=/^data[-\w.:]+$/i;function A6(e,n){const i=hm(n);let s=n,l=Sn;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&E6.test(n)){if(n.charAt(4)==="-"){const h=n.slice(5).replace(L0,R6);s="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{const h=n.slice(4);if(!L0.test(h)){let d=h.replace(k6,T6);d.charAt(0)!=="-"&&(d="-"+d),n="data"+d}}l=_g}return new l(s,n)}function T6(e){return"-"+e.toLowerCase()}function R6(e){return e.charAt(1).toUpperCase()}const D6=jC([OC,S6,BC,zC,PC],"html"),yg=jC([OC,w6,BC,zC,PC],"svg");function M6(e){return e.join(" ").trim()}var va={},kp,I0;function N6(){if(I0)return kp;I0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,h=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
472
- `,u="/",m="*",f="",y="comment",S="declaration";function k(_,b){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];b=b||{};var v=1,x=1;function E(K){var Y=K.match(n);Y&&(v+=Y.length);var V=K.lastIndexOf(c);x=~V?K.length-V:x+K.length}function M(){var K={line:v,column:x};return function(Y){return Y.position=new R(K),O(),Y}}function R(K){this.start=K,this.end={line:v,column:x},this.source=b.source}R.prototype.content=_;function j(K){var Y=new Error(b.source+":"+v+":"+x+": "+K);if(Y.reason=K,Y.filename=b.source,Y.line=v,Y.column=x,Y.source=_,!b.silent)throw Y}function D(K){var Y=K.exec(_);if(Y){var V=Y[0];return E(V),_=_.slice(V.length),Y}}function O(){D(i)}function P(K){var Y;for(K=K||[];Y=U();)Y!==!1&&K.push(Y);return K}function U(){var K=M();if(!(u!=_.charAt(0)||m!=_.charAt(1))){for(var Y=2;f!=_.charAt(Y)&&(m!=_.charAt(Y)||u!=_.charAt(Y+1));)++Y;if(Y+=2,f===_.charAt(Y-1))return j("End of comment missing");var V=_.slice(2,Y-2);return x+=2,E(V),_=_.slice(Y),x+=2,K({type:y,comment:V})}}function q(){var K=M(),Y=D(s);if(Y){if(U(),!D(l))return j("property missing ':'");var V=D(h),Z=K({type:S,property:w(Y[0].replace(e,f)),value:V?w(V[0].replace(e,f)):f});return D(d),Z}}function $(){var K=[];P(K);for(var Y;Y=q();)Y!==!1&&(K.push(Y),P(K));return K}return O(),$()}function w(_){return _?_.replace(o,f):f}return kp=k,kp}var B0;function j6(){if(B0)return va;B0=1;var e=va&&va.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(va,"__esModule",{value:!0}),va.default=i;const n=e(N6());function i(s,l){let h=null;if(!s||typeof s!="string")return h;const d=(0,n.default)(s),o=typeof l=="function";return d.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:m}=c;o?l(u,m,c):m&&(h=h||{},h[u]=m)}),h}return va}var nl={},z0;function O6(){if(z0)return nl;z0=1,Object.defineProperty(nl,"__esModule",{value:!0}),nl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,h=function(u){return!u||i.test(u)||e.test(u)},d=function(u,m){return m.toUpperCase()},o=function(u,m){return"".concat(m,"-")},c=function(u,m){return m===void 0&&(m={}),h(u)?u:(u=u.toLowerCase(),m.reactCompat?u=u.replace(l,o):u=u.replace(s,o),u.replace(n,d))};return nl.camelCase=c,nl}var rl,P0;function L6(){if(P0)return rl;P0=1;var e=rl&&rl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},n=e(j6()),i=O6();function s(l,h){var d={};return!l||typeof l!="string"||(0,n.default)(l,function(o,c){o&&c&&(d[(0,i.camelCase)(o,h)]=c)}),d}return s.default=s,rl=s,rl}var I6=L6();const B6=Ku(I6),FC=HC("end"),bg=HC("start");function HC(e){return n;function n(i){const s=i&&i.position&&i.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function z6(e){const n=bg(e),i=FC(e);if(n&&i)return{start:n,end:i}}function fl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?F0(e.position):"start"in e||"end"in e?F0(e):"line"in e||"column"in e?mm(e):""}function mm(e){return H0(e&&e.line)+":"+H0(e&&e.column)}function F0(e){return mm(e&&e.start)+"-"+mm(e&&e.end)}function H0(e){return e&&typeof e=="number"?e:1}class an extends Error{constructor(n,i,s){super(),typeof i=="string"&&(s=i,i=void 0);let l="",h={},d=!1;if(i&&("line"in i&&"column"in i?h={place:i}:"start"in i&&"end"in i?h={place:i}:"type"in i?h={ancestors:[i],place:i.position}:h={...i}),typeof n=="string"?l=n:!h.cause&&n&&(d=!0,l=n.message,h.cause=n),!h.ruleId&&!h.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?h.ruleId=s:(h.source=s.slice(0,c),h.ruleId=s.slice(c+1))}if(!h.place&&h.ancestors&&h.ancestors){const c=h.ancestors[h.ancestors.length-1];c&&(h.place=c.position)}const o=h.place&&"start"in h.place?h.place.start:h.place;this.ancestors=h.ancestors||void 0,this.cause=h.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=o?o.line:void 0,this.name=fl(h.place)||"1:1",this.place=h.place||void 0,this.reason=this.message,this.ruleId=h.ruleId||void 0,this.source=h.source||void 0,this.stack=d&&h.cause&&typeof h.cause.stack=="string"?h.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}an.prototype.file="";an.prototype.name="";an.prototype.reason="";an.prototype.message="";an.prototype.stack="";an.prototype.column=void 0;an.prototype.line=void 0;an.prototype.ancestors=void 0;an.prototype.cause=void 0;an.prototype.fatal=void 0;an.prototype.place=void 0;an.prototype.ruleId=void 0;an.prototype.source=void 0;const xg={}.hasOwnProperty,P6=new Map,F6=/[A-Z]/g,H6=new Set(["table","tbody","thead","tfoot","tr"]),U6=new Set(["td","th"]),UC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $6(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=n.filePath||void 0;let s;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=Z6(i,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=X6(i,n.jsx,n.jsxs)}const l={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:s,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?yg:D6,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},h=$C(l,e,void 0);return h&&typeof h!="string"?h:l.create(e,l.Fragment,{children:h||void 0},void 0)}function $C(e,n,i){if(n.type==="element")return q6(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return V6(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return W6(e,n,i);if(n.type==="mdxjsEsm")return G6(e,n);if(n.type==="root")return K6(e,n,i);if(n.type==="text")return Y6(e,n)}function q6(e,n,i){const s=e.schema;let l=s;n.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=yg,e.schema=l),e.ancestors.push(n);const h=VC(e,n.tagName,!1),d=Q6(e,n);let o=wg(e,n);return H6.has(n.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!b6(c):!0})),qC(e,d,h,n),Sg(d,o),e.ancestors.pop(),e.schema=s,e.create(n,h,d,i)}function V6(e,n){if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}wl(e,n.position)}function G6(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);wl(e,n.position)}function W6(e,n,i){const s=e.schema;let l=s;n.name==="svg"&&s.space==="html"&&(l=yg,e.schema=l),e.ancestors.push(n);const h=n.name===null?e.Fragment:VC(e,n.name,!0),d=J6(e,n),o=wg(e,n);return qC(e,d,h,n),Sg(d,o),e.ancestors.pop(),e.schema=s,e.create(n,h,d,i)}function K6(e,n,i){const s={};return Sg(s,wg(e,n)),e.create(n,e.Fragment,s,i)}function Y6(e,n){return n.value}function qC(e,n,i,s){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=s)}function Sg(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function X6(e,n,i){return s;function s(l,h,d,o){const u=Array.isArray(d.children)?i:n;return o?u(h,d,o):u(h,d)}}function Z6(e,n){return i;function i(s,l,h,d){const o=Array.isArray(h.children),c=bg(s);return n(l,h,d,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Q6(e,n){const i={};let s,l;for(l in n.properties)if(l!=="children"&&xg.call(n.properties,l)){const h=eI(e,l,n.properties[l]);if(h){const[d,o]=h;e.tableCellAlignToStyle&&d==="align"&&typeof o=="string"&&U6.has(n.tagName)?s=o:i[d]=o}}if(s){const h=i.style||(i.style={});h[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return i}function J6(e,n){const i={};for(const s of n.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const h=s.data.estree.body[0];h.type;const d=h.expression;d.type;const o=d.properties[0];o.type,Object.assign(i,e.evaluater.evaluateExpression(o.argument))}else wl(e,n.position);else{const l=s.name;let h;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const o=s.value.data.estree.body[0];o.type,h=e.evaluater.evaluateExpression(o.expression)}else wl(e,n.position);else h=s.value===null?!0:s.value;i[l]=h}return i}function wg(e,n){const i=[];let s=-1;const l=e.passKeys?new Map:P6;for(;++s<n.children.length;){const h=n.children[s];let d;if(e.passKeys){const c=h.type==="element"?h.tagName:h.type==="mdxJsxFlowElement"||h.type==="mdxJsxTextElement"?h.name:void 0;if(c){const u=l.get(c)||0;d=c+"-"+u,l.set(c,u+1)}}const o=$C(e,h,d);o!==void 0&&i.push(o)}return i}function eI(e,n,i){const s=A6(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=s.commaSeparated?m6(i):M6(i)),s.property==="style"){let l=typeof i=="object"?i:tI(e,String(i));return e.stylePropertyNameCase==="css"&&(l=nI(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?C6[s.property]||s.property:s.attribute,i]}}function tI(e,n){try{return B6(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const s=i,l=new an("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=UC+"#cannot-parse-style-attribute",l}}function VC(e,n,i){let s;if(!i)s={type:"Literal",value:n};else if(n.includes(".")){const l=n.split(".");let h=-1,d;for(;++h<l.length;){const o=N0(l[h])?{type:"Identifier",name:l[h]}:{type:"Literal",value:l[h]};d=d?{type:"MemberExpression",object:d,property:o,computed:!!(h&&o.type==="Literal"),optional:!1}:o}s=d}else s=N0(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(s.type==="Literal"){const l=s.value;return xg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);wl(e)}function wl(e,n){const i=new an("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=UC+"#cannot-handle-mdx-estrees-without-createevaluater",i}function nI(e){const n={};let i;for(i in e)xg.call(e,i)&&(n[rI(i)]=e[i]);return n}function rI(e){let n=e.replace(F6,iI);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function iI(e){return"-"+e.toLowerCase()}const Ep={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"]},sI={};function Cg(e,n){const i=sI,s=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,l=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return GC(e,s,l)}function GC(e,n,i){if(aI(e)){if("value"in e)return e.type==="html"&&!i?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return U0(e.children,n,i)}return Array.isArray(e)?U0(e,n,i):""}function U0(e,n,i){const s=[];let l=-1;for(;++l<e.length;)s[l]=GC(e[l],n,i);return s.join("")}function aI(e){return!!(e&&typeof e=="object")}const $0=document.createElement("i");function kg(e){const n="&"+e+";";$0.innerHTML=n;const i=$0.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function In(e,n,i,s){const l=e.length;let h=0,d;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,i=i>0?i:0,s.length<1e4)d=Array.from(s),d.unshift(n,i),e.splice(...d);else for(i&&e.splice(n,i);h<s.length;)d=s.slice(h,h+1e4),d.unshift(n,0),e.splice(...d),h+=1e4,n+=1e4}function Xn(e,n){return e.length>0?(In(e,e.length,0,n),e):n}const q0={}.hasOwnProperty;function WC(e){const n={};let i=-1;for(;++i<e.length;)oI(n,e[i]);return n}function oI(e,n){let i;for(i in n){const l=(q0.call(e,i)?e[i]:void 0)||(e[i]={}),h=n[i];let d;if(h)for(d in h){q0.call(l,d)||(l[d]=[]);const o=h[d];lI(l[d],Array.isArray(o)?o:o?[o]:[])}}}function lI(e,n){let i=-1;const s=[];for(;++i<n.length;)(n[i].add==="after"?e:s).push(n[i]);In(e,0,0,s)}function KC(e,n){const i=Number.parseInt(e,n);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function ar(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const dn=Xi(/[A-Za-z]/),sn=Xi(/[\dA-Za-z]/),cI=Xi(/[#-'*+\--9=?A-Z^-~]/);function qu(e){return e!==null&&(e<32||e===127)}const gm=Xi(/\d/),uI=Xi(/[\dA-Fa-f]/),dI=Xi(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function _t(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const jd=Xi(new RegExp("\\p{P}|\\p{S}","u")),Ts=Xi(/\s/);function Xi(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function eo(e){const n=[];let i=-1,s=0,l=0;for(;++i<e.length;){const h=e.charCodeAt(i);let d="";if(h===37&&sn(e.charCodeAt(i+1))&&sn(e.charCodeAt(i+2)))l=2;else if(h<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(h))||(d=String.fromCharCode(h));else if(h>55295&&h<57344){const o=e.charCodeAt(i+1);h<56320&&o>56319&&o<57344?(d=String.fromCharCode(h,o),l=1):d="�"}else d=String.fromCharCode(h);d&&(n.push(e.slice(s,i),encodeURIComponent(d)),s=i+l+1,d=""),l&&(i+=l,l=0)}return n.join("")+e.slice(s)}function rt(e,n,i,s){const l=s?s-1:Number.POSITIVE_INFINITY;let h=0;return d;function d(c){return Je(c)?(e.enter(i),o(c)):n(c)}function o(c){return Je(c)&&h++<l?(e.consume(c),o):(e.exit(i),n(c))}}const hI={tokenize:fI};function fI(e){const n=e.attempt(this.parser.constructs.contentInitial,s,l);let i;return n;function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),rt(e,n,"linePrefix")}function l(o){return e.enter("paragraph"),h(o)}function h(o){const c=e.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=c),i=c,d(o)}function d(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Be(o)?(e.consume(o),e.exit("chunkText"),h):(e.consume(o),d)}}const pI={tokenize:mI},V0={tokenize:gI};function mI(e){const n=this,i=[];let s=0,l,h,d;return o;function o(x){if(s<i.length){const E=i[s];return n.containerState=E[1],e.attempt(E[0].continuation,c,u)(x)}return u(x)}function c(x){if(s++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&v();const E=n.events.length;let M=E,R;for(;M--;)if(n.events[M][0]==="exit"&&n.events[M][1].type==="chunkFlow"){R=n.events[M][1].end;break}b(s);let j=E;for(;j<n.events.length;)n.events[j][1].end={...R},j++;return In(n.events,M+1,0,n.events.slice(E)),n.events.length=j,u(x)}return o(x)}function u(x){if(s===i.length){if(!l)return y(x);if(l.currentConstruct&&l.currentConstruct.concrete)return k(x);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(V0,m,f)(x)}function m(x){return l&&v(),b(s),y(x)}function f(x){return n.parser.lazy[n.now().line]=s!==i.length,d=n.now().offset,k(x)}function y(x){return n.containerState={},e.attempt(V0,S,k)(x)}function S(x){return s++,i.push([n.currentConstruct,n.containerState]),y(x)}function k(x){if(x===null){l&&v(),b(0),e.consume(x);return}return l=l||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:h}),w(x)}function w(x){if(x===null){_(e.exit("chunkFlow"),!0),b(0),e.consume(x);return}return Be(x)?(e.consume(x),_(e.exit("chunkFlow")),s=0,n.interrupt=void 0,o):(e.consume(x),w)}function _(x,E){const M=n.sliceStream(x);if(E&&M.push(null),x.previous=h,h&&(h.next=x),h=x,l.defineSkip(x.start),l.write(M),n.parser.lazy[x.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<d&&(!l.events[R][1].end||l.events[R][1].end.offset>d))return;const j=n.events.length;let D=j,O,P;for(;D--;)if(n.events[D][0]==="exit"&&n.events[D][1].type==="chunkFlow"){if(O){P=n.events[D][1].end;break}O=!0}for(b(s),R=j;R<n.events.length;)n.events[R][1].end={...P},R++;In(n.events,D+1,0,n.events.slice(j)),n.events.length=R}}function b(x){let E=i.length;for(;E-- >x;){const M=i[E];n.containerState=M[1],M[0].exit.call(n,e)}i.length=x}function v(){l.write([null]),h=void 0,l=void 0,n.containerState._closeFlow=void 0}}function gI(e,n,i){return rt(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pa(e){if(e===null||_t(e)||Ts(e))return 1;if(jd(e))return 2}function Od(e,n,i){const s=[];let l=-1;for(;++l<e.length;){const h=e[l].resolveAll;h&&!s.includes(h)&&(n=h(n,i),s.push(h))}return n}const vm={name:"attention",resolveAll:vI,tokenize:_I};function vI(e,n){let i=-1,s,l,h,d,o,c,u,m;for(;++i<e.length;)if(e[i][0]==="enter"&&e[i][1].type==="attentionSequence"&&e[i][1]._close){for(s=i;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&n.sliceSerialize(e[s][1]).charCodeAt(0)===n.sliceSerialize(e[i][1]).charCodeAt(0)){if((e[s][1]._close||e[i][1]._open)&&(e[i][1].end.offset-e[i][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[i][1].end.offset-e[i][1].start.offset)%3))continue;c=e[s][1].end.offset-e[s][1].start.offset>1&&e[i][1].end.offset-e[i][1].start.offset>1?2:1;const f={...e[s][1].end},y={...e[i][1].start};G0(f,-c),G0(y,c),d={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[s][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:y},h={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[i][1].start}},l={type:c>1?"strong":"emphasis",start:{...d.start},end:{...o.end}},e[s][1].end={...d.start},e[i][1].start={...o.end},u=[],e[s][1].end.offset-e[s][1].start.offset&&(u=Xn(u,[["enter",e[s][1],n],["exit",e[s][1],n]])),u=Xn(u,[["enter",l,n],["enter",d,n],["exit",d,n],["enter",h,n]]),u=Xn(u,Od(n.parser.constructs.insideSpan.null,e.slice(s+1,i),n)),u=Xn(u,[["exit",h,n],["enter",o,n],["exit",o,n],["exit",l,n]]),e[i][1].end.offset-e[i][1].start.offset?(m=2,u=Xn(u,[["enter",e[i][1],n],["exit",e[i][1],n]])):m=0,In(e,s-1,i-s+3,u),i=s+u.length-m-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function _I(e,n){const i=this.parser.constructs.attentionMarkers.null,s=this.previous,l=Pa(s);let h;return d;function d(c){return h=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===h)return e.consume(c),o;const u=e.exit("attentionSequence"),m=Pa(c),f=!m||m===2&&l||i.includes(c),y=!l||l===2&&m||i.includes(s);return u._open=!!(h===42?f:f&&(l||!y)),u._close=!!(h===42?y:y&&(m||!f)),n(c)}}function G0(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const yI={name:"autolink",tokenize:bI};function bI(e,n,i){let s=0;return l;function l(S){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),h}function h(S){return dn(S)?(e.consume(S),d):S===64?i(S):u(S)}function d(S){return S===43||S===45||S===46||sn(S)?(s=1,o(S)):u(S)}function o(S){return S===58?(e.consume(S),s=0,c):(S===43||S===45||S===46||sn(S))&&s++<32?(e.consume(S),o):(s=0,u(S))}function c(S){return S===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),n):S===null||S===32||S===60||qu(S)?i(S):(e.consume(S),c)}function u(S){return S===64?(e.consume(S),m):cI(S)?(e.consume(S),u):i(S)}function m(S){return sn(S)?f(S):i(S)}function f(S){return S===46?(e.consume(S),s=0,m):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),n):y(S)}function y(S){if((S===45||sn(S))&&s++<63){const k=S===45?y:f;return e.consume(S),k}return i(S)}}const ql={partial:!0,tokenize:xI};function xI(e,n,i){return s;function s(h){return Je(h)?rt(e,l,"linePrefix")(h):l(h)}function l(h){return h===null||Be(h)?n(h):i(h)}}const YC={continuation:{tokenize:wI},exit:CI,name:"blockQuote",tokenize:SI};function SI(e,n,i){const s=this;return l;function l(d){if(d===62){const o=s.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),h}return i(d)}function h(d){return Je(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(d))}}function wI(e,n,i){const s=this;return l;function l(d){return Je(d)?rt(e,h,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):h(d)}function h(d){return e.attempt(YC,n,i)(d)}}function CI(e){e.exit("blockQuote")}const XC={name:"characterEscape",tokenize:kI};function kI(e,n,i){return s;function s(h){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(h),e.exit("escapeMarker"),l}function l(h){return dI(h)?(e.enter("characterEscapeValue"),e.consume(h),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(h)}}const ZC={name:"characterReference",tokenize:EI};function EI(e,n,i){const s=this;let l=0,h,d;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),h=31,d=sn,m(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),h=6,d=uI,m):(e.enter("characterReferenceValue"),h=7,d=gm,m(f))}function m(f){if(f===59&&l){const y=e.exit("characterReferenceValue");return d===sn&&!kg(s.sliceSerialize(y))?i(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return d(f)&&l++<h?(e.consume(f),m):i(f)}}const W0={partial:!0,tokenize:TI},K0={concrete:!0,name:"codeFenced",tokenize:AI};function AI(e,n,i){const s=this,l={partial:!0,tokenize:M};let h=0,d=0,o;return c;function c(R){return u(R)}function u(R){const j=s.events[s.events.length-1];return h=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,o=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(R)}function m(R){return R===o?(d++,e.consume(R),m):d<3?i(R):(e.exit("codeFencedFenceSequence"),Je(R)?rt(e,f,"whitespace")(R):f(R))}function f(R){return R===null||Be(R)?(e.exit("codeFencedFence"),s.interrupt?n(R):e.check(W0,w,E)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===null||Be(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(R)):Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rt(e,S,"whitespace")(R)):R===96&&R===o?i(R):(e.consume(R),y)}function S(R){return R===null||Be(R)?f(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Be(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(R)):R===96&&R===o?i(R):(e.consume(R),k)}function w(R){return e.attempt(l,E,_)(R)}function _(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),b}function b(R){return h>0&&Je(R)?rt(e,v,"linePrefix",h+1)(R):v(R)}function v(R){return R===null||Be(R)?e.check(W0,w,E)(R):(e.enter("codeFlowValue"),x(R))}function x(R){return R===null||Be(R)?(e.exit("codeFlowValue"),v(R)):(e.consume(R),x)}function E(R){return e.exit("codeFenced"),n(R)}function M(R,j,D){let O=0;return P;function P(Y){return R.enter("lineEnding"),R.consume(Y),R.exit("lineEnding"),U}function U(Y){return R.enter("codeFencedFence"),Je(Y)?rt(R,q,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):q(Y)}function q(Y){return Y===o?(R.enter("codeFencedFenceSequence"),$(Y)):D(Y)}function $(Y){return Y===o?(O++,R.consume(Y),$):O>=d?(R.exit("codeFencedFenceSequence"),Je(Y)?rt(R,K,"whitespace")(Y):K(Y)):D(Y)}function K(Y){return Y===null||Be(Y)?(R.exit("codeFencedFence"),j(Y)):D(Y)}}}function TI(e,n,i){const s=this;return l;function l(d){return d===null?i(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),h)}function h(d){return s.parser.lazy[s.now().line]?i(d):n(d)}}const Ap={name:"codeIndented",tokenize:DI},RI={partial:!0,tokenize:MI};function DI(e,n,i){const s=this;return l;function l(u){return e.enter("codeIndented"),rt(e,h,"linePrefix",5)(u)}function h(u){const m=s.events[s.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?d(u):i(u)}function d(u){return u===null?c(u):Be(u)?e.attempt(RI,d,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Be(u)?(e.exit("codeFlowValue"),d(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),n(u)}}function MI(e,n,i){const s=this;return l;function l(d){return s.parser.lazy[s.now().line]?i(d):Be(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):rt(e,h,"linePrefix",5)(d)}function h(d){const o=s.events[s.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(d):Be(d)?l(d):i(d)}}const NI={name:"codeText",previous:OI,resolve:jI,tokenize:LI};function jI(e){let n=e.length-4,i=3,s,l;if((e[i][1].type==="lineEnding"||e[i][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(s=i;++s<n;)if(e[s][1].type==="codeTextData"){e[i][1].type="codeTextPadding",e[n][1].type="codeTextPadding",i+=2,n-=2;break}}for(s=i-1,n++;++s<=n;)l===void 0?s!==n&&e[s][1].type!=="lineEnding"&&(l=s):(s===n||e[s][1].type==="lineEnding")&&(e[l][1].type="codeTextData",s!==l+2&&(e[l][1].end=e[s-1][1].end,e.splice(l+2,s-l-2),n-=s-l-2,s=l+2),l=void 0);return e}function OI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LI(e,n,i){let s=0,l,h;return d;function d(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),s++,o):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?i(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(h=e.enter("codeTextSequence"),l=0,m(f)):Be(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Be(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function m(f){return f===96?(e.consume(f),l++,m):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),n(f)):(h.type="codeTextData",u(f))}}class II{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,i){const s=i==null?Number.POSITIVE_INFINITY:i;return s<this.left.length?this.left.slice(n,s):n>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(n,i,s){const l=i||0;this.setCursor(Math.trunc(n));const h=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return s&&il(this.left,s),h.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),il(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),il(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const i=this.left.splice(n,Number.POSITIVE_INFINITY);il(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);il(this.left,i.reverse())}}}function il(e,n){let i=0;if(n.length<1e4)e.push(...n);else for(;i<n.length;)e.push(...n.slice(i,i+1e4)),i+=1e4}function QC(e){const n={};let i=-1,s,l,h,d,o,c,u;const m=new II(e);for(;++i<m.length;){for(;i in n;)i=n[i];if(s=m.get(i),i&&s[1].type==="chunkFlow"&&m.get(i-1)[1].type==="listItemPrefix"&&(c=s[1]._tokenizer.events,h=0,h<c.length&&c[h][1].type==="lineEndingBlank"&&(h+=2),h<c.length&&c[h][1].type==="content"))for(;++h<c.length&&c[h][1].type!=="content";)c[h][1].type==="chunkText"&&(c[h][1]._isInFirstContentOfListItem=!0,h++);if(s[0]==="enter")s[1].contentType&&(Object.assign(n,BI(m,i)),i=n[i],u=!0);else if(s[1]._container){for(h=i,l=void 0;h--;)if(d=m.get(h),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(l&&(m.get(l)[1].type="lineEndingBlank"),d[1].type="lineEnding",l=h);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;l&&(s[1].end={...m.get(l)[1].start},o=m.slice(l,i),o.unshift(s),m.splice(l,i-l+1,o))}}return In(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!u}function BI(e,n){const i=e.get(n)[1],s=e.get(n)[2];let l=n-1;const h=[];let d=i._tokenizer;d||(d=s.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const o=d.events,c=[],u={};let m,f,y=-1,S=i,k=0,w=0;const _=[w];for(;S;){for(;e.get(++l)[1]!==S;);h.push(l),S._tokenizer||(m=s.sliceStream(S),S.next||m.push(null),f&&d.defineSkip(S.start),S._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(m),S._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),f=S,S=S.next}for(S=i;++y<o.length;)o[y][0]==="exit"&&o[y-1][0]==="enter"&&o[y][1].type===o[y-1][1].type&&o[y][1].start.line!==o[y][1].end.line&&(w=y+1,_.push(w),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(d.events=[],S?(S._tokenizer=void 0,S.previous=void 0):_.pop(),y=_.length;y--;){const b=o.slice(_[y],_[y+1]),v=h.pop();c.push([v,v+b.length-1]),e.splice(v,2,b)}for(c.reverse(),y=-1;++y<c.length;)u[k+c[y][0]]=k+c[y][1],k+=c[y][1]-c[y][0]-1;return u}const zI={resolve:FI,tokenize:HI},PI={partial:!0,tokenize:UI};function FI(e){return QC(e),e}function HI(e,n){let i;return s;function s(o){return e.enter("content"),i=e.enter("chunkContent",{contentType:"content"}),l(o)}function l(o){return o===null?h(o):Be(o)?e.check(PI,d,h)(o):(e.consume(o),l)}function h(o){return e.exit("chunkContent"),e.exit("content"),n(o)}function d(o){return e.consume(o),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,l}}function UI(e,n,i){const s=this;return l;function l(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),rt(e,h,"linePrefix")}function h(d){if(d===null||Be(d))return i(d);const o=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(d):e.interrupt(s.parser.constructs.flow,i,n)(d)}}function JC(e,n,i,s,l,h,d,o,c){const u=c||Number.POSITIVE_INFINITY;let m=0;return f;function f(b){return b===60?(e.enter(s),e.enter(l),e.enter(h),e.consume(b),e.exit(h),y):b===null||b===32||b===41||qu(b)?i(b):(e.enter(s),e.enter(d),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(b))}function y(b){return b===62?(e.enter(h),e.consume(b),e.exit(h),e.exit(l),e.exit(s),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),S(b))}function S(b){return b===62?(e.exit("chunkString"),e.exit(o),y(b)):b===null||b===60||Be(b)?i(b):(e.consume(b),b===92?k:S)}function k(b){return b===60||b===62||b===92?(e.consume(b),S):S(b)}function w(b){return!m&&(b===null||b===41||_t(b))?(e.exit("chunkString"),e.exit(o),e.exit(d),e.exit(s),n(b)):m<u&&b===40?(e.consume(b),m++,w):b===41?(e.consume(b),m--,w):b===null||b===32||b===40||qu(b)?i(b):(e.consume(b),b===92?_:w)}function _(b){return b===40||b===41||b===92?(e.consume(b),w):w(b)}}function ek(e,n,i,s,l,h){const d=this;let o=0,c;return u;function u(S){return e.enter(s),e.enter(l),e.consume(S),e.exit(l),e.enter(h),m}function m(S){return o>999||S===null||S===91||S===93&&!c||S===94&&!o&&"_hiddenFootnoteSupport"in d.parser.constructs?i(S):S===93?(e.exit(h),e.enter(l),e.consume(S),e.exit(l),e.exit(s),n):Be(S)?(e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||S===91||S===93||Be(S)||o++>999?(e.exit("chunkString"),m(S)):(e.consume(S),c||(c=!Je(S)),S===92?y:f)}function y(S){return S===91||S===92||S===93?(e.consume(S),o++,f):f(S)}}function tk(e,n,i,s,l,h){let d;return o;function o(y){return y===34||y===39||y===40?(e.enter(s),e.enter(l),e.consume(y),e.exit(l),d=y===40?41:y,c):i(y)}function c(y){return y===d?(e.enter(l),e.consume(y),e.exit(l),e.exit(s),n):(e.enter(h),u(y))}function u(y){return y===d?(e.exit(h),c(d)):y===null?i(y):Be(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),rt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===d||y===null||Be(y)?(e.exit("chunkString"),u(y)):(e.consume(y),y===92?f:m)}function f(y){return y===d||y===92?(e.consume(y),m):m(y)}}function pl(e,n){let i;return s;function s(l){return Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i=!0,s):Je(l)?rt(e,s,i?"linePrefix":"lineSuffix")(l):n(l)}}const $I={name:"definition",tokenize:VI},qI={partial:!0,tokenize:GI};function VI(e,n,i){const s=this;let l;return h;function h(S){return e.enter("definition"),d(S)}function d(S){return ek.call(s,e,o,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function o(S){return l=ar(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),c):i(S)}function c(S){return _t(S)?pl(e,u)(S):u(S)}function u(S){return JC(e,m,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function m(S){return e.attempt(qI,f,f)(S)}function f(S){return Je(S)?rt(e,y,"whitespace")(S):y(S)}function y(S){return S===null||Be(S)?(e.exit("definition"),s.parser.defined.push(l),n(S)):i(S)}}function GI(e,n,i){return s;function s(o){return _t(o)?pl(e,l)(o):i(o)}function l(o){return tk(e,h,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function h(o){return Je(o)?rt(e,d,"whitespace")(o):d(o)}function d(o){return o===null||Be(o)?n(o):i(o)}}const WI={name:"hardBreakEscape",tokenize:KI};function KI(e,n,i){return s;function s(h){return e.enter("hardBreakEscape"),e.consume(h),l}function l(h){return Be(h)?(e.exit("hardBreakEscape"),n(h)):i(h)}}const YI={name:"headingAtx",resolve:XI,tokenize:ZI};function XI(e,n){let i=e.length-2,s=3,l,h;return e[s][1].type==="whitespace"&&(s+=2),i-2>s&&e[i][1].type==="whitespace"&&(i-=2),e[i][1].type==="atxHeadingSequence"&&(s===i-1||i-4>s&&e[i-2][1].type==="whitespace")&&(i-=s+1===i?2:4),i>s&&(l={type:"atxHeadingText",start:e[s][1].start,end:e[i][1].end},h={type:"chunkText",start:e[s][1].start,end:e[i][1].end,contentType:"text"},In(e,s,i-s+1,[["enter",l,n],["enter",h,n],["exit",h,n],["exit",l,n]])),e}function ZI(e,n,i){let s=0;return l;function l(m){return e.enter("atxHeading"),h(m)}function h(m){return e.enter("atxHeadingSequence"),d(m)}function d(m){return m===35&&s++<6?(e.consume(m),d):m===null||_t(m)?(e.exit("atxHeadingSequence"),o(m)):i(m)}function o(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||Be(m)?(e.exit("atxHeading"),n(m)):Je(m)?rt(e,o,"whitespace")(m):(e.enter("atxHeadingText"),u(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),o(m))}function u(m){return m===null||m===35||_t(m)?(e.exit("atxHeadingText"),o(m)):(e.consume(m),u)}}const QI=["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"],Y0=["pre","script","style","textarea"],JI={concrete:!0,name:"htmlFlow",resolveTo:nB,tokenize:rB},eB={partial:!0,tokenize:sB},tB={partial:!0,tokenize:iB};function nB(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function rB(e,n,i){const s=this;let l,h,d,o,c;return u;function u(z){return m(z)}function m(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),y):z===47?(e.consume(z),h=!0,w):z===63?(e.consume(z),l=3,s.interrupt?n:N):dn(z)?(e.consume(z),d=String.fromCharCode(z),_):i(z)}function y(z){return z===45?(e.consume(z),l=2,S):z===91?(e.consume(z),l=5,o=0,k):dn(z)?(e.consume(z),l=4,s.interrupt?n:N):i(z)}function S(z){return z===45?(e.consume(z),s.interrupt?n:N):i(z)}function k(z){const X="CDATA[";return z===X.charCodeAt(o++)?(e.consume(z),o===X.length?s.interrupt?n:q:k):i(z)}function w(z){return dn(z)?(e.consume(z),d=String.fromCharCode(z),_):i(z)}function _(z){if(z===null||z===47||z===62||_t(z)){const X=z===47,J=d.toLowerCase();return!X&&!h&&Y0.includes(J)?(l=1,s.interrupt?n(z):q(z)):QI.includes(d.toLowerCase())?(l=6,X?(e.consume(z),b):s.interrupt?n(z):q(z)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?i(z):h?v(z):x(z))}return z===45||sn(z)?(e.consume(z),d+=String.fromCharCode(z),_):i(z)}function b(z){return z===62?(e.consume(z),s.interrupt?n:q):i(z)}function v(z){return Je(z)?(e.consume(z),v):P(z)}function x(z){return z===47?(e.consume(z),P):z===58||z===95||dn(z)?(e.consume(z),E):Je(z)?(e.consume(z),x):P(z)}function E(z){return z===45||z===46||z===58||z===95||sn(z)?(e.consume(z),E):M(z)}function M(z){return z===61?(e.consume(z),R):Je(z)?(e.consume(z),M):x(z)}function R(z){return z===null||z===60||z===61||z===62||z===96?i(z):z===34||z===39?(e.consume(z),c=z,j):Je(z)?(e.consume(z),R):D(z)}function j(z){return z===c?(e.consume(z),c=null,O):z===null||Be(z)?i(z):(e.consume(z),j)}function D(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||_t(z)?M(z):(e.consume(z),D)}function O(z){return z===47||z===62||Je(z)?x(z):i(z)}function P(z){return z===62?(e.consume(z),U):i(z)}function U(z){return z===null||Be(z)?q(z):Je(z)?(e.consume(z),U):i(z)}function q(z){return z===45&&l===2?(e.consume(z),V):z===60&&l===1?(e.consume(z),Z):z===62&&l===4?(e.consume(z),L):z===63&&l===3?(e.consume(z),N):z===93&&l===5?(e.consume(z),F):Be(z)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(eB,B,$)(z)):z===null||Be(z)?(e.exit("htmlFlowData"),$(z)):(e.consume(z),q)}function $(z){return e.check(tB,K,B)(z)}function K(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),Y}function Y(z){return z===null||Be(z)?$(z):(e.enter("htmlFlowData"),q(z))}function V(z){return z===45?(e.consume(z),N):q(z)}function Z(z){return z===47?(e.consume(z),d="",Q):q(z)}function Q(z){if(z===62){const X=d.toLowerCase();return Y0.includes(X)?(e.consume(z),L):q(z)}return dn(z)&&d.length<8?(e.consume(z),d+=String.fromCharCode(z),Q):q(z)}function F(z){return z===93?(e.consume(z),N):q(z)}function N(z){return z===62?(e.consume(z),L):z===45&&l===2?(e.consume(z),N):q(z)}function L(z){return z===null||Be(z)?(e.exit("htmlFlowData"),B(z)):(e.consume(z),L)}function B(z){return e.exit("htmlFlow"),n(z)}}function iB(e,n,i){const s=this;return l;function l(d){return Be(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),h):i(d)}function h(d){return s.parser.lazy[s.now().line]?i(d):n(d)}}function sB(e,n,i){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(ql,n,i)}}const aB={name:"htmlText",tokenize:oB};function oB(e,n,i){const s=this;let l,h,d;return o;function o(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),c}function c(N){return N===33?(e.consume(N),u):N===47?(e.consume(N),M):N===63?(e.consume(N),x):dn(N)?(e.consume(N),D):i(N)}function u(N){return N===45?(e.consume(N),m):N===91?(e.consume(N),h=0,k):dn(N)?(e.consume(N),v):i(N)}function m(N){return N===45?(e.consume(N),S):i(N)}function f(N){return N===null?i(N):N===45?(e.consume(N),y):Be(N)?(d=f,Z(N)):(e.consume(N),f)}function y(N){return N===45?(e.consume(N),S):f(N)}function S(N){return N===62?V(N):N===45?y(N):f(N)}function k(N){const L="CDATA[";return N===L.charCodeAt(h++)?(e.consume(N),h===L.length?w:k):i(N)}function w(N){return N===null?i(N):N===93?(e.consume(N),_):Be(N)?(d=w,Z(N)):(e.consume(N),w)}function _(N){return N===93?(e.consume(N),b):w(N)}function b(N){return N===62?V(N):N===93?(e.consume(N),b):w(N)}function v(N){return N===null||N===62?V(N):Be(N)?(d=v,Z(N)):(e.consume(N),v)}function x(N){return N===null?i(N):N===63?(e.consume(N),E):Be(N)?(d=x,Z(N)):(e.consume(N),x)}function E(N){return N===62?V(N):x(N)}function M(N){return dn(N)?(e.consume(N),R):i(N)}function R(N){return N===45||sn(N)?(e.consume(N),R):j(N)}function j(N){return Be(N)?(d=j,Z(N)):Je(N)?(e.consume(N),j):V(N)}function D(N){return N===45||sn(N)?(e.consume(N),D):N===47||N===62||_t(N)?O(N):i(N)}function O(N){return N===47?(e.consume(N),V):N===58||N===95||dn(N)?(e.consume(N),P):Be(N)?(d=O,Z(N)):Je(N)?(e.consume(N),O):V(N)}function P(N){return N===45||N===46||N===58||N===95||sn(N)?(e.consume(N),P):U(N)}function U(N){return N===61?(e.consume(N),q):Be(N)?(d=U,Z(N)):Je(N)?(e.consume(N),U):O(N)}function q(N){return N===null||N===60||N===61||N===62||N===96?i(N):N===34||N===39?(e.consume(N),l=N,$):Be(N)?(d=q,Z(N)):Je(N)?(e.consume(N),q):(e.consume(N),K)}function $(N){return N===l?(e.consume(N),l=void 0,Y):N===null?i(N):Be(N)?(d=$,Z(N)):(e.consume(N),$)}function K(N){return N===null||N===34||N===39||N===60||N===61||N===96?i(N):N===47||N===62||_t(N)?O(N):(e.consume(N),K)}function Y(N){return N===47||N===62||_t(N)?O(N):i(N)}function V(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),n):i(N)}function Z(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),Q}function Q(N){return Je(N)?rt(e,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):F(N)}function F(N){return e.enter("htmlTextData"),d(N)}}const Eg={name:"labelEnd",resolveAll:dB,resolveTo:hB,tokenize:fB},lB={tokenize:pB},cB={tokenize:mB},uB={tokenize:gB};function dB(e){let n=-1;const i=[];for(;++n<e.length;){const s=e[n][1];if(i.push(e[n]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const l=s.type==="labelImage"?4:2;s.type="data",n+=l}}return e.length!==i.length&&In(e,0,e.length,i),e}function hB(e,n){let i=e.length,s=0,l,h,d,o;for(;i--;)if(l=e[i][1],h){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[i][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(d){if(e[i][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(h=i,l.type!=="labelLink")){s=2;break}}else l.type==="labelEnd"&&(d=i);const c={type:e[h][1].type==="labelLink"?"link":"image",start:{...e[h][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[h][1].start},end:{...e[d][1].end}},m={type:"labelText",start:{...e[h+s+2][1].end},end:{...e[d-2][1].start}};return o=[["enter",c,n],["enter",u,n]],o=Xn(o,e.slice(h+1,h+s+3)),o=Xn(o,[["enter",m,n]]),o=Xn(o,Od(n.parser.constructs.insideSpan.null,e.slice(h+s+4,d-3),n)),o=Xn(o,[["exit",m,n],e[d-2],e[d-1],["exit",u,n]]),o=Xn(o,e.slice(d+1)),o=Xn(o,[["exit",c,n]]),In(e,h,e.length,o),e}function fB(e,n,i){const s=this;let l=s.events.length,h,d;for(;l--;)if((s.events[l][1].type==="labelImage"||s.events[l][1].type==="labelLink")&&!s.events[l][1]._balanced){h=s.events[l][1];break}return o;function o(y){return h?h._inactive?f(y):(d=s.parser.defined.includes(ar(s.sliceSerialize({start:h.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),c):i(y)}function c(y){return y===40?e.attempt(lB,m,d?m:f)(y):y===91?e.attempt(cB,m,d?u:f)(y):d?m(y):f(y)}function u(y){return e.attempt(uB,m,f)(y)}function m(y){return n(y)}function f(y){return h._balanced=!0,i(y)}}function pB(e,n,i){return s;function s(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),l}function l(f){return _t(f)?pl(e,h)(f):h(f)}function h(f){return f===41?m(f):JC(e,d,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function d(f){return _t(f)?pl(e,c)(f):m(f)}function o(f){return i(f)}function c(f){return f===34||f===39||f===40?tk(e,u,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):m(f)}function u(f){return _t(f)?pl(e,m)(f):m(f)}function m(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),n):i(f)}}function mB(e,n,i){const s=this;return l;function l(o){return ek.call(s,e,h,d,"reference","referenceMarker","referenceString")(o)}function h(o){return s.parser.defined.includes(ar(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?n(o):i(o)}function d(o){return i(o)}}function gB(e,n,i){return s;function s(h){return e.enter("reference"),e.enter("referenceMarker"),e.consume(h),e.exit("referenceMarker"),l}function l(h){return h===93?(e.enter("referenceMarker"),e.consume(h),e.exit("referenceMarker"),e.exit("reference"),n):i(h)}}const vB={name:"labelStartImage",resolveAll:Eg.resolveAll,tokenize:_B};function _B(e,n,i){const s=this;return l;function l(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),h}function h(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),d):i(o)}function d(o){return o===94&&"_hiddenFootnoteSupport"in s.parser.constructs?i(o):n(o)}}const yB={name:"labelStartLink",resolveAll:Eg.resolveAll,tokenize:bB};function bB(e,n,i){const s=this;return l;function l(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),h}function h(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?i(d):n(d)}}const Tp={name:"lineEnding",tokenize:xB};function xB(e,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),rt(e,n,"linePrefix")}}const Au={name:"thematicBreak",tokenize:SB};function SB(e,n,i){let s=0,l;return h;function h(u){return e.enter("thematicBreak"),d(u)}function d(u){return l=u,o(u)}function o(u){return u===l?(e.enter("thematicBreakSequence"),c(u)):s>=3&&(u===null||Be(u))?(e.exit("thematicBreak"),n(u)):i(u)}function c(u){return u===l?(e.consume(u),s++,c):(e.exit("thematicBreakSequence"),Je(u)?rt(e,o,"whitespace")(u):o(u))}}const bn={continuation:{tokenize:EB},exit:TB,name:"list",tokenize:kB},wB={partial:!0,tokenize:RB},CB={partial:!0,tokenize:AB};function kB(e,n,i){const s=this,l=s.events[s.events.length-1];let h=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,d=0;return o;function o(S){const k=s.containerState.type||(S===42||S===43||S===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!s.containerState.marker||S===s.containerState.marker:gm(S)){if(s.containerState.type||(s.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),S===42||S===45?e.check(Au,i,u)(S):u(S);if(!s.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(S)}return i(S)}function c(S){return gm(S)&&++d<10?(e.consume(S),c):(!s.interrupt||d<2)&&(s.containerState.marker?S===s.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),u(S)):i(S)}function u(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||S,e.check(ql,s.interrupt?i:m,e.attempt(wB,y,f))}function m(S){return s.containerState.initialBlankLine=!0,h++,y(S)}function f(S){return Je(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),y):i(S)}function y(S){return s.containerState.size=h+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(S)}}function EB(e,n,i){const s=this;return s.containerState._closeFlow=void 0,e.check(ql,l,h);function l(o){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,rt(e,n,"listItemIndent",s.containerState.size+1)(o)}function h(o){return s.containerState.furtherBlankLines||!Je(o)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,d(o)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(CB,n,d)(o))}function d(o){return s.containerState._closeFlow=!0,s.interrupt=void 0,rt(e,e.attempt(bn,n,i),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function AB(e,n,i){const s=this;return rt(e,l,"listItemIndent",s.containerState.size+1);function l(h){const d=s.events[s.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===s.containerState.size?n(h):i(h)}}function TB(e){e.exit(this.containerState.type)}function RB(e,n,i){const s=this;return rt(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(h){const d=s.events[s.events.length-1];return!Je(h)&&d&&d[1].type==="listItemPrefixWhitespace"?n(h):i(h)}}const X0={name:"setextUnderline",resolveTo:DB,tokenize:MB};function DB(e,n){let i=e.length,s,l,h;for(;i--;)if(e[i][0]==="enter"){if(e[i][1].type==="content"){s=i;break}e[i][1].type==="paragraph"&&(l=i)}else e[i][1].type==="content"&&e.splice(i,1),!h&&e[i][1].type==="definition"&&(h=i);const d={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",h?(e.splice(l,0,["enter",d,n]),e.splice(h+1,0,["exit",e[s][1],n]),e[s][1].end={...e[h][1].end}):e[s][1]=d,e.push(["exit",d,n]),e}function MB(e,n,i){const s=this;let l;return h;function h(u){let m=s.events.length,f;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){f=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),l=u,d(u)):i(u)}function d(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===l?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),Je(u)?rt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Be(u)?(e.exit("setextHeadingLine"),n(u)):i(u)}}const NB={tokenize:jB};function jB(e){const n=this,i=e.attempt(ql,s,e.attempt(this.parser.constructs.flowInitial,l,rt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(zI,l)),"linePrefix")));return i;function s(h){if(h===null){e.consume(h);return}return e.enter("lineEndingBlank"),e.consume(h),e.exit("lineEndingBlank"),n.currentConstruct=void 0,i}function l(h){if(h===null){e.consume(h);return}return e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),n.currentConstruct=void 0,i}}const OB={resolveAll:rk()},LB=nk("string"),IB=nk("text");function nk(e){return{resolveAll:rk(e==="text"?BB:void 0),tokenize:n};function n(i){const s=this,l=this.parser.constructs[e],h=i.attempt(l,d,o);return d;function d(m){return u(m)?h(m):o(m)}function o(m){if(m===null){i.consume(m);return}return i.enter("data"),i.consume(m),c}function c(m){return u(m)?(i.exit("data"),h(m)):(i.consume(m),c)}function u(m){if(m===null)return!0;const f=l[m];let y=-1;if(f)for(;++y<f.length;){const S=f[y];if(!S.previous||S.previous.call(s,s.previous))return!0}return!1}}}function rk(e){return n;function n(i,s){let l=-1,h;for(;++l<=i.length;)h===void 0?i[l]&&i[l][1].type==="data"&&(h=l,l++):(!i[l]||i[l][1].type!=="data")&&(l!==h+2&&(i[h][1].end=i[l-1][1].end,i.splice(h+2,l-h-2),l=h+2),h=void 0);return e?e(i,s):i}}function BB(e,n){let i=0;for(;++i<=e.length;)if((i===e.length||e[i][1].type==="lineEnding")&&e[i-1][1].type==="data"){const s=e[i-1][1],l=n.sliceStream(s);let h=l.length,d=-1,o=0,c;for(;h--;){const u=l[h];if(typeof u=="string"){for(d=u.length;u.charCodeAt(d-1)===32;)o++,d--;if(d)break;d=-1}else if(u===-2)c=!0,o++;else if(u!==-1){h++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(o=0),o){const u={type:i===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:h?d:s.start._bufferIndex+d,_index:s.start._index+h,line:s.end.line,column:s.end.column-o,offset:s.end.offset-o},end:{...s.end}};s.end={...u.start},s.start.offset===s.end.offset?Object.assign(s,u):(e.splice(i,0,["enter",u,n],["exit",u,n]),i+=2)}i++}return e}const zB={42:bn,43:bn,45:bn,48:bn,49:bn,50:bn,51:bn,52:bn,53:bn,54:bn,55:bn,56:bn,57:bn,62:YC},PB={91:$I},FB={[-2]:Ap,[-1]:Ap,32:Ap},HB={35:YI,42:Au,45:[X0,Au],60:JI,61:X0,95:Au,96:K0,126:K0},UB={38:ZC,92:XC},$B={[-5]:Tp,[-4]:Tp,[-3]:Tp,33:vB,38:ZC,42:vm,60:[yI,aB],91:yB,92:[WI,XC],93:Eg,95:vm,96:NI},qB={null:[vm,OB]},VB={null:[42,95]},GB={null:[]},WB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:VB,contentInitial:PB,disable:GB,document:zB,flow:HB,flowInitial:FB,insideSpan:qB,string:UB,text:$B},Symbol.toStringTag,{value:"Module"}));function KB(e,n,i){let s={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const l={},h=[];let d=[],o=[];const c={attempt:j(M),check:j(R),consume:v,enter:x,exit:E,interrupt:j(R,{interrupt:!0})},u={code:null,containerState:{},defineSkip:w,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:S,write:f};let m=n.tokenize.call(u,c);return n.resolveAll&&h.push(n),u;function f(U){return d=Xn(d,U),_(),d[d.length-1]!==null?[]:(D(n,0),u.events=Od(h,u.events,u),u.events)}function y(U,q){return XB(S(U),q)}function S(U){return YB(d,U)}function k(){const{_bufferIndex:U,_index:q,line:$,column:K,offset:Y}=s;return{_bufferIndex:U,_index:q,line:$,column:K,offset:Y}}function w(U){l[U.line]=U.column,P()}function _(){let U;for(;s._index<d.length;){const q=d[s._index];if(typeof q=="string")for(U=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===U&&s._bufferIndex<q.length;)b(q.charCodeAt(s._bufferIndex));else b(q)}}function b(U){m=m(U)}function v(U){Be(U)?(s.line++,s.column=1,s.offset+=U===-3?2:1,P()):U!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===d[s._index].length&&(s._bufferIndex=-1,s._index++)),u.previous=U}function x(U,q){const $=q||{};return $.type=U,$.start=k(),u.events.push(["enter",$,u]),o.push($),$}function E(U){const q=o.pop();return q.end=k(),u.events.push(["exit",q,u]),q}function M(U,q){D(U,q.from)}function R(U,q){q.restore()}function j(U,q){return $;function $(K,Y,V){let Z,Q,F,N;return Array.isArray(K)?B(K):"tokenize"in K?B([K]):L(K);function L(te){return W;function W(H){const ne=H!==null&&te[H],ae=H!==null&&te.null,pe=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return B(pe)(H)}}function B(te){return Z=te,Q=0,te.length===0?V:z(te[Q])}function z(te){return W;function W(H){return N=O(),F=te,te.partial||(u.currentConstruct=te),te.name&&u.parser.constructs.disable.null.includes(te.name)?J():te.tokenize.call(q?Object.assign(Object.create(u),q):u,c,X,J)(H)}}function X(te){return U(F,N),Y}function J(te){return N.restore(),++Q<Z.length?z(Z[Q]):V}}}function D(U,q){U.resolveAll&&!h.includes(U)&&h.push(U),U.resolve&&In(u.events,q,u.events.length-q,U.resolve(u.events.slice(q),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function O(){const U=k(),q=u.previous,$=u.currentConstruct,K=u.events.length,Y=Array.from(o);return{from:K,restore:V};function V(){s=U,u.previous=q,u.currentConstruct=$,u.events.length=K,o=Y,P()}}function P(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function YB(e,n){const i=n.start._index,s=n.start._bufferIndex,l=n.end._index,h=n.end._bufferIndex;let d;if(i===l)d=[e[i].slice(s,h)];else{if(d=e.slice(i,l),s>-1){const o=d[0];typeof o=="string"?d[0]=o.slice(s):d.shift()}h>0&&d.push(e[l].slice(0,h))}return d}function XB(e,n){let i=-1;const s=[];let l;for(;++i<e.length;){const h=e[i];let d;if(typeof h=="string")d=h;else switch(h){case-5:{d="\r";break}case-4:{d=`
473
- `;break}case-3:{d=`\r
474
- `;break}case-2:{d=n?" ":" ";break}case-1:{if(!n&&l)continue;d=" ";break}default:d=String.fromCharCode(h)}l=h===-2,s.push(d)}return s.join("")}function ZB(e){const s={constructs:WC([WB,...(e||{}).extensions||[]]),content:l(hI),defined:[],document:l(pI),flow:l(NB),lazy:{},string:l(LB),text:l(IB)};return s;function l(h){return d;function d(o){return KB(s,h,o)}}}function QB(e){for(;!QC(e););return e}const Z0=/[\0\t\n\r]/g;function JB(){let e=1,n="",i=!0,s;return l;function l(h,d,o){const c=[];let u,m,f,y,S;for(h=n+(typeof h=="string"?h.toString():new TextDecoder(d||void 0).decode(h)),f=0,n="",i&&(h.charCodeAt(0)===65279&&f++,i=void 0);f<h.length;){if(Z0.lastIndex=f,u=Z0.exec(h),y=u&&u.index!==void 0?u.index:h.length,S=h.charCodeAt(y),!u){n=h.slice(f);break}if(S===10&&f===y&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),f<y&&(c.push(h.slice(f,y)),e+=y-f),S){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}f=y+1}return o&&(s&&c.push(-5),n&&c.push(n),c.push(null)),c}}const ez=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tz(e){return e.replace(ez,nz)}function nz(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const l=i.charCodeAt(1),h=l===120||l===88;return KC(i.slice(h?2:1),h?16:10)}return kg(i)||e}const ik={}.hasOwnProperty;function rz(e,n,i){return n&&typeof n=="object"&&(i=n,n=void 0),iz(i)(QB(ZB(i).document().write(JB()(e,n,!0))))}function iz(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:h(Wt),autolinkProtocol:O,autolinkEmail:O,atxHeading:h(Fe),blockQuote:h(ae),characterEscape:O,characterReference:O,codeFenced:h(pe),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:h(pe,d),codeText:h(ue,d),codeTextData:O,data:O,codeFlowValue:O,definition:h(Re),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:h(Ie),hardBreakEscape:h(lt),hardBreakTrailing:h(lt),htmlFlow:h(De,d),htmlFlowData:O,htmlText:h(De,d),htmlTextData:O,image:h(en),label:d,link:h(Wt),listItem:h(Kt),listItemValue:y,listOrdered:h(fn,f),listUnordered:h(fn),paragraph:h(ur),reference:z,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:h(Fe),strong:h($t),thematicBreak:h(Mt)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:ne,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:te,characterReference:W,codeFenced:c(_),codeFencedFence:w,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:P,codeIndented:c(b),codeText:c(Y),codeTextData:P,data:P,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(q),hardBreakTrailing:c(q),htmlFlow:c($),htmlFlowData:P,htmlText:c(K),htmlTextData:P,image:c(Z),label:F,labelText:Q,lineEnding:U,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:X,resourceDestinationString:N,resourceTitleString:L,resource:B,setextHeading:c(D),setextHeadingLineSequence:j,setextHeadingText:R,strong:c(),thematicBreak:c()}};sk(n,(e||{}).mdastExtensions||[]);const i={};return s;function s(he){let xe={type:"root",children:[]};const Oe={stack:[xe],tokenStack:[],config:n,enter:o,exit:u,buffer:d,resume:m,data:i},Pe=[];let qe=-1;for(;++qe<he.length;)if(he[qe][1].type==="listOrdered"||he[qe][1].type==="listUnordered")if(he[qe][0]==="enter")Pe.push(qe);else{const wt=Pe.pop();qe=l(he,wt,qe)}for(qe=-1;++qe<he.length;){const wt=n[he[qe][0]];ik.call(wt,he[qe][1].type)&&wt[he[qe][1].type].call(Object.assign({sliceSerialize:he[qe][2].sliceSerialize},Oe),he[qe][1])}if(Oe.tokenStack.length>0){const wt=Oe.tokenStack[Oe.tokenStack.length-1];(wt[1]||Q0).call(Oe,void 0,wt[0])}for(xe.position={start:Ii(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Ii(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<n.transforms.length;)xe=n.transforms[qe](xe)||xe;return xe}function l(he,xe,Oe){let Pe=xe-1,qe=-1,wt=!1,Xe,zt,Tt,tn;for(;++Pe<=Oe;){const it=he[Pe];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?qe++:qe--,tn=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(Xe&&!tn&&!qe&&!Tt&&(Tt=Pe),tn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tn=void 0}if(!qe&&it[0]==="enter"&&it[1].type==="listItemPrefix"||qe===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(Xe){let wn=Pe;for(zt=void 0;wn--;){const zn=he[wn];if(zn[1].type==="lineEnding"||zn[1].type==="lineEndingBlank"){if(zn[0]==="exit")continue;zt&&(he[zt][1].type="lineEndingBlank",wt=!0),zn[1].type="lineEnding",zt=wn}else if(!(zn[1].type==="linePrefix"||zn[1].type==="blockQuotePrefix"||zn[1].type==="blockQuotePrefixWhitespace"||zn[1].type==="blockQuoteMarker"||zn[1].type==="listItemIndent"))break}Tt&&(!zt||Tt<zt)&&(Xe._spread=!0),Xe.end=Object.assign({},zt?he[zt][1].start:it[1].end),he.splice(zt||Pe,0,["exit",Xe,it[2]]),Pe++,Oe++}if(it[1].type==="listItemPrefix"){const wn={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};Xe=wn,he.splice(Pe,0,["enter",wn,it[2]]),Pe++,Oe++,Tt=void 0,tn=!0}}}return he[xe][1]._spread=wt,Oe}function h(he,xe){return Oe;function Oe(Pe){o.call(this,he(Pe),Pe),xe&&xe.call(this,Pe)}}function d(){this.stack.push({type:"fragment",children:[]})}function o(he,xe,Oe){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([xe,Oe||void 0]),he.position={start:Ii(xe.start),end:void 0}}function c(he){return xe;function xe(Oe){he&&he.call(this,Oe),u.call(this,Oe)}}function u(he,xe){const Oe=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==he.type&&(xe?xe.call(this,he,Pe[0]):(Pe[1]||Q0).call(this,he,Pe[0]));else throw new Error("Cannot close `"+he.type+"` ("+fl({start:he.start,end:he.end})+"): it’s not open");Oe.position.end=Ii(he.end)}function m(){return Cg(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function y(he){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function S(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=he}function k(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=he}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.value=he.replace(/(\r?\n|\r)$/g,"")}function v(he){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=xe,Oe.identifier=ar(this.sliceSerialize(he)).toLowerCase()}function x(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.title=he}function E(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.url=he}function M(he){const xe=this.stack[this.stack.length-1];if(!xe.depth){const Oe=this.sliceSerialize(he).length;xe.depth=Oe}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function j(he){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function O(he){const Oe=this.stack[this.stack.length-1].children;let Pe=Oe[Oe.length-1];(!Pe||Pe.type!=="text")&&(Pe=gt(),Pe.position={start:Ii(he.start),end:void 0},Oe.push(Pe)),this.stack.push(Pe)}function P(he){const xe=this.stack.pop();xe.value+=this.sliceSerialize(he),xe.position.end=Ii(he.end)}function U(he){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Oe=xe.children[xe.children.length-1];Oe.position.end=Ii(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(xe.type)&&(O.call(this,he),P.call(this,he))}function q(){this.data.atHardBreak=!0}function $(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.value=he}function K(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.value=he}function Y(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.value=he}function V(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=xe,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Z(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=xe,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Q(he){const xe=this.sliceSerialize(he),Oe=this.stack[this.stack.length-2];Oe.label=tz(xe),Oe.identifier=ar(xe).toLowerCase()}function F(){const he=this.stack[this.stack.length-1],xe=this.resume(),Oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Oe.type==="link"){const Pe=he.children;Oe.children=Pe}else Oe.alt=xe}function N(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.url=he}function L(){const he=this.resume(),xe=this.stack[this.stack.length-1];xe.title=he}function B(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function X(he){const xe=this.resume(),Oe=this.stack[this.stack.length-1];Oe.label=xe,Oe.identifier=ar(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function J(he){this.data.characterReferenceType=he.type}function te(he){const xe=this.sliceSerialize(he),Oe=this.data.characterReferenceType;let Pe;Oe?(Pe=KC(xe,Oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=kg(xe);const qe=this.stack[this.stack.length-1];qe.value+=Pe}function W(he){const xe=this.stack.pop();xe.position.end=Ii(he.end)}function H(he){P.call(this,he);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(he)}function ne(he){P.call(this,he);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(he)}function ae(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function ue(){return{type:"inlineCode",value:""}}function Re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function Fe(){return{type:"heading",depth:0,children:[]}}function lt(){return{type:"break"}}function De(){return{type:"html",value:""}}function en(){return{type:"image",title:null,url:"",alt:null}}function Wt(){return{type:"link",title:null,url:"",children:[]}}function fn(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Kt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function ur(){return{type:"paragraph",children:[]}}function $t(){return{type:"strong",children:[]}}function gt(){return{type:"text",value:""}}function Mt(){return{type:"thematicBreak"}}}function Ii(e){return{line:e.line,column:e.column,offset:e.offset}}function sk(e,n){let i=-1;for(;++i<n.length;){const s=n[i];Array.isArray(s)?sk(e,s):sz(e,s)}}function sz(e,n){let i;for(i in n)if(ik.call(n,i))switch(i){case"canContainEols":{const s=n[i];s&&e[i].push(...s);break}case"transforms":{const s=n[i];s&&e[i].push(...s);break}case"enter":case"exit":{const s=n[i];s&&Object.assign(e[i],s);break}}}function Q0(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+fl({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+fl({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+fl({start:n.start,end:n.end})+") is still open")}function az(e){const n=this;n.parser=i;function i(s){return rz(s,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function oz(e,n){const i={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,i),e.applyData(n,i)}function lz(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
475
- `}]}function cz(e,n){const i=n.value?n.value+`
476
- `:"",s={},l=n.lang?n.lang.split(/\s+/):[];l.length>0&&(s.className=["language-"+l[0]]);let h={type:"element",tagName:"code",properties:s,children:[{type:"text",value:i}]};return n.meta&&(h.data={meta:n.meta}),e.patch(n,h),h=e.applyData(n,h),h={type:"element",tagName:"pre",properties:{},children:[h]},e.patch(n,h),h}function uz(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function dz(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function hz(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(n.identifier).toUpperCase(),l=eo(s.toLowerCase()),h=e.footnoteOrder.indexOf(s);let d,o=e.footnoteCounts.get(s);o===void 0?(o=0,e.footnoteOrder.push(s),d=e.footnoteOrder.length):d=h+1,o+=1,e.footnoteCounts.set(s,o);const c={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+l,id:i+"fnref-"+l+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(n,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,u),e.applyData(n,u)}function fz(e,n){const i={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function pz(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function ak(e,n){const i=n.referenceType;let s="]";if(i==="collapsed"?s+="[]":i==="full"&&(s+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+s}];const l=e.all(n),h=l[0];h&&h.type==="text"?h.value="["+h.value:l.unshift({type:"text",value:"["});const d=l[l.length-1];return d&&d.type==="text"?d.value+=s:l.push({type:"text",value:s}),l}function mz(e,n){const i=String(n.identifier).toUpperCase(),s=e.definitionById.get(i);if(!s)return ak(e,n);const l={src:eo(s.url||""),alt:n.alt};s.title!==null&&s.title!==void 0&&(l.title=s.title);const h={type:"element",tagName:"img",properties:l,children:[]};return e.patch(n,h),e.applyData(n,h)}function gz(e,n){const i={src:eo(n.url)};n.alt!==null&&n.alt!==void 0&&(i.alt=n.alt),n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,s),e.applyData(n,s)}function vz(e,n){const i={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,i);const s={type:"element",tagName:"code",properties:{},children:[i]};return e.patch(n,s),e.applyData(n,s)}function _z(e,n){const i=String(n.identifier).toUpperCase(),s=e.definitionById.get(i);if(!s)return ak(e,n);const l={href:eo(s.url||"")};s.title!==null&&s.title!==void 0&&(l.title=s.title);const h={type:"element",tagName:"a",properties:l,children:e.all(n)};return e.patch(n,h),e.applyData(n,h)}function yz(e,n){const i={href:eo(n.url)};n.title!==null&&n.title!==void 0&&(i.title=n.title);const s={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function bz(e,n,i){const s=e.all(n),l=i?xz(i):ok(n),h={},d=[];if(typeof n.checked=="boolean"){const m=s[0];let f;m&&m.type==="element"&&m.tagName==="p"?f=m:(f={type:"element",tagName:"p",properties:{},children:[]},s.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),h.className=["task-list-item"]}let o=-1;for(;++o<s.length;){const m=s[o];(l||o!==0||m.type!=="element"||m.tagName!=="p")&&d.push({type:"text",value:`
477
- `}),m.type==="element"&&m.tagName==="p"&&!l?d.push(...m.children):d.push(m)}const c=s[s.length-1];c&&(l||c.type!=="element"||c.tagName!=="p")&&d.push({type:"text",value:`
478
- `});const u={type:"element",tagName:"li",properties:h,children:d};return e.patch(n,u),e.applyData(n,u)}function xz(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const i=e.children;let s=-1;for(;!n&&++s<i.length;)n=ok(i[s])}return n}function ok(e){const n=e.spread;return n==null?e.children.length>1:n}function Sz(e,n){const i={},s=e.all(n);let l=-1;for(typeof n.start=="number"&&n.start!==1&&(i.start=n.start);++l<s.length;){const d=s[l];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const h={type:"element",tagName:n.ordered?"ol":"ul",properties:i,children:e.wrap(s,!0)};return e.patch(n,h),e.applyData(n,h)}function wz(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Cz(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function kz(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Ez(e,n){const i=e.all(n),s=i.shift(),l=[];if(s){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(n.children[0],d),l.push(d)}if(i.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},o=bg(n.children[1]),c=FC(n.children[n.children.length-1]);o&&c&&(d.position={start:o,end:c}),l.push(d)}const h={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(n,h),e.applyData(n,h)}function Az(e,n,i){const s=i?i.children:void 0,h=(s?s.indexOf(n):1)===0?"th":"td",d=i&&i.type==="table"?i.align:void 0,o=d?d.length:n.children.length;let c=-1;const u=[];for(;++c<o;){const f=n.children[c],y={},S=d?d[c]:void 0;S&&(y.align=S);let k={type:"element",tagName:h,properties:y,children:[]};f&&(k.children=e.all(f),e.patch(f,k),k=e.applyData(f,k)),u.push(k)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,m),e.applyData(n,m)}function Tz(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const J0=9,ex=32;function Rz(e){const n=String(e),i=/\r?\n|\r/g;let s=i.exec(n),l=0;const h=[];for(;s;)h.push(tx(n.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=i.exec(n);return h.push(tx(n.slice(l),l>0,!1)),h.join("")}function tx(e,n,i){let s=0,l=e.length;if(n){let h=e.codePointAt(s);for(;h===J0||h===ex;)s++,h=e.codePointAt(s)}if(i){let h=e.codePointAt(l-1);for(;h===J0||h===ex;)l--,h=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function Dz(e,n){const i={type:"text",value:Rz(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function Mz(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const Nz={blockquote:oz,break:lz,code:cz,delete:uz,emphasis:dz,footnoteReference:hz,heading:fz,html:pz,imageReference:mz,image:gz,inlineCode:vz,linkReference:_z,link:yz,listItem:bz,list:Sz,paragraph:wz,root:Cz,strong:kz,table:Ez,tableCell:Tz,tableRow:Az,text:Dz,thematicBreak:Mz,toml:vu,yaml:vu,definition:vu,footnoteDefinition:vu};function vu(){}const lk=-1,Ld=0,ml=1,Vu=2,Ag=3,Tg=4,Rg=5,Dg=6,ck=7,uk=8,nx=typeof self=="object"?self:globalThis,jz=(e,n)=>{const i=(l,h)=>(e.set(h,l),l),s=l=>{if(e.has(l))return e.get(l);const[h,d]=n[l];switch(h){case Ld:case lk:return i(d,l);case ml:{const o=i([],l);for(const c of d)o.push(s(c));return o}case Vu:{const o=i({},l);for(const[c,u]of d)o[s(c)]=s(u);return o}case Ag:return i(new Date(d),l);case Tg:{const{source:o,flags:c}=d;return i(new RegExp(o,c),l)}case Rg:{const o=i(new Map,l);for(const[c,u]of d)o.set(s(c),s(u));return o}case Dg:{const o=i(new Set,l);for(const c of d)o.add(s(c));return o}case ck:{const{name:o,message:c}=d;return i(new nx[o](c),l)}case uk:return i(BigInt(d),l);case"BigInt":return i(Object(BigInt(d)),l);case"ArrayBuffer":return i(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:o}=new Uint8Array(d);return i(new DataView(o),d)}}return i(new nx[h](d),l)};return s},rx=e=>jz(new Map,e)(0),_a="",{toString:Oz}={},{keys:Lz}=Object,sl=e=>{const n=typeof e;if(n!=="object"||!e)return[Ld,n];const i=Oz.call(e).slice(8,-1);switch(i){case"Array":return[ml,_a];case"Object":return[Vu,_a];case"Date":return[Ag,_a];case"RegExp":return[Tg,_a];case"Map":return[Rg,_a];case"Set":return[Dg,_a];case"DataView":return[ml,i]}return i.includes("Array")?[ml,i]:i.includes("Error")?[ck,i]:[Vu,i]},_u=([e,n])=>e===Ld&&(n==="function"||n==="symbol"),Iz=(e,n,i,s)=>{const l=(d,o)=>{const c=s.push(d)-1;return i.set(o,c),c},h=d=>{if(i.has(d))return i.get(d);let[o,c]=sl(d);switch(o){case Ld:{let m=d;switch(c){case"bigint":o=uk,m=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return l([lk],d)}return l([o,m],d)}case ml:{if(c){let y=d;return c==="DataView"?y=new Uint8Array(d.buffer):c==="ArrayBuffer"&&(y=new Uint8Array(d)),l([c,[...y]],d)}const m=[],f=l([o,m],d);for(const y of d)m.push(h(y));return f}case Vu:{if(c)switch(c){case"BigInt":return l([c,d.toString()],d);case"Boolean":case"Number":case"String":return l([c,d.valueOf()],d)}if(n&&"toJSON"in d)return h(d.toJSON());const m=[],f=l([o,m],d);for(const y of Lz(d))(e||!_u(sl(d[y])))&&m.push([h(y),h(d[y])]);return f}case Ag:return l([o,d.toISOString()],d);case Tg:{const{source:m,flags:f}=d;return l([o,{source:m,flags:f}],d)}case Rg:{const m=[],f=l([o,m],d);for(const[y,S]of d)(e||!(_u(sl(y))||_u(sl(S))))&&m.push([h(y),h(S)]);return f}case Dg:{const m=[],f=l([o,m],d);for(const y of d)(e||!_u(sl(y)))&&m.push(h(y));return f}}const{message:u}=d;return l([o,{name:c,message:u}],d)};return h},ix=(e,{json:n,lossy:i}={})=>{const s=[];return Iz(!(n||i),!!n,new Map,s)(e),s},Gu=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?rx(ix(e,n)):structuredClone(e):(e,n)=>rx(ix(e,n));function Bz(e,n){const i=[{type:"text",value:"↩"}];return n>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),i}function zz(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Pz(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||Bz,s=e.options.footnoteBackLabel||zz,l=e.options.footnoteLabel||"Footnotes",h=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const m=e.all(u),f=String(u.identifier).toUpperCase(),y=eo(f.toLowerCase());let S=0;const k=[],w=e.footnoteCounts.get(f);for(;w!==void 0&&++S<=w;){k.length>0&&k.push({type:"text",value:" "});let v=typeof i=="string"?i:i(c,S);typeof v=="string"&&(v={type:"text",value:v}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+y+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(c,S),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const _=m[m.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const v=_.children[_.children.length-1];v&&v.type==="text"?v.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...k)}else m.push(...k);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+y},children:e.wrap(m,!0)};e.patch(u,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:h,properties:{...Gu(d),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
479
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
480
- `}]}}const Id=(function(e){if(e==null)return $z;if(typeof e=="function")return Bd(e);if(typeof e=="object")return Array.isArray(e)?Fz(e):Hz(e);if(typeof e=="string")return Uz(e);throw new Error("Expected function, string, or object as test")});function Fz(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=Id(e[i]);return Bd(s);function s(...l){let h=-1;for(;++h<n.length;)if(n[h].apply(this,l))return!0;return!1}}function Hz(e){const n=e;return Bd(i);function i(s){const l=s;let h;for(h in e)if(l[h]!==n[h])return!1;return!0}}function Uz(e){return Bd(n);function n(i){return i&&i.type===e}}function Bd(e){return n;function n(i,s,l){return!!(qz(i)&&e.call(this,i,typeof s=="number"?s:void 0,l||void 0))}}function $z(){return!0}function qz(e){return e!==null&&typeof e=="object"&&"type"in e}const dk=[],Vz=!0,_m=!1,Gz="skip";function hk(e,n,i,s){let l;typeof n=="function"&&typeof i!="function"?(s=i,i=n):l=n;const h=Id(l),d=s?-1:1;o(e,void 0,[])();function o(c,u,m){const f=c&&typeof c=="object"?c:{};if(typeof f.type=="string"){const S=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(c.type+(S?"<"+S+">":""))+")"})}return y;function y(){let S=dk,k,w,_;if((!n||h(c,u,m[m.length-1]||void 0))&&(S=Wz(i(c,m)),S[0]===_m))return S;if("children"in c&&c.children){const b=c;if(b.children&&S[0]!==Gz)for(w=(s?b.children.length:-1)+d,_=m.concat(b);w>-1&&w<b.children.length;){const v=b.children[w];if(k=o(v,w,_)(),k[0]===_m)return k;w=typeof k[1]=="number"?k[1]:w+d}}return S}}}function Wz(e){return Array.isArray(e)?e:typeof e=="number"?[Vz,e]:e==null?dk:[e]}function Mg(e,n,i,s){let l,h,d;typeof n=="function"&&typeof i!="function"?(h=void 0,d=n,l=i):(h=n,d=i,l=s),hk(e,h,o,l);function o(c,u){const m=u[u.length-1],f=m?m.children.indexOf(c):void 0;return d(c,f,m)}}const ym={}.hasOwnProperty,Kz={};function Yz(e,n){const i=n||Kz,s=new Map,l=new Map,h=new Map,d={...Nz,...i.handlers},o={all:u,applyData:Zz,definitionById:s,footnoteById:l,footnoteCounts:h,footnoteOrder:[],handlers:d,one:c,options:i,patch:Xz,wrap:Jz};return Mg(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const f=m.type==="definition"?s:l,y=String(m.identifier).toUpperCase();f.has(y)||f.set(y,m)}}),o;function c(m,f){const y=m.type,S=o.handlers[y];if(ym.call(o.handlers,y)&&S)return S(o,m,f);if(o.options.passThrough&&o.options.passThrough.includes(y)){if("children"in m){const{children:w,..._}=m,b=Gu(_);return b.children=o.all(m),b}return Gu(m)}return(o.options.unknownHandler||Qz)(o,m,f)}function u(m){const f=[];if("children"in m){const y=m.children;let S=-1;for(;++S<y.length;){const k=o.one(y[S],m);if(k){if(S&&y[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=sx(k.value)),!Array.isArray(k)&&k.type==="element")){const w=k.children[0];w&&w.type==="text"&&(w.value=sx(w.value))}Array.isArray(k)?f.push(...k):f.push(k)}}}return f}}function Xz(e,n){e.position&&(n.position=z6(e))}function Zz(e,n){let i=n;if(e&&e.data){const s=e.data.hName,l=e.data.hChildren,h=e.data.hProperties;if(typeof s=="string")if(i.type==="element")i.tagName=s;else{const d="children"in i?i.children:[i];i={type:"element",tagName:s,properties:{},children:d}}i.type==="element"&&h&&Object.assign(i.properties,Gu(h)),"children"in i&&i.children&&l!==null&&l!==void 0&&(i.children=l)}return i}function Qz(e,n){const i=n.data||{},s="value"in n&&!(ym.call(i,"hProperties")||ym.call(i,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function Jz(e,n){const i=[];let s=-1;for(n&&i.push({type:"text",value:`
481
- `});++s<e.length;)s&&i.push({type:"text",value:`
482
- `}),i.push(e[s]);return n&&e.length>0&&i.push({type:"text",value:`
483
- `}),i}function sx(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function ax(e,n){const i=Yz(e,n),s=i.one(e,void 0),l=Pz(i),h=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&h.children.push({type:"text",value:`
484
- `},l),h}function eP(e,n){return e&&"run"in e?async function(i,s){const l=ax(i,{file:s,...n});await e.run(l,s)}:function(i,s){return ax(i,{file:s,...e||n})}}function ox(e){if(e)throw e}var Rp,lx;function tP(){if(lx)return Rp;lx=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},h=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var m=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!m&&!f)return!1;var y;for(y in u);return typeof y>"u"||e.call(u,y)},d=function(u,m){i&&m.name==="__proto__"?i(u,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):u[m.name]=m.newValue},o=function(u,m){if(m==="__proto__")if(e.call(u,m)){if(s)return s(u,m).value}else return;return u[m]};return Rp=function c(){var u,m,f,y,S,k,w=arguments[0],_=1,b=arguments.length,v=!1;for(typeof w=="boolean"&&(v=w,w=arguments[1]||{},_=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});_<b;++_)if(u=arguments[_],u!=null)for(m in u)f=o(w,m),y=o(u,m),w!==y&&(v&&y&&(h(y)||(S=l(y)))?(S?(S=!1,k=f&&l(f)?f:[]):k=f&&h(f)?f:{},d(w,{name:m,newValue:c(v,k,y)})):typeof y<"u"&&d(w,{name:m,newValue:y}));return w},Rp}var nP=tP();const Dp=Ku(nP);function bm(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rP(){const e=[],n={run:i,use:s};return n;function i(...l){let h=-1;const d=l.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);o(null,...l);function o(c,...u){const m=e[++h];let f=-1;if(c){d(c);return}for(;++f<l.length;)(u[f]===null||u[f]===void 0)&&(u[f]=l[f]);l=u,m?iP(m,o)(...u):d(null,...u)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),n}}function iP(e,n){let i;return s;function s(...d){const o=e.length>d.length;let c;o&&d.push(l);try{c=e.apply(this,d)}catch(u){const m=u;if(o&&i)throw m;return l(m)}o||(c&&c.then&&typeof c.then=="function"?c.then(h,l):c instanceof Error?l(c):h(c))}function l(d,...o){i||(i=!0,n(d,...o))}function h(d){l(null,d)}}const yr={basename:sP,dirname:aP,extname:oP,join:lP,sep:"/"};function sP(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Vl(e);let i=0,s=-1,l=e.length,h;if(n===void 0||n.length===0||n.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(h){i=l+1;break}}else s<0&&(h=!0,s=l+1);return s<0?"":e.slice(i,s)}if(n===e)return"";let d=-1,o=n.length-1;for(;l--;)if(e.codePointAt(l)===47){if(h){i=l+1;break}}else d<0&&(h=!0,d=l+1),o>-1&&(e.codePointAt(l)===n.codePointAt(o--)?o<0&&(s=l):(o=-1,s=d));return i===s?s=d:s<0&&(s=e.length),e.slice(i,s)}function aP(e){if(Vl(e),e.length===0)return".";let n=-1,i=e.length,s;for(;--i;)if(e.codePointAt(i)===47){if(s){n=i;break}}else s||(s=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function oP(e){Vl(e);let n=e.length,i=-1,s=0,l=-1,h=0,d;for(;n--;){const o=e.codePointAt(n);if(o===47){if(d){s=n+1;break}continue}i<0&&(d=!0,i=n+1),o===46?l<0?l=n:h!==1&&(h=1):l>-1&&(h=-1)}return l<0||i<0||h===0||h===1&&l===i-1&&l===s+1?"":e.slice(l,i)}function lP(...e){let n=-1,i;for(;++n<e.length;)Vl(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":cP(i)}function cP(e){Vl(e);const n=e.codePointAt(0)===47;let i=uP(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function uP(e,n){let i="",s=0,l=-1,h=0,d=-1,o,c;for(;++d<=e.length;){if(d<e.length)o=e.codePointAt(d);else{if(o===47)break;o=47}if(o===47){if(!(l===d-1||h===1))if(l!==d-1&&h===2){if(i.length<2||s!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(c=i.lastIndexOf("/"),c!==i.length-1){c<0?(i="",s=0):(i=i.slice(0,c),s=i.length-1-i.lastIndexOf("/")),l=d,h=0;continue}}else if(i.length>0){i="",s=0,l=d,h=0;continue}}n&&(i=i.length>0?i+"/..":"..",s=2)}else i.length>0?i+="/"+e.slice(l+1,d):i=e.slice(l+1,d),s=d-l-1;l=d,h=0}else o===46&&h>-1?h++:h=-1}return i}function Vl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dP={cwd:hP};function hP(){return"/"}function xm(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function fP(e){if(typeof e=="string")e=new URL(e);else if(!xm(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return pP(e)}function pP(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const n=e.pathname;let i=-1;for(;++i<n.length;)if(n.codePointAt(i)===37&&n.codePointAt(i+1)===50){const s=n.codePointAt(i+2);if(s===70||s===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(n)}const Mp=["history","path","basename","stem","extname","dirname"];class fk{constructor(n){let i;n?xm(n)?i={path:n}:typeof n=="string"||mP(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":dP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<Mp.length;){const h=Mp[s];h in i&&i[h]!==void 0&&i[h]!==null&&(this[h]=h==="history"?[...i[h]]:i[h])}let l;for(l in i)Mp.includes(l)||(this[l]=i[l])}get basename(){return typeof this.path=="string"?yr.basename(this.path):void 0}set basename(n){jp(n,"basename"),Np(n,"basename"),this.path=yr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?yr.dirname(this.path):void 0}set dirname(n){cx(this.basename,"dirname"),this.path=yr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?yr.extname(this.path):void 0}set extname(n){if(Np(n,"extname"),cx(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=yr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){xm(n)&&(n=fP(n)),jp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?yr.basename(this.path,this.extname):void 0}set stem(n){jp(n,"stem"),Np(n,"stem"),this.path=yr.join(this.dirname||"",n+(this.extname||""))}fail(n,i,s){const l=this.message(n,i,s);throw l.fatal=!0,l}info(n,i,s){const l=this.message(n,i,s);return l.fatal=void 0,l}message(n,i,s){const l=new an(n,i,s);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Np(e,n){if(e&&e.includes(yr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+yr.sep+"`")}function jp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function cx(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function mP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gP=(function(e){const s=this.constructor.prototype,l=s[e],h=function(){return l.apply(h,arguments)};return Object.setPrototypeOf(h,s),h}),vP={}.hasOwnProperty;class Ng extends gP{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=rP()}copy(){const n=new Ng;let i=-1;for(;++i<this.attachers.length;){const s=this.attachers[i];n.use(...s)}return n.data(Dp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?(Ip("data",this.frozen),this.namespace[n]=i,this):vP.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Ip("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const l=i.call(n,...s);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const i=yu(n),s=this.parser||this.Parser;return Op("parse",s),s(String(i),i)}process(n,i){const s=this;return this.freeze(),Op("process",this.parser||this.Parser),Lp("process",this.compiler||this.Compiler),i?l(void 0,i):new Promise(l);function l(h,d){const o=yu(n),c=s.parse(o);s.run(c,o,function(m,f,y){if(m||!f||!y)return u(m);const S=f,k=s.stringify(S,y);bP(k)?y.value=k:y.result=k,u(m,y)});function u(m,f){m||!f?d(m):h?h(f):i(void 0,f)}}}processSync(n){let i=!1,s;return this.freeze(),Op("processSync",this.parser||this.Parser),Lp("processSync",this.compiler||this.Compiler),this.process(n,l),dx("processSync","process",i),s;function l(h,d){i=!0,ox(h),s=d}}run(n,i,s){ux(n),this.freeze();const l=this.transformers;return!s&&typeof i=="function"&&(s=i,i=void 0),s?h(void 0,s):new Promise(h);function h(d,o){const c=yu(i);l.run(n,c,u);function u(m,f,y){const S=f||n;m?o(m):d?d(S):s(void 0,S,y)}}}runSync(n,i){let s=!1,l;return this.run(n,i,h),dx("runSync","run",s),l;function h(d,o){ox(d),l=o,s=!0}}stringify(n,i){this.freeze();const s=yu(i),l=this.compiler||this.Compiler;return Lp("stringify",l),ux(n),l(n,s)}use(n,...i){const s=this.attachers,l=this.namespace;if(Ip("use",this.frozen),n!=null)if(typeof n=="function")c(n,i);else if(typeof n=="object")Array.isArray(n)?o(n):d(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function h(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[m,...f]=u;c(m,f)}else d(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function d(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(l.settings=Dp(!0,l.settings,u.settings))}function o(u){let m=-1;if(u!=null)if(Array.isArray(u))for(;++m<u.length;){const f=u[m];h(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,m){let f=-1,y=-1;for(;++f<s.length;)if(s[f][0]===u){y=f;break}if(y===-1)s.push([u,...m]);else if(m.length>0){let[S,...k]=m;const w=s[y][1];bm(w)&&bm(S)&&(S=Dp(!0,w,S)),s[y]=[u,S,...k]}}}}const _P=new Ng().freeze();function Op(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ip(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ux(e){if(!bm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function dx(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function yu(e){return yP(e)?e:new fk(e)}function yP(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function bP(e){return typeof e=="string"||xP(e)}function xP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const SP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",hx=[],fx={allowDangerousHtml:!0},wP=/^(https?|ircs?|mailto|xmpp)$/i,CP=[{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 kP(e){const n=EP(e),i=AP(e);return TP(n.runSync(n.parse(i),i),e)}function EP(e){const n=e.rehypePlugins||hx,i=e.remarkPlugins||hx,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fx}:fx;return _P().use(az).use(i).use(eP,s).use(n)}function AP(e){const n=e.children||"",i=new fk;return typeof n=="string"&&(i.value=n),i}function TP(e,n){const i=n.allowedElements,s=n.allowElement,l=n.components,h=n.disallowedElements,d=n.skipHtml,o=n.unwrapDisallowed,c=n.urlTransform||RP;for(const m of CP)Object.hasOwn(n,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+SP+m.id,void 0);return Mg(e,u),$6(e,{Fragment:g.Fragment,components:l,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function u(m,f,y){if(m.type==="raw"&&y&&typeof f=="number")return d?y.children.splice(f,1):y.children[f]={type:"text",value:m.value},f;if(m.type==="element"){let S;for(S in Ep)if(Object.hasOwn(Ep,S)&&Object.hasOwn(m.properties,S)){const k=m.properties[S],w=Ep[S];(w===null||w.includes(m.tagName))&&(m.properties[S]=c(String(k||""),S,m))}}if(m.type==="element"){let S=i?!i.includes(m.tagName):h?h.includes(m.tagName):!1;if(!S&&s&&typeof f=="number"&&(S=!s(m,f,y)),S&&y&&typeof f=="number")return o&&m.children?y.children.splice(f,1,...m.children):y.children.splice(f,1),f}}}function RP(e){const n=e.indexOf(":"),i=e.indexOf("?"),s=e.indexOf("#"),l=e.indexOf("/");return n===-1||l!==-1&&n>l||i!==-1&&n>i||s!==-1&&n>s||wP.test(e.slice(0,n))?e:""}function px(e,n){const i=String(e);if(typeof n!="string")throw new TypeError("Expected character");let s=0,l=i.indexOf(n);for(;l!==-1;)s++,l=i.indexOf(n,l+n.length);return s}function DP(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function MP(e,n,i){const l=Id((i||{}).ignore||[]),h=NP(n);let d=-1;for(;++d<h.length;)hk(e,"text",o);function o(u,m){let f=-1,y;for(;++f<m.length;){const S=m[f],k=y?y.children:void 0;if(l(S,k?k.indexOf(S):void 0,y))return;y=S}if(y)return c(u,m)}function c(u,m){const f=m[m.length-1],y=h[d][0],S=h[d][1];let k=0;const _=f.children.indexOf(u);let b=!1,v=[];y.lastIndex=0;let x=y.exec(u.value);for(;x;){const E=x.index,M={index:x.index,input:x.input,stack:[...m,u]};let R=S(...x,M);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?y.lastIndex=E+1:(k!==E&&v.push({type:"text",value:u.value.slice(k,E)}),Array.isArray(R)?v.push(...R):R&&v.push(R),k=E+x[0].length,b=!0),!y.global)break;x=y.exec(u.value)}return b?(k<u.value.length&&v.push({type:"text",value:u.value.slice(k)}),f.children.splice(_,1,...v)):v=[u],_+v.length}}function NP(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const i=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<i.length;){const l=i[s];n.push([jP(l[0]),OP(l[1])])}return n}function jP(e){return typeof e=="string"?new RegExp(DP(e),"g"):e}function OP(e){return typeof e=="function"?e:function(){return e}}const Bp="phrasing",zp=["autolink","link","image","label"];function LP(){return{transforms:[UP],enter:{literalAutolink:BP,literalAutolinkEmail:Pp,literalAutolinkHttp:Pp,literalAutolinkWww:Pp},exit:{literalAutolink:HP,literalAutolinkEmail:FP,literalAutolinkHttp:zP,literalAutolinkWww:PP}}}function IP(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bp,notInConstruct:zp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bp,notInConstruct:zp},{character:":",before:"[ps]",after:"\\/",inConstruct:Bp,notInConstruct:zp}]}}function BP(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Pp(e){this.config.enter.autolinkProtocol.call(this,e)}function zP(e){this.config.exit.autolinkProtocol.call(this,e)}function PP(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function FP(e){this.config.exit.autolinkEmail.call(this,e)}function HP(e){this.exit(e)}function UP(e){MP(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$P],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),qP]],{ignore:["link","linkReference"]})}function $P(e,n,i,s,l){let h="";if(!pk(l)||(/^w/i.test(n)&&(i=n+i,n="",h="http://"),!VP(i)))return!1;const d=GP(i+s);if(!d[0])return!1;const o={type:"link",title:null,url:h+n+d[0],children:[{type:"text",value:n+d[0]}]};return d[1]?[o,{type:"text",value:d[1]}]:o}function qP(e,n,i,s){return!pk(s,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function VP(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function GP(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let i=n[0],s=i.indexOf(")");const l=px(e,"(");let h=px(e,")");for(;s!==-1&&l>h;)e+=i.slice(0,s+1),i=i.slice(s+1),s=i.indexOf(")"),h++;return[e,i]}function pk(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||Ts(i)||jd(i))&&(!n||i!==47)}mk.peek=t8;function WP(){this.buffer()}function KP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function YP(){this.buffer()}function XP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function ZP(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=ar(this.sliceSerialize(e)).toLowerCase(),i.label=n}function QP(e){this.exit(e)}function JP(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=ar(this.sliceSerialize(e)).toLowerCase(),i.label=n}function e8(e){this.exit(e)}function t8(){return"["}function mk(e,n,i,s){const l=i.createTracker(s);let h=l.move("[^");const d=i.enter("footnoteReference"),o=i.enter("reference");return h+=l.move(i.safe(i.associationId(e),{after:"]",before:h})),o(),d(),h+=l.move("]"),h}function n8(){return{enter:{gfmFootnoteCallString:WP,gfmFootnoteCall:KP,gfmFootnoteDefinitionLabelString:YP,gfmFootnoteDefinition:XP},exit:{gfmFootnoteCallString:ZP,gfmFootnoteCall:QP,gfmFootnoteDefinitionLabelString:JP,gfmFootnoteDefinition:e8}}}function r8(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:mk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(s,l,h,d){const o=h.createTracker(d);let c=o.move("[^");const u=h.enter("footnoteDefinition"),m=h.enter("label");return c+=o.move(h.safe(h.associationId(s),{before:c,after:"]"})),m(),c+=o.move("]:"),s.children&&s.children.length>0&&(o.shift(4),c+=o.move((n?`
485
- `:" ")+h.indentLines(h.containerFlow(s,o.current()),n?gk:i8))),u(),c}}function i8(e,n,i){return n===0?e:gk(e,n,i)}function gk(e,n,i){return(i?"":" ")+e}const s8=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];vk.peek=u8;function a8(){return{canContainEols:["delete"],enter:{strikethrough:l8},exit:{strikethrough:c8}}}function o8(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:s8}],handlers:{delete:vk}}}function l8(e){this.enter({type:"delete",children:[]},e)}function c8(e){this.exit(e)}function vk(e,n,i,s){const l=i.createTracker(s),h=i.enter("strikethrough");let d=l.move("~~");return d+=i.containerPhrasing(e,{...l.current(),before:d,after:"~"}),d+=l.move("~~"),h(),d}function u8(){return"~"}function d8(e){return e.length}function h8(e,n){const i=n||{},s=(i.align||[]).concat(),l=i.stringLength||d8,h=[],d=[],o=[],c=[];let u=0,m=-1;for(;++m<e.length;){const w=[],_=[];let b=-1;for(e[m].length>u&&(u=e[m].length);++b<e[m].length;){const v=f8(e[m][b]);if(i.alignDelimiters!==!1){const x=l(v);_[b]=x,(c[b]===void 0||x>c[b])&&(c[b]=x)}w.push(v)}d[m]=w,o[m]=_}let f=-1;if(typeof s=="object"&&"length"in s)for(;++f<u;)h[f]=mx(s[f]);else{const w=mx(s);for(;++f<u;)h[f]=w}f=-1;const y=[],S=[];for(;++f<u;){const w=h[f];let _="",b="";w===99?(_=":",b=":"):w===108?_=":":w===114&&(b=":");let v=i.alignDelimiters===!1?1:Math.max(1,c[f]-_.length-b.length);const x=_+"-".repeat(v)+b;i.alignDelimiters!==!1&&(v=_.length+v+b.length,v>c[f]&&(c[f]=v),S[f]=v),y[f]=x}d.splice(1,0,y),o.splice(1,0,S),m=-1;const k=[];for(;++m<d.length;){const w=d[m],_=o[m];f=-1;const b=[];for(;++f<u;){const v=w[f]||"";let x="",E="";if(i.alignDelimiters!==!1){const M=c[f]-(_[f]||0),R=h[f];R===114?x=" ".repeat(M):R===99?M%2?(x=" ".repeat(M/2+.5),E=" ".repeat(M/2-.5)):(x=" ".repeat(M/2),E=x):E=" ".repeat(M)}i.delimiterStart!==!1&&!f&&b.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&v==="")&&(i.delimiterStart!==!1||f)&&b.push(" "),i.alignDelimiters!==!1&&b.push(x),b.push(v),i.alignDelimiters!==!1&&b.push(E),i.padding!==!1&&b.push(" "),(i.delimiterEnd!==!1||f!==u-1)&&b.push("|")}k.push(i.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return k.join(`
486
- `)}function f8(e){return e==null?"":String(e)}function mx(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function p8(e,n,i,s){const l=i.enter("blockquote"),h=i.createTracker(s);h.move("> "),h.shift(2);const d=i.indentLines(i.containerFlow(e,h.current()),m8);return l(),d}function m8(e,n,i){return">"+(i?"":" ")+e}function g8(e,n){return gx(e,n.inConstruct,!0)&&!gx(e,n.notInConstruct,!1)}function gx(e,n,i){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return i;let s=-1;for(;++s<n.length;)if(e.includes(n[s]))return!0;return!1}function vx(e,n,i,s){let l=-1;for(;++l<i.unsafe.length;)if(i.unsafe[l].character===`
487
- `&&g8(i.stack,i.unsafe[l]))return/[ \t]/.test(s.before)?"":" ";return`\\
488
- `}function v8(e,n){const i=String(e);let s=i.indexOf(n),l=s,h=0,d=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++h>d&&(d=h):h=1,l=s+n.length,s=i.indexOf(n,l);return d}function _8(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function y8(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function b8(e,n,i,s){const l=y8(i),h=e.value||"",d=l==="`"?"GraveAccent":"Tilde";if(_8(e,i)){const f=i.enter("codeIndented"),y=i.indentLines(h,x8);return f(),y}const o=i.createTracker(s),c=l.repeat(Math.max(v8(h,l)+1,3)),u=i.enter("codeFenced");let m=o.move(c);if(e.lang){const f=i.enter(`codeFencedLang${d}`);m+=o.move(i.safe(e.lang,{before:m,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=i.enter(`codeFencedMeta${d}`);m+=o.move(" "),m+=o.move(i.safe(e.meta,{before:m,after:`
489
- `,encode:["`"],...o.current()})),f()}return m+=o.move(`
490
- `),h&&(m+=o.move(h+`
491
- `)),m+=o.move(c),u(),m}function x8(e,n,i){return(i?"":" ")+e}function jg(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function S8(e,n,i,s){const l=jg(i),h=l==='"'?"Quote":"Apostrophe",d=i.enter("definition");let o=i.enter("label");const c=i.createTracker(s);let u=c.move("[");return u+=c.move(i.safe(i.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=i.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(i.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=i.enter("destinationRaw"),u+=c.move(i.safe(e.url,{before:u,after:e.title?" ":`
492
- `,...c.current()}))),o(),e.title&&(o=i.enter(`title${h}`),u+=c.move(" "+l),u+=c.move(i.safe(e.title,{before:u,after:l,...c.current()})),u+=c.move(l),o()),d(),u}function w8(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function Cl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Wu(e,n,i){const s=Pa(e),l=Pa(n);return s===void 0?l===void 0?i==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_k.peek=C8;function _k(e,n,i,s){const l=w8(i),h=i.enter("emphasis"),d=i.createTracker(s),o=d.move(l);let c=d.move(i.containerPhrasing(e,{after:l,before:o,...d.current()}));const u=c.charCodeAt(0),m=Wu(s.before.charCodeAt(s.before.length-1),u,l);m.inside&&(c=Cl(u)+c.slice(1));const f=c.charCodeAt(c.length-1),y=Wu(s.after.charCodeAt(0),f,l);y.inside&&(c=c.slice(0,-1)+Cl(f));const S=d.move(l);return h(),i.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},o+c+S}function C8(e,n,i){return i.options.emphasis||"*"}function k8(e,n){let i=!1;return Mg(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return i=!0,_m}),!!((!e.depth||e.depth<3)&&Cg(e)&&(n.options.setext||i))}function E8(e,n,i,s){const l=Math.max(Math.min(6,e.depth||1),1),h=i.createTracker(s);if(k8(e,i)){const m=i.enter("headingSetext"),f=i.enter("phrasing"),y=i.containerPhrasing(e,{...h.current(),before:`
493
- `,after:`
494
- `});return f(),m(),y+`
495
- `+(l===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
496
- `))+1))}const d="#".repeat(l),o=i.enter("headingAtx"),c=i.enter("phrasing");h.move(d+" ");let u=i.containerPhrasing(e,{before:"# ",after:`
497
- `,...h.current()});return/^[\t ]/.test(u)&&(u=Cl(u.charCodeAt(0))+u.slice(1)),u=u?d+" "+u:d,i.options.closeAtx&&(u+=" "+d),c(),o(),u}yk.peek=A8;function yk(e){return e.value||""}function A8(){return"<"}bk.peek=T8;function bk(e,n,i,s){const l=jg(i),h=l==='"'?"Quote":"Apostrophe",d=i.enter("image");let o=i.enter("label");const c=i.createTracker(s);let u=c.move("![");return u+=c.move(i.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=i.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(i.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=i.enter("destinationRaw"),u+=c.move(i.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=i.enter(`title${h}`),u+=c.move(" "+l),u+=c.move(i.safe(e.title,{before:u,after:l,...c.current()})),u+=c.move(l),o()),u+=c.move(")"),d(),u}function T8(){return"!"}xk.peek=R8;function xk(e,n,i,s){const l=e.referenceType,h=i.enter("imageReference");let d=i.enter("label");const o=i.createTracker(s);let c=o.move("![");const u=i.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),d();const m=i.stack;i.stack=[],d=i.enter("reference");const f=i.safe(i.associationId(e),{before:c,after:"]",...o.current()});return d(),i.stack=m,h(),l==="full"||!u||u!==f?c+=o.move(f+"]"):l==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function R8(){return"!"}Sk.peek=D8;function Sk(e,n,i){let s=e.value||"",l="`",h=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(s);)l+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++h<i.unsafe.length;){const d=i.unsafe[h],o=i.compilePattern(d);let c;if(d.atBreak)for(;c=o.exec(s);){let u=c.index;s.charCodeAt(u)===10&&s.charCodeAt(u-1)===13&&u--,s=s.slice(0,u)+" "+s.slice(c.index+1)}}return l+s+l}function D8(){return"`"}function wk(e,n){const i=Cg(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(i===e.url||"mailto:"+i===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ck.peek=M8;function Ck(e,n,i,s){const l=jg(i),h=l==='"'?"Quote":"Apostrophe",d=i.createTracker(s);let o,c;if(wk(e,i)){const m=i.stack;i.stack=[],o=i.enter("autolink");let f=d.move("<");return f+=d.move(i.containerPhrasing(e,{before:f,after:">",...d.current()})),f+=d.move(">"),o(),i.stack=m,f}o=i.enter("link"),c=i.enter("label");let u=d.move("[");return u+=d.move(i.containerPhrasing(e,{before:u,after:"](",...d.current()})),u+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=i.enter("destinationLiteral"),u+=d.move("<"),u+=d.move(i.safe(e.url,{before:u,after:">",...d.current()})),u+=d.move(">")):(c=i.enter("destinationRaw"),u+=d.move(i.safe(e.url,{before:u,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=i.enter(`title${h}`),u+=d.move(" "+l),u+=d.move(i.safe(e.title,{before:u,after:l,...d.current()})),u+=d.move(l),c()),u+=d.move(")"),o(),u}function M8(e,n,i){return wk(e,i)?"<":"["}kk.peek=N8;function kk(e,n,i,s){const l=e.referenceType,h=i.enter("linkReference");let d=i.enter("label");const o=i.createTracker(s);let c=o.move("[");const u=i.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),d();const m=i.stack;i.stack=[],d=i.enter("reference");const f=i.safe(i.associationId(e),{before:c,after:"]",...o.current()});return d(),i.stack=m,h(),l==="full"||!u||u!==f?c+=o.move(f+"]"):l==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function N8(){return"["}function Og(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function j8(e){const n=Og(e),i=e.options.bulletOther;if(!i)return n==="*"?"-":"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(i===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+i+"`) to be different");return i}function O8(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function Ek(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function L8(e,n,i,s){const l=i.enter("list"),h=i.bulletCurrent;let d=e.ordered?O8(i):Og(i);const o=e.ordered?d==="."?")":".":j8(i);let c=n&&i.bulletLastUsed?d===i.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&m&&(!m.children||!m.children[0])&&i.stack[i.stack.length-1]==="list"&&i.stack[i.stack.length-2]==="listItem"&&i.stack[i.stack.length-3]==="list"&&i.stack[i.stack.length-4]==="listItem"&&i.indexStack[i.indexStack.length-1]===0&&i.indexStack[i.indexStack.length-2]===0&&i.indexStack[i.indexStack.length-3]===0&&(c=!0),Ek(i)===d&&m){let f=-1;for(;++f<e.children.length;){const y=e.children[f];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(d=o),i.bulletCurrent=d;const u=i.containerFlow(e,s);return i.bulletLastUsed=d,i.bulletCurrent=h,l(),u}function I8(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function B8(e,n,i,s){const l=I8(i);let h=i.bulletCurrent||Og(i);n&&n.type==="list"&&n.ordered&&(h=(typeof n.start=="number"&&n.start>-1?n.start:1)+(i.options.incrementListMarker===!1?0:n.children.indexOf(e))+h);let d=h.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(d=Math.ceil(d/4)*4);const o=i.createTracker(s);o.move(h+" ".repeat(d-h.length)),o.shift(d);const c=i.enter("listItem"),u=i.indentLines(i.containerFlow(e,o.current()),m);return c(),u;function m(f,y,S){return y?(S?"":" ".repeat(d))+f:(S?h:h+" ".repeat(d-h.length))+f}}function z8(e,n,i,s){const l=i.enter("paragraph"),h=i.enter("phrasing"),d=i.containerPhrasing(e,s);return h(),l(),d}const P8=Id(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function F8(e,n,i,s){return(e.children.some(function(d){return P8(d)})?i.containerPhrasing:i.containerFlow).call(i,e,s)}function H8(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Ak.peek=U8;function Ak(e,n,i,s){const l=H8(i),h=i.enter("strong"),d=i.createTracker(s),o=d.move(l+l);let c=d.move(i.containerPhrasing(e,{after:l,before:o,...d.current()}));const u=c.charCodeAt(0),m=Wu(s.before.charCodeAt(s.before.length-1),u,l);m.inside&&(c=Cl(u)+c.slice(1));const f=c.charCodeAt(c.length-1),y=Wu(s.after.charCodeAt(0),f,l);y.inside&&(c=c.slice(0,-1)+Cl(f));const S=d.move(l+l);return h(),i.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},o+c+S}function U8(e,n,i){return i.options.strong||"*"}function $8(e,n,i,s){return i.safe(e.value,s)}function q8(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function V8(e,n,i){const s=(Ek(i)+(i.options.ruleSpaces?" ":"")).repeat(q8(i));return i.options.ruleSpaces?s.slice(0,-1):s}const Tk={blockquote:p8,break:vx,code:b8,definition:S8,emphasis:_k,hardBreak:vx,heading:E8,html:yk,image:bk,imageReference:xk,inlineCode:Sk,link:Ck,linkReference:kk,list:L8,listItem:B8,paragraph:z8,root:F8,strong:Ak,text:$8,thematicBreak:V8};function G8(){return{enter:{table:W8,tableData:_x,tableHeader:_x,tableRow:Y8},exit:{codeText:X8,table:K8,tableData:Fp,tableHeader:Fp,tableRow:Fp}}}function W8(e){const n=e._align;this.enter({type:"table",align:n.map(function(i){return i==="none"?null:i}),children:[]},e),this.data.inTable=!0}function K8(e){this.exit(e),this.data.inTable=void 0}function Y8(e){this.enter({type:"tableRow",children:[]},e)}function Fp(e){this.exit(e)}function _x(e){this.enter({type:"tableCell",children:[]},e)}function X8(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Z8));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function Z8(e,n){return n==="|"?n:e}function Q8(e){const n=e||{},i=n.tableCellPadding,s=n.tablePipeAlign,l=n.stringLength,h=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
498
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:d,tableCell:c,tableRow:o}};function d(S,k,w,_){return u(m(S,w,_),S.align)}function o(S,k,w,_){const b=f(S,w,_),v=u([b]);return v.slice(0,v.indexOf(`
499
- `))}function c(S,k,w,_){const b=w.enter("tableCell"),v=w.enter("phrasing"),x=w.containerPhrasing(S,{..._,before:h,after:h});return v(),b(),x}function u(S,k){return h8(S,{align:k,alignDelimiters:s,padding:i,stringLength:l})}function m(S,k,w){const _=S.children;let b=-1;const v=[],x=k.enter("table");for(;++b<_.length;)v[b]=f(_[b],k,w);return x(),v}function f(S,k,w){const _=S.children;let b=-1;const v=[],x=k.enter("tableRow");for(;++b<_.length;)v[b]=c(_[b],S,k,w);return x(),v}function y(S,k,w){let _=Tk.inlineCode(S,k,w);return w.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function J8(){return{exit:{taskListCheckValueChecked:yx,taskListCheckValueUnchecked:yx,paragraph:t9}}}function e9(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:n9}}}function yx(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function t9(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const i=this.stack[this.stack.length-1];i.type;const s=i.children[0];if(s&&s.type==="text"){const l=n.children;let h=-1,d;for(;++h<l.length;){const o=l[h];if(o.type==="paragraph"){d=o;break}}d===i&&(s.value=s.value.slice(1),s.value.length===0?i.children.shift():i.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,i.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function n9(e,n,i,s){const l=e.children[0],h=typeof e.checked=="boolean"&&l&&l.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",o=i.createTracker(s);h&&o.move(d);let c=Tk.listItem(e,n,i,{...s,...o.current()});return h&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(m){return m+d}}function r9(){return[LP(),n8(),a8(),G8(),J8()]}function i9(e){return{extensions:[IP(),r8(e),o8(),Q8(e),e9()]}}const s9={tokenize:d9,partial:!0},Rk={tokenize:h9,partial:!0},Dk={tokenize:f9,partial:!0},Mk={tokenize:p9,partial:!0},a9={tokenize:m9,partial:!0},Nk={name:"wwwAutolink",tokenize:c9,previous:Ok},jk={name:"protocolAutolink",tokenize:u9,previous:Lk},ri={name:"emailAutolink",tokenize:l9,previous:Ik},Er={};function o9(){return{text:Er}}let bs=48;for(;bs<123;)Er[bs]=ri,bs++,bs===58?bs=65:bs===91&&(bs=97);Er[43]=ri;Er[45]=ri;Er[46]=ri;Er[95]=ri;Er[72]=[ri,jk];Er[104]=[ri,jk];Er[87]=[ri,Nk];Er[119]=[ri,Nk];function l9(e,n,i){const s=this;let l,h;return d;function d(f){return!Sm(f)||!Ik.call(s,s.previous)||Lg(s.events)?i(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Sm(f)?(e.consume(f),o):f===64?(e.consume(f),c):i(f)}function c(f){return f===46?e.check(a9,m,u)(f):f===45||f===95||sn(f)?(h=!0,e.consume(f),c):m(f)}function u(f){return e.consume(f),l=!0,c}function m(f){return h&&l&&dn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(f)):i(f)}}function c9(e,n,i){const s=this;return l;function l(d){return d!==87&&d!==119||!Ok.call(s,s.previous)||Lg(s.events)?i(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(s9,e.attempt(Rk,e.attempt(Dk,h),i),i)(d))}function h(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(d)}}function u9(e,n,i){const s=this;let l="",h=!1;return d;function d(f){return(f===72||f===104)&&Lk.call(s,s.previous)&&!Lg(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(f),e.consume(f),o):i(f)}function o(f){if(dn(f)&&l.length<5)return l+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const y=l.toLowerCase();if(y==="http"||y==="https")return e.consume(f),c}return i(f)}function c(f){return f===47?(e.consume(f),h?u:(h=!0,c)):i(f)}function u(f){return f===null||qu(f)||_t(f)||Ts(f)||jd(f)?i(f):e.attempt(Rk,e.attempt(Dk,m),i)(f)}function m(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(f)}}function d9(e,n,i){let s=0;return l;function l(d){return(d===87||d===119)&&s<3?(s++,e.consume(d),l):d===46&&s===3?(e.consume(d),h):i(d)}function h(d){return d===null?i(d):n(d)}}function h9(e,n,i){let s,l,h;return d;function d(u){return u===46||u===95?e.check(Mk,c,o)(u):u===null||_t(u)||Ts(u)||u!==45&&jd(u)?c(u):(h=!0,e.consume(u),d)}function o(u){return u===95?s=!0:(l=s,s=void 0),e.consume(u),d}function c(u){return l||s||!h?i(u):n(u)}}function f9(e,n){let i=0,s=0;return l;function l(d){return d===40?(i++,e.consume(d),l):d===41&&s<i?h(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(Mk,n,h)(d):d===null||_t(d)||Ts(d)?n(d):(e.consume(d),l)}function h(d){return d===41&&s++,e.consume(d),l}}function p9(e,n,i){return s;function s(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),s):o===38?(e.consume(o),h):o===93?(e.consume(o),l):o===60||o===null||_t(o)||Ts(o)?n(o):i(o)}function l(o){return o===null||o===40||o===91||_t(o)||Ts(o)?n(o):s(o)}function h(o){return dn(o)?d(o):i(o)}function d(o){return o===59?(e.consume(o),s):dn(o)?(e.consume(o),d):i(o)}}function m9(e,n,i){return s;function s(h){return e.consume(h),l}function l(h){return sn(h)?i(h):n(h)}}function Ok(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_t(e)}function Lk(e){return!dn(e)}function Ik(e){return!(e===47||Sm(e))}function Sm(e){return e===43||e===45||e===46||e===95||sn(e)}function Lg(e){let n=e.length,i=!1;for(;n--;){const s=e[n][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){i=!0;break}if(s._gfmAutolinkLiteralWalkedInto){i=!1;break}}return e.length>0&&!i&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),i}const g9={tokenize:C9,partial:!0};function v9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:x9,continuation:{tokenize:S9},exit:w9}},text:{91:{name:"gfmFootnoteCall",tokenize:b9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:_9,resolveTo:y9}}}}function _9(e,n,i){const s=this;let l=s.events.length;const h=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let d;for(;l--;){const c=s.events[l][1];if(c.type==="labelImage"){d=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!d||!d._balanced)return i(c);const u=ar(s.sliceSerialize({start:d.end,end:s.now()}));return u.codePointAt(0)!==94||!h.includes(u.slice(1))?i(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function y9(e,n){let i=e.length;for(;i--;)if(e[i][1].type==="labelImage"&&e[i][0]==="enter"){e[i][1];break}e[i+1][1].type="data",e[i+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[i+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[i+3][1].end),end:Object.assign({},e[i+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const h={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},h.start),end:Object.assign({},h.end)},o=[e[i+1],e[i+2],["enter",s,n],e[i+3],e[i+4],["enter",l,n],["exit",l,n],["enter",h,n],["enter",d,n],["exit",d,n],["exit",h,n],e[e.length-2],e[e.length-1],["exit",s,n]];return e.splice(i,e.length-i+1,...o),e}function b9(e,n,i){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let h=0,d;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?i(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(h>999||f===93&&!d||f===null||f===91||_t(f))return i(f);if(f===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(ar(s.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(f)}return _t(f)||(d=!0),h++,e.consume(f),f===92?m:u}function m(f){return f===91||f===92||f===93?(e.consume(f),h++,u):u(f)}}function x9(e,n,i){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let h,d=0,o;return c;function c(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):i(k)}function m(k){if(d>999||k===93&&!o||k===null||k===91||_t(k))return i(k);if(k===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return h=ar(s.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return _t(k)||(o=!0),d++,e.consume(k),k===92?f:m}function f(k){return k===91||k===92||k===93?(e.consume(k),d++,m):m(k)}function y(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(h)||l.push(h),rt(e,S,"gfmFootnoteDefinitionWhitespace")):i(k)}function S(k){return n(k)}}function S9(e,n,i){return e.check(ql,n,e.attempt(g9,n,i))}function w9(e){e.exit("gfmFootnoteDefinition")}function C9(e,n,i){const s=this;return rt(e,l,"gfmFootnoteDefinitionIndent",5);function l(h){const d=s.events[s.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?n(h):i(h)}}function k9(e){let i=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:h,resolveAll:l};return i==null&&(i=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function l(d,o){let c=-1;for(;++c<d.length;)if(d[c][0]==="enter"&&d[c][1].type==="strikethroughSequenceTemporary"&&d[c][1]._close){let u=c;for(;u--;)if(d[u][0]==="exit"&&d[u][1].type==="strikethroughSequenceTemporary"&&d[u][1]._open&&d[c][1].end.offset-d[c][1].start.offset===d[u][1].end.offset-d[u][1].start.offset){d[c][1].type="strikethroughSequence",d[u][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},d[u][1].start),end:Object.assign({},d[c][1].end)},f={type:"strikethroughText",start:Object.assign({},d[u][1].end),end:Object.assign({},d[c][1].start)},y=[["enter",m,o],["enter",d[u][1],o],["exit",d[u][1],o],["enter",f,o]],S=o.parser.constructs.insideSpan.null;S&&In(y,y.length,0,Od(S,d.slice(u+1,c),o)),In(y,y.length,0,[["exit",f,o],["enter",d[c][1],o],["exit",d[c][1],o],["exit",m,o]]),In(d,u-1,c-u+3,y),c=u+y.length-2;break}}for(c=-1;++c<d.length;)d[c][1].type==="strikethroughSequenceTemporary"&&(d[c][1].type="data");return d}function h(d,o,c){const u=this.previous,m=this.events;let f=0;return y;function y(k){return u===126&&m[m.length-1][1].type!=="characterEscape"?c(k):(d.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const w=Pa(u);if(k===126)return f>1?c(k):(d.consume(k),f++,S);if(f<2&&!i)return c(k);const _=d.exit("strikethroughSequenceTemporary"),b=Pa(k);return _._open=!b||b===2&&!!w,_._close=!w||w===2&&!!b,o(k)}}}class E9{constructor(){this.map=[]}add(n,i,s){A9(this,n,i,s)}consume(n){if(this.map.sort(function(h,d){return h[0]-d[0]}),this.map.length===0)return;let i=this.map.length;const s=[];for(;i>0;)i-=1,s.push(n.slice(this.map[i][0]+this.map[i][1]),this.map[i][2]),n.length=this.map[i][0];s.push(n.slice()),n.length=0;let l=s.pop();for(;l;){for(const h of l)n.push(h);l=s.pop()}this.map.length=0}}function A9(e,n,i,s){let l=0;if(!(i===0&&s.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=i,e.map[l][2].push(...s);return}l+=1}e.map.push([n,i,s])}}function T9(e,n){let i=!1;const s=[];for(;n<e.length;){const l=e[n];if(i){if(l[0]==="enter")l[1].type==="tableContent"&&s.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const h=s.length-1;s[h]=s[h]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(i=!0);n+=1}return s}function R9(){return{flow:{null:{name:"table",tokenize:D9,resolveAll:M9}}}}function D9(e,n,i){const s=this;let l=0,h=0,d;return o;function o(P){let U=s.events.length-1;for(;U>-1;){const K=s.events[U][1].type;if(K==="lineEnding"||K==="linePrefix")U--;else break}const q=U>-1?s.events[U][1].type:null,$=q==="tableHead"||q==="tableRow"?R:c;return $===R&&s.parser.lazy[s.now().line]?i(P):$(P)}function c(P){return e.enter("tableHead"),e.enter("tableRow"),u(P)}function u(P){return P===124||(d=!0,h+=1),m(P)}function m(P){return P===null?i(P):Be(P)?h>1?(h=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),S):i(P):Je(P)?rt(e,m,"whitespace")(P):(h+=1,d&&(d=!1,l+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),d=!0,m):(e.enter("data"),f(P)))}function f(P){return P===null||P===124||_t(P)?(e.exit("data"),m(P)):(e.consume(P),P===92?y:f)}function y(P){return P===92||P===124?(e.consume(P),f):f(P)}function S(P){return s.interrupt=!1,s.parser.lazy[s.now().line]?i(P):(e.enter("tableDelimiterRow"),d=!1,Je(P)?rt(e,k,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):k(P))}function k(P){return P===45||P===58?_(P):P===124?(d=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),w):M(P)}function w(P){return Je(P)?rt(e,_,"whitespace")(P):_(P)}function _(P){return P===58?(h+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),b):P===45?(h+=1,b(P)):P===null||Be(P)?E(P):M(P)}function b(P){return P===45?(e.enter("tableDelimiterFiller"),v(P)):M(P)}function v(P){return P===45?(e.consume(P),v):P===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(P))}function x(P){return Je(P)?rt(e,E,"whitespace")(P):E(P)}function E(P){return P===124?k(P):P===null||Be(P)?!d||l!==h?M(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(P)):M(P)}function M(P){return i(P)}function R(P){return e.enter("tableRow"),j(P)}function j(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),j):P===null||Be(P)?(e.exit("tableRow"),n(P)):Je(P)?rt(e,j,"whitespace")(P):(e.enter("data"),D(P))}function D(P){return P===null||P===124||_t(P)?(e.exit("data"),j(P)):(e.consume(P),P===92?O:D)}function O(P){return P===92||P===124?(e.consume(P),D):D(P)}}function M9(e,n){let i=-1,s=!0,l=0,h=[0,0,0,0],d=[0,0,0,0],o=!1,c=0,u,m,f;const y=new E9;for(;++i<e.length;){const S=e[i],k=S[1];S[0]==="enter"?k.type==="tableHead"?(o=!1,c!==0&&(bx(y,n,c,u,m),m=void 0,c=0),u={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(i,0,[["enter",u,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(s=!0,f=void 0,h=[0,0,0,0],d=[0,i+1,0,0],o&&(o=!1,m={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(i,0,[["enter",m,n]])),l=k.type==="tableDelimiterRow"?2:m?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(s=!1,d[2]===0&&(h[1]!==0&&(d[0]=d[1],f=bu(y,n,h,l,void 0,f),h=[0,0,0,0]),d[2]=i)):k.type==="tableCellDivider"&&(s?s=!1:(h[1]!==0&&(d[0]=d[1],f=bu(y,n,h,l,void 0,f)),h=d,d=[h[1],i,0,0])):k.type==="tableHead"?(o=!0,c=i):k.type==="tableRow"||k.type==="tableDelimiterRow"?(c=i,h[1]!==0?(d[0]=d[1],f=bu(y,n,h,l,i,f)):d[1]!==0&&(f=bu(y,n,d,l,i,f)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(d[3]=i)}for(c!==0&&bx(y,n,c,u,m),y.consume(n.events),i=-1;++i<n.events.length;){const S=n.events[i];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=T9(n.events,i))}return e}function bu(e,n,i,s,l,h){const d=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",o="tableContent";i[0]!==0&&(h.end=Object.assign({},xa(n.events,i[0])),e.add(i[0],0,[["exit",h,n]]));const c=xa(n.events,i[1]);if(h={type:d,start:Object.assign({},c),end:Object.assign({},c)},e.add(i[1],0,[["enter",h,n]]),i[2]!==0){const u=xa(n.events,i[2]),m=xa(n.events,i[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},m)};if(e.add(i[2],0,[["enter",f,n]]),s!==2){const y=n.events[i[2]],S=n.events[i[3]];if(y[1].end=Object.assign({},S[1].end),y[1].type="chunkText",y[1].contentType="text",i[3]>i[2]+1){const k=i[2]+1,w=i[3]-i[2]-1;e.add(k,w,[])}}e.add(i[3]+1,0,[["exit",f,n]])}return l!==void 0&&(h.end=Object.assign({},xa(n.events,l)),e.add(l,0,[["exit",h,n]]),h=void 0),h}function bx(e,n,i,s,l){const h=[],d=xa(n.events,i);l&&(l.end=Object.assign({},d),h.push(["exit",l,n])),s.end=Object.assign({},d),h.push(["exit",s,n]),e.add(i+1,0,h)}function xa(e,n){const i=e[n],s=i[0]==="enter"?"start":"end";return i[1][s]}const N9={name:"tasklistCheck",tokenize:O9};function j9(){return{text:{91:N9}}}function O9(e,n,i){const s=this;return l;function l(c){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?i(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),h)}function h(c){return _t(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),d):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),d):i(c)}function d(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):i(c)}function o(c){return Be(c)?n(c):Je(c)?e.check({tokenize:L9},n,i)(c):i(c)}}function L9(e,n,i){return rt(e,s,"whitespace");function s(l){return l===null?i(l):n(l)}}function I9(e){return WC([o9(),v9(),k9(e),R9(),j9()])}const B9={};function z9(e){const n=this,i=e||B9,s=n.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),h=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),d=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(I9(i)),h.push(r9()),d.push(i9(i))}function Bk({children:e,className:n,inverted:i=!1}){return g.jsx("div",{className:be("visualization-container markdown-render overflow-x-auto wrap-break-words break",n),children:g.jsx(kP,{remarkPlugins:[z9],components:{code({className:s,children:l,...h}){const d=/language-(\w+)/.exec(s||""),o=d?d[1]:"",c=!o,u=Array.isArray(l)?l.join(""):String(l);return!c&&o?g.jsx("div",{className:"w-full max-w-full overflow-x-auto my-2 min-w-0",children:g.jsx(vg,{theme:i?Sl.nightOwl:Sl.oneDark,code:u.trim(),language:o,children:({className:m,style:f,tokens:y,getLineProps:S,getTokenProps:k})=>g.jsx("pre",{className:be("rounded-lg text-sm p-3",m),style:f,children:y.map((w,_)=>g.jsx("div",{...S({line:w}),children:w.map((b,v)=>g.jsx("span",{...k({token:b})},v))},_))})})}):g.jsx("code",{className:be("px-1.5 py-0.5 rounded text-sm font-mono",i?"bg-primary-foreground/20 text-primary-foreground":"bg-muted",s),...h,children:l})},a({href:s,children:l,...h}){return g.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:be("underline underline-offset-2 transition-colors",i?"text-primary-foreground/80 hover:text-primary-foreground":"text-primary hover:text-primary/80"),...h,children:l})},p({children:s}){return g.jsx("p",{className:"last:mb-0 leading-relaxed wrap-break-words",children:s})},ul({children:s}){return g.jsx("ul",{className:"list-outside list-disc pl-8",children:s})},ol({children:s}){return g.jsx("ol",{className:"list-outside list-decimal pl-8",children:s})},li({children:s,className:l}){const h=l==null?void 0:l.includes("nested");return g.jsx("li",{className:be("leading-snug",h&&"ml-8"),children:s})},h1({children:s}){return g.jsx("h1",{className:"text-lg font-semibold mb-1.5 mt-3 first:mt-0",children:s})},h2({children:s}){return g.jsx("h2",{className:"text-base font-semibold mb-1.5 mt-2.5 first:mt-0",children:s})},h3({children:s}){return g.jsx("h3",{className:"text-sm font-semibold mb-1 mt-2 first:mt-0",children:s})},blockquote({children:s}){return g.jsx("blockquote",{className:be("border-l-2 pl-3 my-1.5 italic",i?"border-primary-foreground/40 text-primary-foreground/70":"border-muted-foreground/40 text-muted-foreground"),children:s})},strong({children:s}){return g.jsx("strong",{className:be("font-semibold",i&&"text-primary-foreground"),children:s})},em({children:s}){return g.jsx("em",{className:"italic",children:s})},hr(){return g.jsx("hr",{className:be("my-3",i?"border-primary-foreground/30":"border-border")})},table({children:s}){return g.jsx("div",{className:"my-2 overflow-x-auto max-w-full",children:g.jsx("table",{className:"w-full border-collapse text-sm",children:s})})},th({children:s}){return g.jsx("th",{className:be("border border-border px-2 py-1.5 text-left font-semibold",i?"bg-primary-foreground/10 text-primary-foreground":"bg-muted"),children:s})},td({children:s}){return g.jsx("td",{className:be("border px-2 py-1.5",i?"border-primary-foreground/20":"border-border"),children:s})}},children:e})})}function P9(e){return e.filter(n=>n.type==="text").map(n=>n.text).join("")}function F9(e,n){const i=n.findIndex(s=>s.message.id===e);if(i<=0)return null;for(let s=i-1;s>=0;s--){const l=n[s];if(l.message.role==="assistant"&&l.message.status!=="streaming")return l.message.id}return null}function H9(e,n){const i=e.map(d=>({message:d.message,parts:d.parts,isQueued:!1})),s=n.map(d=>({message:{id:d.id,role:"user",sessionId:d.sessionId,createdAt:d.createdAt},parts:[{id:`${d.id}-part`,messageId:d.id,createdAt:d.createdAt,type:"text",text:d.content}],isQueued:!0,queueId:d.id})),l=[...i].sort((d,o)=>d.message.createdAt-o.message.createdAt),h=[...s].sort((d,o)=>d.message.createdAt-o.message.createdAt);return[...l,...h]}function U9({part:e}){const[n,i]=T.useState(!1);return g.jsxs("div",{className:"flex flex-col items-center my-4",children:[g.jsxs("button",{onClick:()=>i(!n),className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[n?g.jsx(Fa,{className:"size-3"}):g.jsx(Zr,{className:"size-3"}),g.jsxs("span",{className:"border-b border-dashed border-muted-foreground/40 pb-px",children:[e.compactedMessageIds.length," messages compacted"]})]}),n&&g.jsx("div",{className:"mt-2 max-w-lg w-full rounded-lg border border-border bg-muted/50 px-4 py-3 text-sm text-muted-foreground",children:g.jsx(Bk,{children:e.summary})})]})}function $9({parts:e,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s,inverted:l=!1}){const h=[...e].sort((d,o)=>d.createdAt-o.createdAt);return g.jsx(g.Fragment,{children:h.map(d=>{switch(d.type){case"text":return g.jsx("div",{className:"min-w-0",children:g.jsx(Bk,{inverted:l,children:d.text||"..."})},d.id);case"reasoning":return g.jsx("div",{className:"visualization-container text-muted-foreground text-sm italic border-l-2 border-muted-foreground/30 pl-3 my-2 wrap-break-word",children:d.text},d.id);case"tool":return g.jsx(c6,{part:d,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s},d.id);case"image":return g.jsx("img",{src:d.url,alt:"",className:"max-w-full rounded-lg mt-2"},d.id);case"file":return g.jsx("div",{className:"mt-2 p-2 bg-muted rounded text-sm",children:d.filename||"unnamed"},d.id);default:return null}})})}function q9({session:e,messagesWithParts:n,queuedMessages:i,preconfigs:s,prompts:l,models:h,defaultModel:d,onSendMessage:o,onRemoveFromQueue:c,onChangePreconfig:u,onChangeModel:m,pendingPermissions:f,onPermissionResponse:y,onRename:S,usage:k,modelName:w,onNavigateToSubagent:_,onNavigateBack:b,isStreaming:v,onInterrupt:x,onRevert:E,onFork:M,onCompact:R,isCompacting:j,serverUrl:D,apiToken:O}){const P=T.useRef(null),[U,q]=T.useState(!0),$=150,K=H9(n,i);T.useEffect(()=>{q(!0),P.current&&(P.current.scrollTop=P.current.scrollHeight)},[e.id]),T.useEffect(()=>{P.current&&U&&(P.current.scrollTop=P.current.scrollHeight)},[n,U]),T.useEffect(()=>{const V=P.current;if(!V)return;const Z=()=>{const{scrollHeight:Q,scrollTop:F,clientHeight:N}=V,L=Q-F-N;q(L<$)};return V.addEventListener("scroll",Z,{passive:!0}),()=>V.removeEventListener("scroll",Z)},[]);const Y=f.filter(V=>!n.some(Z=>Z.parts.some(Q=>Q.type==="tool"&&Q.callId===V.toolCallId)));return g.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[g.jsx($4,{session:e,preconfigs:s,models:h,defaultModel:d,usage:k,modelName:w,onChangePreconfig:u,onChangeModel:m,onRename:S,onNavigateBack:b,isStreaming:v,onInterrupt:x,onCompact:R,isCompacting:j,canCompact:n.length>=4}),e.status==="closed"&&g.jsx(ku,{className:"mx-4 mt-4",children:g.jsx(Eu,{children:"This session is archived. You can reopen it from the sidebar."})}),g.jsx($i,{className:"flex-1 min-h-0",ref:P,children:g.jsxs("div",{className:"p-4",children:[K.length===0?g.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[g.jsx("p",{className:"text-lg mb-2",children:"Start a conversation"}),g.jsx("p",{className:"text-sm",children:"Send a message below to begin."})]}):K.map(V=>{const Z=V.parts.find(N=>N.type==="compaction");if(Z)return g.jsx(U9,{part:Z},V.message.id);const Q=!V.isQueued&&V.message.role==="user",F=Q?F9(V.message.id,n):null;return g.jsx(q4,{message:V.message,textContent:P9(V.parts),isQueued:V.isQueued,onRemove:V.isQueued?()=>c(V.queueId):void 0,canRevert:Q&&F!==null,onRevert:F?()=>E==null?void 0:E(e.id,F):void 0,canFork:Q&&F!==null,onFork:F?()=>M==null?void 0:M(e.id,V.message.id):void 0,children:V.parts.length===0?g.jsx("span",{className:"opacity-50",children:"..."}):g.jsx($9,{parts:V.parts,pendingPermissions:f,onPermissionResponse:y,onNavigateToSubagent:_,inverted:V.message.role==="user"})},V.message.id)}),Y.length>0&&g.jsx("div",{className:"mt-4 flex flex-col gap-2",children:Y.map(V=>g.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-lg",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx("span",{className:"text-sm font-medium",children:V.toolName}),g.jsx("span",{className:"text-xs text-muted-foreground",children:V.permissionType})]}),g.jsx("p",{className:"text-sm mb-3",children:V.message}),g.jsxs("div",{className:"flex justify-end gap-2",children:[g.jsx(Te,{variant:"outline",size:"sm",onClick:()=>y(V.toolCallId,!1,!1),children:"Deny"}),g.jsx(Te,{size:"sm",onClick:()=>y(V.toolCallId,!0,!1),children:"Approve"})]})]},V.toolCallId))})]})}),e.status==="active"&&!e.parentId&&g.jsx(p6,{onSendMessage:o,disabled:j,workspaceId:e.workspaceId,serverUrl:D,apiToken:O,prompts:l}),e.parentId&&g.jsxs("div",{className:"p-4 border-t border-border bg-muted/50 text-center flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[g.jsx(JA,{className:"size-4"}),"This is a subagent session (read-only)"]})]})}function V9({className:e,orientation:n="horizontal",...i}){return g.jsx(Gj,{"data-slot":"tabs","data-orientation":n,className:be("group/tabs flex gap-2 data-horizontal:flex-col",e),...i})}const G9=$a("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function W9({className:e,variant:n="default",...i}){return g.jsx(Wj,{"data-slot":"tabs-list","data-variant":n,className:be(G9({variant:n}),e),...i})}function Hp({className:e,...n}){return g.jsx(Kj,{"data-slot":"tabs-trigger",className:be("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...n})}function Up({className:e,...n}){return g.jsx(Yj,{"data-slot":"tabs-content",className:be("flex-1 text-sm outline-none",e),...n})}function xx(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Sx({permission:e,onRevoke:n}){const i=!!e.revokedAt;return g.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border last:border-0",children:[g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[g.jsxs(xn,{variant:i?"outline":"secondary",children:[g.jsx(Ox,{className:"size-3","data-icon":"inline-start"}),e.permissionType]}),i&&g.jsx(xn,{variant:"outline",className:"text-muted-foreground",children:"Revoked"})]}),g.jsx("p",{className:"text-sm font-mono truncate text-muted-foreground",children:e.permissionKey}),g.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Granted ",xx(e.grantedAt),e.revokedAt&&` • Revoked ${xx(e.revokedAt)}`]})]}),!i&&g.jsx(Te,{variant:"ghost",size:"icon",onClick:()=>n(e.id),className:"size-8 text-destructive hover:text-destructive",children:g.jsx(El,{className:"size-4"})})]})}function K9({open:e,onOpenChange:n,title:i,description:s,confirmLabel:l="Confirm",cancelLabel:h="Cancel",variant:d="default",onConfirm:o,onCancel:c}){const u=()=>{c==null||c(),n(!1)},m=()=>{o(),n(!1)};return g.jsx(Ya,{open:e,onOpenChange:n,children:g.jsxs(Xa,{className:"sm:max-w-[425px]",children:[g.jsxs(Za,{children:[g.jsx(Qa,{children:i}),g.jsx(Fl,{children:s})]}),g.jsxs(wd,{children:[g.jsx(Te,{variant:"outline",onClick:u,children:h}),g.jsx(Te,{variant:d==="destructive"?"destructive":"default",onClick:m,children:l})]})]})})}function Y9({token:e,onLogout:n}){return g.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-muted",children:[g.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[g.jsx("span",{className:"text-muted-foreground",children:"Token:"}),g.jsx("code",{className:"font-mono text-foreground bg-background px-1.5 py-0.5 rounded text-[10px]",children:XT(e)})]}),g.jsx(Te,{variant:"destructive",size:"sm",onClick:n,title:"Disconnect and clear token",children:"Logout"})]})}function X9({open:e,onOpenChange:n,permissions:i,onRefreshPermissions:s,onRevokePermission:l,onRevokeAllPermissions:h,apiToken:d,onLogout:o}){const{theme:c,setTheme:u}=eA(),[m,f]=T.useState(!1),y=i.filter(k=>!k.revokedAt),S=i.filter(k=>k.revokedAt);return g.jsxs(Ya,{open:e,onOpenChange:n,children:[g.jsxs(Xa,{className:"sm:max-w-[500px] max-h-[80vh]",children:[g.jsxs(Za,{children:[g.jsx(Qa,{children:"Settings"}),g.jsx(Fl,{children:"Manage your preferences and permissions"})]}),g.jsxs(V9,{defaultValue:"account",className:"mt-4",children:[g.jsxs(W9,{className:"grid w-full grid-cols-3",children:[g.jsx(Hp,{value:"account",children:"Account"}),g.jsx(Hp,{value:"appearance",children:"Appearance"}),g.jsxs(Hp,{value:"permissions",children:[g.jsx(Ox,{className:"size-3","data-icon":"inline-start"}),"Permissions",y.length>0&&g.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 text-xs bg-primary text-primary-foreground rounded-full",children:y.length})]})]}),g.jsx(Up,{value:"account",className:"mt-4",children:g.jsx("div",{className:"flex flex-col gap-4",children:g.jsxs("div",{children:[g.jsx(Pi,{className:"text-sm font-medium",children:"Session"}),g.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Manage your current session"}),d?g.jsx(Y9,{token:d,onLogout:o}):g.jsx("p",{className:"text-sm text-muted-foreground",children:"No active session"})]})})}),g.jsx(Up,{value:"appearance",className:"mt-4",children:g.jsx("div",{className:"flex flex-col gap-4",children:g.jsxs("div",{children:[g.jsx(Pi,{className:"text-sm font-medium",children:"Theme"}),g.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose your preferred color scheme"}),g.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[g.jsxs(Te,{variant:c==="light"?"default":"outline",className:"justify-start",onClick:()=>u("light"),children:[g.jsx(TT,{className:"size-4","data-icon":"inline-start"}),"Light"]}),g.jsxs(Te,{variant:c==="dark"?"default":"outline",className:"justify-start",onClick:()=>u("dark"),children:[g.jsx(oT,{className:"size-4","data-icon":"inline-start"}),"Dark"]}),g.jsxs(Te,{variant:c==="system"?"default":"outline",className:"justify-start",onClick:()=>u("system"),children:[g.jsx(sT,{className:"size-4","data-icon":"inline-start"}),"System"]})]})]})})}),g.jsx(Up,{value:"permissions",className:"mt-4",children:g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{children:[g.jsx(Pi,{className:"text-sm font-medium",children:"Always-allowed Operations"}),g.jsx("p",{className:"text-sm text-muted-foreground",children:"Tools you've approved to run without asking"})]}),g.jsxs("div",{className:"flex gap-2",children:[g.jsx(Te,{variant:"outline",size:"icon",onClick:s,className:"size-8",children:g.jsx(wa,{className:"size-4"})}),y.length>0&&g.jsxs(Te,{variant:"destructive",size:"sm",onClick:()=>f(!0),children:[g.jsx(El,{className:"size-4","data-icon":"inline-start"}),"Revoke All"]})]})]}),g.jsx(ll,{}),g.jsxs($i,{className:"h-[300px]",children:[y.length===0&&S.length===0&&g.jsxs("div",{className:"text-center py-8 text-muted-foreground text-sm",children:["No permissions granted yet.",g.jsx("br",{}),'Approve tool requests with "Always allow" to add them here.']}),y.length>0&&g.jsxs("div",{className:"mb-4",children:[g.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Active (",y.length,")"]}),y.map(k=>g.jsx(Sx,{permission:k,onRevoke:l},k.id))]}),S.length>0&&g.jsxs("div",{children:[g.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Revoked (",S.length,")"]}),S.map(k=>g.jsx(Sx,{permission:k,onRevoke:l},k.id))]})]})]})})]})]}),g.jsx(K9,{open:m,onOpenChange:f,title:"Revoke All Permissions",description:"This will revoke all always-allowed permissions for this workspace. You'll need to approve these tools again when they're used.",confirmLabel:"Revoke All",variant:"destructive",onConfirm:()=>{h(),f(!1)}})]})}function Z9({status:e}){switch(e.status){case"connected":return g.jsxs(xn,{variant:"default",className:"bg-green-600",children:[g.jsx(kl,{className:"size-3 mr-1"}),"Connected"]});case"disabled":return g.jsxs(xn,{variant:"secondary",children:[g.jsx(Yu,{className:"size-3 mr-1"}),"Disabled"]});case"failed":return g.jsxs(xn,{variant:"destructive",children:[g.jsx(cl,{className:"size-3 mr-1"}),"Failed"]});case"needs_auth":return g.jsxs(xn,{variant:"outline",className:"border-yellow-500 text-yellow-600",children:[g.jsx(cl,{className:"size-3 mr-1"}),"Needs Auth"]});case"needs_client_registration":return g.jsxs(xn,{variant:"outline",className:"border-orange-500 text-orange-600",children:[g.jsx(cl,{className:"size-3 mr-1"}),"Needs Registration"]});default:return g.jsx(xn,{variant:"secondary",children:"Unknown"})}}function Q9({open:e,onOpenChange:n,workspaceId:i,workspacePath:s,serverUrl:l,apiToken:h}){const{fetchWithAuth:d}=Pl(),[o,c]=T.useState({}),[u,m]=T.useState(!1),[f,y]=T.useState(null),[S,k]=T.useState(null),w=T.useCallback(async()=>{if(i){m(!0),k(null);try{const E=await d(`/api/workspaces/${i}/mcp/status`,{},{serverUrl:l,token:h});if(!E.ok)throw new Error("Failed to load MCP status");const M=await E.json();c(M.status||{})}catch(E){const M=E instanceof Error?E.message:"Unknown error";k(M)}finally{m(!1)}}},[i,d,l,h]);T.useEffect(()=>{e&&i&&w()},[e,i,w]);const _=async E=>{if(i){y(E);try{if(!(await d(`/api/workspaces/${i}/mcp/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})},{serverUrl:l,token:h})).ok)throw new Error("Failed to connect");await w()}catch(M){const R=M instanceof Error?M.message:"Unknown error";k(R)}finally{y(null)}}},b=async E=>{if(i){y(E);try{if(!(await d(`/api/workspaces/${i}/mcp/disconnect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})},{serverUrl:l,token:h})).ok)throw new Error("Failed to disconnect");await w()}catch(M){const R=M instanceof Error?M.message:"Unknown error";k(R)}finally{y(null)}}},v=async E=>{if(i){y(E);try{const M=await d(`/api/workspaces/${i}/mcp/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})},{serverUrl:l,token:h});if(!M.ok)throw new Error("Failed to start auth");const R=await M.json();R.authorizationUrl&&window.open(R.authorizationUrl,"_blank"),await w()}catch(M){const R=M instanceof Error?M.message:"Unknown error";k(R)}finally{y(null)}}},x=Object.entries(o);return g.jsx(Ya,{open:e,onOpenChange:n,children:g.jsxs(Xa,{className:"sm:max-w-[600px] max-h-[80vh]",children:[g.jsxs(Za,{children:[g.jsxs(Qa,{className:"flex items-center gap-2",children:[g.jsx(Ss,{className:"size-5"}),"MCP Servers"]}),g.jsx(Fl,{children:"Manage Model Context Protocol servers for this workspace"})]}),g.jsxs("div",{className:"mt-4 space-y-4",children:[S&&g.jsxs(ku,{variant:"destructive",children:[g.jsx(cl,{className:"size-4"}),g.jsx(Eu,{children:S})]}),g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure servers in ",g.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})]}),g.jsx(Te,{variant:"outline",size:"sm",onClick:w,disabled:u,children:g.jsx(wa,{className:`size-4 ${u?"animate-spin":""}`})})]}),g.jsx($i,{className:"h-[400px]",children:u&&x.length===0?g.jsx("div",{className:"flex items-center justify-center py-8",children:g.jsx(Zn,{className:"size-6 animate-spin text-muted-foreground"})}):x.length===0?g.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[g.jsx(Ss,{className:"size-12 mx-auto mb-3 opacity-50"}),g.jsx("p",{className:"font-medium",children:"No MCP servers configured"}),g.jsxs("p",{className:"text-sm mt-1",children:["Create ",g.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})," in your workspace to add servers."]})]}):g.jsx("div",{className:"space-y-3",children:x.map(([E,{config:M,status:R}])=>{var j;return g.jsxs("div",{className:"border rounded-lg p-4",children:[g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsxs("div",{className:"flex items-start gap-3",children:[g.jsx(Ss,{className:"size-5 text-muted-foreground mt-0.5"}),g.jsxs("div",{children:[g.jsx("div",{className:"font-medium",children:E}),g.jsx("div",{className:"text-sm text-muted-foreground",children:(M==null?void 0:M.type)==="local"?g.jsxs("span",{children:["Local - ",((j=M.command)==null?void 0:j[0])||"command"]}):(M==null?void 0:M.type)==="remote"?g.jsxs("span",{className:"flex items-center gap-1",children:["Remote - ",M.url]}):"Unknown type"}),R.status==="failed"&&"error"in R&&g.jsx(ku,{variant:"destructive",className:"mt-2 py-2",children:g.jsx(Eu,{className:"text-xs",children:R.error})}),R.status==="needs_client_registration"&&"error"in R&&g.jsx(ku,{className:"mt-2 py-2 border-orange-500",children:g.jsx(Eu,{className:"text-xs",children:R.error})})]})]}),g.jsx("div",{className:"flex items-center gap-2",children:g.jsx(Z9,{status:R})})]}),g.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[R.status==="connected"&&g.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>b(E),disabled:f===E,children:[f===E?g.jsx(Zn,{className:"size-4 animate-spin"}):g.jsx(dT,{className:"size-4"}),g.jsx("span",{className:"ml-1",children:"Disconnect"})]}),(R.status==="disabled"||R.status==="failed")&&g.jsxs(Te,{variant:"outline",size:"sm",onClick:()=>_(E),disabled:f===E,children:[f===E?g.jsx(Zn,{className:"size-4 animate-spin"}):g.jsx(fT,{className:"size-4"}),g.jsx("span",{className:"ml-1",children:"Connect"})]}),R.status==="needs_auth"&&g.jsxs(Te,{variant:"default",size:"sm",onClick:()=>v(E),disabled:f===E,children:[f===E?g.jsx(Zn,{className:"size-4 animate-spin"}):g.jsx(Vp,{className:"size-4"}),g.jsx("span",{className:"ml-1",children:"Authenticate"})]})]})]},E)})})})]})]})})}function wx({message:e="Connecting to server..."}){return g.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-muted-foreground",children:[g.jsx(Zn,{className:"size-8 animate-spin"}),g.jsx("p",{className:"text-sm",children:e})]})}const J9=({serverUrl:e,authError:n,retryCount:i,nextRetryIn:s,onRetry:l,onLogout:h})=>g.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] px-4 text-center",children:[g.jsx(Ix,{className:"size-12 text-destructive mb-4"}),g.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Unable to connect to server"}),g.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-[400px]",children:n||"Please check that the server is running."}),e&&g.jsx("p",{className:"text-xs text-muted-foreground mb-6 font-mono bg-muted px-3 py-1.5 rounded",children:e}),g.jsxs("div",{className:"flex flex-col items-center gap-4",children:[g.jsxs("p",{className:"text-sm text-muted-foreground",children:["Retrying in ",s,"s..."]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(Te,{onClick:l,variant:"default",children:[g.jsx(wa,{className:"size-4 mr-2","data-icon":"inline-start"}),"Retry Now"]}),g.jsx(Te,{onClick:h,variant:"ghost",children:"Change Server"})]}),i>0&&g.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retry attempt: ",i]})]})]});function Cx({onServerAdded:e,error:n}){const[i,s]=T.useState(""),[l,h]=T.useState(""),[d,o]=T.useState(""),[c,u]=T.useState(!1),[m,f]=T.useState(null),y=S=>{S.preventDefault();const k=i.trim(),w=l.trim(),_=d.trim();if(!k){f("Please enter a server name");return}if(!w){f("Please enter a server URL");return}if(!_){f("Please enter an API token");return}if(!zx(_)){f("Invalid token format. Token should be 64 hex characters (0-9, a-f).");return}const b=Ru(w),v={id:crypto.randomUUID(),name:k,url:b,token:_,createdAt:new Date().toISOString()};e(v)};return g.jsx("div",{className:"w-full h-full flex items-center justify-center bg-background dark:bg-gradient-to-br dark:from-muted dark:via-background dark:to-muted p-4",children:g.jsx("div",{className:"w-full max-w-md",children:g.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[g.jsxs("div",{className:"px-6 pt-6 pb-4 text-center border-b border-border",children:[g.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Add your first server"}),g.jsx("p",{className:"text-muted-foreground mt-1",children:"Connect to a Jean2 server to get started"})]}),g.jsxs("form",{onSubmit:y,className:"p-6 space-y-4",children:[g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{htmlFor:"serverName",className:"text-sm font-medium text-foreground",children:"Server Name"}),g.jsx("input",{id:"serverName",type:"text",value:i,onChange:S=>{s(S.target.value),f(null)},placeholder:"Production",className:"w-full px-3 py-2 bg-background border border-input rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{htmlFor:"serverUrl",className:"text-sm font-medium text-foreground",children:"Server URL"}),g.jsx("input",{id:"serverUrl",type:"text",value:l,onChange:S=>{h(S.target.value),f(null)},placeholder:"localhost:3000",className:"w-full px-3 py-2 bg-background border border-input rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"})]}),g.jsxs("div",{className:"space-y-2",children:[g.jsx("label",{htmlFor:"token",className:"text-sm font-medium text-foreground",children:"API Token"}),g.jsxs("div",{className:"relative",children:[g.jsx("input",{id:"token",type:c?"text":"password",value:d,onChange:S=>{o(S.target.value),f(null)},placeholder:"Enter your 64-character token",className:"w-full px-3 py-2 pr-10 bg-background border border-input rounded-lg text-foreground font-mono text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"}),g.jsx("button",{type:"button",onClick:()=>u(!c),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":c?"Hide token":"Show token",children:c?g.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):g.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})]})]}),(m||n)&&g.jsx("div",{className:"px-3 py-2 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive text-sm",children:m||n}),g.jsx("button",{type:"submit",className:"w-full py-2.5 bg-primary text-primary-foreground font-medium rounded-lg hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-colors",children:"Add Server"})]})]})})})}function kx({onServerSwitch:e,onSelectWorkspace:n}){const[i,s]=T.useState(!1),l=T.useRef(!1),h=Ul(),{quickConnections:d,switchServer:o,removeFromQuickConnections:c,isSwitching:u}=Ua(),m=S=>{o(S.serverId)&&(l.current=!0,e==null||e(),S.workspaceId&&n&&n(S.workspaceId))};T.useEffect(()=>{!u&&i&&l.current&&(s(!1),l.current=!1)},[u,i]);const f=(S,k)=>{S.stopPropagation(),c(k)},y=()=>g.jsx(dg,{children:g.jsx(hg,{className:"max-h-[50vh] overflow-y-auto",children:d.length>0?g.jsx(bl,{heading:"Quick Switch",children:d.map(S=>g.jsxs(Ea,{onSelect:()=>m(S),className:"justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Ss,{className:"size-4 text-muted-foreground"}),g.jsxs("span",{children:[S.serverName,S.workspaceName&&g.jsxs("span",{className:"text-muted-foreground",children:[" / ",S.workspaceName]})]})]}),g.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",onClick:k=>f(k,S.id),children:g.jsx(El,{className:"size-3 text-destructive"})})]},S.id))}):g.jsx(fg,{className:"py-6",children:g.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[g.jsx(tp,{className:"size-8"}),g.jsx("p",{className:"text-sm font-medium",children:"No favorites yet"}),g.jsx("p",{className:"text-xs",children:"Star a workspace to add it here"})]})})})});return h?g.jsxs(Ad,{open:i,onOpenChange:s,children:[g.jsx(q5,{asChild:!0,children:g.jsx(Te,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:g.jsx(tp,{className:"size-4"})})}),g.jsxs(Td,{side:"bottom",className:"max-h-[80vh]",children:[g.jsx(Rd,{children:g.jsx(Dd,{children:"Quick Switch"})}),g.jsx("div",{className:"mt-4",children:y()})]})]}):g.jsxs(kd,{open:i,onOpenChange:s,children:[g.jsx(pg,{asChild:!0,children:g.jsx(Te,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:g.jsx(tp,{className:"size-4"})})}),g.jsx(Ed,{className:"w-[300px] p-0",align:"start",children:y()})]})}function Ex({viewMode:e,onViewModeChange:n}){const i=T.useCallback(()=>{n(e==="overview"?"default":"overview")},[e,n]),s=e==="overview";return g.jsx(xl,{children:g.jsxs(ja,{children:[g.jsx(Oa,{asChild:!0,children:g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:i,children:s?g.jsx(XA,{className:"h-4 w-4"}):g.jsx(KA,{className:"h-4 w-4"})})}),g.jsx(La,{children:s?"Single workspace":"Overview"})]})})}function e7({open:e,onOpenChange:n,editServer:i}){const{addServer:s,editServer:l}=Ua(),[h,d]=T.useState(""),[o,c]=T.useState(""),[u,m]=T.useState(""),[f,y]=T.useState(!1),[S,k]=T.useState(null),w=i!=null;T.useEffect(()=>{i?(d(i.name),c(i.url),m(i.token)):(d(""),c(""),m("")),k(null),y(!1)},[i,e]);const _=b=>{b.preventDefault(),k(null);const v=h.trim(),x=o.trim(),E=u.trim();if(!v){k("Name is required");return}if(!x){k("Server URL is required");return}if(!E){k("API token is required");return}if(!zx(E)){k("Token must be 64 hexadecimal characters");return}const M=Ru(x);w?l(i.id,{name:v,url:M,token:E}):s(v,M,E),n(!1)};return g.jsx(Ya,{open:e,onOpenChange:n,children:g.jsxs(Xa,{className:"sm:max-w-[425px]",children:[g.jsxs(Za,{children:[g.jsx(Qa,{children:w?"Edit Server":"Add Server"}),g.jsx(Fl,{children:w?"Update server details":"Enter your server details"})]}),g.jsxs("form",{onSubmit:_,children:[g.jsxs("div",{className:"grid gap-4 py-4",children:[g.jsxs("div",{className:"grid gap-2",children:[g.jsx(Pi,{htmlFor:"server-name",children:"Name"}),g.jsx(Cu,{id:"server-name",value:h,onChange:b=>d(b.target.value),placeholder:"My Server"})]}),g.jsxs("div",{className:"grid gap-2",children:[g.jsx(Pi,{htmlFor:"server-url",children:"Server URL"}),g.jsx(Cu,{id:"server-url",value:o,onChange:b=>c(b.target.value),placeholder:"localhost:3000"})]}),g.jsxs("div",{className:"grid gap-2",children:[g.jsx(Pi,{htmlFor:"server-token",children:"API Token"}),g.jsxs("div",{className:"relative",children:[g.jsx(Cu,{id:"server-token",type:f?"text":"password",value:u,onChange:b=>m(b.target.value),placeholder:"64-character hex string",className:"pr-10"}),g.jsx("button",{type:"button",onClick:()=>y(!f),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-transparent",children:f?g.jsx(LA,{className:"size-4 text-muted-foreground"}):g.jsx(BA,{className:"size-4 text-muted-foreground"})})]})]}),S&&g.jsx("p",{className:"text-sm text-destructive",children:S})]}),g.jsxs(wd,{children:[g.jsx(Te,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),g.jsx(Te,{type:"submit",children:w?"Save":"Add"})]})]})]})})}const t7=(e,n)=>e&&n?`ws://${n}/ws?token=${e}`:null,$p=e=>e?`http://${e}/api`:null;function n7(){var on,co,Ql,Is;const{servers:e,activeServer:n,addServer:i,removeServer:s,isSwitching:l,clearSwitchingState:h,quickConnections:d}=Ua(),[o,c]=T.useState([]),[u,m]=T.useState([]),[f,y]=T.useState([]),[S,k]=T.useState(null),[w,_]=T.useState({}),[b,v]=T.useState({}),[x,E]=T.useState(null),M=T.useRef(null),[R,j]=T.useState(!1),[D,O]=T.useState(null),[P,U]=T.useState({promptTokens:0,completionTokens:0,totalTokens:0}),[q,$]=T.useState("gpt-4o"),[K,Y]=T.useState([]),[V,Z]=T.useState("gpt-4o"),[Q,F]=T.useState([]),[N,L]=T.useState(null),[B,z]=T.useState(!1),[X,J]=T.useState(!1),[te,W]=T.useState(!1),[H,ne]=T.useState(!1),[ae,pe]=T.useState(()=>localStorage.getItem("jean2_sidebar_view")||"default"),[ue,Re]=T.useState([]),[Ie,Fe]=T.useState([]),[lt,De]=T.useState({}),[en,Wt]=T.useState(null),[fn,Kt]=T.useState(!1),[ur,$t]=T.useState(null),[gt,Mt]=T.useState(!1),[he,xe]=T.useState(0),[Oe,Pe]=T.useState(0),[qe,wt]=T.useState(0),Xe=(on=S==null?void 0:S.compacting)!=null?on:!1;T.useEffect(()=>{localStorage.setItem("jean2_sidebar_view",ae)},[ae]);const zt=1e4,Tt=3e4,tn=1e3,it=T.useRef(null),wn=T.useRef(null),[zn,to]=T.useState(!1),ct=(co=n==null?void 0:n.token)!=null?co:null,ut=(Ql=n==null?void 0:n.url)!=null?Ql:null;T.useEffect(()=>{M.current=x},[x]);const Ar=T.useRef(null),Pn=T.useRef(!1),Zi=T.useCallback(re=>{i(re.name,re.url,re.token)},[i]),Cn=T.useCallback(()=>{n&&s(n.id),M.current&&M.current.close(),E(null),j(!1),Mt(!1),xe(0),Pe(0)},[n,s]),zd=T.useCallback(()=>{xe(re=>re+1),Mt(!1),Pe(0)},[]),Os=T.useCallback(()=>{M.current&&M.current.close(),E(null),j(!1),Mt(!1),xe(0),Pe(0),c([]),m([]),k(null),_({}),v({}),O(null),U({promptTokens:0,completionTokens:0,totalTokens:0}),$("gpt-4o"),Y([]),F([]),L(null),Re([]),Fe([]),De({}),wt(re=>re+1)},[]),Fn=T.useCallback(async(re,we={})=>{if(!ct)throw new Error("No API token available");const ge=new Headers(we.headers||{});ge.set("Authorization",`Bearer ${ct}`);const me=await fetch(re,{...we,signal:we.signal,headers:ge});if(me.status===401)throw Wt("Authentication failed. Your token may have been regenerated."),Cn(),new Error("Unauthorized");return me},[ct,Cn]),Qi=T.useCallback(re=>{const we=w[re]||[],ge=b[re]||{};return we.map(me=>({message:me,parts:(ge[me.id]||[]).sort((He,kt)=>He.createdAt-kt.createdAt)}))},[w,b]);T.useEffect(()=>{if(!ct||!ut)return;const re=t7(ct,ut);if(!re)return;const we=new WebSocket(re);return we.onopen=()=>{j(!0),Wt(null),xe(0),Mt(!1)},we.onclose=ge=>{j(!1),(ge.code===1008||ge.code===401)&&(Wt("Authentication failed. Please check your token."),Cn())},we.onerror=ge=>{console.error("WebSocket error:",ge)},we.onmessage=ge=>{var He;const me=JSON.parse(ge.data);(He=Ar.current)==null||He.call(Ar,me)},E(we),()=>we.close()},[ct,ut,Cn,qe]),T.useEffect(()=>{if(ct&&ut&&!R&&!gt){const re=setTimeout(()=>{R||Mt(!0)},zt);return()=>clearTimeout(re)}},[ct,ut,R,gt]),T.useEffect(()=>{if(gt&&!R&&ct&&ut){const re=Math.min(tn*Math.pow(2,he),Tt);let we=Math.floor(re/1e3);Pe(we);const ge=setInterval(()=>{we-=1,Pe(Math.max(0,we))},1e3),me=setTimeout(()=>{xe(He=>He+1),wt(He=>He+1)},re);return()=>{clearInterval(ge),clearTimeout(me)}}},[gt,R,ct,ut,he]),T.useEffect(()=>{var ge;if(!ct||!ut)return;(ge=it.current)==null||ge.abort(),it.current=new AbortController;const re=it.current.signal,we=$p(ut);if(we)return to(!0),Promise.all([Fn(`${we}/sessions`,{signal:re}).then(me=>me.json()),Fn(`${we}/preconfigs`,{signal:re}).then(me=>me.json()),Fn(`${we}/prompts`,{signal:re}).then(me=>me.json()),Fn(`${we}/models`,{signal:re}).then(me=>me.json()),Fn(`${we}/workspaces`,{signal:re}).then(me=>me.json())]).then(([me,He,kt,ln,cn])=>{c(me.sessions||[]),m(He.preconfigs||[]),y(kt.prompts||[]),Y(ln.models||[]),Z(ln.defaultModel||"gpt-4o");const hr=cn.workspaces||[];if(F(hr),wn.current){const ts=hr.find(fr=>fr.id===wn.current);ts&&L(ts),wn.current=null}else{const ts=localStorage.getItem("activeWorkspaceId"),fr=hr.find($d=>$d.id===ts);L(fr||hr[0])}h(),to(!1)}).catch(me=>{var He;if(me.name==="AbortError"){console.log("Fetch aborted due to server switch");return}console.error("Failed to load server data:",me),to(!1),(He=me.message)!=null&&He.includes("Unauthorized")||Wt("Failed to connect to server")}),()=>{var me;(me=it.current)==null||me.abort()}},[ct,ut,Fn,h]),T.useEffect(()=>{N&&localStorage.setItem("activeWorkspaceId",N.id)},[N]);const Gl=async(re,we,ge)=>{const me=$p(ut);if(!me)return;const kt=await(await Fn(`${me}/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:re,path:we,isVirtual:ge})})).json();return F(ln=>[...ln,kt.workspace]),kt.workspace},Wl=re=>{L(re),k(null)},no=re=>{wn.current=re},Kl=async re=>{const we=$p(ut);we&&(await Fn(`${we}/workspaces/${re}`,{method:"DELETE"}),F(ge=>ge.filter(me=>me.id!==re)),(N==null?void 0:N.id)===re&&L(Q[0]||null))},ro=async()=>{const re=`Workspace ${Q.length+1}`,we=`~/.jean2/workspaces/${crypto.randomUUID()}`;await Gl(re,we,!0)},io=async re=>{const we=re.split("/").pop()||re.split("\\").pop()||"Workspace";await Gl(we,re,!1)},so=T.useCallback(re=>{var we;switch(re.type){case"session.created":c(ge=>[re.session,...ge]),Pn.current&&(k(re.session),_(ge=>({...ge,[re.session.id]:[]})),v(ge=>({...ge,[re.session.id]:{}})),U({promptTokens:0,completionTokens:0,totalTokens:0}),$(V),Pn.current=!1);break;case"session.resumed":k(re.session),re.isRunning&&O(re.session.id),re.messages&&(_(ge=>({...ge,[re.session.id]:re.messages.map(me=>me.message)})),v(ge=>{const me={...ge};me[re.session.id]={};for(const He of re.messages)me[re.session.id][He.message.id]=He.parts;return me})),U((we=re.usage)!=null?we:{promptTokens:0,completionTokens:0,totalTokens:0}),$(re.session.selectedModel||V);break;case"message.created":_(ge=>({...ge,[re.message.sessionId]:[...ge[re.message.sessionId]||[],re.message]})),v(ge=>({...ge,[re.message.sessionId]:{...ge[re.message.sessionId],[re.message.id]:[]}})),"status"in re.message&&re.message.status==="streaming"&&O(re.message.sessionId);break;case"message.updated":_(ge=>({...ge,[re.message.sessionId]:(ge[re.message.sessionId]||[]).map(me=>me.id===re.message.id?re.message:me)})),"status"in re.message&&re.message.status!=="streaming"&&O(ge=>ge===re.message.sessionId?null:ge);break;case"part.created":v(ge=>{const me=ge[re.sessionId]||{},He=me[re.part.messageId]||[];return{...ge,[re.sessionId]:{...me,[re.part.messageId]:[...He,re.part]}}});break;case"part.updated":v(ge=>{const me=ge[re.sessionId]||{},He=me[re.part.messageId]||[];return{...ge,[re.sessionId]:{...me,[re.part.messageId]:He.map(kt=>kt.id===re.part.id?re.part:kt)}}});break;case"part.append":O(re.sessionId),v(ge=>{const me=ge[re.sessionId]||{};for(const He of Object.keys(me)){const kt=me[He],ln=kt.findIndex(cn=>cn.id===re.partId);if(ln!==-1){const cn=kt[ln];if(cn.type==="text"||cn.type==="reasoning"){const hr=[...kt];return hr[ln]={...cn,text:cn.text+re.delta},{...ge,[re.sessionId]:{...me,[He]:hr}}}}}return ge});break;case"chat.usage":if(re.sessionId!==(S==null?void 0:S.id))return;U({promptTokens:re.usage.promptTokens,completionTokens:re.usage.completionTokens,totalTokens:re.usage.totalTokens}),$(re.model);break;case"error":console.error("Server error:",re.code,re.message);break;case"session.closed":c(ge=>ge.map(me=>me.id===re.sessionId?{...me,status:"closed"}:me)),_(ge=>{const me={...ge};return delete me[re.sessionId],me}),v(ge=>{const me={...ge};return delete me[re.sessionId],me}),(S==null?void 0:S.id)===re.sessionId&&k(null);break;case"session.reopened":c(ge=>ge.map(me=>me.id===re.session.id?re.session:me)),(S==null?void 0:S.id)===re.session.id&&k(re.session);break;case"session.deleted":c(ge=>ge.filter(me=>me.id!==re.sessionId)),_(ge=>{const me={...ge};return delete me[re.sessionId],me}),v(ge=>{const me={...ge};return delete me[re.sessionId],me}),(S==null?void 0:S.id)===re.sessionId&&k(null);break;case"session.updated":c(ge=>ge.map(me=>me.id===re.session.id?re.session:me)),(S==null?void 0:S.id)===re.session.id&&k(re.session);break;case"session.renamed":c(ge=>ge.map(me=>me.id===re.session.id?re.session:me)),(S==null?void 0:S.id)===re.session.id&&k(re.session);break;case"permission.list":Re(re.permissions);break;case"permission.revoked":Re(ge=>ge.map(me=>me.id===re.permissionId?{...me,revokedAt:new Date().toISOString()}:me));break;case"permission.all_revoked":Re(ge=>{const me=new Date().toISOString();return ge.map(He=>({...He,revokedAt:me}))});break;case"permission.request":{const ge={toolCallId:re.toolCallId,toolName:re.toolName,args:re.args,permissionType:re.permissionType,permissionKey:re.permissionKey,message:re.message,details:re.details,dangerous:re.dangerous,childSessionId:re.childSessionId,subagentName:re.subagentName};Fe(me=>[...me,ge]);break}case"permission.granted":Fe(ge=>ge.filter(me=>me.toolCallId!==re.toolCallId));break;case"session.interrupted":D===re.sessionId&&O(null),re.result.cascadedTo.length>0&&console.log(`Session ${re.sessionId} interrupted. Cascaded to:`,re.result.cascadedTo);break;case"queue.list":De(ge=>({...ge,[re.sessionId]:re.messages}));break;case"queue.added":De(ge=>({...ge,[re.sessionId]:[...ge[re.sessionId]||[],re.message]}));break;case"queue.removed":De(ge=>({...ge,[re.sessionId]:(ge[re.sessionId]||[]).filter(me=>me.id!==re.queueId)}));break;case"queue.sending":De(ge=>({...ge,[re.sessionId]:(ge[re.sessionId]||[]).filter(me=>me.id!==re.queueId)}));break;case"session.reverted":console.log(`Session reverted to message ${re.revertedTo.messageId}, removed ${re.removed.messageIds.length} messages`);break;case"compaction.complete":break;case"session.forked":{const{forkedSession:ge,messages:me}=re;c(He=>[ge,...He]),_(He=>({...He,[ge.id]:me.map(kt=>kt.message)})),v(He=>{const kt={...He};kt[ge.id]={};for(const ln of me)kt[ge.id][ln.message.id]=ln.parts;return kt}),k(ge),U({promptTokens:0,completionTokens:0,totalTokens:0});break}case"session.state":_(ge=>({...ge,[re.sessionId]:re.messages.map(me=>me.message)})),v(ge=>{const me={...ge};me[re.sessionId]={};for(const He of re.messages)me[re.sessionId][He.message.id]=He.parts;return me}),D===re.sessionId&&O(null);break}},[S,V,D]);T.useEffect(()=>{Ar.current=so},[so]),T.useEffect(()=>{const re=async we=>{const ge=we.target;if(!(ge.tagName==="INPUT"||ge.tagName==="TEXTAREA"||ge.isContentEditable)){if((we.metaKey||we.ctrlKey)&&we.key==="`"){we.preventDefault(),W(He=>!He);return}if((we.metaKey||we.ctrlKey)&&we.key==="n"){we.preventDefault();try{await tA("create_new_window")}catch(He){console.error("Failed to create new window:",He)}}}};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[]);const Ve=T.useCallback((re,we)=>{x&&x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({type:re,...we}))},[x]),dr=T.useCallback((re,we)=>{Pn.current=!0,Ve("session.create",{preconfigId:re,title:we,workspaceId:N==null?void 0:N.id})},[Ve,N]),Ct=T.useCallback(re=>{Fe([]),O(null);const we=o.find(ge=>ge.id===re);if(we!=null&&we.workspaceId&&we.workspaceId!==(N==null?void 0:N.id)){const ge=Q.find(me=>me.id===we.workspaceId);ge&&L(ge)}Ve("session.resume",{sessionId:re})},[Ve,o,Q,N]),nn=T.useCallback(re=>{Ve("session.close",{sessionId:re})},[Ve]),ii=T.useCallback((re,we)=>{Ve("session.revert",{sessionId:re,messageId:we})},[Ve]),ao=T.useCallback((re,we)=>{Ve("session.fork",{sessionId:re,messageId:we})},[Ve]),Pd=T.useCallback((re,we)=>{Ve("session.compact",{sessionId:re,messageIds:we})},[Ve]),Fd=T.useCallback(re=>{Ve("session.reopen",{sessionId:re})},[Ve]),Yl=T.useCallback(re=>{Ve("session.delete",{sessionId:re})},[Ve]),Ji=T.useCallback(re=>{S&&Ve("session.update",{sessionId:S.id,preconfigId:re})},[S,Ve]),oo=T.useCallback((re,we)=>{S&&Ve("session.update_model",{sessionId:S.id,modelId:re,providerId:we})},[S,Ve]),si=T.useCallback((re,we)=>{Ve("session.rename",{sessionId:re,title:we})},[Ve]),ai=T.useCallback(()=>{S!=null&&S.parentId&&Ct(S.parentId)},[S,Ct]),oi=T.useCallback((re,we)=>{Ve("queue.add",{sessionId:re,content:we})},[Ve]),li=T.useCallback(re=>{Ve("queue.remove",{queueId:re})},[Ve]),Nt=T.useCallback(re=>{!S||Xe||(D===S.id?oi(S.id,re):Ve("chat.message",{sessionId:S.id,content:re}))},[S,D,Xe,Ve,oi]),Xl=T.useCallback((re,we,ge)=>{Fe(me=>me.filter(He=>He.toolCallId!==re)),Ve("permission.response",{toolCallId:re,allowed:we,alwaysAllow:ge})},[Ve]),Zl=T.useCallback(()=>{S&&Ve("session.interrupt",{sessionId:S.id})},[S,Ve]),Tr=T.useCallback(()=>{N&&Ve("permission.list",{workspaceId:N.id})},[N,Ve]),ci=o.filter(re=>re.workspaceId===(N==null?void 0:N.id)),Hd=d.filter(re=>re.serverId===(n==null?void 0:n.id)&&re.workspaceId).map(re=>re.workspaceId),lo=S?Qi(S.id):[],es=u.filter(re=>re.mode!=="subagent"),Ud=T.useCallback(re=>{var ge;L(Q.find(me=>me.id===re)||null),Pn.current=!0;const we=(ge=es[0])==null?void 0:ge.id;Ve("session.create",{preconfigId:we,workspaceId:re})},[Ve,Q,es]),Ls=!(S!=null&&S.parentId),Pt=!!n,tr=()=>e.length===0?g.jsx(Cx,{onServerAdded:Zi,error:en||void 0}):Pt?l?g.jsx("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:g.jsx(wx,{message:`Connecting to ${(n==null?void 0:n.name)||"server"}...`})}):!R&&o.length===0?gt?g.jsx("div",{className:"flex w-full h-full items-center justify-center bg-background",children:g.jsx(J9,{serverUrl:ut,authError:en,retryCount:he,nextRetryIn:Oe,onRetry:zd,onLogout:Cn})}):g.jsxs("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:[g.jsx(wx,{}),g.jsx(Te,{variant:"ghost",size:"sm",onClick:Cn,className:"text-muted-foreground",children:"Change Server"})]}):g.jsx(g.Fragment,{children:S?g.jsx(q9,{session:S,messagesWithParts:lo,queuedMessages:lt[S.id]||[],preconfigs:Ls?es:u,prompts:f,models:K,defaultModel:V,onSendMessage:Nt,onRemoveFromQueue:li,onChangePreconfig:Ji,onChangeModel:oo,pendingPermissions:Ie,onPermissionResponse:Xl,onRename:si,usage:P,modelName:q,onNavigateToSubagent:Ct,onNavigateBack:ai,isStreaming:D===S.id,onInterrupt:Zl,onRevert:ii,onFork:ao,onCompact:(()=>{const re=lo.filter(we=>we.message.role!=="system"&&!we.parts.some(ge=>ge.type==="compaction"));return re.length>=4?()=>{const we=re.slice(0,re.length-2).map(ge=>ge.message.id);we.length>0&&Pd(S.id,we)}:void 0})(),isCompacting:Xe,serverUrl:ut!=null?ut:void 0,apiToken:ct!=null?ct:void 0}):g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center text-muted-foreground px-6",children:[g.jsx("h2",{className:"mb-2",children:"Select or create a session"}),g.jsx("p",{children:"Choose a session from the sidebar or create a new one to start chatting."})]})}):g.jsx(Cx,{onServerAdded:Zi,error:en||void 0});return g.jsxs(e4,{defaultOpen:!0,children:[Pt&&g.jsx(f4,{allSessions:o,viewMode:ae,favoritedWorkspaceIds:Hd,sessions:ci,currentSession:S,currentSessionId:(Is=S==null?void 0:S.id)!=null?Is:null,streamingSessionId:D,connected:R,workspaces:Q,activeWorkspace:N,onCreateSession:()=>{var re;return dr((re=es[0])==null?void 0:re.id)},onResumeSession:Ct,onCloseSession:nn,onReopenSession:Fd,onDeleteSession:Yl,onSelectWorkspace:Wl,onCreateVirtualWorkspace:ro,onCreatePhysicalWorkspace:io,onDeleteWorkspace:Kl,onOpenSettings:()=>z(!0),onOpenMCP:()=>ne(!0),onOpenAddServer:()=>Kt(!0),onServerSwitch:Os,onCreateSessionInWorkspace:Ud}),g.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden",style:{paddingTop:"env(safe-area-inset-top, 0)",paddingBottom:"env(safe-area-inset-bottom, 0)"},children:[g.jsxs("header",{className:"md:hidden flex items-center justify-between p-3 border-b border-border bg-background sticky top-0 z-10",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[Pt&&g.jsx(y0,{}),g.jsx("span",{className:"font-semibold",children:"Jean2"})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[Pt&&g.jsx(kx,{onServerSwitch:Os,onSelectWorkspace:no}),Pt&&g.jsx(Ex,{viewMode:ae,onViewModeChange:pe}),Pt&&N&&g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>J(!X),title:X?"Hide Files":"Show Files",children:g.jsx(Gp,{className:"w-4 h-4"})}),Pt&&N&&g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>W(!te),title:te?"Hide Terminal":"Show Terminal",children:g.jsx(Tb,{className:"w-4 h-4"})})]})]}),g.jsxs("header",{className:"hidden md:flex items-center justify-between p-3 border-b border-border",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[Pt&&g.jsx(y0,{}),g.jsx("span",{className:"font-semibold",children:"Jean2"})]}),g.jsxs("div",{className:"flex items-center gap-2",children:[Pt&&g.jsx(kx,{onServerSwitch:Os,onSelectWorkspace:no}),Pt&&g.jsx(Ex,{viewMode:ae,onViewModeChange:pe}),Pt&&N&&g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>J(!X),title:X?"Hide Files":"Show Files",children:g.jsx(Gp,{className:"w-4 h-4"})}),Pt&&N&&g.jsx(Te,{variant:"ghost",size:"icon-sm",onClick:()=>W(!te),title:te?"Hide Terminal":"Show Terminal",children:g.jsx(Tb,{className:"w-4 h-4"})})]})]}),tr(),Pt&&g.jsx(D4,{workspaceId:N==null?void 0:N.id,workspacePath:N==null?void 0:N.path,workspaceName:N==null?void 0:N.name,serverUrl:ut!=null?ut:void 0,apiToken:ct!=null?ct:void 0,isOpen:te,onClose:()=>W(!1)})]}),Pt&&g.jsxs(g.Fragment,{children:[g.jsx(g4,{workspaceId:N==null?void 0:N.id,serverUrl:ut!=null?ut:void 0,apiToken:ct!=null?ct:void 0,isOpen:X,onClose:()=>J(!1)}),g.jsx(X9,{open:B,onOpenChange:z,permissions:ue,onRefreshPermissions:Tr,onRevokePermission:re=>{Ve("permission.revoke",{permissionId:re})},onRevokeAllPermissions:()=>{Ve("permission.revoke_all",{workspaceId:N==null?void 0:N.id})},apiToken:ct,onLogout:Cn}),g.jsx(Q9,{open:H,onOpenChange:ne,workspaceId:N==null?void 0:N.id,workspacePath:N==null?void 0:N.path,serverUrl:ut!=null?ut:void 0,apiToken:ct!=null?ct:void 0})]}),g.jsx(e7,{open:fn,onOpenChange:re=>{Kt(re),re||$t(null)},editServer:ur})]})}function r7(){return g.jsx(ZT,{children:g.jsx(n7,{})})}Z2.createRoot(document.getElementById("root")).render(g.jsx(T.StrictMode,{children:g.jsx(J2,{defaultTheme:"dark",storageKey:"jean2-theme",children:g.jsx(r7,{})})}));