@jean2/client 0.5.0 → 0.6.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,524 +0,0 @@
1
- function V2(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 u of h.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).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 sd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var np={exports:{}},al={};/**
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 wb;function G2(){if(wb)return al;wb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(s,l,h){var u=null;if(h!==void 0&&(u=""+h),l.key!==void 0&&(u=""+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:u,ref:l!==void 0?l:null,props:h}}return al.Fragment=n,al.jsx=i,al.jsxs=i,al}var Cb;function W2(){return Cb||(Cb=1,np.exports=G2()),np.exports}var m=W2(),rp={exports:{}},$e={};/**
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 kb;function K2(){if(kb)return $e;kb=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"),u=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),b=Symbol.iterator;function S(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function y(I,L,z){this.props=I,this.context=L,this.refs=_,this.updater=z||k}y.prototype.isReactComponent={},y.prototype.setState=function(I,L){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,L,"setState")},y.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function v(){}v.prototype=y.prototype;function x(I,L,z){this.props=I,this.context=L,this.refs=_,this.updater=z||k}var E=x.prototype=new v;E.constructor=x,w(E,y.prototype),E.isPureReactComponent=!0;var N=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function O(I,L,z){var Z=z.ref;return{$$typeof:e,type:I,key:L,ref:Z!==void 0?Z:null,props:z}}function P(I,L){return O(I.type,L,I.props)}function $(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function U(I){var L={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(z){return L[z]})}var q=/\/+/g;function Y(I,L){return typeof I=="object"&&I!==null&&I.key!=null?U(""+I.key):L.toString(36)}function K(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(R,R):(I.status="pending",I.then(function(L){I.status==="pending"&&(I.status="fulfilled",I.value=L)},function(L){I.status==="pending"&&(I.status="rejected",I.reason=L)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function V(I,L,z,Z,X){var ee=typeof I;(ee==="undefined"||ee==="boolean")&&(I=null);var W=!1;if(I===null)W=!0;else switch(ee){case"bigint":case"string":case"number":W=!0;break;case"object":switch(I.$$typeof){case e:case n:W=!0;break;case g:return W=I._init,V(W(I._payload),L,z,Z,X)}}if(W)return X=X(I),W=Z===""?"."+Y(I,0):Z,N(X)?(z="",W!=null&&(z=W.replace(q,"$&/")+"/"),V(X,L,z,"",function(ae){return ae})):X!=null&&($(X)&&(X=P(X,z+(X.key==null||I&&I.key===X.key?"":(""+X.key).replace(q,"$&/")+"/")+W)),L.push(X)),1;W=0;var H=Z===""?".":Z+":";if(N(I))for(var te=0;te<I.length;te++)Z=I[te],ee=H+Y(Z,te),W+=V(Z,L,z,ee,X);else if(te=S(I),typeof te=="function")for(I=te.call(I),te=0;!(Z=I.next()).done;)Z=Z.value,ee=H+Y(Z,te++),W+=V(Z,L,z,ee,X);else if(ee==="object"){if(typeof I.then=="function")return V(K(I),L,z,Z,X);throw L=String(I),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return W}function J(I,L,z){if(I==null)return I;var Z=[],X=0;return V(I,Z,"","",function(ee){return L.call(z,ee,X++)}),Z}function ne(I){if(I._status===-1){var L=I._result;L=L(),L.then(function(z){(I._status===0||I._status===-1)&&(I._status=1,I._result=z)},function(z){(I._status===0||I._status===-1)&&(I._status=2,I._result=z)}),I._status===-1&&(I._status=0,I._result=L)}if(I._status===1)return I._result.default;throw I._result}var F=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},j={map:J,forEach:function(I,L,z){J(I,function(){L.apply(this,arguments)},z)},count:function(I){var L=0;return J(I,function(){L++}),L},toArray:function(I){return J(I,function(L){return L})||[]},only:function(I){if(!$(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return $e.Activity=f,$e.Children=j,$e.Component=y,$e.Fragment=i,$e.Profiler=l,$e.PureComponent=x,$e.StrictMode=s,$e.Suspense=c,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,$e.__COMPILER_RUNTIME={__proto__:null,c:function(I){return M.H.useMemoCache(I)}},$e.cache=function(I){return function(){return I.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function(I,L,z){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var Z=w({},I.props),X=I.key;if(L!=null)for(ee in L.key!==void 0&&(X=""+L.key),L)!D.call(L,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&L.ref===void 0||(Z[ee]=L[ee]);var ee=arguments.length-2;if(ee===1)Z.children=z;else if(1<ee){for(var W=Array(ee),H=0;H<ee;H++)W[H]=arguments[H+2];Z.children=W}return O(I.type,X,Z)},$e.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:h,_context:I},I},$e.createElement=function(I,L,z){var Z,X={},ee=null;if(L!=null)for(Z in L.key!==void 0&&(ee=""+L.key),L)D.call(L,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(X[Z]=L[Z]);var W=arguments.length-2;if(W===1)X.children=z;else if(1<W){for(var H=Array(W),te=0;te<W;te++)H[te]=arguments[te+2];X.children=H}if(I&&I.defaultProps)for(Z in W=I.defaultProps,W)X[Z]===void 0&&(X[Z]=W[Z]);return O(I,ee,X)},$e.createRef=function(){return{current:null}},$e.forwardRef=function(I){return{$$typeof:o,render:I}},$e.isValidElement=$,$e.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:ne}},$e.memo=function(I,L){return{$$typeof:d,type:I,compare:L===void 0?null:L}},$e.startTransition=function(I){var L=M.T,z={};M.T=z;try{var Z=I(),X=M.S;X!==null&&X(z,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,F)}catch(ee){F(ee)}finally{L!==null&&z.types!==null&&(L.types=z.types),M.T=L}},$e.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},$e.use=function(I){return M.H.use(I)},$e.useActionState=function(I,L,z){return M.H.useActionState(I,L,z)},$e.useCallback=function(I,L){return M.H.useCallback(I,L)},$e.useContext=function(I){return M.H.useContext(I)},$e.useDebugValue=function(){},$e.useDeferredValue=function(I,L){return M.H.useDeferredValue(I,L)},$e.useEffect=function(I,L){return M.H.useEffect(I,L)},$e.useEffectEvent=function(I){return M.H.useEffectEvent(I)},$e.useId=function(){return M.H.useId()},$e.useImperativeHandle=function(I,L,z){return M.H.useImperativeHandle(I,L,z)},$e.useInsertionEffect=function(I,L){return M.H.useInsertionEffect(I,L)},$e.useLayoutEffect=function(I,L){return M.H.useLayoutEffect(I,L)},$e.useMemo=function(I,L){return M.H.useMemo(I,L)},$e.useOptimistic=function(I,L){return M.H.useOptimistic(I,L)},$e.useReducer=function(I,L,z){return M.H.useReducer(I,L,z)},$e.useRef=function(I){return M.H.useRef(I)},$e.useState=function(I){return M.H.useState(I)},$e.useSyncExternalStore=function(I,L,z){return M.H.useSyncExternalStore(I,L,z)},$e.useTransition=function(){return M.H.useTransition()},$e.version="19.2.4",$e}var Eb;function Rm(){return Eb||(Eb=1,rp.exports=K2()),rp.exports}var T=Rm();const Jn=sd(T),Ox=V2({__proto__:null,default:Jn},[T]);var ip={exports:{}},ol={},sp={exports:{}},ap={};/**
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 Ab;function Y2(){return Ab||(Ab=1,(function(e){function n(V,J){var ne=V.length;V.push(J);e:for(;0<ne;){var F=ne-1>>>1,j=V[F];if(0<l(j,J))V[F]=J,V[ne]=j,ne=F;else break e}}function i(V){return V.length===0?null:V[0]}function s(V){if(V.length===0)return null;var J=V[0],ne=V.pop();if(ne!==J){V[0]=ne;e:for(var F=0,j=V.length,I=j>>>1;F<I;){var L=2*(F+1)-1,z=V[L],Z=L+1,X=V[Z];if(0>l(z,ne))Z<j&&0>l(X,z)?(V[F]=X,V[Z]=ne,F=Z):(V[F]=z,V[L]=ne,F=L);else if(Z<j&&0>l(X,ne))V[F]=X,V[Z]=ne,F=Z;else break e}}return J}function l(V,J){var ne=V.sortIndex-J.sortIndex;return ne!==0?ne:V.id-J.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 u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var c=[],d=[],g=1,f=null,b=3,S=!1,k=!1,w=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var J=i(d);J!==null;){if(J.callback===null)s(d);else if(J.startTime<=V)s(d),J.sortIndex=J.expirationTime,n(c,J);else break;J=i(d)}}function N(V){if(w=!1,E(V),!k)if(i(c)!==null)k=!0,R||(R=!0,U());else{var J=i(d);J!==null&&K(N,J.startTime-V)}}var R=!1,M=-1,D=5,O=-1;function P(){return _?!0:!(e.unstable_now()-O<D)}function $(){if(_=!1,R){var V=e.unstable_now();O=V;var J=!0;try{e:{k=!1,w&&(w=!1,v(M),M=-1),S=!0;var ne=b;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,b=f.priorityLevel;var j=F(f.expirationTime<=V);if(V=e.unstable_now(),typeof j=="function"){f.callback=j,E(V),J=!0;break t}f===i(c)&&s(c),E(V)}else s(c);f=i(c)}if(f!==null)J=!0;else{var I=i(d);I!==null&&K(N,I.startTime-V),J=!1}}break e}finally{f=null,b=ne,S=!1}J=void 0}}finally{J?U():R=!1}}}var U;if(typeof x=="function")U=function(){x($)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Y=q.port2;q.port1.onmessage=$,U=function(){Y.postMessage(null)}}else U=function(){y($,0)};function K(V,J){M=y(function(){V(e.unstable_now())},J)}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 b},e.unstable_next=function(V){switch(b){case 1:case 2:case 3:var J=3;break;default:J=b}var ne=b;b=J;try{return V()}finally{b=ne}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(V,J){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ne=b;b=V;try{return J()}finally{b=ne}},e.unstable_scheduleCallback=function(V,J,ne){var F=e.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?F+ne:F):ne=F,V){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=ne+j,V={id:g++,callback:J,priorityLevel:V,startTime:ne,expirationTime:j,sortIndex:-1},ne>F?(V.sortIndex=ne,n(d,V),i(c)===null&&V===i(d)&&(w?(v(M),M=-1):w=!0,K(N,ne-F))):(V.sortIndex=j,n(c,V),k||S||(k=!0,R||(R=!0,U()))),V},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(V){var J=b;return function(){var ne=b;b=J;try{return V.apply(this,arguments)}finally{b=ne}}}})(ap)),ap}var Tb;function X2(){return Tb||(Tb=1,sp.exports=Y2()),sp.exports}var op={exports:{}},on={};/**
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 Rb;function Z2(){if(Rb)return on;Rb=1;var e=Rm();function n(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+c+"; visit "+d+" 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,d,g){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:f==null?null:""+f,children:c,containerInfo:d,implementation:g}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,d){if(c==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return on.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,on.createPortal=function(c,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return h(c,d,null,g)},on.flushSync=function(c){var d=u.T,g=s.p;try{if(u.T=null,s.p=2,c)return c()}finally{u.T=d,s.p=g,s.d.f()}},on.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(c,d))},on.prefetchDNS=function(c){typeof c=="string"&&s.d.D(c)},on.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var g=d.as,f=o(g,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?s.d.S(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:f,integrity:b,fetchPriority:S}):g==="script"&&s.d.X(c,{crossOrigin:f,integrity:b,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},on.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=o(d.as,d.crossOrigin);s.d.M(c,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(c)},on.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,f=o(g,d.crossOrigin);s.d.L(c,g,{crossOrigin:f,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},on.preloadModule=function(c,d){if(typeof c=="string")if(d){var g=o(d.as,d.crossOrigin);s.d.m(c,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(c)},on.requestFormReset=function(c){s.d.r(c)},on.unstable_batchedUpdates=function(c,d){return c(d)},on.useFormState=function(c,d,g){return u.H.useFormState(c,d,g)},on.useFormStatus=function(){return u.H.useHostTransitionStatus()},on.version="19.2.4",on}var Db;function Lx(){if(Db)return op.exports;Db=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(),op.exports=Z2(),op.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 Nb;function Q2(){if(Nb)return ol;Nb=1;var e=X2(),n=Rm(),i=Lx();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 u(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 d(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 B=!1,G=C.child;G;){if(G===a){B=!0,a=C,p=A;break}if(G===p){B=!0,p=C,a=A;break}G=G.sibling}if(!B){for(G=A.child;G;){if(G===a){B=!0,a=A,p=C;break}if(G===p){B=!0,p=A,a=C;break}G=G.sibling}if(!B)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 g(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=g(t),r!==null)return r;t=t.sibling}return null}var f=Object.assign,b=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"),y=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),x=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function U(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var q=Symbol.for("react.client.reference");function Y(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===q?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case w:return"Fragment";case y:return"Profiler";case _:return"StrictMode";case N: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 M:return r=t.displayName||null,r!==null?r:Y(t.type)||"Memo";case D:r=t._payload,t=t._init;try{return Y(t(r))}catch{}}return null}var K=Array.isArray,V=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},F=[],j=-1;function I(t){return{current:t}}function L(t){0>j||(t.current=F[j],F[j]=null,j--)}function z(t,r){j++,F[j]=t.current,t.current=r}var Z=I(null),X=I(null),ee=I(null),W=I(null);function H(t,r){switch(z(ee,r),z(X,t),z(Z,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?Gy(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=Gy(r),t=Wy(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}L(Z),z(Z,t)}function te(){L(Z),L(X),L(ee)}function ae(t){t.memoizedState!==null&&z(W,t);var r=Z.current,a=Wy(r,t.type);r!==a&&(z(X,t),z(Z,a))}function pe(t){X.current===t&&(L(Z),L(X)),W.current===t&&(L(W),nl._currentValue=ne)}var ce,Oe;function Ie(t){if(ce===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);ce=r&&r[1]||"",Oe=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ce+t+Oe}var Ue=!1;function ut(t,r){if(!t||Ue)return"";Ue=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(r){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(de){var ue=de}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(de){ue=de}t.call(ge.prototype)}}else{try{throw Error()}catch(de){ue=de}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(de){if(de&&ue&&typeof de.stack=="string")return[de.stack,ue.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(),B=A[0],G=A[1];if(B&&G){var re=B.split(`
44
- `),le=G.split(`
45
- `);for(C=p=0;p<re.length&&!re[p].includes("DetermineComponentFrameRoot");)p++;for(;C<le.length&&!le[C].includes("DetermineComponentFrameRoot");)C++;if(p===re.length||C===le.length)for(p=re.length-1,C=le.length-1;1<=p&&0<=C&&re[p]!==le[C];)C--;for(;1<=p&&0<=C;p--,C--)if(re[p]!==le[C]){if(p!==1||C!==1)do if(p--,C--,0>C||re[p]!==le[C]){var fe=`
46
- `+re[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{Ue=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ie(a):""}function Ne(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 ut(t.type,!1);case 11:return ut(t.type.render,!1);case 1:return ut(t.type,!0);case 31:return Ie("Activity");default:return""}}function gn(t){try{var r="",a=null;do r+=Ne(t,a),a=t,t=t.return;while(t);return r}catch(p){return`
47
- Error generating stack: `+p.message+`
48
- `+p.stack}}var Gt=Object.prototype.hasOwnProperty,sn=e.unstable_scheduleCallback,Wt=e.unstable_cancelCallback,$n=e.unstable_shouldYield,Mt=e.unstable_requestPaint,Tt=e.unstable_now,Zt=e.unstable_getCurrentPriorityLevel,he=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Pe=e.unstable_LowPriority,qe=e.unstable_IdlePriority,wt=e.log,nt=e.unstable_setDisableYieldValue,Rt=null,jt=null;function Qt(t){if(typeof wt=="function"&&nt(t),jt&&typeof jt.setStrictMode=="function")try{jt.setStrictMode(Rt,t)}catch{}}var lt=Math.clz32?Math.clz32:Yd,mr=Math.log,dn=Math.LN2;function Yd(t){return t>>>=0,t===0?32:31-(mr(t)/dn|0)|0}var Bs=256,zs=262144,Nr=4194304;function qn(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 ho(t,r,a){var p=t.pendingLanes;if(p===0)return 0;var C=0,A=t.suspendedLanes,B=t.pingedLanes;t=t.warmLanes;var G=p&134217727;return G!==0?(p=G&~A,p!==0?C=qn(p):(B&=G,B!==0?C=qn(B):a||(a=G&~t,a!==0&&(C=qn(a))))):(G=p&~A,G!==0?C=qn(G):B!==0?C=qn(B):a||(a=p&~t,a!==0&&(C=qn(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 Mr(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function vt(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 ft(){var t=Nr;return Nr<<=1,(Nr&62914560)===0&&(Nr=4194304),t}function ui(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function gr(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function tc(t,r,a,p,C,A){var B=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,re=t.expirationTimes,le=t.hiddenUpdates;for(a=B&~a;0<a;){var fe=31-lt(a),ge=1<<fe;G[fe]=0,re[fe]=-1;var ue=le[fe];if(ue!==null)for(le[fe]=null,fe=0;fe<ue.length;fe++){var de=ue[fe];de!==null&&(de.lane&=-536870913)}a&=~ge}p!==0&&vr(t,p,0),A!==0&&C===0&&t.tag!==0&&(t.suspendedLanes|=A&~(B&~r))}function vr(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var p=31-lt(r);t.entangledLanes|=r,t.entanglements[p]=t.entanglements[p]|1073741824|a&261930}function nc(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var p=31-lt(a),C=1<<p;C&r|t[p]&r&&(t[p]|=r),a&=~C}}function Ps(t,r){var a=r&-r;return a=(a&42)!==0?1:An(a),(a&(t.suspendedLanes|r))!==0?0:a}function An(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 fo(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function po(){var t=J.p;return t!==0?t:(t=window.event,t===void 0?32:gb(t.type))}function rc(t,r){var a=J.p;try{return J.p=t,r()}finally{J.p=a}}var ir=Math.random().toString(36).slice(2),Ut="__reactFiber$"+ir,an="__reactProps$"+ir,di="__reactContainer$"+ir,Fs="__reactEvents$"+ir,He="__reactListeners$"+ir,Xd="__reactHandles$"+ir,ts="__reactResources$"+ir,ns="__reactMarker$"+ir;function mo(t){delete t[Ut],delete t[an],delete t[Fs],delete t[He],delete t[Xd]}function hi(t){var r=t[Ut];if(r)return r;for(var a=t.parentNode;a;){if(r=a[di]||a[Ut]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=eb(t);t!==null;){if(a=t[Ut])return a;t=eb(t)}return r}t=a,a=t.parentNode}return null}function fi(t){if(t=t[Ut]||t[di]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function rs(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function pi(t){var r=t[ts];return r||(r=t[ts]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function It(t){t[ns]=!0}var ic=new Set,sc={};function jr(t,r){mi(t,r),mi(t+"Capture",r)}function mi(t,r){for(sc[t]=r,t=0;t<r.length;t++)ic.add(r[t])}var ac=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]*$"),oc={},lc={};function Zd(t){return Gt.call(lc,t)?!0:Gt.call(oc,t)?!1:ac.test(t)?lc[t]=!0:(oc[t]=!0,!1)}function Hs(t,r,a){if(Zd(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 Us(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 sr(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 vn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function cc(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Qd(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(B){a=""+B,A.call(this,B)}}),Object.defineProperty(t,r,{enumerable:p.enumerable}),{getValue:function(){return a},setValue:function(B){a=""+B},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function $s(t){if(!t._valueTracker){var r=cc(t)?"checked":"value";t._valueTracker=Qd(t,r,""+t[r])}}function is(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),p="";return t&&(p=cc(t)?t.checked?"true":"false":t.value),t=p,t!==a?(r.setValue(t),!0):!1}function qs(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 Jd=/[\n"\\]/g;function _t(t){return t.replace(Jd,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function go(t,r,a,p,C,A,B,G){t.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?t.type=B:t.removeAttribute("type"),r!=null?B==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+vn(r)):t.value!==""+vn(r)&&(t.value=""+vn(r)):B!=="submit"&&B!=="reset"||t.removeAttribute("value"),r!=null?Vs(t,B,vn(r)):a!=null?Vs(t,B,vn(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=""+vn(G):t.removeAttribute("name")}function vo(t,r,a,p,C,A,B,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)){$s(t);return}a=a!=null?""+vn(a):"",r=r!=null?""+vn(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,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(t.name=B),$s(t)}function Vs(t,r,a){r==="number"&&qs(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Or(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=""+vn(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 _o(t,r,a){if(r!=null&&(r=""+vn(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a!=null?""+vn(a):""}function Q(t,r,a,p){if(r==null){if(p!=null){if(a!=null)throw Error(s(92));if(K(p)){if(1<p.length)throw Error(s(93));p=p[0]}a=p}a==null&&(a=""),r=a}a=vn(r),t.defaultValue=a,p=t.textContent,p===a&&p!==""&&p!==null&&(t.value=p),$s(t)}function be(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var Ve=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 Fe(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||Ve.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function Ct(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&&Fe(t,C,p)}else for(var A in r)r.hasOwnProperty(A)&&Fe(t,A,r[A])}function Tn(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 ye=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"]]),Ce=/^[\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 st(t){return Ce.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function yt(){}var hn=null;function _n(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ar=null,Gs=null;function Vg(t){var r=fi(t);if(r&&(t=r.stateNode)){var a=t[an]||null;e:switch(t=r.stateNode,r.type){case"input":if(go(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="'+_t(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var p=a[r];if(p!==t&&p.form===t.form){var C=p[an]||null;if(!C)throw Error(s(90));go(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&&is(p)}break e;case"textarea":_o(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Or(t,!!a.multiple,r,!1)}}}var eh=!1;function Gg(t,r,a){if(eh)return t(r,a);eh=!0;try{var p=t(r);return p}finally{if(eh=!1,(ar!==null||Gs!==null)&&(Xc(),ar&&(r=ar,t=Gs,Gs=ar=null,Vg(r),t)))for(r=0;r<t.length;r++)Vg(t[r])}}function yo(t,r){var a=t.stateNode;if(a===null)return null;var p=a[an]||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 Lr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),th=!1;if(Lr)try{var bo={};Object.defineProperty(bo,"passive",{get:function(){th=!0}}),window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{th=!1}var gi=null,nh=null,uc=null;function Wg(){if(uc)return uc;var t,r=nh,a=r.length,p,C="value"in gi?gi.value:gi.textContent,A=C.length;for(t=0;t<a&&r[t]===C[t];t++);var B=a-t;for(p=1;p<=B&&r[a-p]===C[A-p];p++);return uc=C.slice(t,1<p?1-p:void 0)}function dc(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 hc(){return!0}function Kg(){return!1}function yn(t){function r(a,p,C,A,B){this._reactName=a,this._targetInst=C,this.type=p,this.nativeEvent=A,this.target=B,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)?hc:Kg,this.isPropagationStopped=Kg,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=hc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=hc)},persist:function(){},isPersistent:hc}),r}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fc=yn(ss),xo=f({},ss,{view:0,detail:0}),$k=yn(xo),rh,ih,So,pc=f({},xo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ah,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!==So&&(So&&t.type==="mousemove"?(rh=t.screenX-So.screenX,ih=t.screenY-So.screenY):ih=rh=0,So=t),rh)},movementY:function(t){return"movementY"in t?t.movementY:ih}}),Yg=yn(pc),qk=f({},pc,{dataTransfer:0}),Vk=yn(qk),Gk=f({},xo,{relatedTarget:0}),sh=yn(Gk),Wk=f({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),Kk=yn(Wk),Yk=f({},ss,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Xk=yn(Yk),Zk=f({},ss,{data:0}),Xg=yn(Zk),Qk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jk={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"},eE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tE(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=eE[t])?!!r[t]:!1}function ah(){return tE}var nE=f({},xo,{key:function(t){if(t.key){var r=Qk[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=dc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Jk[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ah,charCode:function(t){return t.type==="keypress"?dc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?dc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),rE=yn(nE),iE=f({},pc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zg=yn(iE),sE=f({},xo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ah}),aE=yn(sE),oE=f({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),lE=yn(oE),cE=f({},pc,{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}),uE=yn(cE),dE=f({},ss,{newState:0,oldState:0}),hE=yn(dE),fE=[9,13,27,32],oh=Lr&&"CompositionEvent"in window,wo=null;Lr&&"documentMode"in document&&(wo=document.documentMode);var pE=Lr&&"TextEvent"in window&&!wo,Qg=Lr&&(!oh||wo&&8<wo&&11>=wo),Jg=" ",ev=!1;function tv(t,r){switch(t){case"keyup":return fE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ws=!1;function mE(t,r){switch(t){case"compositionend":return nv(r);case"keypress":return r.which!==32?null:(ev=!0,Jg);case"textInput":return t=r.data,t===Jg&&ev?null:t;default:return null}}function gE(t,r){if(Ws)return t==="compositionend"||!oh&&tv(t,r)?(t=Wg(),uc=nh=gi=null,Ws=!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 Qg&&r.locale!=="ko"?null:r.data;default:return null}}var vE={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 rv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!vE[t.type]:r==="textarea"}function iv(t,r,a,p){ar?Gs?Gs.push(p):Gs=[p]:ar=p,r=ru(r,"onChange"),0<r.length&&(a=new fc("onChange","change",null,a,p),t.push({event:a,listeners:r}))}var Co=null,ko=null;function _E(t){Fy(t,0)}function mc(t){var r=rs(t);if(is(r))return t}function sv(t,r){if(t==="change")return r}var av=!1;if(Lr){var lh;if(Lr){var ch="oninput"in document;if(!ch){var ov=document.createElement("div");ov.setAttribute("oninput","return;"),ch=typeof ov.oninput=="function"}lh=ch}else lh=!1;av=lh&&(!document.documentMode||9<document.documentMode)}function lv(){Co&&(Co.detachEvent("onpropertychange",cv),ko=Co=null)}function cv(t){if(t.propertyName==="value"&&mc(ko)){var r=[];iv(r,ko,t,_n(t)),Gg(_E,r)}}function yE(t,r,a){t==="focusin"?(lv(),Co=r,ko=a,Co.attachEvent("onpropertychange",cv)):t==="focusout"&&lv()}function bE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return mc(ko)}function xE(t,r){if(t==="click")return mc(r)}function SE(t,r){if(t==="input"||t==="change")return mc(r)}function wE(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Rn=typeof Object.is=="function"?Object.is:wE;function Eo(t,r){if(Rn(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(!Gt.call(r,C)||!Rn(t[C],r[C]))return!1}return!0}function uv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function dv(t,r){var a=uv(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=uv(a)}}function hv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?hv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function fv(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=qs(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=qs(t.document)}return r}function uh(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 CE=Lr&&"documentMode"in document&&11>=document.documentMode,Ks=null,dh=null,Ao=null,hh=!1;function pv(t,r,a){var p=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;hh||Ks==null||Ks!==qs(p)||(p=Ks,"selectionStart"in p&&uh(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}),Ao&&Eo(Ao,p)||(Ao=p,p=ru(dh,"onSelect"),0<p.length&&(r=new fc("onSelect","select",null,r,a),t.push({event:r,listeners:p}),r.target=Ks)))}function as(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Ys={animationend:as("Animation","AnimationEnd"),animationiteration:as("Animation","AnimationIteration"),animationstart:as("Animation","AnimationStart"),transitionrun:as("Transition","TransitionRun"),transitionstart:as("Transition","TransitionStart"),transitioncancel:as("Transition","TransitionCancel"),transitionend:as("Transition","TransitionEnd")},fh={},mv={};Lr&&(mv=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function os(t){if(fh[t])return fh[t];if(!Ys[t])return t;var r=Ys[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in mv)return fh[t]=r[a];return t}var gv=os("animationend"),vv=os("animationiteration"),_v=os("animationstart"),kE=os("transitionrun"),EE=os("transitionstart"),AE=os("transitioncancel"),yv=os("transitionend"),bv=new Map,ph="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(" ");ph.push("scrollEnd");function or(t,r){bv.set(t,r),jr(r,[t])}var gc=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)},Vn=[],Xs=0,mh=0;function vc(){for(var t=Xs,r=mh=Xs=0;r<t;){var a=Vn[r];Vn[r++]=null;var p=Vn[r];Vn[r++]=null;var C=Vn[r];Vn[r++]=null;var A=Vn[r];if(Vn[r++]=null,p!==null&&C!==null){var B=p.pending;B===null?C.next=C:(C.next=B.next,B.next=C),p.pending=C}A!==0&&xv(a,C,A)}}function _c(t,r,a,p){Vn[Xs++]=t,Vn[Xs++]=r,Vn[Xs++]=a,Vn[Xs++]=p,mh|=p,t.lanes|=p,t=t.alternate,t!==null&&(t.lanes|=p)}function gh(t,r,a,p){return _c(t,r,a,p),yc(t)}function ls(t,r){return _c(t,null,null,r),yc(t)}function xv(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-lt(a),t=A.hiddenUpdates,p=t[C],p===null?t[C]=[r]:p.push(r),r.lane=a|536870912),A):null}function yc(t){if(50<Yo)throw Yo=0,Ef=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var Zs={};function TE(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 Dn(t,r,a,p){return new TE(t,r,a,p)}function vh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ir(t,r){var a=t.alternate;return a===null?(a=Dn(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 Sv(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 bc(t,r,a,p,C,A){var B=0;if(p=t,typeof t=="function")vh(t)&&(B=1);else if(typeof t=="string")B=j2(t,a,Z.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O:return t=Dn(31,a,r,C),t.elementType=O,t.lanes=A,t;case w:return cs(a.children,C,A,r);case _:B=8,C|=24;break;case y:return t=Dn(12,a,r,C|2),t.elementType=y,t.lanes=A,t;case N:return t=Dn(13,a,r,C),t.elementType=N,t.lanes=A,t;case R:return t=Dn(19,a,r,C),t.elementType=R,t.lanes=A,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case x:B=10;break e;case v:B=9;break e;case E:B=11;break e;case M:B=14;break e;case D:B=16,p=null;break e}B=29,a=Error(s(130,t===null?"null":typeof t,"")),p=null}return r=Dn(B,a,r,C),r.elementType=t,r.type=p,r.lanes=A,r}function cs(t,r,a,p){return t=Dn(7,t,p,r),t.lanes=a,t}function _h(t,r,a){return t=Dn(6,t,null,r),t.lanes=a,t}function wv(t){var r=Dn(18,null,null,0);return r.stateNode=t,r}function yh(t,r,a){return r=Dn(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Cv=new WeakMap;function Gn(t,r){if(typeof t=="object"&&t!==null){var a=Cv.get(t);return a!==void 0?a:(r={value:t,source:r,stack:gn(r)},Cv.set(t,r),r)}return{value:t,source:r,stack:gn(r)}}var Qs=[],Js=0,xc=null,To=0,Wn=[],Kn=0,vi=null,_r=1,yr="";function Br(t,r){Qs[Js++]=To,Qs[Js++]=xc,xc=t,To=r}function kv(t,r,a){Wn[Kn++]=_r,Wn[Kn++]=yr,Wn[Kn++]=vi,vi=t;var p=_r;t=yr;var C=32-lt(p)-1;p&=~(1<<C),a+=1;var A=32-lt(r)+C;if(30<A){var B=C-C%5;A=(p&(1<<B)-1).toString(32),p>>=B,C-=B,_r=1<<32-lt(r)+C|a<<C|p,yr=A+t}else _r=1<<A|a<<C|p,yr=t}function bh(t){t.return!==null&&(Br(t,1),kv(t,1,0))}function xh(t){for(;t===xc;)xc=Qs[--Js],Qs[Js]=null,To=Qs[--Js],Qs[Js]=null;for(;t===vi;)vi=Wn[--Kn],Wn[Kn]=null,yr=Wn[--Kn],Wn[Kn]=null,_r=Wn[--Kn],Wn[Kn]=null}function Ev(t,r){Wn[Kn++]=_r,Wn[Kn++]=yr,Wn[Kn++]=vi,_r=r.id,yr=r.overflow,vi=t}var Jt=null,kt=null,rt=!1,_i=null,Yn=!1,Sh=Error(s(519));function yi(t){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ro(Gn(r,t)),Sh}function Av(t){var r=t.stateNode,a=t.type,p=t.memoizedProps;switch(r[Ut]=t,r[an]=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<Zo.length;a++)Qe(Zo[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),vo(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),Q(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||qy(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=yt),r=!0):r=!1,r||yi(t,!0)}function Tv(t){for(Jt=t.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:Yn=!1;return;case 27:case 3:Yn=!0;return;default:Jt=Jt.return}}function ea(t){if(t!==Jt)return!1;if(!rt)return Tv(t),rt=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Hf(t.type,t.memoizedProps)),a=!a),a&&kt&&yi(t),Tv(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));kt=Jy(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));kt=Jy(t)}else r===27?(r=kt,ji(t.type)?(t=Gf,Gf=null,kt=t):kt=r):kt=Jt?Zn(t.stateNode.nextSibling):null;return!0}function us(){kt=Jt=null,rt=!1}function wh(){var t=_i;return t!==null&&(wn===null?wn=t:wn.push.apply(wn,t),_i=null),t}function Ro(t){_i===null?_i=[t]:_i.push(t)}var Ch=I(null),ds=null,zr=null;function bi(t,r,a){z(Ch,r._currentValue),r._currentValue=a}function Pr(t){t._currentValue=Ch.current,L(Ch)}function kh(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 Eh(t,r,a,p){var C=t.child;for(C!==null&&(C.return=t);C!==null;){var A=C.dependencies;if(A!==null){var B=C.child;A=A.firstContext;e:for(;A!==null;){var G=A;A=C;for(var re=0;re<r.length;re++)if(G.context===r[re]){A.lanes|=a,G=A.alternate,G!==null&&(G.lanes|=a),kh(A.return,a,t),p||(B=null);break e}A=G.next}}else if(C.tag===18){if(B=C.return,B===null)throw Error(s(341));B.lanes|=a,A=B.alternate,A!==null&&(A.lanes|=a),kh(B,a,t),B=null}else B=C.child;if(B!==null)B.return=C;else for(B=C;B!==null;){if(B===t){B=null;break}if(C=B.sibling,C!==null){C.return=B.return,B=C;break}B=B.return}C=B}}function ta(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 B=C.alternate;if(B===null)throw Error(s(387));if(B=B.memoizedProps,B!==null){var G=C.type;Rn(C.pendingProps.value,B.value)||(t!==null?t.push(G):t=[G])}}else if(C===W.current){if(B=C.alternate,B===null)throw Error(s(387));B.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(t!==null?t.push(nl):t=[nl])}C=C.return}t!==null&&Eh(r,t,a,p),r.flags|=262144}function Sc(t){for(t=t.firstContext;t!==null;){if(!Rn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function hs(t){ds=t,zr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function en(t){return Rv(ds,t)}function wc(t,r){return ds===null&&hs(t),Rv(t,r)}function Rv(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},zr===null){if(t===null)throw Error(s(308));zr=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else zr=zr.next=r;return a}var RE=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()})}},DE=e.unstable_scheduleCallback,NE=e.unstable_NormalPriority,Bt={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ah(){return{controller:new RE,data:new Map,refCount:0}}function Do(t){t.refCount--,t.refCount===0&&DE(NE,function(){t.controller.abort()})}var No=null,Th=0,na=0,ra=null;function ME(t,r){if(No===null){var a=No=[];Th=0,na=Mf(),ra={status:"pending",value:void 0,then:function(p){a.push(p)}}}return Th++,r.then(Dv,Dv),r}function Dv(){if(--Th===0&&No!==null){ra!==null&&(ra.status="fulfilled");var t=No;No=null,na=0,ra=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function jE(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 Nv=V.S;V.S=function(t,r){py=Tt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&ME(t,r),Nv!==null&&Nv(t,r)};var fs=I(null);function Rh(){var t=fs.current;return t!==null?t:bt.pooledCache}function Cc(t,r){r===null?z(fs,fs.current):z(fs,r.pool)}function Mv(){var t=Rh();return t===null?null:{parent:Bt._currentValue,pool:t}}var ia=Error(s(460)),Dh=Error(s(474)),kc=Error(s(542)),Ec={then:function(){}};function jv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ov(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(yt,yt),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,Iv(t),t;default:if(typeof r.status=="string")r.then(yt,yt);else{if(t=bt,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,Iv(t),t}throw ms=r,ia}}function ps(t){try{var r=t._init;return r(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ms=a,ia):a}}var ms=null;function Lv(){if(ms===null)throw Error(s(459));var t=ms;return ms=null,t}function Iv(t){if(t===ia||t===kc)throw Error(s(483))}var sa=null,Mo=0;function Ac(t){var r=Mo;return Mo+=1,sa===null&&(sa=[]),Ov(sa,t,r)}function jo(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function Tc(t,r){throw r.$$typeof===b?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function Bv(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=Ir(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 B(se){return t&&se.alternate===null&&(se.flags|=67108866),se}function G(se,ie,oe,me){return ie===null||ie.tag!==6?(ie=_h(oe,se.mode,me),ie.return=se,ie):(ie=C(ie,oe),ie.return=se,ie)}function re(se,ie,oe,me){var Le=oe.type;return Le===w?fe(se,ie,oe.props.children,me,oe.key):ie!==null&&(ie.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===D&&ps(Le)===ie.type)?(ie=C(ie,oe.props),jo(ie,oe),ie.return=se,ie):(ie=bc(oe.type,oe.key,oe.props,null,se.mode,me),jo(ie,oe),ie.return=se,ie)}function le(se,ie,oe,me){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==oe.containerInfo||ie.stateNode.implementation!==oe.implementation?(ie=yh(oe,se.mode,me),ie.return=se,ie):(ie=C(ie,oe.children||[]),ie.return=se,ie)}function fe(se,ie,oe,me,Le){return ie===null||ie.tag!==7?(ie=cs(oe,se.mode,me,Le),ie.return=se,ie):(ie=C(ie,oe),ie.return=se,ie)}function ge(se,ie,oe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=_h(""+ie,se.mode,oe),ie.return=se,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case S:return oe=bc(ie.type,ie.key,ie.props,null,se.mode,oe),jo(oe,ie),oe.return=se,oe;case k:return ie=yh(ie,se.mode,oe),ie.return=se,ie;case D:return ie=ps(ie),ge(se,ie,oe)}if(K(ie)||U(ie))return ie=cs(ie,se.mode,oe,null),ie.return=se,ie;if(typeof ie.then=="function")return ge(se,Ac(ie),oe);if(ie.$$typeof===x)return ge(se,wc(se,ie),oe);Tc(se,ie)}return null}function ue(se,ie,oe,me){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,me);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case S:return oe.key===Le?re(se,ie,oe,me):null;case k:return oe.key===Le?le(se,ie,oe,me):null;case D:return oe=ps(oe),ue(se,ie,oe,me)}if(K(oe)||U(oe))return Le!==null?null:fe(se,ie,oe,me,null);if(typeof oe.then=="function")return ue(se,ie,Ac(oe),me);if(oe.$$typeof===x)return ue(se,ie,wc(se,oe),me);Tc(se,oe)}return null}function de(se,ie,oe,me,Le){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return se=se.get(oe)||null,G(ie,se,""+me,Le);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case S:return se=se.get(me.key===null?oe:me.key)||null,re(ie,se,me,Le);case k:return se=se.get(me.key===null?oe:me.key)||null,le(ie,se,me,Le);case D:return me=ps(me),de(se,ie,oe,me,Le)}if(K(me)||U(me))return se=se.get(oe)||null,fe(ie,se,me,Le,null);if(typeof me.then=="function")return de(se,ie,oe,Ac(me),Le);if(me.$$typeof===x)return de(se,ie,oe,wc(ie,me),Le);Tc(ie,me)}return null}function Ae(se,ie,oe,me){for(var Le=null,at=null,Me=ie,We=ie=0,tt=null;Me!==null&&We<oe.length;We++){Me.index>We?(tt=Me,Me=null):tt=Me.sibling;var ot=ue(se,Me,oe[We],me);if(ot===null){Me===null&&(Me=tt);break}t&&Me&&ot.alternate===null&&r(se,Me),ie=A(ot,ie,We),at===null?Le=ot:at.sibling=ot,at=ot,Me=tt}if(We===oe.length)return a(se,Me),rt&&Br(se,We),Le;if(Me===null){for(;We<oe.length;We++)Me=ge(se,oe[We],me),Me!==null&&(ie=A(Me,ie,We),at===null?Le=Me:at.sibling=Me,at=Me);return rt&&Br(se,We),Le}for(Me=p(Me);We<oe.length;We++)tt=de(Me,se,We,oe[We],me),tt!==null&&(t&&tt.alternate!==null&&Me.delete(tt.key===null?We:tt.key),ie=A(tt,ie,We),at===null?Le=tt:at.sibling=tt,at=tt);return t&&Me.forEach(function(zi){return r(se,zi)}),rt&&Br(se,We),Le}function ze(se,ie,oe,me){if(oe==null)throw Error(s(151));for(var Le=null,at=null,Me=ie,We=ie=0,tt=null,ot=oe.next();Me!==null&&!ot.done;We++,ot=oe.next()){Me.index>We?(tt=Me,Me=null):tt=Me.sibling;var zi=ue(se,Me,ot.value,me);if(zi===null){Me===null&&(Me=tt);break}t&&Me&&zi.alternate===null&&r(se,Me),ie=A(zi,ie,We),at===null?Le=zi:at.sibling=zi,at=zi,Me=tt}if(ot.done)return a(se,Me),rt&&Br(se,We),Le;if(Me===null){for(;!ot.done;We++,ot=oe.next())ot=ge(se,ot.value,me),ot!==null&&(ie=A(ot,ie,We),at===null?Le=ot:at.sibling=ot,at=ot);return rt&&Br(se,We),Le}for(Me=p(Me);!ot.done;We++,ot=oe.next())ot=de(Me,se,We,ot.value,me),ot!==null&&(t&&ot.alternate!==null&&Me.delete(ot.key===null?We:ot.key),ie=A(ot,ie,We),at===null?Le=ot:at.sibling=ot,at=ot);return t&&Me.forEach(function(q2){return r(se,q2)}),rt&&Br(se,We),Le}function gt(se,ie,oe,me){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),me=C(ie,oe.props.children),me.return=se,se=me;break e}}else if(ie.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===D&&ps(Le)===ie.type){a(se,ie.sibling),me=C(ie,oe.props),jo(me,oe),me.return=se,se=me;break e}a(se,ie);break}else r(se,ie);ie=ie.sibling}oe.type===w?(me=cs(oe.props.children,se.mode,me,oe.key),me.return=se,se=me):(me=bc(oe.type,oe.key,oe.props,null,se.mode,me),jo(me,oe),me.return=se,se=me)}return B(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),me=C(ie,oe.children||[]),me.return=se,se=me;break e}else{a(se,ie);break}else r(se,ie);ie=ie.sibling}me=yh(oe,se.mode,me),me.return=se,se=me}return B(se);case D:return oe=ps(oe),gt(se,ie,oe,me)}if(K(oe))return Ae(se,ie,oe,me);if(U(oe)){if(Le=U(oe),typeof Le!="function")throw Error(s(150));return oe=Le.call(oe),ze(se,ie,oe,me)}if(typeof oe.then=="function")return gt(se,ie,Ac(oe),me);if(oe.$$typeof===x)return gt(se,ie,wc(se,oe),me);Tc(se,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,ie!==null&&ie.tag===6?(a(se,ie.sibling),me=C(ie,oe),me.return=se,se=me):(a(se,ie),me=_h(oe,se.mode,me),me.return=se,se=me),B(se)):a(se,ie)}return function(se,ie,oe,me){try{Mo=0;var Le=gt(se,ie,oe,me);return sa=null,Le}catch(Me){if(Me===ia||Me===kc)throw Me;var at=Dn(29,Me,null,se.mode);return at.lanes=me,at.return=se,at}finally{}}}var gs=Bv(!0),zv=Bv(!1),xi=!1;function Nh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mh(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 Si(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function wi(t,r,a){var p=t.updateQueue;if(p===null)return null;if(p=p.shared,(ct&2)!==0){var C=p.pending;return C===null?r.next=r:(r.next=C.next,C.next=r),p.pending=r,r=yc(t),xv(t,null,a),r}return _c(t,p,r,a),yc(t)}function Oo(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,nc(t,a)}}function jh(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 B={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};A===null?C=A=B:A=A.next=B,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 Oh=!1;function Lo(){if(Oh){var t=ra;if(t!==null)throw t}}function Io(t,r,a,p){Oh=!1;var C=t.updateQueue;xi=!1;var A=C.firstBaseUpdate,B=C.lastBaseUpdate,G=C.shared.pending;if(G!==null){C.shared.pending=null;var re=G,le=re.next;re.next=null,B===null?A=le:B.next=le,B=re;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,G=fe.lastBaseUpdate,G!==B&&(G===null?fe.firstBaseUpdate=le:G.next=le,fe.lastBaseUpdate=re))}if(A!==null){var ge=C.baseState;B=0,fe=le=re=null,G=A;do{var ue=G.lane&-536870913,de=ue!==G.lane;if(de?(et&ue)===ue:(p&ue)===ue){ue!==0&&ue===na&&(Oh=!0),fe!==null&&(fe=fe.next={lane:0,tag:G.tag,payload:G.payload,callback:null,next:null});e:{var Ae=t,ze=G;ue=r;var gt=a;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){ge=Ae.call(gt,ge,ue);break e}ge=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,ue=typeof Ae=="function"?Ae.call(gt,ge,ue):Ae,ue==null)break e;ge=f({},ge,ue);break e;case 2:xi=!0}}ue=G.callback,ue!==null&&(t.flags|=64,de&&(t.flags|=8192),de=C.callbacks,de===null?C.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:G.tag,payload:G.payload,callback:G.callback,next:null},fe===null?(le=fe=de,re=ge):fe=fe.next=de,B|=ue;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&&(re=ge),C.baseState=re,C.firstBaseUpdate=le,C.lastBaseUpdate=fe,A===null&&(C.shared.lanes=0),Ti|=B,t.lanes=B,t.memoizedState=ge}}function Pv(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function Fv(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Pv(a[t],r)}var aa=I(null),Rc=I(0);function Hv(t,r){t=Kr,z(Rc,t),z(aa,r),Kr=t|r.baseLanes}function Lh(){z(Rc,Kr),z(aa,aa.current)}function Ih(){Kr=Rc.current,L(aa),L(Rc)}var Nn=I(null),Xn=null;function Ci(t){var r=t.alternate;z(Ot,Ot.current&1),z(Nn,t),Xn===null&&(r===null||aa.current!==null||r.memoizedState!==null)&&(Xn=t)}function Bh(t){z(Ot,Ot.current),z(Nn,t),Xn===null&&(Xn=t)}function Uv(t){t.tag===22?(z(Ot,Ot.current),z(Nn,t),Xn===null&&(Xn=t)):ki()}function ki(){z(Ot,Ot.current),z(Nn,Nn.current)}function Mn(t){L(Nn),Xn===t&&(Xn=null),L(Ot)}var Ot=I(0);function Dc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||qf(a)||Vf(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 Fr=0,Ge=null,pt=null,zt=null,Nc=!1,oa=!1,vs=!1,Mc=0,Bo=0,la=null,OE=0;function Dt(){throw Error(s(321))}function zh(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!Rn(t[a],r[a]))return!1;return!0}function Ph(t,r,a,p,C,A){return Fr=A,Ge=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,V.H=t===null||t.memoizedState===null?k_:ef,vs=!1,A=a(p,C),vs=!1,oa&&(A=qv(r,a,p,C)),$v(t),A}function $v(t){V.H=Fo;var r=pt!==null&&pt.next!==null;if(Fr=0,zt=pt=Ge=null,Nc=!1,Bo=0,la=null,r)throw Error(s(300));t===null||Pt||(t=t.dependencies,t!==null&&Sc(t)&&(Pt=!0))}function qv(t,r,a,p){Ge=t;var C=0;do{if(oa&&(la=null),Bo=0,oa=!1,25<=C)throw Error(s(301));if(C+=1,zt=pt=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=E_,A=r(a,p)}while(oa);return A}function LE(){var t=V.H,r=t.useState()[0];return r=typeof r.then=="function"?zo(r):r,t=t.useState()[0],(pt!==null?pt.memoizedState:null)!==t&&(Ge.flags|=1024),r}function Fh(){var t=Mc!==0;return Mc=0,t}function Hh(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function Uh(t){if(Nc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Nc=!1}Fr=0,zt=pt=Ge=null,oa=!1,Bo=Mc=0,la=null}function fn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?Ge.memoizedState=zt=t:zt=zt.next=t,zt}function Lt(){if(pt===null){var t=Ge.alternate;t=t!==null?t.memoizedState:null}else t=pt.next;var r=zt===null?Ge.memoizedState:zt.next;if(r!==null)zt=r,pt=t;else{if(t===null)throw Ge.alternate===null?Error(s(467)):Error(s(310));pt=t,t={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},zt===null?Ge.memoizedState=zt=t:zt=zt.next=t}return zt}function jc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zo(t){var r=Bo;return Bo+=1,la===null&&(la=[]),t=Ov(la,t,r),r=Ge,(zt===null?r.memoizedState:zt.next)===null&&(r=r.alternate,V.H=r===null||r.memoizedState===null?k_:ef),t}function Oc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zo(t);if(t.$$typeof===x)return en(t)}throw Error(s(438,String(t)))}function $h(t){var r=null,a=Ge.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var p=Ge.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=jc(),Ge.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 Hr(t,r){return typeof r=="function"?r(t):r}function Lc(t){var r=Lt();return qh(r,pt,t)}function qh(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 B=C.next;C.next=A.next,A.next=B}r.baseQueue=C=A,p.pending=null}if(A=t.baseState,C===null)t.memoizedState=A;else{r=C.next;var G=B=null,re=null,le=r,fe=!1;do{var ge=le.lane&-536870913;if(ge!==le.lane?(et&ge)===ge:(Fr&ge)===ge){var ue=le.revertLane;if(ue===0)re!==null&&(re=re.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),ge===na&&(fe=!0);else if((Fr&ue)===ue){le=le.next,ue===na&&(fe=!0);continue}else ge={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},re===null?(G=re=ge,B=A):re=re.next=ge,Ge.lanes|=ue,Ti|=ue;ge=le.action,vs&&a(A,ge),A=le.hasEagerState?le.eagerState:a(A,ge)}else ue={lane:ge,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},re===null?(G=re=ue,B=A):re=re.next=ue,Ge.lanes|=ge,Ti|=ge;le=le.next}while(le!==null&&le!==r);if(re===null?B=A:re.next=G,!Rn(A,t.memoizedState)&&(Pt=!0,fe&&(a=ra,a!==null)))throw a;t.memoizedState=A,t.baseState=B,t.baseQueue=re,p.lastRenderedState=A}return C===null&&(p.lanes=0),[t.memoizedState,p.dispatch]}function Vh(t){var r=Lt(),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 B=C=C.next;do A=t(A,B.action),B=B.next;while(B!==C);Rn(A,r.memoizedState)||(Pt=!0),r.memoizedState=A,r.baseQueue===null&&(r.baseState=A),a.lastRenderedState=A}return[A,p]}function Vv(t,r,a){var p=Ge,C=Lt(),A=rt;if(A){if(a===void 0)throw Error(s(407));a=a()}else a=r();var B=!Rn((pt||C).memoizedState,a);if(B&&(C.memoizedState=a,Pt=!0),C=C.queue,Kh(Kv.bind(null,p,C,t),[t]),C.getSnapshot!==r||B||zt!==null&&zt.memoizedState.tag&1){if(p.flags|=2048,ca(9,{destroy:void 0},Wv.bind(null,p,C,a,r),null),bt===null)throw Error(s(349));A||(Fr&127)!==0||Gv(p,r,a)}return a}function Gv(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Ge.updateQueue,r===null?(r=jc(),Ge.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function Wv(t,r,a,p){r.value=a,r.getSnapshot=p,Yv(r)&&Xv(t)}function Kv(t,r,a){return a(function(){Yv(r)&&Xv(t)})}function Yv(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!Rn(t,a)}catch{return!0}}function Xv(t){var r=ls(t,2);r!==null&&Cn(r,t,2)}function Gh(t){var r=fn();if(typeof t=="function"){var a=t;if(t=a(),vs){Qt(!0);try{a()}finally{Qt(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:t},r}function Zv(t,r,a,p){return t.baseState=a,qh(t,pt,typeof p=="function"?p:Hr)}function IE(t,r,a,p,C){if(zc(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(B){A.listeners.push(B)}};V.T!==null?a(!0):A.isTransition=!1,p(A),a=r.pending,a===null?(A.next=r.pending=A,Qv(r,A)):(A.next=a.next,r.pending=a.next=A)}}function Qv(t,r){var a=r.action,p=r.payload,C=t.state;if(r.isTransition){var A=V.T,B={};V.T=B;try{var G=a(C,p),re=V.S;re!==null&&re(B,G),Jv(t,r,G)}catch(le){Wh(t,r,le)}finally{A!==null&&B.types!==null&&(A.types=B.types),V.T=A}}else try{A=a(C,p),Jv(t,r,A)}catch(le){Wh(t,r,le)}}function Jv(t,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(p){e_(t,r,p)},function(p){return Wh(t,r,p)}):e_(t,r,a)}function e_(t,r,a){r.status="fulfilled",r.value=a,t_(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,Qv(t,a)))}function Wh(t,r,a){var p=t.pending;if(t.pending=null,p!==null){p=p.next;do r.status="rejected",r.reason=a,t_(r),r=r.next;while(r!==p)}t.action=null}function t_(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function n_(t,r){return r}function r_(t,r){if(rt){var a=bt.formState;if(a!==null){e:{var p=Ge;if(rt){if(kt){t:{for(var C=kt,A=Yn;C.nodeType!==8;){if(!A){C=null;break t}if(C=Zn(C.nextSibling),C===null){C=null;break t}}A=C.data,C=A==="F!"||A==="F"?C:null}if(C){kt=Zn(C.nextSibling),p=C.data==="F!";break e}}yi(p)}p=!1}p&&(r=a[0])}}return a=fn(),a.memoizedState=a.baseState=r,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n_,lastRenderedState:r},a.queue=p,a=S_.bind(null,Ge,p),p.dispatch=a,p=Gh(!1),A=Jh.bind(null,Ge,!1,p.queue),p=fn(),C={state:r,dispatch:null,action:t,pending:null},p.queue=C,a=IE.bind(null,Ge,C,A,a),C.dispatch=a,p.memoizedState=t,[r,a,!1]}function i_(t){var r=Lt();return s_(r,pt,t)}function s_(t,r,a){if(r=qh(t,r,n_)[0],t=Lc(Hr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var p=zo(r)}catch(B){throw B===ia?kc:B}else p=r;r=Lt();var C=r.queue,A=C.dispatch;return a!==r.memoizedState&&(Ge.flags|=2048,ca(9,{destroy:void 0},BE.bind(null,C,a),null)),[p,A,t]}function BE(t,r){t.action=r}function a_(t){var r=Lt(),a=pt;if(a!==null)return s_(r,a,t);Lt(),r=r.memoizedState,a=Lt();var p=a.queue.dispatch;return a.memoizedState=t,[r,p,!1]}function ca(t,r,a,p){return t={tag:t,create:a,deps:p,inst:r,next:null},r=Ge.updateQueue,r===null&&(r=jc(),Ge.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 o_(){return Lt().memoizedState}function Ic(t,r,a,p){var C=fn();Ge.flags|=t,C.memoizedState=ca(1|r,{destroy:void 0},a,p===void 0?null:p)}function Bc(t,r,a,p){var C=Lt();p=p===void 0?null:p;var A=C.memoizedState.inst;pt!==null&&p!==null&&zh(p,pt.memoizedState.deps)?C.memoizedState=ca(r,A,a,p):(Ge.flags|=t,C.memoizedState=ca(1|r,A,a,p))}function l_(t,r){Ic(8390656,8,t,r)}function Kh(t,r){Bc(2048,8,t,r)}function zE(t){Ge.flags|=4;var r=Ge.updateQueue;if(r===null)r=jc(),Ge.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function c_(t){var r=Lt().memoizedState;return zE({ref:r,nextImpl:t}),function(){if((ct&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function u_(t,r){return Bc(4,2,t,r)}function d_(t,r){return Bc(4,4,t,r)}function h_(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 f_(t,r,a){a=a!=null?a.concat([t]):null,Bc(4,4,h_.bind(null,r,t),a)}function Yh(){}function p_(t,r){var a=Lt();r=r===void 0?null:r;var p=a.memoizedState;return r!==null&&zh(r,p[1])?p[0]:(a.memoizedState=[t,r],t)}function m_(t,r){var a=Lt();r=r===void 0?null:r;var p=a.memoizedState;if(r!==null&&zh(r,p[1]))return p[0];if(p=t(),vs){Qt(!0);try{t()}finally{Qt(!1)}}return a.memoizedState=[p,r],p}function Xh(t,r,a){return a===void 0||(Fr&1073741824)!==0&&(et&261930)===0?t.memoizedState=r:(t.memoizedState=a,t=gy(),Ge.lanes|=t,Ti|=t,a)}function g_(t,r,a,p){return Rn(a,r)?a:aa.current!==null?(t=Xh(t,a,p),Rn(t,r)||(Pt=!0),t):(Fr&42)===0||(Fr&1073741824)!==0&&(et&261930)===0?(Pt=!0,t.memoizedState=a):(t=gy(),Ge.lanes|=t,Ti|=t,r)}function v_(t,r,a,p,C){var A=J.p;J.p=A!==0&&8>A?A:8;var B=V.T,G={};V.T=G,Jh(t,!1,r,a);try{var re=C(),le=V.S;if(le!==null&&le(G,re),re!==null&&typeof re=="object"&&typeof re.then=="function"){var fe=jE(re,p);Po(t,r,fe,Ln(t))}else Po(t,r,p,Ln(t))}catch(ge){Po(t,r,{then:function(){},status:"rejected",reason:ge},Ln())}finally{J.p=A,B!==null&&G.types!==null&&(B.types=G.types),V.T=B}}function PE(){}function Zh(t,r,a,p){if(t.tag!==5)throw Error(s(476));var C=__(t).queue;v_(t,C,r,ne,a===null?PE:function(){return y_(t),a(p)})}function __(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:ne},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function y_(t){var r=__(t);r.next===null&&(r=t.alternate.memoizedState),Po(t,r.next.queue,{},Ln())}function Qh(){return en(nl)}function b_(){return Lt().memoizedState}function x_(){return Lt().memoizedState}function FE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=Ln();t=Si(a);var p=wi(r,t,a);p!==null&&(Cn(p,r,a),Oo(p,r,a)),r={cache:Ah()},t.payload=r;return}r=r.return}}function HE(t,r,a){var p=Ln();a={lane:p,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},zc(t)?w_(r,a):(a=gh(t,r,a,p),a!==null&&(Cn(a,t,p),C_(a,r,p)))}function S_(t,r,a){var p=Ln();Po(t,r,a,p)}function Po(t,r,a,p){var C={lane:p,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(zc(t))w_(r,C);else{var A=t.alternate;if(t.lanes===0&&(A===null||A.lanes===0)&&(A=r.lastRenderedReducer,A!==null))try{var B=r.lastRenderedState,G=A(B,a);if(C.hasEagerState=!0,C.eagerState=G,Rn(G,B))return _c(t,r,C,0),bt===null&&vc(),!1}catch{}finally{}if(a=gh(t,r,C,p),a!==null)return Cn(a,t,p),C_(a,r,p),!0}return!1}function Jh(t,r,a,p){if(p={lane:2,revertLane:Mf(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},zc(t)){if(r)throw Error(s(479))}else r=gh(t,a,p,2),r!==null&&Cn(r,t,2)}function zc(t){var r=t.alternate;return t===Ge||r!==null&&r===Ge}function w_(t,r){oa=Nc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function C_(t,r,a){if((a&4194048)!==0){var p=r.lanes;p&=t.pendingLanes,a|=p,r.lanes=a,nc(t,a)}}var Fo={readContext:en,use:Oc,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt,useHostTransitionStatus:Dt,useFormState:Dt,useActionState:Dt,useOptimistic:Dt,useMemoCache:Dt,useCacheRefresh:Dt};Fo.useEffectEvent=Dt;var k_={readContext:en,use:Oc,useCallback:function(t,r){return fn().memoizedState=[t,r===void 0?null:r],t},useContext:en,useEffect:l_,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,Ic(4194308,4,h_.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Ic(4194308,4,t,r)},useInsertionEffect:function(t,r){Ic(4,2,t,r)},useMemo:function(t,r){var a=fn();r=r===void 0?null:r;var p=t();if(vs){Qt(!0);try{t()}finally{Qt(!1)}}return a.memoizedState=[p,r],p},useReducer:function(t,r,a){var p=fn();if(a!==void 0){var C=a(r);if(vs){Qt(!0);try{a(r)}finally{Qt(!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=HE.bind(null,Ge,t),[p.memoizedState,t]},useRef:function(t){var r=fn();return t={current:t},r.memoizedState=t},useState:function(t){t=Gh(t);var r=t.queue,a=S_.bind(null,Ge,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:Yh,useDeferredValue:function(t,r){var a=fn();return Xh(a,t,r)},useTransition:function(){var t=Gh(!1);return t=v_.bind(null,Ge,t.queue,!0,!1),fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var p=Ge,C=fn();if(rt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),bt===null)throw Error(s(349));(et&127)!==0||Gv(p,r,a)}C.memoizedState=a;var A={value:a,getSnapshot:r};return C.queue=A,l_(Kv.bind(null,p,A,t),[t]),p.flags|=2048,ca(9,{destroy:void 0},Wv.bind(null,p,A,a,r),null),a},useId:function(){var t=fn(),r=bt.identifierPrefix;if(rt){var a=yr,p=_r;a=(p&~(1<<32-lt(p)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Mc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=OE++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Qh,useFormState:r_,useActionState:r_,useOptimistic:function(t){var r=fn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Jh.bind(null,Ge,!0,a),a.dispatch=r,[t,r]},useMemoCache:$h,useCacheRefresh:function(){return fn().memoizedState=FE.bind(null,Ge)},useEffectEvent:function(t){var r=fn(),a={impl:t};return r.memoizedState=a,function(){if((ct&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},ef={readContext:en,use:Oc,useCallback:p_,useContext:en,useEffect:Kh,useImperativeHandle:f_,useInsertionEffect:u_,useLayoutEffect:d_,useMemo:m_,useReducer:Lc,useRef:o_,useState:function(){return Lc(Hr)},useDebugValue:Yh,useDeferredValue:function(t,r){var a=Lt();return g_(a,pt.memoizedState,t,r)},useTransition:function(){var t=Lc(Hr)[0],r=Lt().memoizedState;return[typeof t=="boolean"?t:zo(t),r]},useSyncExternalStore:Vv,useId:b_,useHostTransitionStatus:Qh,useFormState:i_,useActionState:i_,useOptimistic:function(t,r){var a=Lt();return Zv(a,pt,t,r)},useMemoCache:$h,useCacheRefresh:x_};ef.useEffectEvent=c_;var E_={readContext:en,use:Oc,useCallback:p_,useContext:en,useEffect:Kh,useImperativeHandle:f_,useInsertionEffect:u_,useLayoutEffect:d_,useMemo:m_,useReducer:Vh,useRef:o_,useState:function(){return Vh(Hr)},useDebugValue:Yh,useDeferredValue:function(t,r){var a=Lt();return pt===null?Xh(a,t,r):g_(a,pt.memoizedState,t,r)},useTransition:function(){var t=Vh(Hr)[0],r=Lt().memoizedState;return[typeof t=="boolean"?t:zo(t),r]},useSyncExternalStore:Vv,useId:b_,useHostTransitionStatus:Qh,useFormState:a_,useActionState:a_,useOptimistic:function(t,r){var a=Lt();return pt!==null?Zv(a,pt,t,r):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:$h,useCacheRefresh:x_};E_.useEffectEvent=c_;function tf(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 nf={enqueueSetState:function(t,r,a){t=t._reactInternals;var p=Ln(),C=Si(p);C.payload=r,a!=null&&(C.callback=a),r=wi(t,C,p),r!==null&&(Cn(r,t,p),Oo(r,t,p))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var p=Ln(),C=Si(p);C.tag=1,C.payload=r,a!=null&&(C.callback=a),r=wi(t,C,p),r!==null&&(Cn(r,t,p),Oo(r,t,p))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Ln(),p=Si(a);p.tag=2,r!=null&&(p.callback=r),r=wi(t,p,a),r!==null&&(Cn(r,t,a),Oo(r,t,a))}};function A_(t,r,a,p,C,A,B){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(p,A,B):r.prototype&&r.prototype.isPureReactComponent?!Eo(a,p)||!Eo(C,A):!0}function T_(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&&nf.enqueueReplaceState(r,r.state,null)}function _s(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 R_(t){gc(t)}function D_(t){console.error(t)}function N_(t){gc(t)}function Pc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(p){setTimeout(function(){throw p})}}function M_(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 rf(t,r,a){return a=Si(a),a.tag=3,a.payload={element:null},a.callback=function(){Pc(t,r)},a}function j_(t){return t=Si(t),t.tag=3,t}function O_(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(){M_(r,a,p)}}var B=a.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(t.callback=function(){M_(r,a,p),typeof C!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var G=p.stack;this.componentDidCatch(p.value,{componentStack:G!==null?G:""})})}function UE(t,r,a,p,C){if(a.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(r=a.alternate,r!==null&&ta(r,a,C,!0),a=Nn.current,a!==null){switch(a.tag){case 31:case 13:return Xn===null?Zc():a.alternate===null&&Nt===0&&(Nt=3),a.flags&=-257,a.flags|=65536,a.lanes=C,p===Ec?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([p]):r.add(p),Rf(t,p,C)),!1;case 22:return a.flags|=65536,p===Ec?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)),Rf(t,p,C)),!1}throw Error(s(435,a.tag))}return Rf(t,p,C),Zc(),!1}if(rt)return r=Nn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=C,p!==Sh&&(t=Error(s(422),{cause:p}),Ro(Gn(t,a)))):(p!==Sh&&(r=Error(s(423),{cause:p}),Ro(Gn(r,a))),t=t.current.alternate,t.flags|=65536,C&=-C,t.lanes|=C,p=Gn(p,a),C=rf(t.stateNode,p,C),jh(t,C),Nt!==4&&(Nt=2)),!1;var A=Error(s(520),{cause:p});if(A=Gn(A,a),Ko===null?Ko=[A]:Ko.push(A),Nt!==4&&(Nt=2),r===null)return!0;p=Gn(p,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=C&-C,a.lanes|=t,t=rf(a.stateNode,p,t),jh(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"&&(Ri===null||!Ri.has(A))))return a.flags|=65536,C&=-C,a.lanes|=C,C=j_(C),O_(C,t,a,p),jh(a,C),!1}a=a.return}while(a!==null);return!1}var sf=Error(s(461)),Pt=!1;function tn(t,r,a,p){r.child=t===null?zv(r,null,a,p):gs(r,t.child,a,p)}function L_(t,r,a,p,C){a=a.render;var A=r.ref;if("ref"in p){var B={};for(var G in p)G!=="ref"&&(B[G]=p[G])}else B=p;return hs(r),p=Ph(t,r,a,B,A,C),G=Fh(),t!==null&&!Pt?(Hh(t,r,C),Ur(t,r,C)):(rt&&G&&bh(r),r.flags|=1,tn(t,r,p,C),r.child)}function I_(t,r,a,p,C){if(t===null){var A=a.type;return typeof A=="function"&&!vh(A)&&A.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=A,B_(t,r,A,p,C)):(t=bc(a.type,null,p,r,r.mode,C),t.ref=r.ref,t.return=r,r.child=t)}if(A=t.child,!ff(t,C)){var B=A.memoizedProps;if(a=a.compare,a=a!==null?a:Eo,a(B,p)&&t.ref===r.ref)return Ur(t,r,C)}return r.flags|=1,t=Ir(A,p),t.ref=r.ref,t.return=r,r.child=t}function B_(t,r,a,p,C){if(t!==null){var A=t.memoizedProps;if(Eo(A,p)&&t.ref===r.ref)if(Pt=!1,r.pendingProps=p=A,ff(t,C))(t.flags&131072)!==0&&(Pt=!0);else return r.lanes=t.lanes,Ur(t,r,C)}return af(t,r,a,p,C)}function z_(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 P_(t,r,A,a,p)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Cc(r,A!==null?A.cachePool:null),A!==null?Hv(r,A):Lh(),Uv(r);else return p=r.lanes=536870912,P_(t,r,A!==null?A.baseLanes|a:a,a,p)}else A!==null?(Cc(r,A.cachePool),Hv(r,A),ki(),r.memoizedState=null):(t!==null&&Cc(r,null),Lh(),ki());return tn(t,r,C,a),r.child}function Ho(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function P_(t,r,a,p,C){var A=Rh();return A=A===null?null:{parent:Bt._currentValue,pool:A},r.memoizedState={baseLanes:a,cachePool:A},t!==null&&Cc(r,null),Lh(),Uv(r),t!==null&&ta(t,r,p,!0),r.childLanes=C,null}function Fc(t,r){return r=Uc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function F_(t,r,a){return gs(r,t.child,null,a),t=Fc(r,r.pendingProps),t.flags|=2,Mn(r),r.memoizedState=null,t}function $E(t,r,a){var p=r.pendingProps,C=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(rt){if(p.mode==="hidden")return t=Fc(r,p),r.lanes=536870912,Ho(null,t);if(Bh(r),(t=kt)?(t=Qy(t,Yn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:vi!==null?{id:_r,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},a=wv(t),a.return=r,r.child=a,Jt=r,kt=null)):t=null,t===null)throw yi(r);return r.lanes=536870912,null}return Fc(r,p)}var A=t.memoizedState;if(A!==null){var B=A.dehydrated;if(Bh(r),C)if(r.flags&256)r.flags&=-257,r=F_(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(Pt||ta(t,r,a,!1),C=(a&t.childLanes)!==0,Pt||C){if(p=bt,p!==null&&(B=Ps(p,a),B!==0&&B!==A.retryLane))throw A.retryLane=B,ls(t,B),Cn(p,t,B),sf;Zc(),r=F_(t,r,a)}else t=A.treeContext,kt=Zn(B.nextSibling),Jt=r,rt=!0,_i=null,Yn=!1,t!==null&&Ev(r,t),r=Fc(r,p),r.flags|=4096;return r}return t=Ir(t.child,{mode:p.mode,children:p.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Hc(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 af(t,r,a,p,C){return hs(r),a=Ph(t,r,a,p,void 0,C),p=Fh(),t!==null&&!Pt?(Hh(t,r,C),Ur(t,r,C)):(rt&&p&&bh(r),r.flags|=1,tn(t,r,a,C),r.child)}function H_(t,r,a,p,C,A){return hs(r),r.updateQueue=null,a=qv(r,p,a,C),$v(t),p=Fh(),t!==null&&!Pt?(Hh(t,r,A),Ur(t,r,A)):(rt&&p&&bh(r),r.flags|=1,tn(t,r,a,A),r.child)}function U_(t,r,a,p,C){if(hs(r),r.stateNode===null){var A=Zs,B=a.contextType;typeof B=="object"&&B!==null&&(A=en(B)),A=new a(p,A),r.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=nf,r.stateNode=A,A._reactInternals=r,A=r.stateNode,A.props=p,A.state=r.memoizedState,A.refs={},Nh(r),B=a.contextType,A.context=typeof B=="object"&&B!==null?en(B):Zs,A.state=r.memoizedState,B=a.getDerivedStateFromProps,typeof B=="function"&&(tf(r,a,B,p),A.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(B=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),B!==A.state&&nf.enqueueReplaceState(A,A.state,null),Io(r,p,A,C),Lo(),A.state=r.memoizedState),typeof A.componentDidMount=="function"&&(r.flags|=4194308),p=!0}else if(t===null){A=r.stateNode;var G=r.memoizedProps,re=_s(a,G);A.props=re;var le=A.context,fe=a.contextType;B=Zs,typeof fe=="object"&&fe!==null&&(B=en(fe));var ge=a.getDerivedStateFromProps;fe=typeof ge=="function"||typeof A.getSnapshotBeforeUpdate=="function",G=r.pendingProps!==G,fe||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(G||le!==B)&&T_(r,A,p,B),xi=!1;var ue=r.memoizedState;A.state=ue,Io(r,p,A,C),Lo(),le=r.memoizedState,G||ue!==le||xi?(typeof ge=="function"&&(tf(r,a,ge,p),le=r.memoizedState),(re=xi||A_(r,a,re,p,ue,le,B))?(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=B,p=re):(typeof A.componentDidMount=="function"&&(r.flags|=4194308),p=!1)}else{A=r.stateNode,Mh(t,r),B=r.memoizedProps,fe=_s(a,B),A.props=fe,ge=r.pendingProps,ue=A.context,le=a.contextType,re=Zs,typeof le=="object"&&le!==null&&(re=en(le)),G=a.getDerivedStateFromProps,(le=typeof G=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(B!==ge||ue!==re)&&T_(r,A,p,re),xi=!1,ue=r.memoizedState,A.state=ue,Io(r,p,A,C),Lo();var de=r.memoizedState;B!==ge||ue!==de||xi||t!==null&&t.dependencies!==null&&Sc(t.dependencies)?(typeof G=="function"&&(tf(r,a,G,p),de=r.memoizedState),(fe=xi||A_(r,a,fe,p,ue,de,re)||t!==null&&t.dependencies!==null&&Sc(t.dependencies))?(le||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(p,de,re),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(p,de,re)),typeof A.componentDidUpdate=="function"&&(r.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof A.componentDidUpdate!="function"||B===t.memoizedProps&&ue===t.memoizedState||(r.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&ue===t.memoizedState||(r.flags|=1024),r.memoizedProps=p,r.memoizedState=de),A.props=p,A.state=de,A.context=re,p=fe):(typeof A.componentDidUpdate!="function"||B===t.memoizedProps&&ue===t.memoizedState||(r.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||B===t.memoizedProps&&ue===t.memoizedState||(r.flags|=1024),p=!1)}return A=p,Hc(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=gs(r,t.child,null,C),r.child=gs(r,null,a,C)):tn(t,r,a,C),r.memoizedState=A.state,t=r.child):t=Ur(t,r,C),t}function $_(t,r,a,p){return us(),r.flags|=256,tn(t,r,a,p),r.child}var of={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lf(t){return{baseLanes:t,cachePool:Mv()}}function cf(t,r,a){return t=t!==null?t.childLanes&~a:0,r&&(t|=On),t}function q_(t,r,a){var p=r.pendingProps,C=!1,A=(r.flags&128)!==0,B;if((B=A)||(B=t!==null&&t.memoizedState===null?!1:(Ot.current&2)!==0),B&&(C=!0,r.flags&=-129),B=(r.flags&32)!==0,r.flags&=-33,t===null){if(rt){if(C?Ci(r):ki(),(t=kt)?(t=Qy(t,Yn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:vi!==null?{id:_r,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},a=wv(t),a.return=r,r.child=a,Jt=r,kt=null)):t=null,t===null)throw yi(r);return Vf(t)?r.lanes=32:r.lanes=536870912,null}var G=p.children;return p=p.fallback,C?(ki(),C=r.mode,G=Uc({mode:"hidden",children:G},C),p=cs(p,C,a,null),G.return=r,p.return=r,G.sibling=p,r.child=G,p=r.child,p.memoizedState=lf(a),p.childLanes=cf(t,B,a),r.memoizedState=of,Ho(null,p)):(Ci(r),uf(r,G))}var re=t.memoizedState;if(re!==null&&(G=re.dehydrated,G!==null)){if(A)r.flags&256?(Ci(r),r.flags&=-257,r=df(t,r,a)):r.memoizedState!==null?(ki(),r.child=t.child,r.flags|=128,r=null):(ki(),G=p.fallback,C=r.mode,p=Uc({mode:"visible",children:p.children},C),G=cs(G,C,a,null),G.flags|=2,p.return=r,G.return=r,p.sibling=G,r.child=p,gs(r,t.child,null,a),p=r.child,p.memoizedState=lf(a),p.childLanes=cf(t,B,a),r.memoizedState=of,r=Ho(null,p));else if(Ci(r),Vf(G)){if(B=G.nextSibling&&G.nextSibling.dataset,B)var le=B.dgst;B=le,p=Error(s(419)),p.stack="",p.digest=B,Ro({value:p,source:null,stack:null}),r=df(t,r,a)}else if(Pt||ta(t,r,a,!1),B=(a&t.childLanes)!==0,Pt||B){if(B=bt,B!==null&&(p=Ps(B,a),p!==0&&p!==re.retryLane))throw re.retryLane=p,ls(t,p),Cn(B,t,p),sf;qf(G)||Zc(),r=df(t,r,a)}else qf(G)?(r.flags|=192,r.child=t.child,r=null):(t=re.treeContext,kt=Zn(G.nextSibling),Jt=r,rt=!0,_i=null,Yn=!1,t!==null&&Ev(r,t),r=uf(r,p.children),r.flags|=4096);return r}return C?(ki(),G=p.fallback,C=r.mode,re=t.child,le=re.sibling,p=Ir(re,{mode:"hidden",children:p.children}),p.subtreeFlags=re.subtreeFlags&65011712,le!==null?G=Ir(le,G):(G=cs(G,C,a,null),G.flags|=2),G.return=r,p.return=r,p.sibling=G,r.child=p,Ho(null,p),p=r.child,G=t.child.memoizedState,G===null?G=lf(a):(C=G.cachePool,C!==null?(re=Bt._currentValue,C=C.parent!==re?{parent:re,pool:re}:C):C=Mv(),G={baseLanes:G.baseLanes|a,cachePool:C}),p.memoizedState=G,p.childLanes=cf(t,B,a),r.memoizedState=of,Ho(t.child,p)):(Ci(r),a=t.child,t=a.sibling,a=Ir(a,{mode:"visible",children:p.children}),a.return=r,a.sibling=null,t!==null&&(B=r.deletions,B===null?(r.deletions=[t],r.flags|=16):B.push(t)),r.child=a,r.memoizedState=null,a)}function uf(t,r){return r=Uc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Uc(t,r){return t=Dn(22,t,null,r),t.lanes=0,t}function df(t,r,a){return gs(r,t.child,null,a),t=uf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function V_(t,r,a){t.lanes|=r;var p=t.alternate;p!==null&&(p.lanes|=r),kh(t.return,r,a)}function hf(t,r,a,p,C,A){var B=t.memoizedState;B===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:p,tail:a,tailMode:C,treeForkCount:A}:(B.isBackwards=r,B.rendering=null,B.renderingStartTime=0,B.last=p,B.tail=a,B.tailMode=C,B.treeForkCount=A)}function G_(t,r,a){var p=r.pendingProps,C=p.revealOrder,A=p.tail;p=p.children;var B=Ot.current,G=(B&2)!==0;if(G?(B=B&1|2,r.flags|=128):B&=1,z(Ot,B),tn(t,r,p,a),p=rt?To:0,!G&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&V_(t,a,r);else if(t.tag===19)V_(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&&Dc(t)===null&&(C=a),a=a.sibling;a=C,a===null?(C=r.child,r.child=null):(C=a.sibling,a.sibling=null),hf(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&&Dc(t)===null){r.child=C;break}t=C.sibling,C.sibling=a,a=C,C=t}hf(r,!0,a,null,A,p);break;case"together":hf(r,!1,null,null,void 0,p);break;default:r.memoizedState=null}return r.child}function Ur(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),Ti|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(ta(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=Ir(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Ir(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function ff(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&Sc(t)))}function qE(t,r,a){switch(r.tag){case 3:H(r,r.stateNode.containerInfo),bi(r,Bt,t.memoizedState.cache),us();break;case 27:case 5:ae(r);break;case 4:H(r,r.stateNode.containerInfo);break;case 10:bi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Bh(r),null;break;case 13:var p=r.memoizedState;if(p!==null)return p.dehydrated!==null?(Ci(r),r.flags|=128,null):(a&r.child.childLanes)!==0?q_(t,r,a):(Ci(r),t=Ur(t,r,a),t!==null?t.sibling:null);Ci(r);break;case 19:var C=(t.flags&128)!==0;if(p=(a&r.childLanes)!==0,p||(ta(t,r,a,!1),p=(a&r.childLanes)!==0),C){if(p)return G_(t,r,a);r.flags|=128}if(C=r.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),z(Ot,Ot.current),p)break;return null;case 22:return r.lanes=0,z_(t,r,a,r.pendingProps);case 24:bi(r,Bt,t.memoizedState.cache)}return Ur(t,r,a)}function W_(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)Pt=!0;else{if(!ff(t,a)&&(r.flags&128)===0)return Pt=!1,qE(t,r,a);Pt=(t.flags&131072)!==0}else Pt=!1,rt&&(r.flags&1048576)!==0&&kv(r,To,r.index);switch(r.lanes=0,r.tag){case 16:e:{var p=r.pendingProps;if(t=ps(r.elementType),r.type=t,typeof t=="function")vh(t)?(p=_s(t,p),r.tag=1,r=U_(null,r,t,p,a)):(r.tag=0,r=af(null,r,t,p,a));else{if(t!=null){var C=t.$$typeof;if(C===E){r.tag=11,r=L_(null,r,t,p,a);break e}else if(C===M){r.tag=14,r=I_(null,r,t,p,a);break e}}throw r=Y(t)||t,Error(s(306,r,""))}}return r;case 0:return af(t,r,r.type,r.pendingProps,a);case 1:return p=r.type,C=_s(p,r.pendingProps),U_(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,Mh(t,r),Io(r,p,null,a);var B=r.memoizedState;if(p=B.cache,bi(r,Bt,p),p!==A.cache&&Eh(r,[Bt],a,!0),Lo(),p=B.element,A.isDehydrated)if(A={element:p,isDehydrated:!1,cache:B.cache},r.updateQueue.baseState=A,r.memoizedState=A,r.flags&256){r=$_(t,r,p,a);break e}else if(p!==C){C=Gn(Error(s(424)),r),Ro(C),r=$_(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(kt=Zn(t.firstChild),Jt=r,rt=!0,_i=null,Yn=!0,a=zv(r,null,p,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(us(),p===C){r=Ur(t,r,a);break e}tn(t,r,p,a)}r=r.child}return r;case 26:return Hc(t,r),t===null?(a=ib(r.type,null,r.pendingProps,null))?r.memoizedState=a:rt||(a=r.type,t=r.pendingProps,p=iu(ee.current).createElement(a),p[Ut]=r,p[an]=t,nn(p,a,t),It(p),r.stateNode=p):r.memoizedState=ib(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return ae(r),t===null&&rt&&(p=r.stateNode=tb(r.type,r.pendingProps,ee.current),Jt=r,Yn=!0,C=kt,ji(r.type)?(Gf=C,kt=Zn(p.firstChild)):kt=C),tn(t,r,r.pendingProps.children,a),Hc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&rt&&((C=p=kt)&&(p=b2(p,r.type,r.pendingProps,Yn),p!==null?(r.stateNode=p,Jt=r,kt=Zn(p.firstChild),Yn=!1,C=!0):C=!1),C||yi(r)),ae(r),C=r.type,A=r.pendingProps,B=t!==null?t.memoizedProps:null,p=A.children,Hf(C,A)?p=null:B!==null&&Hf(C,B)&&(r.flags|=32),r.memoizedState!==null&&(C=Ph(t,r,LE,null,null,a),nl._currentValue=C),Hc(t,r),tn(t,r,p,a),r.child;case 6:return t===null&&rt&&((t=a=kt)&&(a=x2(a,r.pendingProps,Yn),a!==null?(r.stateNode=a,Jt=r,kt=null,t=!0):t=!1),t||yi(r)),null;case 13:return q_(t,r,a);case 4:return H(r,r.stateNode.containerInfo),p=r.pendingProps,t===null?r.child=gs(r,null,p,a):tn(t,r,p,a),r.child;case 11:return L_(t,r,r.type,r.pendingProps,a);case 7:return tn(t,r,r.pendingProps,a),r.child;case 8:return tn(t,r,r.pendingProps.children,a),r.child;case 12:return tn(t,r,r.pendingProps.children,a),r.child;case 10:return p=r.pendingProps,bi(r,r.type,p.value),tn(t,r,p.children,a),r.child;case 9:return C=r.type._context,p=r.pendingProps.children,hs(r),C=en(C),p=p(C),r.flags|=1,tn(t,r,p,a),r.child;case 14:return I_(t,r,r.type,r.pendingProps,a);case 15:return B_(t,r,r.type,r.pendingProps,a);case 19:return G_(t,r,a);case 31:return $E(t,r,a);case 22:return z_(t,r,a,r.pendingProps);case 24:return hs(r),p=en(Bt),t===null?(C=Rh(),C===null&&(C=bt,A=Ah(),C.pooledCache=A,A.refCount++,A!==null&&(C.pooledCacheLanes|=a),C=A),r.memoizedState={parent:p,cache:C},Nh(r),bi(r,Bt,C)):((t.lanes&a)!==0&&(Mh(t,r),Io(r,null,null,a),Lo()),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),bi(r,Bt,p)):(p=A.cache,bi(r,Bt,p),p!==C.cache&&Eh(r,[Bt],a,!0))),tn(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function $r(t){t.flags|=4}function pf(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(by())t.flags|=8192;else throw ms=Ec,Dh}else t.flags&=-16777217}function K_(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!cb(r))if(by())t.flags|=8192;else throw ms=Ec,Dh}function $c(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?ft():536870912,t.lanes|=r,fa|=r)}function Uo(t,r){if(!rt)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 Et(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 VE(t,r,a){var p=r.pendingProps;switch(xh(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(r),null;case 1:return Et(r),null;case 3:return a=r.stateNode,p=null,t!==null&&(p=t.memoizedState.cache),r.memoizedState.cache!==p&&(r.flags|=2048),Pr(Bt),te(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(ea(r)?$r(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,wh())),Et(r),null;case 26:var C=r.type,A=r.memoizedState;return t===null?($r(r),A!==null?(Et(r),K_(r,A)):(Et(r),pf(r,C,null,p,a))):A?A!==t.memoizedState?($r(r),Et(r),K_(r,A)):(Et(r),r.flags&=-16777217):(t=t.memoizedProps,t!==p&&$r(r),Et(r),pf(r,C,t,p,a)),null;case 27:if(pe(r),a=ee.current,C=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==p&&$r(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return Et(r),null}t=Z.current,ea(r)?Av(r):(t=tb(C,p,a),r.stateNode=t,$r(r))}return Et(r),null;case 5:if(pe(r),C=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==p&&$r(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return Et(r),null}if(A=Z.current,ea(r))Av(r);else{var B=iu(ee.current);switch(A){case 1:A=B.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:A=B.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":A=B.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":A=B.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":A=B.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof p.is=="string"?B.createElement("select",{is:p.is}):B.createElement("select"),p.multiple?A.multiple=!0:p.size&&(A.size=p.size);break;default:A=typeof p.is=="string"?B.createElement(C,{is:p.is}):B.createElement(C)}}A[Ut]=r,A[an]=p;e:for(B=r.child;B!==null;){if(B.tag===5||B.tag===6)A.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===r)break e;for(;B.sibling===null;){if(B.return===null||B.return===r)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}r.stateNode=A;e:switch(nn(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&&$r(r)}}return Et(r),pf(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==p&&$r(r);else{if(typeof p!="string"&&r.stateNode===null)throw Error(s(166));if(t=ee.current,ea(r)){if(t=r.stateNode,a=r.memoizedProps,p=null,C=Jt,C!==null)switch(C.tag){case 27:case 5:p=C.memoizedProps}t[Ut]=r,t=!!(t.nodeValue===a||p!==null&&p.suppressHydrationWarning===!0||qy(t.nodeValue,a)),t||yi(r,!0)}else t=iu(t).createTextNode(p),t[Ut]=r,r.stateNode=t}return Et(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(p=ea(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[Ut]=r}else us(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Et(r),t=!1}else a=wh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(Mn(r),r):(Mn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Et(r),null;case 13:if(p=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(C=ea(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[Ut]=r}else us(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Et(r),C=!1}else C=wh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=C),C=!0;if(!C)return r.flags&256?(Mn(r),r):(Mn(r),null)}return Mn(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),$c(r,r.updateQueue),Et(r),null);case 4:return te(),t===null&&If(r.stateNode.containerInfo),Et(r),null;case 10:return Pr(r.type),Et(r),null;case 19:if(L(Ot),p=r.memoizedState,p===null)return Et(r),null;if(C=(r.flags&128)!==0,A=p.rendering,A===null)if(C)Uo(p,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(A=Dc(t),A!==null){for(r.flags|=128,Uo(p,!1),t=A.updateQueue,r.updateQueue=t,$c(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)Sv(a,t),a=a.sibling;return z(Ot,Ot.current&1|2),rt&&Br(r,p.treeForkCount),r.child}t=t.sibling}p.tail!==null&&Tt()>Kc&&(r.flags|=128,C=!0,Uo(p,!1),r.lanes=4194304)}else{if(!C)if(t=Dc(A),t!==null){if(r.flags|=128,C=!0,t=t.updateQueue,r.updateQueue=t,$c(r,t),Uo(p,!0),p.tail===null&&p.tailMode==="hidden"&&!A.alternate&&!rt)return Et(r),null}else 2*Tt()-p.renderingStartTime>Kc&&a!==536870912&&(r.flags|=128,C=!0,Uo(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=Tt(),t.sibling=null,a=Ot.current,z(Ot,C?a&1|2:a&1),rt&&Br(r,p.treeForkCount),t):(Et(r),null);case 22:case 23:return Mn(r),Ih(),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&&(Et(r),r.subtreeFlags&6&&(r.flags|=8192)):Et(r),a=r.updateQueue,a!==null&&$c(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&&L(fs),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Pr(Bt),Et(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function GE(t,r){switch(xh(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Pr(Bt),te(),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(Mn(r),r.alternate===null)throw Error(s(340));us()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Mn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));us()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return L(Ot),null;case 4:return te(),null;case 10:return Pr(r.type),null;case 22:case 23:return Mn(r),Ih(),t!==null&&L(fs),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return Pr(Bt),null;case 25:return null;default:return null}}function Y_(t,r){switch(xh(r),r.tag){case 3:Pr(Bt),te();break;case 26:case 27:case 5:pe(r);break;case 4:te();break;case 31:r.memoizedState!==null&&Mn(r);break;case 13:Mn(r);break;case 19:L(Ot);break;case 10:Pr(r.type);break;case 22:case 23:Mn(r),Ih(),t!==null&&L(fs);break;case 24:Pr(Bt)}}function $o(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,B=a.inst;p=A(),B.destroy=p}a=a.next}while(a!==C)}}catch(G){ht(r,r.return,G)}}function Ei(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 B=p.inst,G=B.destroy;if(G!==void 0){B.destroy=void 0,C=r;var re=a,le=G;try{le()}catch(fe){ht(C,re,fe)}}}p=p.next}while(p!==A)}}catch(fe){ht(r,r.return,fe)}}function X_(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{Fv(r,a)}catch(p){ht(t,t.return,p)}}}function Z_(t,r,a){a.props=_s(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(p){ht(t,r,p)}}function qo(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 br(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 Q_(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 mf(t,r,a){try{var p=t.stateNode;p2(p,t.type,a,r),p[an]=r}catch(C){ht(t,t.return,C)}}function J_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ji(t.type)||t.tag===4}function gf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||J_(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&&ji(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 vf(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=yt));else if(p!==4&&(p===27&&ji(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(vf(t,r,a),t=t.sibling;t!==null;)vf(t,r,a),t=t.sibling}function qc(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&&ji(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(qc(t,r,a),t=t.sibling;t!==null;)qc(t,r,a),t=t.sibling}function ey(t){var r=t.stateNode,a=t.memoizedProps;try{for(var p=t.type,C=r.attributes;C.length;)r.removeAttributeNode(C[0]);nn(r,p,a),r[Ut]=t,r[an]=a}catch(A){ht(t,t.return,A)}}var qr=!1,Ft=!1,_f=!1,ty=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function WE(t,r){if(t=t.containerInfo,Pf=du,t=fv(t),uh(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 B=0,G=-1,re=-1,le=0,fe=0,ge=t,ue=null;t:for(;;){for(var de;ge!==a||C!==0&&ge.nodeType!==3||(G=B+C),ge!==A||p!==0&&ge.nodeType!==3||(re=B+p),ge.nodeType===3&&(B+=ge.nodeValue.length),(de=ge.firstChild)!==null;)ue=ge,ge=de;for(;;){if(ge===t)break t;if(ue===a&&++le===C&&(G=B),ue===A&&++fe===p&&(re=B),(de=ge.nextSibling)!==null)break;ge=ue,ue=ge.parentNode}ge=de}a=G===-1||re===-1?null:{start:G,end:re}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ff={focusedElem:t,selectionRange:a},du=!1,Kt=r;Kt!==null;)if(r=Kt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Kt=t;else for(;Kt!==null;){switch(r=Kt,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 Ae=_s(a.type,C);t=p.getSnapshotBeforeUpdate(Ae,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)$f(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":$f(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,Kt=t;break}Kt=r.return}}function ny(t,r,a){var p=a.flags;switch(a.tag){case 0:case 11:case 15:Gr(t,a),p&4&&$o(5,a);break;case 1:if(Gr(t,a),p&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(B){ht(a,a.return,B)}else{var C=_s(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(C,r,t.__reactInternalSnapshotBeforeUpdate)}catch(B){ht(a,a.return,B)}}p&64&&X_(a),p&512&&qo(a,a.return);break;case 3:if(Gr(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{Fv(t,r)}catch(B){ht(a,a.return,B)}}break;case 27:r===null&&p&4&&ey(a);case 26:case 5:Gr(t,a),r===null&&p&4&&Q_(a),p&512&&qo(a,a.return);break;case 12:Gr(t,a);break;case 31:Gr(t,a),p&4&&sy(t,a);break;case 13:Gr(t,a),p&4&&ay(t,a),p&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=n2.bind(null,a),S2(t,a))));break;case 22:if(p=a.memoizedState!==null||qr,!p){r=r!==null&&r.memoizedState!==null||Ft,C=qr;var A=Ft;qr=p,(Ft=r)&&!A?Wr(t,a,(a.subtreeFlags&8772)!==0):Gr(t,a),qr=C,Ft=A}break;case 30:break;default:Gr(t,a)}}function ry(t){var r=t.alternate;r!==null&&(t.alternate=null,ry(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&mo(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 At=null,bn=!1;function Vr(t,r,a){for(a=a.child;a!==null;)iy(t,r,a),a=a.sibling}function iy(t,r,a){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(Rt,a)}catch{}switch(a.tag){case 26:Ft||br(a,r),Vr(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ft||br(a,r);var p=At,C=bn;ji(a.type)&&(At=a.stateNode,bn=!1),Vr(t,r,a),Jo(a.stateNode),At=p,bn=C;break;case 5:Ft||br(a,r);case 6:if(p=At,C=bn,At=null,Vr(t,r,a),At=p,bn=C,At!==null)if(bn)try{(At.nodeType===9?At.body:At.nodeName==="HTML"?At.ownerDocument.body:At).removeChild(a.stateNode)}catch(A){ht(a,r,A)}else try{At.removeChild(a.stateNode)}catch(A){ht(a,r,A)}break;case 18:At!==null&&(bn?(t=At,Xy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),xa(t)):Xy(At,a.stateNode));break;case 4:p=At,C=bn,At=a.stateNode.containerInfo,bn=!0,Vr(t,r,a),At=p,bn=C;break;case 0:case 11:case 14:case 15:Ei(2,a,r),Ft||Ei(4,a,r),Vr(t,r,a);break;case 1:Ft||(br(a,r),p=a.stateNode,typeof p.componentWillUnmount=="function"&&Z_(a,r,p)),Vr(t,r,a);break;case 21:Vr(t,r,a);break;case 22:Ft=(p=Ft)||a.memoizedState!==null,Vr(t,r,a),Ft=p;break;default:Vr(t,r,a)}}function sy(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{xa(t)}catch(a){ht(r,r.return,a)}}}function ay(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{xa(t)}catch(a){ht(r,r.return,a)}}function KE(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new ty),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new ty),r;default:throw Error(s(435,t.tag))}}function Vc(t,r){var a=KE(t);r.forEach(function(p){if(!a.has(p)){a.add(p);var C=r2.bind(null,t,p);p.then(C,C)}})}function xn(t,r){var a=r.deletions;if(a!==null)for(var p=0;p<a.length;p++){var C=a[p],A=t,B=r,G=B;e:for(;G!==null;){switch(G.tag){case 27:if(ji(G.type)){At=G.stateNode,bn=!1;break e}break;case 5:At=G.stateNode,bn=!1;break e;case 3:case 4:At=G.stateNode.containerInfo,bn=!0;break e}G=G.return}if(At===null)throw Error(s(160));iy(A,B,C),At=null,bn=!1,A=C.alternate,A!==null&&(A.return=null),C.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)oy(r,t),r=r.sibling}var lr=null;function oy(t,r){var a=t.alternate,p=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:xn(r,t),Sn(t),p&4&&(Ei(3,t,t.return),$o(3,t),Ei(5,t,t.return));break;case 1:xn(r,t),Sn(t),p&512&&(Ft||a===null||br(a,a.return)),p&64&&qr&&(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=lr;if(xn(r,t),Sn(t),p&512&&(Ft||a===null||br(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[ns]||A[Ut]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=C.createElement(p),C.head.insertBefore(A,C.querySelector("head > title"))),nn(A,p,a),A[Ut]=t,It(A),p=A;break e;case"link":var B=ob("link","href",C).get(p+(a.href||""));if(B){for(var G=0;G<B.length;G++)if(A=B[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)){B.splice(G,1);break t}}A=C.createElement(p),nn(A,p,a),C.head.appendChild(A);break;case"meta":if(B=ob("meta","content",C).get(p+(a.content||""))){for(G=0;G<B.length;G++)if(A=B[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)){B.splice(G,1);break t}}A=C.createElement(p),nn(A,p,a),C.head.appendChild(A);break;default:throw Error(s(468,p))}A[Ut]=t,It(A),p=A}t.stateNode=p}else lb(C,t.type,t.stateNode);else t.stateNode=ab(C,p,t.memoizedProps);else A!==p?(A===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):A.count--,p===null?lb(C,t.type,t.stateNode):ab(C,p,t.memoizedProps)):p===null&&t.stateNode!==null&&mf(t,t.memoizedProps,a.memoizedProps)}break;case 27:xn(r,t),Sn(t),p&512&&(Ft||a===null||br(a,a.return)),a!==null&&p&4&&mf(t,t.memoizedProps,a.memoizedProps);break;case 5:if(xn(r,t),Sn(t),p&512&&(Ft||a===null||br(a,a.return)),t.flags&32){C=t.stateNode;try{be(C,"")}catch(Ae){ht(t,t.return,Ae)}}p&4&&t.stateNode!=null&&(C=t.memoizedProps,mf(t,C,a!==null?a.memoizedProps:C)),p&1024&&(_f=!0);break;case 6:if(xn(r,t),Sn(t),p&4){if(t.stateNode===null)throw Error(s(162));p=t.memoizedProps,a=t.stateNode;try{a.nodeValue=p}catch(Ae){ht(t,t.return,Ae)}}break;case 3:if(ou=null,C=lr,lr=su(r.containerInfo),xn(r,t),lr=C,Sn(t),p&4&&a!==null&&a.memoizedState.isDehydrated)try{xa(r.containerInfo)}catch(Ae){ht(t,t.return,Ae)}_f&&(_f=!1,ly(t));break;case 4:p=lr,lr=su(t.stateNode.containerInfo),xn(r,t),Sn(t),lr=p;break;case 12:xn(r,t),Sn(t);break;case 31:xn(r,t),Sn(t),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,Vc(t,p)));break;case 13:xn(r,t),Sn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Wc=Tt()),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,Vc(t,p)));break;case 22:C=t.memoizedState!==null;var re=a!==null&&a.memoizedState!==null,le=qr,fe=Ft;if(qr=le||C,Ft=fe||re,xn(r,t),Ft=fe,qr=le,Sn(t),p&8192)e:for(r=t.stateNode,r._visibility=C?r._visibility&-2:r._visibility|1,C&&(a===null||re||qr||Ft||ys(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){re=a=r;try{if(A=re.stateNode,C)B=A.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{G=re.stateNode;var ge=re.memoizedProps.style,ue=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;G.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ae){ht(re,re.return,Ae)}}}else if(r.tag===6){if(a===null){re=r;try{re.stateNode.nodeValue=C?"":re.memoizedProps}catch(Ae){ht(re,re.return,Ae)}}}else if(r.tag===18){if(a===null){re=r;try{var de=re.stateNode;C?Zy(de,!0):Zy(re.stateNode,!1)}catch(Ae){ht(re,re.return,Ae)}}}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,Vc(t,a))));break;case 19:xn(r,t),Sn(t),p&4&&(p=t.updateQueue,p!==null&&(t.updateQueue=null,Vc(t,p)));break;case 30:break;case 21:break;default:xn(r,t),Sn(t)}}function Sn(t){var r=t.flags;if(r&2){try{for(var a,p=t.return;p!==null;){if(J_(p)){a=p;break}p=p.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var C=a.stateNode,A=gf(t);qc(t,A,C);break;case 5:var B=a.stateNode;a.flags&32&&(be(B,""),a.flags&=-33);var G=gf(t);qc(t,G,B);break;case 3:case 4:var re=a.stateNode.containerInfo,le=gf(t);vf(t,le,re);break;default:throw Error(s(161))}}catch(fe){ht(t,t.return,fe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function ly(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;ly(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Gr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)ny(t,r.alternate,r),r=r.sibling}function ys(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Ei(4,r,r.return),ys(r);break;case 1:br(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&Z_(r,r.return,a),ys(r);break;case 27:Jo(r.stateNode);case 26:case 5:br(r,r.return),ys(r);break;case 22:r.memoizedState===null&&ys(r);break;case 30:ys(r);break;default:ys(r)}t=t.sibling}}function Wr(t,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var p=r.alternate,C=t,A=r,B=A.flags;switch(A.tag){case 0:case 11:case 15:Wr(C,A,a),$o(4,A);break;case 1:if(Wr(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 re=C.shared.hiddenCallbacks;if(re!==null)for(C.shared.hiddenCallbacks=null,C=0;C<re.length;C++)Pv(re[C],G)}catch(le){ht(p,p.return,le)}}a&&B&64&&X_(A),qo(A,A.return);break;case 27:ey(A);case 26:case 5:Wr(C,A,a),a&&p===null&&B&4&&Q_(A),qo(A,A.return);break;case 12:Wr(C,A,a);break;case 31:Wr(C,A,a),a&&B&4&&sy(C,A);break;case 13:Wr(C,A,a),a&&B&4&&ay(C,A);break;case 22:A.memoizedState===null&&Wr(C,A,a),qo(A,A.return);break;case 30:break;default:Wr(C,A,a)}r=r.sibling}}function yf(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&&Do(a))}function bf(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Do(t))}function cr(t,r,a,p){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)cy(t,r,a,p),r=r.sibling}function cy(t,r,a,p){var C=r.flags;switch(r.tag){case 0:case 11:case 15:cr(t,r,a,p),C&2048&&$o(9,r);break;case 1:cr(t,r,a,p);break;case 3:cr(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&&Do(t)));break;case 12:if(C&2048){cr(t,r,a,p),t=r.stateNode;try{var A=r.memoizedProps,B=A.id,G=A.onPostCommit;typeof G=="function"&&G(B,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(re){ht(r,r.return,re)}}else cr(t,r,a,p);break;case 31:cr(t,r,a,p);break;case 13:cr(t,r,a,p);break;case 23:break;case 22:A=r.stateNode,B=r.alternate,r.memoizedState!==null?A._visibility&2?cr(t,r,a,p):Vo(t,r):A._visibility&2?cr(t,r,a,p):(A._visibility|=2,ua(t,r,a,p,(r.subtreeFlags&10256)!==0||!1)),C&2048&&yf(B,r);break;case 24:cr(t,r,a,p),C&2048&&bf(r.alternate,r);break;default:cr(t,r,a,p)}}function ua(t,r,a,p,C){for(C=C&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var A=t,B=r,G=a,re=p,le=B.flags;switch(B.tag){case 0:case 11:case 15:ua(A,B,G,re,C),$o(8,B);break;case 23:break;case 22:var fe=B.stateNode;B.memoizedState!==null?fe._visibility&2?ua(A,B,G,re,C):Vo(A,B):(fe._visibility|=2,ua(A,B,G,re,C)),C&&le&2048&&yf(B.alternate,B);break;case 24:ua(A,B,G,re,C),C&&le&2048&&bf(B.alternate,B);break;default:ua(A,B,G,re,C)}r=r.sibling}}function Vo(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:Vo(a,p),C&2048&&yf(p.alternate,p);break;case 24:Vo(a,p),C&2048&&bf(p.alternate,p);break;default:Vo(a,p)}r=r.sibling}}var Go=8192;function da(t,r,a){if(t.subtreeFlags&Go)for(t=t.child;t!==null;)uy(t,r,a),t=t.sibling}function uy(t,r,a){switch(t.tag){case 26:da(t,r,a),t.flags&Go&&t.memoizedState!==null&&O2(a,lr,t.memoizedState,t.memoizedProps);break;case 5:da(t,r,a);break;case 3:case 4:var p=lr;lr=su(t.stateNode.containerInfo),da(t,r,a),lr=p;break;case 22:t.memoizedState===null&&(p=t.alternate,p!==null&&p.memoizedState!==null?(p=Go,Go=16777216,da(t,r,a),Go=p):da(t,r,a));break;default:da(t,r,a)}}function dy(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 Wo(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];Kt=p,fy(p,t)}dy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hy(t),t=t.sibling}function hy(t){switch(t.tag){case 0:case 11:case 15:Wo(t),t.flags&2048&&Ei(9,t,t.return);break;case 3:Wo(t);break;case 12:Wo(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Gc(t)):Wo(t);break;default:Wo(t)}}function Gc(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];Kt=p,fy(p,t)}dy(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Ei(8,r,r.return),Gc(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Gc(r));break;default:Gc(r)}t=t.sibling}}function fy(t,r){for(;Kt!==null;){var a=Kt;switch(a.tag){case 0:case 11:case 15:Ei(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:Do(a.memoizedState.cache)}if(p=a.child,p!==null)p.return=a,Kt=p;else e:for(a=t;Kt!==null;){p=Kt;var C=p.sibling,A=p.return;if(ry(p),p===a){Kt=null;break e}if(C!==null){C.return=A,Kt=C;break e}Kt=A}}}var YE={getCacheForType:function(t){var r=en(Bt),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return en(Bt).controller.signal}},XE=typeof WeakMap=="function"?WeakMap:Map,ct=0,bt=null,Ze=null,et=0,dt=0,jn=null,Ai=!1,ha=!1,xf=!1,Kr=0,Nt=0,Ti=0,bs=0,Sf=0,On=0,fa=0,Ko=null,wn=null,wf=!1,Wc=0,py=0,Kc=1/0,Yc=null,Ri=null,$t=0,Di=null,pa=null,Yr=0,Cf=0,kf=null,my=null,Yo=0,Ef=null;function Ln(){return(ct&2)!==0&&et!==0?et&-et:V.T!==null?Mf():po()}function gy(){if(On===0)if((et&536870912)===0||rt){var t=zs;zs<<=1,(zs&3932160)===0&&(zs=262144),On=t}else On=536870912;return t=Nn.current,t!==null&&(t.flags|=32),On}function Cn(t,r,a){(t===bt&&(dt===2||dt===9)||t.cancelPendingCommit!==null)&&(ma(t,0),Ni(t,et,On,!1)),gr(t,a),((ct&2)===0||t!==bt)&&(t===bt&&((ct&2)===0&&(bs|=a),Nt===4&&Ni(t,et,On,!1)),xr(t))}function vy(t,r,a){if((ct&6)!==0)throw Error(s(327));var p=!a&&(r&127)===0&&(r&t.expiredLanes)===0||Mr(t,r),C=p?JE(t,r):Tf(t,r,!0),A=p;do{if(C===0){ha&&!p&&Ni(t,r,0,!1);break}else{if(a=t.current.alternate,A&&!ZE(a)){C=Tf(t,r,!1),A=!1;continue}if(C===2){if(A=r,t.errorRecoveryDisabledLanes&A)var B=0;else B=t.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){r=B;e:{var G=t;C=Ko;var re=G.current.memoizedState.isDehydrated;if(re&&(ma(G,B).flags|=256),B=Tf(G,B,!1),B!==2){if(xf&&!re){G.errorRecoveryDisabledLanes|=A,bs|=A,C=4;break e}A=wn,wn=C,A!==null&&(wn===null?wn=A:wn.push.apply(wn,A))}C=B}if(A=!1,C!==2)continue}}if(C===1){ma(t,0),Ni(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:Ni(p,r,On,!Ai);break e;case 2:wn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(C=Wc+300-Tt(),10<C)){if(Ni(p,r,On,!Ai),ho(p,0,!0)!==0)break e;Yr=r,p.timeoutHandle=Ky(_y.bind(null,p,a,wn,Yc,wf,r,On,bs,fa,Ai,A,"Throttled",-0,0),C);break e}_y(p,a,wn,Yc,wf,r,On,bs,fa,Ai,A,null,-0,0)}}break}while(!0);xr(t)}function _y(t,r,a,p,C,A,B,G,re,le,fe,ge,ue,de){if(t.timeoutHandle=-1,ge=r.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yt},uy(r,A,ge);var Ae=(A&62914560)===A?Wc-Tt():(A&4194048)===A?py-Tt():0;if(Ae=L2(ge,Ae),Ae!==null){Yr=A,t.cancelPendingCommit=Ae(Ey.bind(null,t,r,A,a,p,C,B,G,re,fe,ge,null,ue,de)),Ni(t,A,B,!le);return}}Ey(t,r,A,a,p,C,B,G,re)}function ZE(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(!Rn(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 Ni(t,r,a,p){r&=~Sf,r&=~bs,t.suspendedLanes|=r,t.pingedLanes&=~r,p&&(t.warmLanes|=r),p=t.expirationTimes;for(var C=r;0<C;){var A=31-lt(C),B=1<<A;p[A]=-1,C&=~B}a!==0&&vr(t,a,r)}function Xc(){return(ct&6)===0?(Xo(0),!1):!0}function Af(){if(Ze!==null){if(dt===0)var t=Ze.return;else t=Ze,zr=ds=null,Uh(t),sa=null,Mo=0,t=Ze;for(;t!==null;)Y_(t.alternate,t),t=t.return;Ze=null}}function ma(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,v2(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Yr=0,Af(),bt=t,Ze=a=Ir(t.current,null),et=r,dt=0,jn=null,Ai=!1,ha=Mr(t,r),xf=!1,fa=On=Sf=bs=Ti=Nt=0,wn=Ko=null,wf=!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-lt(p),A=1<<C;r|=t[C],p&=~A}return Kr=r,vc(),a}function yy(t,r){Ge=null,V.H=Fo,r===ia||r===kc?(r=Lv(),dt=3):r===Dh?(r=Lv(),dt=4):dt=r===sf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,jn=r,Ze===null&&(Nt=1,Pc(t,Gn(r,t.current)))}function by(){var t=Nn.current;return t===null?!0:(et&4194048)===et?Xn===null:(et&62914560)===et||(et&536870912)!==0?t===Xn:!1}function xy(){var t=V.H;return V.H=Fo,t===null?Fo:t}function Sy(){var t=V.A;return V.A=YE,t}function Zc(){Nt=4,Ai||(et&4194048)!==et&&Nn.current!==null||(ha=!0),(Ti&134217727)===0&&(bs&134217727)===0||bt===null||Ni(bt,et,On,!1)}function Tf(t,r,a){var p=ct;ct|=2;var C=xy(),A=Sy();(bt!==t||et!==r)&&(Yc=null,ma(t,r)),r=!1;var B=Nt;e:do try{if(dt!==0&&Ze!==null){var G=Ze,re=jn;switch(dt){case 8:Af(),B=6;break e;case 3:case 2:case 9:case 6:Nn.current===null&&(r=!0);var le=dt;if(dt=0,jn=null,ga(t,G,re,le),a&&ha){B=0;break e}break;default:le=dt,dt=0,jn=null,ga(t,G,re,le)}}QE(),B=Nt;break}catch(fe){yy(t,fe)}while(!0);return r&&t.shellSuspendCounter++,zr=ds=null,ct=p,V.H=C,V.A=A,Ze===null&&(bt=null,et=0,vc()),B}function QE(){for(;Ze!==null;)wy(Ze)}function JE(t,r){var a=ct;ct|=2;var p=xy(),C=Sy();bt!==t||et!==r?(Yc=null,Kc=Tt()+500,ma(t,r)):ha=Mr(t,r);e:do try{if(dt!==0&&Ze!==null){r=Ze;var A=jn;t:switch(dt){case 1:dt=0,jn=null,ga(t,r,A,1);break;case 2:case 9:if(jv(A)){dt=0,jn=null,Cy(r);break}r=function(){dt!==2&&dt!==9||bt!==t||(dt=7),xr(t)},A.then(r,r);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:jv(A)?(dt=0,jn=null,Cy(r)):(dt=0,jn=null,ga(t,r,A,7));break;case 5:var B=null;switch(Ze.tag){case 26:B=Ze.memoizedState;case 5:case 27:var G=Ze;if(B?cb(B):G.stateNode.complete){dt=0,jn=null;var re=G.sibling;if(re!==null)Ze=re;else{var le=G.return;le!==null?(Ze=le,Qc(le)):Ze=null}break t}}dt=0,jn=null,ga(t,r,A,5);break;case 6:dt=0,jn=null,ga(t,r,A,6);break;case 8:Af(),Nt=6;break e;default:throw Error(s(462))}}e2();break}catch(fe){yy(t,fe)}while(!0);return zr=ds=null,V.H=p,V.A=C,ct=a,Ze!==null?0:(bt=null,et=0,vc(),Nt)}function e2(){for(;Ze!==null&&!$n();)wy(Ze)}function wy(t){var r=W_(t.alternate,t,Kr);t.memoizedProps=t.pendingProps,r===null?Qc(t):Ze=r}function Cy(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=H_(a,r,r.pendingProps,r.type,void 0,et);break;case 11:r=H_(a,r,r.pendingProps,r.type.render,r.ref,et);break;case 5:Uh(r);default:Y_(a,r),r=Ze=Sv(r,Kr),r=W_(a,r,Kr)}t.memoizedProps=t.pendingProps,r===null?Qc(t):Ze=r}function ga(t,r,a,p){zr=ds=null,Uh(r),sa=null,Mo=0;var C=r.return;try{if(UE(t,C,r,a,et)){Nt=1,Pc(t,Gn(a,t.current)),Ze=null;return}}catch(A){if(C!==null)throw Ze=C,A;Nt=1,Pc(t,Gn(a,t.current)),Ze=null;return}r.flags&32768?(rt||p===1?t=!0:ha||(et&536870912)!==0?t=!1:(Ai=t=!0,(p===2||p===9||p===3||p===6)&&(p=Nn.current,p!==null&&p.tag===13&&(p.flags|=16384))),ky(r,t)):Qc(r)}function Qc(t){var r=t;do{if((r.flags&32768)!==0){ky(r,Ai);return}t=r.return;var a=VE(r.alternate,r,Kr);if(a!==null){Ze=a;return}if(r=r.sibling,r!==null){Ze=r;return}Ze=r=t}while(r!==null);Nt===0&&(Nt=5)}function ky(t,r){do{var a=GE(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);Nt=6,Ze=null}function Ey(t,r,a,p,C,A,B,G,re){t.cancelPendingCommit=null;do Jc();while($t!==0);if((ct&6)!==0)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(A=r.lanes|r.childLanes,A|=mh,tc(t,a,A,B,G,re),t===bt&&(Ze=bt=null,et=0),pa=r,Di=t,Yr=a,Cf=A,kf=C,my=p,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,i2(Re,function(){return Ny(),null})):(t.callbackNode=null,t.callbackPriority=0),p=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||p){p=V.T,V.T=null,C=J.p,J.p=2,B=ct,ct|=4;try{WE(t,r,a)}finally{ct=B,J.p=C,V.T=p}}$t=1,Ay(),Ty(),Ry()}}function Ay(){if($t===1){$t=0;var t=Di,r=pa,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=V.T,V.T=null;var p=J.p;J.p=2;var C=ct;ct|=4;try{oy(r,t);var A=Ff,B=fv(t.containerInfo),G=A.focusedElem,re=A.selectionRange;if(B!==G&&G&&G.ownerDocument&&hv(G.ownerDocument.documentElement,G)){if(re!==null&&uh(G)){var le=re.start,fe=re.end;if(fe===void 0&&(fe=le),"selectionStart"in G)G.selectionStart=le,G.selectionEnd=Math.min(fe,G.value.length);else{var ge=G.ownerDocument||document,ue=ge&&ge.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),Ae=G.textContent.length,ze=Math.min(re.start,Ae),gt=re.end===void 0?ze:Math.min(re.end,Ae);!de.extend&&ze>gt&&(B=gt,gt=ze,ze=B);var se=dv(G,ze),ie=dv(G,gt);if(se&&ie&&(de.rangeCount!==1||de.anchorNode!==se.node||de.anchorOffset!==se.offset||de.focusNode!==ie.node||de.focusOffset!==ie.offset)){var oe=ge.createRange();oe.setStart(se.node,se.offset),de.removeAllRanges(),ze>gt?(de.addRange(oe),de.extend(ie.node,ie.offset)):(oe.setEnd(ie.node,ie.offset),de.addRange(oe))}}}}for(ge=[],de=G;de=de.parentNode;)de.nodeType===1&&ge.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof G.focus=="function"&&G.focus(),G=0;G<ge.length;G++){var me=ge[G];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}du=!!Pf,Ff=Pf=null}finally{ct=C,J.p=p,V.T=a}}t.current=r,$t=2}}function Ty(){if($t===2){$t=0;var t=Di,r=pa,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=V.T,V.T=null;var p=J.p;J.p=2;var C=ct;ct|=4;try{ny(t,r.alternate,r)}finally{ct=C,J.p=p,V.T=a}}$t=3}}function Ry(){if($t===4||$t===3){$t=0,Mt();var t=Di,r=pa,a=Yr,p=my;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?$t=5:($t=0,pa=Di=null,Dy(t,t.pendingLanes));var C=t.pendingLanes;if(C===0&&(Ri=null),fo(a),r=r.stateNode,jt&&typeof jt.onCommitFiberRoot=="function")try{jt.onCommitFiberRoot(Rt,r,void 0,(r.current.flags&128)===128)}catch{}if(p!==null){r=V.T,C=J.p,J.p=2,V.T=null;try{for(var A=t.onRecoverableError,B=0;B<p.length;B++){var G=p[B];A(G.value,{componentStack:G.stack})}}finally{V.T=r,J.p=C}}(Yr&3)!==0&&Jc(),xr(t),C=t.pendingLanes,(a&261930)!==0&&(C&42)!==0?t===Ef?Yo++:(Yo=0,Ef=t):Yo=0,Xo(0)}}function Dy(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Do(r)))}function Jc(){return Ay(),Ty(),Ry(),Ny()}function Ny(){if($t!==5)return!1;var t=Di,r=Cf;Cf=0;var a=fo(Yr),p=V.T,C=J.p;try{J.p=32>a?32:a,V.T=null,a=kf,kf=null;var A=Di,B=Yr;if($t=0,pa=Di=null,Yr=0,(ct&6)!==0)throw Error(s(331));var G=ct;if(ct|=4,hy(A.current),cy(A,A.current,B,a),ct=G,Xo(0,!1),jt&&typeof jt.onPostCommitFiberRoot=="function")try{jt.onPostCommitFiberRoot(Rt,A)}catch{}return!0}finally{J.p=C,V.T=p,Dy(t,r)}}function My(t,r,a){r=Gn(a,r),r=rf(t.stateNode,r,2),t=wi(t,r,2),t!==null&&(gr(t,2),xr(t))}function ht(t,r,a){if(t.tag===3)My(t,t,a);else for(;r!==null;){if(r.tag===3){My(r,t,a);break}else if(r.tag===1){var p=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Ri===null||!Ri.has(p))){t=Gn(a,t),a=j_(2),p=wi(r,a,2),p!==null&&(O_(a,p,r,t),gr(p,2),xr(p));break}}r=r.return}}function Rf(t,r,a){var p=t.pingCache;if(p===null){p=t.pingCache=new XE;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)||(xf=!0,C.add(a),t=t2.bind(null,t,r,a),r.then(t,t))}function t2(t,r,a){var p=t.pingCache;p!==null&&p.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,bt===t&&(et&a)===a&&(Nt===4||Nt===3&&(et&62914560)===et&&300>Tt()-Wc?(ct&2)===0&&ma(t,0):Sf|=a,fa===et&&(fa=0)),xr(t)}function jy(t,r){r===0&&(r=ft()),t=ls(t,r),t!==null&&(gr(t,r),xr(t))}function n2(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),jy(t,a)}function r2(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),jy(t,a)}function i2(t,r){return sn(t,r)}var eu=null,va=null,Df=!1,tu=!1,Nf=!1,Mi=0;function xr(t){t!==va&&t.next===null&&(va===null?eu=va=t:va=va.next=t),tu=!0,Df||(Df=!0,a2())}function Xo(t,r){if(!Nf&&tu){Nf=!0;do for(var a=!1,p=eu;p!==null;){if(t!==0){var C=p.pendingLanes;if(C===0)var A=0;else{var B=p.suspendedLanes,G=p.pingedLanes;A=(1<<31-lt(42|t)+1)-1,A&=C&~(B&~G),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(a=!0,By(p,A))}else A=et,A=ho(p,p===bt?A:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(A&3)===0||Mr(p,A)||(a=!0,By(p,A));p=p.next}while(a);Nf=!1}}function s2(){Oy()}function Oy(){tu=Df=!1;var t=0;Mi!==0&&g2()&&(t=Mi);for(var r=Tt(),a=null,p=eu;p!==null;){var C=p.next,A=Ly(p,r);A===0?(p.next=null,a===null?eu=C:a.next=C,C===null&&(va=a)):(a=p,(t!==0||(A&3)!==0)&&(tu=!0)),p=C}$t!==0&&$t!==5||Xo(t),Mi!==0&&(Mi=0)}function Ly(t,r){for(var a=t.suspendedLanes,p=t.pingedLanes,C=t.expirationTimes,A=t.pendingLanes&-62914561;0<A;){var B=31-lt(A),G=1<<B,re=C[B];re===-1?((G&a)===0||(G&p)!==0)&&(C[B]=vt(G,r)):re<=r&&(t.expiredLanes|=G),A&=~G}if(r=bt,a=et,a=ho(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&&Wt(p),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Mr(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(p!==null&&Wt(p),fo(a)){case 2:case 8:a=Se;break;case 32:a=Re;break;case 268435456:a=qe;break;default:a=Re}return p=Iy.bind(null,t),a=sn(a,p),t.callbackPriority=r,t.callbackNode=a,r}return p!==null&&p!==null&&Wt(p),t.callbackPriority=2,t.callbackNode=null,2}function Iy(t,r){if($t!==0&&$t!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Jc()&&t.callbackNode!==a)return null;var p=et;return p=ho(t,t===bt?p:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),p===0?null:(vy(t,p,r),Ly(t,Tt()),t.callbackNode!=null&&t.callbackNode===a?Iy.bind(null,t):null)}function By(t,r){if(Jc())return null;vy(t,r,!0)}function a2(){_2(function(){(ct&6)!==0?sn(he,s2):Oy()})}function Mf(){if(Mi===0){var t=na;t===0&&(t=Bs,Bs<<=1,(Bs&261888)===0&&(Bs=256)),Mi=t}return Mi}function zy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:st(""+t)}function Py(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 o2(t,r,a,p,C){if(r==="submit"&&a&&a.stateNode===C){var A=zy((C[an]||null).action),B=p.submitter;B&&(r=(r=B[an]||null)?zy(r.formAction):B.getAttribute("formAction"),r!==null&&(A=r,B=null));var G=new fc("action","action",null,p,C);t.push({event:G,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Mi!==0){var re=B?Py(C,B):new FormData(C);Zh(a,{pending:!0,data:re,method:C.method,action:A},null,re)}}else typeof A=="function"&&(G.preventDefault(),re=B?Py(C,B):new FormData(C),Zh(a,{pending:!0,data:re,method:C.method,action:A},A,re))},currentTarget:C}]})}}for(var jf=0;jf<ph.length;jf++){var Of=ph[jf],l2=Of.toLowerCase(),c2=Of[0].toUpperCase()+Of.slice(1);or(l2,"on"+c2)}or(gv,"onAnimationEnd"),or(vv,"onAnimationIteration"),or(_v,"onAnimationStart"),or("dblclick","onDoubleClick"),or("focusin","onFocus"),or("focusout","onBlur"),or(kE,"onTransitionRun"),or(EE,"onTransitionStart"),or(AE,"onTransitionCancel"),or(yv,"onTransitionEnd"),mi("onMouseEnter",["mouseout","mouseover"]),mi("onMouseLeave",["mouseout","mouseover"]),mi("onPointerEnter",["pointerout","pointerover"]),mi("onPointerLeave",["pointerout","pointerover"]),jr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),jr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),jr("onBeforeInput",["compositionend","keypress","textInput","paste"]),jr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),jr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),jr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Zo="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(" "),u2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zo));function Fy(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 B=p.length-1;0<=B;B--){var G=p[B],re=G.instance,le=G.currentTarget;if(G=G.listener,re!==A&&C.isPropagationStopped())break e;A=G,C.currentTarget=le;try{A(C)}catch(fe){gc(fe)}C.currentTarget=null,A=re}else for(B=0;B<p.length;B++){if(G=p[B],re=G.instance,le=G.currentTarget,G=G.listener,re!==A&&C.isPropagationStopped())break e;A=G,C.currentTarget=le;try{A(C)}catch(fe){gc(fe)}C.currentTarget=null,A=re}}}}function Qe(t,r){var a=r[Fs];a===void 0&&(a=r[Fs]=new Set);var p=t+"__bubble";a.has(p)||(Hy(r,t,2,!1),a.add(p))}function Lf(t,r,a){var p=0;r&&(p|=4),Hy(a,t,p,r)}var nu="_reactListening"+Math.random().toString(36).slice(2);function If(t){if(!t[nu]){t[nu]=!0,ic.forEach(function(a){a!=="selectionchange"&&(u2.has(a)||Lf(a,!1,t),Lf(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[nu]||(r[nu]=!0,Lf("selectionchange",!1,r))}}function Hy(t,r,a,p){switch(gb(r)){case 2:var C=z2;break;case 8:C=P2;break;default:C=Zf}a=C.bind(null,r,a,t),C=void 0,!th||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 Bf(t,r,a,p,C){var A=p;if((r&1)===0&&(r&2)===0&&p!==null)e:for(;;){if(p===null)return;var B=p.tag;if(B===3||B===4){var G=p.stateNode.containerInfo;if(G===C)break;if(B===4)for(B=p.return;B!==null;){var re=B.tag;if((re===3||re===4)&&B.stateNode.containerInfo===C)return;B=B.return}for(;G!==null;){if(B=hi(G),B===null)return;if(re=B.tag,re===5||re===6||re===26||re===27){p=A=B;continue e}G=G.parentNode}}p=p.return}Gg(function(){var le=A,fe=_n(a),ge=[];e:{var ue=bv.get(t);if(ue!==void 0){var de=fc,Ae=t;switch(t){case"keypress":if(dc(a)===0)break e;case"keydown":case"keyup":de=rE;break;case"focusin":Ae="focus",de=sh;break;case"focusout":Ae="blur",de=sh;break;case"beforeblur":case"afterblur":de=sh;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=Yg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Vk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=aE;break;case gv:case vv:case _v:de=Kk;break;case yv:de=lE;break;case"scroll":case"scrollend":de=$k;break;case"wheel":de=uE;break;case"copy":case"cut":case"paste":de=Xk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Zg;break;case"toggle":case"beforetoggle":de=hE}var ze=(r&4)!==0,gt=!ze&&(t==="scroll"||t==="scrollend"),se=ze?ue!==null?ue+"Capture":null:ue;ze=[];for(var ie=le,oe;ie!==null;){var me=ie;if(oe=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||oe===null||se===null||(me=yo(ie,se),me!=null&&ze.push(Qo(ie,me,oe))),gt)break;ie=ie.return}0<ze.length&&(ue=new de(ue,Ae,null,a,fe),ge.push({event:ue,listeners:ze}))}}if((r&7)===0){e:{if(ue=t==="mouseover"||t==="pointerover",de=t==="mouseout"||t==="pointerout",ue&&a!==hn&&(Ae=a.relatedTarget||a.fromElement)&&(hi(Ae)||Ae[di]))break e;if((de||ue)&&(ue=fe.window===fe?fe:(ue=fe.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?(Ae=a.relatedTarget||a.toElement,de=le,Ae=Ae?hi(Ae):null,Ae!==null&&(gt=h(Ae),ze=Ae.tag,Ae!==gt||ze!==5&&ze!==27&&ze!==6)&&(Ae=null)):(de=null,Ae=le),de!==Ae)){if(ze=Yg,me="onMouseLeave",se="onMouseEnter",ie="mouse",(t==="pointerout"||t==="pointerover")&&(ze=Zg,me="onPointerLeave",se="onPointerEnter",ie="pointer"),gt=de==null?ue:rs(de),oe=Ae==null?ue:rs(Ae),ue=new ze(me,ie+"leave",de,a,fe),ue.target=gt,ue.relatedTarget=oe,me=null,hi(fe)===le&&(ze=new ze(se,ie+"enter",Ae,a,fe),ze.target=oe,ze.relatedTarget=gt,me=ze),gt=me,de&&Ae)t:{for(ze=d2,se=de,ie=Ae,oe=0,me=se;me;me=ze(me))oe++;me=0;for(var Le=ie;Le;Le=ze(Le))me++;for(;0<oe-me;)se=ze(se),oe--;for(;0<me-oe;)ie=ze(ie),me--;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&&Uy(ge,ue,de,ze,!1),Ae!==null&&gt!==null&&Uy(ge,gt,Ae,ze,!0)}}e:{if(ue=le?rs(le):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var at=sv;else if(rv(ue))if(av)at=SE;else{at=bE;var Me=yE}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?le&&Tn(le.elementType)&&(at=sv):at=xE;if(at&&(at=at(t,le))){iv(ge,at,a,fe);break e}Me&&Me(t,ue,le),t==="focusout"&&le&&ue.type==="number"&&le.memoizedProps.value!=null&&Vs(ue,"number",ue.value)}switch(Me=le?rs(le):window,t){case"focusin":(rv(Me)||Me.contentEditable==="true")&&(Ks=Me,dh=le,Ao=null);break;case"focusout":Ao=dh=Ks=null;break;case"mousedown":hh=!0;break;case"contextmenu":case"mouseup":case"dragend":hh=!1,pv(ge,a,fe);break;case"selectionchange":if(CE)break;case"keydown":case"keyup":pv(ge,a,fe)}var We;if(oh)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 Ws?tv(t,a)&&(tt="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(tt="onCompositionStart");tt&&(Qg&&a.locale!=="ko"&&(Ws||tt!=="onCompositionStart"?tt==="onCompositionEnd"&&Ws&&(We=Wg()):(gi=fe,nh="value"in gi?gi.value:gi.textContent,Ws=!0)),Me=ru(le,tt),0<Me.length&&(tt=new Xg(tt,t,null,a,fe),ge.push({event:tt,listeners:Me}),We?tt.data=We:(We=nv(a),We!==null&&(tt.data=We)))),(We=pE?mE(t,a):gE(t,a))&&(tt=ru(le,"onBeforeInput"),0<tt.length&&(Me=new Xg("onBeforeInput","beforeinput",null,a,fe),ge.push({event:Me,listeners:tt}),Me.data=We)),o2(ge,t,le,a,fe)}Fy(ge,r)})}function Qo(t,r,a){return{instance:t,listener:r,currentTarget:a}}function ru(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=yo(t,a),C!=null&&p.unshift(Qo(t,C,A)),C=yo(t,r),C!=null&&p.push(Qo(t,C,A))),t.tag===3)return p;t=t.return}return[]}function d2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Uy(t,r,a,p,C){for(var A=r._reactName,B=[];a!==null&&a!==p;){var G=a,re=G.alternate,le=G.stateNode;if(G=G.tag,re!==null&&re===p)break;G!==5&&G!==26&&G!==27||le===null||(re=le,C?(le=yo(a,A),le!=null&&B.unshift(Qo(a,le,re))):C||(le=yo(a,A),le!=null&&B.push(Qo(a,le,re)))),a=a.return}B.length!==0&&t.push({event:r,listeners:B})}var h2=/\r\n?/g,f2=/\u0000|\uFFFD/g;function $y(t){return(typeof t=="string"?t:""+t).replace(h2,`
49
- `).replace(f2,"")}function qy(t,r){return r=$y(r),$y(t)===r}function mt(t,r,a,p,C,A){switch(a){case"children":typeof p=="string"?r==="body"||r==="textarea"&&p===""||be(t,p):(typeof p=="number"||typeof p=="bigint")&&r!=="body"&&be(t,""+p);break;case"className":Us(t,"class",p);break;case"tabIndex":Us(t,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Us(t,a,p);break;case"style":Ct(t,p,A);break;case"data":if(r!=="object"){Us(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=st(""+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"&&mt(t,r,"name",C.name,C,null),mt(t,r,"formEncType",C.formEncType,C,null),mt(t,r,"formMethod",C.formMethod,C,null),mt(t,r,"formTarget",C.formTarget,C,null)):(mt(t,r,"encType",C.encType,C,null),mt(t,r,"method",C.method,C,null),mt(t,r,"target",C.target,C,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){t.removeAttribute(a);break}p=st(""+p),t.setAttribute(a,p);break;case"onClick":p!=null&&(t.onclick=yt);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=st(""+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),Hs(t,"popover",p);break;case"xlinkActuate":sr(t,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":sr(t,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":sr(t,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":sr(t,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":sr(t,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":sr(t,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":sr(t,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":sr(t,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":sr(t,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Hs(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=ye.get(a)||a,Hs(t,a,p))}}function zf(t,r,a,p,C,A){switch(a){case"style":Ct(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"?be(t,p):(typeof p=="number"||typeof p=="bigint")&&be(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=yt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!sc.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[an]||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,""):Hs(t,a,p)}}}function nn(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 B=a[A];if(B!=null)switch(A){case"src":p=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:mt(t,r,A,B,a,null)}}C&&mt(t,r,"srcSet",a.srcSet,a,null),p&&mt(t,r,"src",a.src,a,null);return;case"input":Qe("invalid",t);var G=A=B=C=null,re=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":B=fe;break;case"checked":re=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:mt(t,r,p,fe,a,null)}}vo(t,A,G,re,le,B,C,!1);return;case"select":Qe("invalid",t),p=B=A=null;for(C in a)if(a.hasOwnProperty(C)&&(G=a[C],G!=null))switch(C){case"value":A=G;break;case"defaultValue":B=G;break;case"multiple":p=G;default:mt(t,r,C,G,a,null)}r=A,a=B,t.multiple=!!p,r!=null?Or(t,!!p,r,!1):a!=null&&Or(t,!!p,a,!0);return;case"textarea":Qe("invalid",t),A=C=p=null;for(B in a)if(a.hasOwnProperty(B)&&(G=a[B],G!=null))switch(B){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:mt(t,r,B,G,a,null)}Q(t,p,C,A);return;case"option":for(re in a)if(a.hasOwnProperty(re)&&(p=a[re],p!=null))switch(re){case"selected":t.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:mt(t,r,re,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<Zo.length;p++)Qe(Zo[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:mt(t,r,le,p,a,null)}return;default:if(Tn(r)){for(fe in a)a.hasOwnProperty(fe)&&(p=a[fe],p!==void 0&&zf(t,r,fe,p,a,void 0));return}}for(G in a)a.hasOwnProperty(G)&&(p=a[G],p!=null&&mt(t,r,G,p,a,null))}function p2(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,B=null,G=null,re=null,le=null,fe=null;for(de in a){var ge=a[de];if(a.hasOwnProperty(de)&&ge!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":re=ge;default:p.hasOwnProperty(de)||mt(t,r,de,null,p,ge)}}for(var ue in p){var de=p[ue];if(ge=a[ue],p.hasOwnProperty(ue)&&(de!=null||ge!=null))switch(ue){case"type":A=de;break;case"name":C=de;break;case"checked":le=de;break;case"defaultChecked":fe=de;break;case"value":B=de;break;case"defaultValue":G=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:de!==ge&&mt(t,r,ue,de,p,ge)}}go(t,B,G,re,le,fe,A,C);return;case"select":de=B=G=ue=null;for(A in a)if(re=a[A],a.hasOwnProperty(A)&&re!=null)switch(A){case"value":break;case"multiple":de=re;default:p.hasOwnProperty(A)||mt(t,r,A,null,p,re)}for(C in p)if(A=p[C],re=a[C],p.hasOwnProperty(C)&&(A!=null||re!=null))switch(C){case"value":ue=A;break;case"defaultValue":G=A;break;case"multiple":B=A;default:A!==re&&mt(t,r,C,A,p,re)}r=G,a=B,p=de,ue!=null?Or(t,!!a,ue,!1):!!p!=!!a&&(r!=null?Or(t,!!a,r,!0):Or(t,!!a,a?[]:"",!1));return;case"textarea":de=ue=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:mt(t,r,G,null,p,C)}for(B in p)if(C=p[B],A=a[B],p.hasOwnProperty(B)&&(C!=null||A!=null))switch(B){case"value":ue=C;break;case"defaultValue":de=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:C!==A&&mt(t,r,B,C,p,A)}_o(t,ue,de);return;case"option":for(var Ae in a)if(ue=a[Ae],a.hasOwnProperty(Ae)&&ue!=null&&!p.hasOwnProperty(Ae))switch(Ae){case"selected":t.selected=!1;break;default:mt(t,r,Ae,null,p,ue)}for(re in p)if(ue=p[re],de=a[re],p.hasOwnProperty(re)&&ue!==de&&(ue!=null||de!=null))switch(re){case"selected":t.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:mt(t,r,re,ue,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)ue=a[ze],a.hasOwnProperty(ze)&&ue!=null&&!p.hasOwnProperty(ze)&&mt(t,r,ze,null,p,ue);for(le in p)if(ue=p[le],de=a[le],p.hasOwnProperty(le)&&ue!==de&&(ue!=null||de!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,r));break;default:mt(t,r,le,ue,p,de)}return;default:if(Tn(r)){for(var gt in a)ue=a[gt],a.hasOwnProperty(gt)&&ue!==void 0&&!p.hasOwnProperty(gt)&&zf(t,r,gt,void 0,p,ue);for(fe in p)ue=p[fe],de=a[fe],!p.hasOwnProperty(fe)||ue===de||ue===void 0&&de===void 0||zf(t,r,fe,ue,p,de);return}}for(var se in a)ue=a[se],a.hasOwnProperty(se)&&ue!=null&&!p.hasOwnProperty(se)&&mt(t,r,se,null,p,ue);for(ge in p)ue=p[ge],de=a[ge],!p.hasOwnProperty(ge)||ue===de||ue==null&&de==null||mt(t,r,ge,ue,p,de)}function Vy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function m2(){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,B=C.initiatorType,G=C.duration;if(A&&G&&Vy(B)){for(B=0,G=C.responseEnd,p+=1;p<a.length;p++){var re=a[p],le=re.startTime;if(le>G)break;var fe=re.transferSize,ge=re.initiatorType;fe&&Vy(ge)&&(re=re.responseEnd,B+=fe*(re<G?1:(G-le)/(re-le)))}if(--p,r+=8*(A+B)/(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 Pf=null,Ff=null;function iu(t){return t.nodeType===9?t:t.ownerDocument}function Gy(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 Wy(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 Hf(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 Uf=null;function g2(){var t=window.event;return t&&t.type==="popstate"?t===Uf?!1:(Uf=t,!0):(Uf=null,!1)}var Ky=typeof setTimeout=="function"?setTimeout:void 0,v2=typeof clearTimeout=="function"?clearTimeout:void 0,Yy=typeof Promise=="function"?Promise:void 0,_2=typeof queueMicrotask=="function"?queueMicrotask:typeof Yy<"u"?function(t){return Yy.resolve(null).then(t).catch(y2)}:Ky;function y2(t){setTimeout(function(){throw t})}function ji(t){return t==="head"}function Xy(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),xa(r);return}p--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")p++;else if(a==="html")Jo(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Jo(a);for(var A=a.firstChild;A;){var B=A.nextSibling,G=A.nodeName;A[ns]||G==="SCRIPT"||G==="STYLE"||G==="LINK"&&A.rel.toLowerCase()==="stylesheet"||a.removeChild(A),A=B}}else a==="body"&&Jo(t.ownerDocument.body);a=C}while(a);xa(r)}function Zy(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 $f(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":$f(a),mo(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function b2(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[ns])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=Zn(t.nextSibling),t===null)break}return null}function x2(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Zn(t.nextSibling),t===null))return null;return t}function Qy(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Zn(t.nextSibling),t===null))return null;return t}function qf(t){return t.data==="$?"||t.data==="$~"}function Vf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function S2(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 Zn(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 Gf=null;function Jy(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Zn(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function eb(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 tb(t,r,a){switch(r=iu(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 Jo(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);mo(t)}var Qn=new Map,nb=new Set;function su(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Xr=J.d;J.d={f:w2,r:C2,D:k2,C:E2,L:A2,m:T2,X:D2,S:R2,M:N2};function w2(){var t=Xr.f(),r=Xc();return t||r}function C2(t){var r=fi(t);r!==null&&r.tag===5&&r.type==="form"?y_(r):Xr.r(t)}var _a=typeof document>"u"?null:document;function rb(t,r,a){var p=_a;if(p&&typeof r=="string"&&r){var C=_t(r);C='link[rel="'+t+'"][href="'+C+'"]',typeof a=="string"&&(C+='[crossorigin="'+a+'"]'),nb.has(C)||(nb.add(C),t={rel:t,crossOrigin:a,href:r},p.querySelector(C)===null&&(r=p.createElement("link"),nn(r,"link",t),It(r),p.head.appendChild(r)))}}function k2(t){Xr.D(t),rb("dns-prefetch",t,null)}function E2(t,r){Xr.C(t,r),rb("preconnect",t,r)}function A2(t,r,a){Xr.L(t,r,a);var p=_a;if(p&&t&&r){var C='link[rel="preload"][as="'+_t(r)+'"]';r==="image"&&a&&a.imageSrcSet?(C+='[imagesrcset="'+_t(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(C+='[imagesizes="'+_t(a.imageSizes)+'"]')):C+='[href="'+_t(t)+'"]';var A=C;switch(r){case"style":A=ya(t);break;case"script":A=ba(t)}Qn.has(A)||(t=f({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Qn.set(A,t),p.querySelector(C)!==null||r==="style"&&p.querySelector(el(A))||r==="script"&&p.querySelector(tl(A))||(r=p.createElement("link"),nn(r,"link",t),It(r),p.head.appendChild(r)))}}function T2(t,r){Xr.m(t,r);var a=_a;if(a&&t){var p=r&&typeof r.as=="string"?r.as:"script",C='link[rel="modulepreload"][as="'+_t(p)+'"][href="'+_t(t)+'"]',A=C;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=ba(t)}if(!Qn.has(A)&&(t=f({rel:"modulepreload",href:t},r),Qn.set(A,t),a.querySelector(C)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(tl(A)))return}p=a.createElement("link"),nn(p,"link",t),It(p),a.head.appendChild(p)}}}function R2(t,r,a){Xr.S(t,r,a);var p=_a;if(p&&t){var C=pi(p).hoistableStyles,A=ya(t);r=r||"default";var B=C.get(A);if(!B){var G={loading:0,preload:null};if(B=p.querySelector(el(A)))G.loading=5;else{t=f({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Qn.get(A))&&Wf(t,a);var re=B=p.createElement("link");It(re),nn(re,"link",t),re._p=new Promise(function(le,fe){re.onload=le,re.onerror=fe}),re.addEventListener("load",function(){G.loading|=1}),re.addEventListener("error",function(){G.loading|=2}),G.loading|=4,au(B,r,p)}B={type:"stylesheet",instance:B,count:1,state:G},C.set(A,B)}}}function D2(t,r){Xr.X(t,r);var a=_a;if(a&&t){var p=pi(a).hoistableScripts,C=ba(t),A=p.get(C);A||(A=a.querySelector(tl(C)),A||(t=f({src:t,async:!0},r),(r=Qn.get(C))&&Kf(t,r),A=a.createElement("script"),It(A),nn(A,"link",t),a.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(C,A))}}function N2(t,r){Xr.M(t,r);var a=_a;if(a&&t){var p=pi(a).hoistableScripts,C=ba(t),A=p.get(C);A||(A=a.querySelector(tl(C)),A||(t=f({src:t,async:!0,type:"module"},r),(r=Qn.get(C))&&Kf(t,r),A=a.createElement("script"),It(A),nn(A,"link",t),a.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},p.set(C,A))}}function ib(t,r,a,p){var C=(C=ee.current)?su(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=ya(a.href),a=pi(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=ya(a.href);var A=pi(C).hoistableStyles,B=A.get(t);if(B||(C=C.ownerDocument||C,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(t,B),(A=C.querySelector(el(t)))&&!A._p&&(B.instance=A,B.state.loading=5),Qn.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},Qn.set(t,a),A||M2(C,t,a,B.state))),r&&p===null)throw Error(s(528,""));return B}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=ba(a),a=pi(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 ya(t){return'href="'+_t(t)+'"'}function el(t){return'link[rel="stylesheet"]['+t+"]"}function sb(t){return f({},t,{"data-precedence":t.precedence,precedence:null})}function M2(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}),nn(r,"link",a),It(r),t.head.appendChild(r))}function ba(t){return'[src="'+_t(t)+'"]'}function tl(t){return"script[async]"+t}function ab(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var p=t.querySelector('style[data-href~="'+_t(a.href)+'"]');if(p)return r.instance=p,It(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"),It(p),nn(p,"style",C),au(p,a.precedence,t),r.instance=p;case"stylesheet":C=ya(a.href);var A=t.querySelector(el(C));if(A)return r.state.loading|=4,r.instance=A,It(A),A;p=sb(a),(C=Qn.get(C))&&Wf(p,C),A=(t.ownerDocument||t).createElement("link"),It(A);var B=A;return B._p=new Promise(function(G,re){B.onload=G,B.onerror=re}),nn(A,"link",p),r.state.loading|=4,au(A,a.precedence,t),r.instance=A;case"script":return A=ba(a.src),(C=t.querySelector(tl(A)))?(r.instance=C,It(C),C):(p=a,(C=Qn.get(A))&&(p=f({},a),Kf(p,C)),t=t.ownerDocument||t,C=t.createElement("script"),It(C),nn(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,au(p,a.precedence,t));return r.instance}function au(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,B=0;B<p.length;B++){var G=p[B];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 Wf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Kf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var ou=null;function ob(t,r,a){if(ou===null){var p=new Map,C=ou=new Map;C.set(a,p)}else C=ou,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[ns]||A[Ut]||t==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var B=A.getAttribute(r)||"";B=t+B;var G=p.get(B);G?G.push(A):p.set(B,[A])}}return p}function lb(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function j2(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 cb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function O2(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=ya(p.href),A=r.querySelector(el(C));if(A){r=A._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=lu.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=A,It(A);return}A=r.ownerDocument||r,p=sb(p),(C=Qn.get(C))&&Wf(p,C),A=A.createElement("link"),It(A);var B=A;B._p=new Promise(function(G,re){B.onload=G,B.onerror=re}),nn(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=lu.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Yf=0;function L2(t,r){return t.stylesheets&&t.count===0&&uu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var p=setTimeout(function(){if(t.stylesheets&&uu(t,t.stylesheets),t.unsuspend){var A=t.unsuspend;t.unsuspend=null,A()}},6e4+r);0<t.imgBytes&&Yf===0&&(Yf=62500*m2());var C=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&uu(t,t.stylesheets),t.unsuspend)){var A=t.unsuspend;t.unsuspend=null,A()}},(t.imgBytes>Yf?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(p),clearTimeout(C)}}:null}function lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)uu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var cu=null;function uu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,cu=new Map,r.forEach(I2,t),cu=null,lu.call(t))}function I2(t,r){if(!(r.state.loading&4)){var a=cu.get(t);if(a)var p=a.get(null);else{a=new Map,cu.set(t,a);for(var C=t.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<C.length;A++){var B=C[A];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(a.set(B.dataset.precedence,B),p=B)}p&&a.set(null,p)}C=r.instance,B=C.getAttribute("data-precedence"),A=a.get(B)||p,A===p&&a.set(null,C),a.set(B,C),this.count++,p=lu.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 nl={$$typeof:x,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function B2(t,r,a,p,C,A,B,G,re){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=ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.hiddenUpdates=ui(null),this.identifierPrefix=p,this.onUncaughtError=C,this.onCaughtError=A,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=re,this.incompleteTransitions=new Map}function ub(t,r,a,p,C,A,B,G,re,le,fe,ge){return t=new B2(t,r,a,B,re,le,fe,ge,G),r=1,A===!0&&(r|=24),A=Dn(3,null,null,r),t.current=A,A.stateNode=t,r=Ah(),r.refCount++,t.pooledCache=r,r.refCount++,A.memoizedState={element:p,isDehydrated:a,cache:r},Nh(A),t}function db(t){return t?(t=Zs,t):Zs}function hb(t,r,a,p,C,A){C=db(C),p.context===null?p.context=C:p.pendingContext=C,p=Si(r),p.payload={element:a},A=A===void 0?null:A,A!==null&&(p.callback=A),a=wi(t,p,r),a!==null&&(Cn(a,t,r),Oo(a,t,r))}function fb(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Xf(t,r){fb(t,r),(t=t.alternate)&&fb(t,r)}function pb(t){if(t.tag===13||t.tag===31){var r=ls(t,67108864);r!==null&&Cn(r,t,67108864),Xf(t,67108864)}}function mb(t){if(t.tag===13||t.tag===31){var r=Ln();r=An(r);var a=ls(t,r);a!==null&&Cn(a,t,r),Xf(t,r)}}var du=!0;function z2(t,r,a,p){var C=V.T;V.T=null;var A=J.p;try{J.p=2,Zf(t,r,a,p)}finally{J.p=A,V.T=C}}function P2(t,r,a,p){var C=V.T;V.T=null;var A=J.p;try{J.p=8,Zf(t,r,a,p)}finally{J.p=A,V.T=C}}function Zf(t,r,a,p){if(du){var C=Qf(p);if(C===null)Bf(t,r,p,hu,a),vb(t,p);else if(H2(C,t,r,a,p))p.stopPropagation();else if(vb(t,p),r&4&&-1<F2.indexOf(t)){for(;C!==null;){var A=fi(C);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var B=qn(A.pendingLanes);if(B!==0){var G=A;for(G.pendingLanes|=2,G.entangledLanes|=2;B;){var re=1<<31-lt(B);G.entanglements[1]|=re,B&=~re}xr(A),(ct&6)===0&&(Kc=Tt()+500,Xo(0))}}break;case 31:case 13:G=ls(A,2),G!==null&&Cn(G,A,2),Xc(),Xf(A,2)}if(A=Qf(p),A===null&&Bf(t,r,p,hu,a),A===C)break;C=A}C!==null&&p.stopPropagation()}else Bf(t,r,p,null,a)}}function Qf(t){return t=_n(t),Jf(t)}var hu=null;function Jf(t){if(hu=null,t=hi(t),t!==null){var r=h(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=u(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 hu=t,null}function gb(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(Zt()){case he:return 2;case Se:return 8;case Re:case Pe:return 32;case qe:return 268435456;default:return 32}default:return 32}}var ep=!1,Oi=null,Li=null,Ii=null,rl=new Map,il=new Map,Bi=[],F2="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 vb(t,r){switch(t){case"focusin":case"focusout":Oi=null;break;case"dragenter":case"dragleave":Li=null;break;case"mouseover":case"mouseout":Ii=null;break;case"pointerover":case"pointerout":rl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":il.delete(r.pointerId)}}function sl(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=fi(r),r!==null&&pb(r)),t):(t.eventSystemFlags|=p,r=t.targetContainers,C!==null&&r.indexOf(C)===-1&&r.push(C),t)}function H2(t,r,a,p,C){switch(r){case"focusin":return Oi=sl(Oi,t,r,a,p,C),!0;case"dragenter":return Li=sl(Li,t,r,a,p,C),!0;case"mouseover":return Ii=sl(Ii,t,r,a,p,C),!0;case"pointerover":var A=C.pointerId;return rl.set(A,sl(rl.get(A)||null,t,r,a,p,C)),!0;case"gotpointercapture":return A=C.pointerId,il.set(A,sl(il.get(A)||null,t,r,a,p,C)),!0}return!1}function _b(t){var r=hi(t.target);if(r!==null){var a=h(r);if(a!==null){if(r=a.tag,r===13){if(r=u(a),r!==null){t.blockedOn=r,rc(t.priority,function(){mb(a)});return}}else if(r===31){if(r=o(a),r!==null){t.blockedOn=r,rc(t.priority,function(){mb(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 fu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Qf(t.nativeEvent);if(a===null){a=t.nativeEvent;var p=new a.constructor(a.type,a);hn=p,a.target.dispatchEvent(p),hn=null}else return r=fi(a),r!==null&&pb(r),t.blockedOn=a,!1;r.shift()}return!0}function yb(t,r,a){fu(t)&&a.delete(r)}function U2(){ep=!1,Oi!==null&&fu(Oi)&&(Oi=null),Li!==null&&fu(Li)&&(Li=null),Ii!==null&&fu(Ii)&&(Ii=null),rl.forEach(yb),il.forEach(yb)}function pu(t,r){t.blockedOn===r&&(t.blockedOn=null,ep||(ep=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,U2)))}var mu=null;function bb(t){mu!==t&&(mu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mu===t&&(mu=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(Jf(p||a)===null)continue;break}var A=fi(a);A!==null&&(t.splice(r,3),r-=3,Zh(A,{pending:!0,data:C,method:a.method,action:p},p,C))}}))}function xa(t){function r(re){return pu(re,t)}Oi!==null&&pu(Oi,t),Li!==null&&pu(Li,t),Ii!==null&&pu(Ii,t),rl.forEach(r),il.forEach(r);for(var a=0;a<Bi.length;a++){var p=Bi[a];p.blockedOn===t&&(p.blockedOn=null)}for(;0<Bi.length&&(a=Bi[0],a.blockedOn===null);)_b(a),a.blockedOn===null&&Bi.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],B=C[an]||null;if(typeof A=="function")B||bb(a);else if(B){var G=null;if(A&&A.hasAttribute("formAction")){if(C=A,B=A[an]||null)G=B.formAction;else if(Jf(C)!==null)continue}else G=B.action;typeof G=="function"?a[p+1]=G:(a.splice(p,3),p-=3),bb(a)}}}function xb(){function t(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(B){return C=B})},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 tp(t){this._internalRoot=t}gu.prototype.render=tp.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,p=Ln();hb(a,p,t,r,null,null)},gu.prototype.unmount=tp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;hb(t.current,2,null,t,null,null),Xc(),r[di]=null}};function gu(t){this._internalRoot=t}gu.prototype.unstable_scheduleHydration=function(t){if(t){var r=po();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Bi.length&&r!==0&&r<Bi[a].priority;a++);Bi.splice(a,0,t),a===0&&_b(t)}};var Sb=n.version;if(Sb!=="19.2.4")throw Error(s(527,Sb,"19.2.4"));J.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=d(r),t=t!==null?g(t):null,t=t===null?null:t.stateNode,t};var $2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{Rt=vu.inject($2),jt=vu}catch{}}return ol.createRoot=function(t,r){if(!l(t))throw Error(s(299));var a=!1,p="",C=R_,A=D_,B=N_;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&&(B=r.onRecoverableError)),r=ub(t,1,!1,null,null,a,p,null,C,A,B,xb),t[di]=r.current,If(t),new tp(r)},ol.hydrateRoot=function(t,r,a){if(!l(t))throw Error(s(299));var p=!1,C="",A=R_,B=D_,G=N_,re=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&&(B=a.onCaughtError),a.onRecoverableError!==void 0&&(G=a.onRecoverableError),a.formState!==void 0&&(re=a.formState)),r=ub(t,1,!0,r,a!=null?a:null,p,C,re,A,B,G,xb),r.context=db(null),a=r.current,p=Ln(),p=An(p),C=Si(p),C.callback=null,wi(a,C,p),a=p,r.current.lanes=a,gr(r,a),xr(r),t[di]=r.current,If(t),new gu(r)},ol.version="19.2.4",ol}var Mb;function J2(){if(Mb)return ip.exports;Mb=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(),ip.exports=Q2(),ip.exports}var eA=J2();const tA={theme:"system",setTheme:()=>null,resolvedTheme:"dark"},Ix=T.createContext(tA);function nA({children:e,defaultTheme:n="system",storageKey:i="jean2-theme",...s}){const[l,h]=T.useState(()=>localStorage.getItem(i)||n),[u,o]=T.useState("dark");T.useEffect(()=>{const d=window.document.documentElement;if(d.classList.remove("light","dark"),l==="system"){const g=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";d.classList.add(g),o(g);return}d.classList.add(l),o(l)},[l]);const c={theme:l,setTheme:d=>{localStorage.setItem(i,d),h(d)},resolvedTheme:u};return m.jsx(Ix.Provider,{...s,value:c,children:e})}const rA=()=>{const e=T.useContext(Ix);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function iA(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 Bx=(...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 sA=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 aA=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 jb=e=>{const n=aA(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 oA={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 lA=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 cA=T.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:l="",children:h,iconNode:u,...o},c)=>T.createElement("svg",{ref:c,...oA,width:n,height:n,stroke:e,strokeWidth:s?Number(i)*24/Number(n):i,className:Bx("lucide",l),...!h&&!lA(o)&&{"aria-hidden":"true"},...o},[...u.map(([d,g])=>T.createElement(d,g)),...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 Ee=(e,n)=>{const i=T.forwardRef(({className:s,...l},h)=>T.createElement(cA,{ref:h,iconNode:n,className:Bx(`lucide-${sA(jb(e))}`,`lucide-${e}`,s),...l}));return i.displayName=jb(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 uA=[["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"}]],dA=Ee("archive",uA);/**
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 hA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],fA=Ee("arrow-left",hA);/**
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 pA=[["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"}]],mA=Ee("bot",pA);/**
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 gA=[["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"}]],Yp=Ee("box",gA);/**
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 vA=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],_A=Ee("brain",vA);/**
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 yA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ni=Ee("check",yA);/**
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 bA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ya=Ee("chevron-down",bA);/**
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 xA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],SA=Ee("chevron-left",xA);/**
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 wA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ri=Ee("chevron-right",wA);/**
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 CA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kA=Ee("chevron-up",CA);/**
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 EA=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],zx=Ee("chevrons-up-down",EA);/**
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 AA=[["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"}]],vl=Ee("circle-alert",AA);/**
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 TA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ol=Ee("circle-check-big",TA);/**
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 RA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],DA=Ee("circle-check",RA);/**
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 NA=[["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"}]],ad=Ee("circle-x",NA);/**
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 MA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],jA=Ee("circle",MA);/**
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 OA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Px=Ee("clock",OA);/**
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 LA=[["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"}]],Cl=Ee("copy",LA);/**
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 IA=[["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"}]],BA=Ee("cpu",IA);/**
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 zA=[["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"}]],PA=Ee("ellipsis",zA);/**
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 FA=[["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"}]],Xp=Ee("external-link",FA);/**
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 HA=[["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"}]],UA=Ee("eye-off",HA);/**
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 $A=[["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"}]],qA=Ee("eye",$A);/**
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 VA=[["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"}]],GA=Ee("file-pen",VA);/**
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 WA=[["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"}]],Dm=Ee("file-text",WA);/**
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 KA=[["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"}]],Sr=Ee("file",KA);/**
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 YA=[["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"}]],Zp=Ee("folder-open",YA);/**
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 XA=[["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"}]],qi=Ee("folder",XA);/**
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 ZA=[["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"}]],QA=Ee("git-branch",ZA);/**
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 JA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ob=Ee("info",JA);/**
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 eT=[["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"}]],tT=Ee("layout-grid",eT);/**
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 nT=[["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"}]],rT=Ee("layout-list",nT);/**
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 iT=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],sT=Ee("link-2",iT);/**
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 aT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Pn=Ee("loader-circle",aT);/**
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 oT=[["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"}]],lT=Ee("lock",oT);/**
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 cT=[["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"}]],uT=Ee("message-square",cT);/**
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 dT=[["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"}]],Fx=Ee("minimize-2",dT);/**
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 hT=[["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"}]],fT=Ee("monitor",hT);/**
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 pT=[["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"}]],mT=Ee("moon",pT);/**
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 gT=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],vT=Ee("palette",gT);/**
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 _T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],yT=Ee("panel-left",_T);/**
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 bT=[["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"}]],xT=Ee("plug-zap",bT);/**
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 ST=[["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"}]],wT=Ee("plug",ST);/**
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 CT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xa=Ee("plus",CT);/**
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 kT=[["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"}]],Na=Ee("refresh-cw",kT);/**
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 ET=[["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"}]],Hx=Ee("rotate-ccw",ET);/**
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 AT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Nm=Ee("search",AT);/**
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 TT=[["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"}]],RT=Ee("send",TT);/**
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 DT=[["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"}]],ks=Ee("server",DT);/**
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 NT=[["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"}]],Ux=Ee("settings",NT);/**
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 MT=[["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"}]],$x=Ee("shield",MT);/**
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 jT=[["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"}]],Lb=Ee("square-terminal",jT);/**
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 OT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],qx=Ee("square",OT);/**
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 LT=[["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"}]],Ib=Ee("star",LT);/**
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 IT=[["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"}]],BT=Ee("sun",IT);/**
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 zT=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Bb=Ee("terminal",zT);/**
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 PT=[["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"}]],Ll=Ee("trash-2",PT);/**
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 FT=[["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"}]],Qp=Ee("triangle-alert",FT);/**
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 HT=[["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"}]],UT=Ee("undo-2",HT);/**
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 $T=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["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:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],qT=Ee("unplug",$T);/**
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 VT=[["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"}]],Vx=Ee("user",VT);/**
395
- * @license lucide-react v0.577.0 - ISC
396
- *
397
- * This source code is licensed under the ISC license.
398
- * See the LICENSE file in the root directory of this source tree.
399
- */const GT=[["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"}]],Gx=Ee("wifi-off",GT);/**
400
- * @license lucide-react v0.577.0 - ISC
401
- *
402
- * This source code is licensed under the ISC license.
403
- * See the LICENSE file in the root directory of this source tree.
404
- */const WT=[["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"}]],KT=Ee("wifi",WT);/**
405
- * @license lucide-react v0.577.0 - ISC
406
- *
407
- * This source code is licensed under the ISC license.
408
- * See the LICENSE file in the root directory of this source tree.
409
- */const YT=[["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"}]],XT=Ee("wrench",YT);/**
410
- * @license lucide-react v0.577.0 - ISC
411
- *
412
- * This source code is licensed under the ISC license.
413
- * See the LICENSE file in the root directory of this source tree.
414
- */const ZT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ei=Ee("x",ZT);/**
415
- * @license lucide-react v0.577.0 - ISC
416
- *
417
- * This source code is licensed under the ISC license.
418
- * See the LICENSE file in the root directory of this source tree.
419
- */const QT=[["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"}]],lp=Ee("zap",QT),tr={SERVERS:"jean2_servers",ACTIVE_SERVER_ID:"jean2_active_server_id",QUICK_CONNECTIONS:"jean2_quick_connections"};function Qr(){try{const e=localStorage.getItem(tr.SERVERS);return e?JSON.parse(e):[]}catch(e){return console.error("Error reading saved servers from localStorage:",e),[]}}function JT(e){return Qr().find(i=>i.id===e)||null}function eR(e){try{const n=Qr();n.push(e),localStorage.setItem(tr.SERVERS,JSON.stringify(n))}catch(n){console.error("Error saving server to localStorage:",n)}}function tR(e,n){try{const i=Qr(),s=i.findIndex(l=>l.id===e);if(s===-1){console.error("Server not found:",e);return}i[s]={...i[s],...n},localStorage.setItem(tr.SERVERS,JSON.stringify(i))}catch(i){console.error("Error updating server in localStorage:",i)}}function nR(e){try{const i=Qr().filter(u=>u.id!==e);localStorage.setItem(tr.SERVERS,JSON.stringify(i));const l=Jr().filter(u=>u.serverId!==e);localStorage.setItem(tr.QUICK_CONNECTIONS,JSON.stringify(l)),Wx()===e&&localStorage.removeItem(tr.ACTIVE_SERVER_ID)}catch(n){console.error("Error deleting server from localStorage:",n)}}function Wx(){try{return localStorage.getItem(tr.ACTIVE_SERVER_ID)}catch(e){return console.error("Error reading active server ID from localStorage:",e),null}}function cp(e){try{localStorage.setItem(tr.ACTIVE_SERVER_ID,e)}catch(n){console.error("Error setting active server ID in localStorage:",n)}}function zb(){const e=Wx();return e?JT(e):null}function Jr(){try{const e=localStorage.getItem(tr.QUICK_CONNECTIONS);return e?JSON.parse(e):[]}catch(e){return console.error("Error reading quick connections from localStorage:",e),[]}}function rR(e){const n=Jr(),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(tr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(l){console.error("Error saving quick connection to localStorage:",l)}return s}function iR(e){try{const i=Jr().filter(s=>s.id!==e);localStorage.setItem(tr.QUICK_CONNECTIONS,JSON.stringify(i))}catch(n){console.error("Error removing quick connection from localStorage:",n)}}function sR(e){try{const n=Jr(),i=new Map(n.map(s=>[s.id,s]));e.forEach((s,l)=>{const h=i.get(s);h&&(h.order=l)}),localStorage.setItem(tr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(n){console.error("Error reordering quick connections in localStorage:",n)}}function Kx(e){return/^[a-f0-9]{64}$/.test(e)}function aR(e){return e.length<12?e:`${e.slice(0,4)}...${e.slice(-4)}`}function Fu(e){let n=e.trim();return n=n.replace(/^(https?:\/\/|wss?:\/\/)/i,""),n=n.replace(/\/+$/,""),n}const Yx=T.createContext(null),oR=({children:e})=>{const[n,i]=T.useState([]),[s,l]=T.useState(null),[h,u]=T.useState([]),[o,c]=T.useState(!1),d=T.useRef(null);T.useEffect(()=>{const x=Qr(),E=zb(),N=Jr();i(x),l(E),u(N)},[]);const g=(x,E,N)=>{const R=Fu(E),M={id:crypto.randomUUID(),name:x,url:R,token:N,createdAt:new Date().toISOString()};return eR(M),i(Qr()),n.length===0&&(cp(M.id),l(M)),M},f=(x,E)=>{const N={...E,...E.url&&{url:Fu(E.url)}};tR(x,N),i(Qr()),(s==null?void 0:s.id)===x&&l(zb())},b=x=>{const E=(s==null?void 0:s.id)===x;if(nR(x),i(Qr()),E){const N=Qr(),R=N.length>0?N[0]:null;R?(cp(R.id),l(R)):l(null)}u(Jr())},S=T.useCallback(x=>(d.current&&(clearTimeout(d.current),d.current=null),o&&(s==null?void 0:s.id)===x?!1:(o&&c(!1),c(!0),d.current=setTimeout(()=>{cp(x);const E=n.find(N=>N.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:g,editServer:f,removeServer:b,switchServer:S,clearSwitchingState:k,addToQuickConnections:(x,E,N,R)=>{rR({serverId:x,serverName:E,workspaceId:N,workspaceName:R}),u(Jr())},removeFromQuickConnections:x=>{iR(x),u(Jr())},reorderQuick:x=>{sR(x),u(Jr())}};return m.jsx(Yx.Provider,{value:v,children:e})},Za=()=>{const e=T.useContext(Yx);if(e===null)throw new Error("useServerContext must be used within a ServerProvider");return e};function Xx(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=Xx(e[n]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function od(){for(var e,n,i=0,s="",l=arguments.length;i<l;i++)(e=arguments[i])&&(n=Xx(e))&&(s&&(s+=" "),s+=n);return s}const Pb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Fb=od,Qa=(e,n)=>i=>{var s;if((n==null?void 0:n.variants)==null)return Fb(e,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:l,defaultVariants:h}=n,u=Object.keys(l).map(d=>{const g=i==null?void 0:i[d],f=h==null?void 0:h[d];if(g===null)return null;const b=Pb(g)||Pb(f);return l[d][b]}),o=i&&Object.entries(i).reduce((d,g)=>{let[f,b]=g;return b===void 0||(d[f]=b),d},{}),c=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((d,g)=>{let{class:f,className:b,...S}=g;return Object.entries(S).every(k=>{let[w,_]=k;return Array.isArray(_)?_.includes({...h,...o}[w]):{...h,...o}[w]===_})?[...d,f,b]:d},[]);return Fb(e,u,c,i==null?void 0:i.class,i==null?void 0:i.className)};var Il=Lx();const lR=sd(Il);function Hb(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function ii(...e){return n=>{let i=!1;const s=e.map(l=>{const h=Hb(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():Hb(e[l],null)}}}}function Xe(...e){return T.useCallback(ii(...e),e)}function Vi(e){const n=cR(e),i=T.forwardRef((s,l)=>{const{children:h,...u}=s,o=T.Children.toArray(h),c=o.find(dR);if(c){const d=c.props.children,g=o.map(f=>f===c?T.Children.count(d)>1?T.Children.only(null):T.isValidElement(d)?d.props.children:null:f);return m.jsx(n,{...u,ref:l,children:T.isValidElement(d)?T.cloneElement(d,void 0,g):null})}return m.jsx(n,{...u,ref:l,children:h})});return i.displayName=`${e}.Slot`,i}var Bl=Vi("Slot");function cR(e){const n=T.forwardRef((i,s)=>{const{children:l,...h}=i;if(T.isValidElement(l)){const u=fR(l),o=hR(h,l.props);return l.type!==T.Fragment&&(o.ref=s?ii(s,u):u),T.cloneElement(l,o)}return T.Children.count(l)>1?T.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var Zx=Symbol("radix.slottable");function uR(e){const n=({children:i})=>m.jsx(m.Fragment,{children:i});return n.displayName=`${e}.Slottable`,n.__radixId=Zx,n}function dR(e){return T.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zx}function hR(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 fR(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 pR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],je=pR.reduce((e,n)=>{const i=Vi(`Primitive.${n}`),s=T.forwardRef((l,h)=>{const{asChild:u,...o}=l,c=u?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...o,ref:h})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{});function Qx(e,n){e&&Il.flushSync(()=>e.dispatchEvent(n))}var Jx=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"}),mR="VisuallyHidden",e1=T.forwardRef((e,n)=>m.jsx(je.span,{...e,ref:n,style:{...Jx,...e.style}}));e1.displayName=mR;var gR=e1;function vR(e,n){const i=T.createContext(n),s=h=>{const{children:u,...o}=h,c=T.useMemo(()=>o,Object.values(o));return m.jsx(i.Provider,{value:c,children:u})};s.displayName=e+"Provider";function l(h){const u=T.useContext(i);if(u)return u;if(n!==void 0)return n;throw new Error(`\`${h}\` must be used within \`${e}\``)}return[s,l]}function Un(e,n=[]){let i=[];function s(h,u){const o=T.createContext(u),c=i.length;i=[...i,u];const d=f=>{var y;const{scope:b,children:S,...k}=f,w=((y=b==null?void 0:b[e])==null?void 0:y[c])||o,_=T.useMemo(()=>k,Object.values(k));return m.jsx(w.Provider,{value:_,children:S})};d.displayName=h+"Provider";function g(f,b){var w;const S=((w=b==null?void 0:b[e])==null?void 0:w[c])||o,k=T.useContext(S);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${f}\` must be used within \`${h}\``)}return[d,g]}const l=()=>{const h=i.map(u=>T.createContext(u));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,_R(l,...n)]}function _R(...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 u=s.reduce((o,{useScope:c,scopeName:d})=>{const f=c(h)[`__scope${d}`];return{...o,...f}},{});return T.useMemo(()=>({[`__scope${n.scopeName}`]:u}),[u])}};return i.scopeName=n.scopeName,i}function Mm(e){const n=e+"CollectionProvider",[i,s]=Un(n),[l,h]=i(n,{collectionRef:{current:null},itemMap:new Map}),u=w=>{const{scope:_,children:y}=w,v=Jn.useRef(null),x=Jn.useRef(new Map).current;return m.jsx(l,{scope:_,itemMap:x,collectionRef:v,children:y})};u.displayName=n;const o=e+"CollectionSlot",c=Vi(o),d=Jn.forwardRef((w,_)=>{const{scope:y,children:v}=w,x=h(o,y),E=Xe(_,x.collectionRef);return m.jsx(c,{ref:E,children:v})});d.displayName=o;const g=e+"CollectionItemSlot",f="data-radix-collection-item",b=Vi(g),S=Jn.forwardRef((w,_)=>{const{scope:y,children:v,...x}=w,E=Jn.useRef(null),N=Xe(_,E),R=h(g,y);return Jn.useEffect(()=>(R.itemMap.set(E,{ref:E,...x}),()=>void R.itemMap.delete(E))),m.jsx(b,{[f]:"",ref:N,children:v})});S.displayName=g;function k(w){const _=h(e+"CollectionConsumer",w);return Jn.useCallback(()=>{const v=_.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(_.itemMap.values()).sort((R,M)=>x.indexOf(R.ref.current)-x.indexOf(M.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:u,Slot:d,ItemSlot:S},k,s]}function we(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 Yt=globalThis!=null&&globalThis.document?T.useLayoutEffect:()=>{},yR=Ox[" useInsertionEffect ".trim().toString()]||Yt;function si({prop:e,defaultProp:n,onChange:i=()=>{},caller:s}){const[l,h,u]=bR({defaultProp:n,onChange:i}),o=e!==void 0,c=o?e:l;{const g=T.useRef(e!==void 0);T.useEffect(()=>{const f=g.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.`),g.current=o},[o,s])}const d=T.useCallback(g=>{var f;if(o){const b=xR(g)?g(e):g;b!==e&&((f=u.current)==null||f.call(u,b))}else h(g)},[o,e,h,u]);return[c,d]}function bR({defaultProp:e,onChange:n}){const[i,s]=T.useState(e),l=T.useRef(i),h=T.useRef(n);return yR(()=>{h.current=n},[n]),T.useEffect(()=>{var u;l.current!==i&&((u=h.current)==null||u.call(h,i),l.current=i)},[i,l]),[i,s,h]}function xR(e){return typeof e=="function"}function SR(e,n){return T.useReducer((i,s)=>{const l=n[i][s];return l!=null?l:i},e)}var Xt=e=>{const{present:n,children:i}=e,s=wR(n),l=typeof i=="function"?i({present:s.isPresent}):T.Children.only(i),h=Xe(s.ref,CR(l));return typeof i=="function"||s.isPresent?T.cloneElement(l,{ref:h}):null};Xt.displayName="Presence";function wR(e){const[n,i]=T.useState(),s=T.useRef(null),l=T.useRef(e),h=T.useRef("none"),u=e?"mounted":"unmounted",[o,c]=SR(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const d=_u(s.current);h.current=o==="mounted"?d:"none"},[o]),Yt(()=>{const d=s.current,g=l.current;if(g!==e){const b=h.current,S=_u(d);e?c("MOUNT"):S==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(g&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,c]),Yt(()=>{var d;if(n){let g;const f=(d=n.ownerDocument.defaultView)!=null?d:window,b=k=>{const _=_u(s.current).includes(CSS.escape(k.animationName));if(k.target===n&&_&&(c("ANIMATION_END"),!l.current)){const y=n.style.animationFillMode;n.style.animationFillMode="forwards",g=f.setTimeout(()=>{n.style.animationFillMode==="forwards"&&(n.style.animationFillMode=y)})}},S=k=>{k.target===n&&(h.current=_u(s.current))};return n.addEventListener("animationstart",S),n.addEventListener("animationcancel",b),n.addEventListener("animationend",b),()=>{f.clearTimeout(g),n.removeEventListener("animationstart",S),n.removeEventListener("animationcancel",b),n.removeEventListener("animationend",b)}}else c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:T.useCallback(d=>{s.current=d?getComputedStyle(d):null,i(d)},[])}}function _u(e){return(e==null?void 0:e.animationName)||"none"}function CR(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 kR=Ox[" useId ".trim().toString()]||(()=>{}),ER=0;function Vt(e){const[n,i]=T.useState(kR());return Yt(()=>{i(s=>s!=null?s:String(ER++))},[e]),e||(n?`radix-${n}`:"")}var ld="Collapsible",[AR]=Un(ld),[TR,jm]=AR(ld),t1=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,open:s,defaultOpen:l,disabled:h,onOpenChange:u,...o}=e,[c,d]=si({prop:s,defaultProp:l!=null?l:!1,onChange:u,caller:ld});return m.jsx(TR,{scope:i,disabled:h,contentId:Vt(),open:c,onOpenToggle:T.useCallback(()=>d(g=>!g),[d]),children:m.jsx(je.div,{"data-state":Lm(c),"data-disabled":h?"":void 0,...o,ref:n})})});t1.displayName=ld;var n1="CollapsibleTrigger",r1=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,...s}=e,l=jm(n1,i);return m.jsx(je.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":Lm(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...s,ref:n,onClick:we(e.onClick,l.onOpenToggle)})});r1.displayName=n1;var Om="CollapsibleContent",i1=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=jm(Om,e.__scopeCollapsible);return m.jsx(Xt,{present:i||l.open,children:({present:h})=>m.jsx(RR,{...s,ref:n,present:h})})});i1.displayName=Om;var RR=T.forwardRef((e,n)=>{const{__scopeCollapsible:i,present:s,children:l,...h}=e,u=jm(Om,i),[o,c]=T.useState(s),d=T.useRef(null),g=Xe(n,d),f=T.useRef(0),b=f.current,S=T.useRef(0),k=S.current,w=u.open||o,_=T.useRef(w),y=T.useRef(void 0);return T.useEffect(()=>{const v=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(v)},[]),Yt(()=>{const v=d.current;if(v){y.current=y.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=y.current.transitionDuration,v.style.animationName=y.current.animationName),c(s)}},[u.open,s]),m.jsx(je.div,{"data-state":Lm(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...h,ref:g,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":k?`${k}px`:void 0,...e.style},children:w&&l})});function Lm(e){return e?"open":"closed"}var DR=t1,NR=T.createContext(void 0);function zl(e){const n=T.useContext(NR);return e||n||"ltr"}function rn(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 MR(e,n=globalThis==null?void 0:globalThis.document){const i=rn(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 jR="DismissableLayer",Jp="dismissableLayer.update",OR="dismissableLayer.pointerDownOutside",LR="dismissableLayer.focusOutside",Ub,s1=T.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ja=T.forwardRef((e,n)=>{var M;const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:h,onInteractOutside:u,onDismiss:o,...c}=e,d=T.useContext(s1),[g,f]=T.useState(null),b=(M=g==null?void 0:g.ownerDocument)!=null?M:globalThis==null?void 0:globalThis.document,[,S]=T.useState({}),k=Xe(n,D=>f(D)),w=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(_),v=g?w.indexOf(g):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,E=v>=y,N=zR(D=>{const O=D.target,P=[...d.branches].some($=>$.contains(O));!E||P||(l==null||l(D),u==null||u(D),D.defaultPrevented||o==null||o())},b),R=PR(D=>{const O=D.target;[...d.branches].some($=>$.contains(O))||(h==null||h(D),u==null||u(D),D.defaultPrevented||o==null||o())},b);return MR(D=>{v===d.layers.size-1&&(s==null||s(D),!D.defaultPrevented&&o&&(D.preventDefault(),o()))},b),T.useEffect(()=>{if(g)return i&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ub=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(g)),d.layers.add(g),$b(),()=>{i&&d.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Ub)}},[g,b,i,d]),T.useEffect(()=>()=>{g&&(d.layers.delete(g),d.layersWithOutsidePointerEventsDisabled.delete(g),$b())},[g,d]),T.useEffect(()=>{const D=()=>S({});return document.addEventListener(Jp,D),()=>document.removeEventListener(Jp,D)},[]),m.jsx(je.div,{...c,ref:k,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,R.onFocusCapture),onBlurCapture:we(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,N.onPointerDownCapture)})});Ja.displayName=jR;var IR="DismissableLayerBranch",BR=T.forwardRef((e,n)=>{const i=T.useContext(s1),s=T.useRef(null),l=Xe(n,s);return T.useEffect(()=>{const h=s.current;if(h)return i.branches.add(h),()=>{i.branches.delete(h)}},[i.branches]),m.jsx(je.div,{...e,ref:l})});BR.displayName=IR;function zR(e,n=globalThis==null?void 0:globalThis.document){const i=rn(e),s=T.useRef(!1),l=T.useRef(()=>{});return T.useEffect(()=>{const h=o=>{if(o.target&&!s.current){let c=function(){a1(OR,i,d,{discrete:!0})};const d={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},u=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",h),n.removeEventListener("click",l.current)}},[n,i]),{onPointerDownCapture:()=>s.current=!0}}function PR(e,n=globalThis==null?void 0:globalThis.document){const i=rn(e),s=T.useRef(!1);return T.useEffect(()=>{const l=h=>{h.target&&!s.current&&a1(LR,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 $b(){const e=new CustomEvent(Jp);document.dispatchEvent(e)}function a1(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?Qx(l,h):l.dispatchEvent(h)}var up="focusScope.autoFocusOnMount",dp="focusScope.autoFocusOnUnmount",qb={bubbles:!1,cancelable:!0},FR="FocusScope",Pl=T.forwardRef((e,n)=>{const{loop:i=!1,trapped:s=!1,onMountAutoFocus:l,onUnmountAutoFocus:h,...u}=e,[o,c]=T.useState(null),d=rn(l),g=rn(h),f=T.useRef(null),b=Xe(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:$i(f.current,{select:!0})},_=function(x){if(S.paused||!o)return;const E=x.relatedTarget;E!==null&&(o.contains(E)||$i(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const N of x)N.removedNodes.length>0&&$i(o)};document.addEventListener("focusin",w),document.addEventListener("focusout",_);const v=new MutationObserver(y);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){Gb.add(S);const w=document.activeElement;if(!o.contains(w)){const y=new CustomEvent(up,qb);o.addEventListener(up,d),o.dispatchEvent(y),y.defaultPrevented||(HR(GR(o1(o)),{select:!0}),document.activeElement===w&&$i(o))}return()=>{o.removeEventListener(up,d),setTimeout(()=>{const y=new CustomEvent(dp,qb);o.addEventListener(dp,g),o.dispatchEvent(y),y.defaultPrevented||$i(w!=null?w:document.body,{select:!0}),o.removeEventListener(dp,g),Gb.remove(S)},0)}}},[o,d,g,S]);const k=T.useCallback(w=>{if(!i&&!s||S.paused)return;const _=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,y=document.activeElement;if(_&&y){const v=w.currentTarget,[x,E]=UR(v);x&&E?!w.shiftKey&&y===E?(w.preventDefault(),i&&$i(x,{select:!0})):w.shiftKey&&y===x&&(w.preventDefault(),i&&$i(E,{select:!0})):y===v&&w.preventDefault()}},[i,s,S.paused]);return m.jsx(je.div,{tabIndex:-1,...u,ref:b,onKeyDown:k})});Pl.displayName=FR;function HR(e,{select:n=!1}={}){const i=document.activeElement;for(const s of e)if($i(s,{select:n}),document.activeElement!==i)return}function UR(e){const n=o1(e),i=Vb(n,e),s=Vb(n.reverse(),e);return[i,s]}function o1(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 Vb(e,n){for(const i of e)if(!$R(i,{upTo:n}))return i}function $R(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 qR(e){return e instanceof HTMLInputElement&&"select"in e}function $i(e,{select:n=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&qR(e)&&n&&e.select()}}var Gb=VR();function VR(){let e=[];return{add(n){const i=e[0];n!==i&&(i==null||i.pause()),e=Wb(e,n),e.unshift(n)},remove(n){var i;e=Wb(e,n),(i=e[0])==null||i.resume()}}}function Wb(e,n){const i=[...e],s=i.indexOf(n);return s!==-1&&i.splice(s,1),i}function GR(e){return e.filter(n=>n.tagName!=="A")}var WR="Portal",eo=T.forwardRef((e,n)=>{var o;const{container:i,...s}=e,[l,h]=T.useState(!1);Yt(()=>h(!0),[]);const u=i||l&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return u?lR.createPortal(m.jsx(je.div,{...s,ref:n}),u):null});eo.displayName=WR;var hp=0;function cd(){T.useEffect(()=>{var n,i;const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(n=e[0])!=null?n:Kb()),document.body.insertAdjacentElement("beforeend",(i=e[1])!=null?i:Kb()),hp++,()=>{hp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(s=>s.remove()),hp--}},[])}function Kb(){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 Cr=function(){return Cr=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},Cr.apply(this,arguments)};function l1(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 KR(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 ju="right-scroll-bar-position",Ou="width-before-scroll-bar",YR="with-scroll-bars-hidden",XR="--removed-body-scroll-bar-size";function fp(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function ZR(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 QR=typeof window<"u"?T.useLayoutEffect:T.useEffect,Yb=new WeakMap;function JR(e,n){var i=ZR(null,function(s){return e.forEach(function(l){return fp(l,s)})});return QR(function(){var s=Yb.get(i);if(s){var l=new Set(s),h=new Set(e),u=i.current;l.forEach(function(o){h.has(o)||fp(o,null)}),h.forEach(function(o){l.has(o)||fp(o,u)})}Yb.set(i,e)},[e]),i}function eD(e){return e}function tD(e,n){n===void 0&&(n=eD);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 u=n(h,s);return i.push(u),function(){i=i.filter(function(o){return o!==u})}},assignSyncMedium:function(h){for(s=!0;i.length;){var u=i;i=[],u.forEach(h)}i={push:function(o){return h(o)},filter:function(){return i}}},assignMedium:function(h){s=!0;var u=[];if(i.length){var o=i;i=[],o.forEach(h),u=i}var c=function(){var g=u;u=[],g.forEach(h)},d=function(){return Promise.resolve().then(c)};d(),i={push:function(g){u.push(g),d()},filter:function(g){return u=u.filter(g),i}}}};return l}function nD(e){e===void 0&&(e={});var n=tD(null);return n.options=Cr({async:!0,ssr:!1},e),n}var c1=function(e){var n=e.sideCar,i=l1(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,Cr({},i))};c1.isSideCarExport=!0;function rD(e,n){return e.useMedium(n),c1}var u1=nD(),pp=function(){},ud=T.forwardRef(function(e,n){var i=T.useRef(null),s=T.useState({onScrollCapture:pp,onWheelCapture:pp,onTouchMoveCapture:pp}),l=s[0],h=s[1],u=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,g=e.enabled,f=e.shards,b=e.sideCar,S=e.noRelative,k=e.noIsolation,w=e.inert,_=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,x=e.gapMode,E=l1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=b,R=JR([i,n]),M=Cr(Cr({},E),l);return T.createElement(T.Fragment,null,g&&T.createElement(N,{sideCar:u1,removeScrollBar:d,shards:f,noRelative:S,noIsolation:k,inert:w,setCallbacks:h,allowPinchZoom:!!_,lockRef:i,gapMode:x}),u?T.cloneElement(T.Children.only(o),Cr(Cr({},M),{ref:R})):T.createElement(v,Cr({},M,{className:c,ref:R}),o))});ud.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ud.classNames={fullWidth:Ou,zeroRight:ju};var iD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function sD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=iD();return n&&e.setAttribute("nonce",n),e}function aD(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function oD(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var lD=function(){var e=0,n=null;return{add:function(i){e==0&&(n=sD())&&(aD(n,i),oD(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},cD=function(){var e=lD();return function(n,i){T.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&i])}},d1=function(){var e=cD(),n=function(i){var s=i.styles,l=i.dynamic;return e(s,l),null};return n},uD={left:0,top:0,right:0,gap:0},mp=function(e){return parseInt(e||"",10)||0},dD=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[mp(i),mp(s),mp(l)]},hD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return uD;var n=dD(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])}},fD=d1(),Ma="data-scroll-locked",pD=function(e,n,i,s){var l=e.left,h=e.top,u=e.right,o=e.gap;return i===void 0&&(i="margin"),`
420
- .`.concat(YR,` {
421
- overflow: hidden `).concat(s,`;
422
- padding-right: `).concat(o,"px ").concat(s,`;
423
- }
424
- body[`).concat(Ma,`] {
425
- overflow: hidden `).concat(s,`;
426
- overscroll-behavior: contain;
427
- `).concat([n&&"position: relative ".concat(s,";"),i==="margin"&&`
428
- padding-left: `.concat(l,`px;
429
- padding-top: `).concat(h,`px;
430
- padding-right: `).concat(u,`px;
431
- margin-left:0;
432
- margin-top:0;
433
- margin-right: `).concat(o,"px ").concat(s,`;
434
- `),i==="padding"&&"padding-right: ".concat(o,"px ").concat(s,";")].filter(Boolean).join(""),`
435
- }
436
-
437
- .`).concat(ju,` {
438
- right: `).concat(o,"px ").concat(s,`;
439
- }
440
-
441
- .`).concat(Ou,` {
442
- margin-right: `).concat(o,"px ").concat(s,`;
443
- }
444
-
445
- .`).concat(ju," .").concat(ju,` {
446
- right: 0 `).concat(s,`;
447
- }
448
-
449
- .`).concat(Ou," .").concat(Ou,` {
450
- margin-right: 0 `).concat(s,`;
451
- }
452
-
453
- body[`).concat(Ma,`] {
454
- `).concat(XR,": ").concat(o,`px;
455
- }
456
- `)},Xb=function(){var e=parseInt(document.body.getAttribute(Ma)||"0",10);return isFinite(e)?e:0},mD=function(){T.useEffect(function(){return document.body.setAttribute(Ma,(Xb()+1).toString()),function(){var e=Xb()-1;e<=0?document.body.removeAttribute(Ma):document.body.setAttribute(Ma,e.toString())}},[])},gD=function(e){var n=e.noRelative,i=e.noImportant,s=e.gapMode,l=s===void 0?"margin":s;mD();var h=T.useMemo(function(){return hD(l)},[l]);return T.createElement(fD,{styles:pD(h,!n,l,i?"":"!important")})},em=!1;if(typeof window<"u")try{var yu=Object.defineProperty({},"passive",{get:function(){return em=!0,!0}});window.addEventListener("test",yu,yu),window.removeEventListener("test",yu,yu)}catch{em=!1}var Sa=em?{passive:!1}:!1,vD=function(e){return e.tagName==="TEXTAREA"},h1=function(e,n){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!vD(e)&&i[n]==="visible")},_D=function(e){return h1(e,"overflowY")},yD=function(e){return h1(e,"overflowX")},Zb=function(e,n){var i=n.ownerDocument,s=n;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var l=f1(e,s);if(l){var h=p1(e,s),u=h[1],o=h[2];if(u>o)return!0}s=s.parentNode}while(s&&s!==i.body);return!1},bD=function(e){var n=e.scrollTop,i=e.scrollHeight,s=e.clientHeight;return[n,i,s]},xD=function(e){var n=e.scrollLeft,i=e.scrollWidth,s=e.clientWidth;return[n,i,s]},f1=function(e,n){return e==="v"?_D(n):yD(n)},p1=function(e,n){return e==="v"?bD(n):xD(n)},SD=function(e,n){return e==="h"&&n==="rtl"?-1:1},wD=function(e,n,i,s,l){var h=SD(e,window.getComputedStyle(n).direction),u=h*s,o=i.target,c=n.contains(o),d=!1,g=u>0,f=0,b=0;do{if(!o)break;var S=p1(e,o),k=S[0],w=S[1],_=S[2],y=w-_-h*k;(k||y)&&f1(e,o)&&(f+=y,b+=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(g&&Math.abs(f)<1||!g&&Math.abs(b)<1)&&(d=!0),d},bu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qb=function(e){return[e.deltaX,e.deltaY]},Jb=function(e){return e&&"current"in e?e.current:e},CD=function(e,n){return e[0]===n[0]&&e[1]===n[1]},kD=function(e){return`
457
- .block-interactivity-`.concat(e,` {pointer-events: none;}
458
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
459
- `)},ED=0,wa=[];function AD(e){var n=T.useRef([]),i=T.useRef([0,0]),s=T.useRef(),l=T.useState(ED++)[0],h=T.useState(d1)[0],u=T.useRef(e);T.useEffect(function(){u.current=e},[e]),T.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var w=KR([e.lockRef.current],(e.shards||[]).map(Jb),!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!u.current.allowPinchZoom;var y=bu(w),v=i.current,x="deltaX"in w?w.deltaX:v[0]-y[0],E="deltaY"in w?w.deltaY:v[1]-y[1],N,R=w.target,M=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in w&&M==="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 $=Zb(M,R);if(!$)return!0;if($?N=M:(N=M==="v"?"h":"v",$=Zb(M,R)),!$)return!1;if(!s.current&&"changedTouches"in w&&(x||E)&&(s.current=N),!N)return!0;var U=s.current||N;return wD(U,_,w,U==="h"?x:E)},[]),c=T.useCallback(function(w){var _=w;if(!(!wa.length||wa[wa.length-1]!==h)){var y="deltaY"in _?Qb(_):bu(_),v=n.current.filter(function(N){return N.name===_.type&&(N.target===_.target||_.target===N.shadowParent)&&CD(N.delta,y)})[0];if(v&&v.should){_.cancelable&&_.preventDefault();return}if(!v){var x=(u.current.shards||[]).map(Jb).filter(Boolean).filter(function(N){return N.contains(_.target)}),E=x.length>0?o(_,x[0]):!u.current.noIsolation;E&&_.cancelable&&_.preventDefault()}}},[]),d=T.useCallback(function(w,_,y,v){var x={name:w,delta:_,target:y,should:v,shadowParent:TD(y)};n.current.push(x),setTimeout(function(){n.current=n.current.filter(function(E){return E!==x})},1)},[]),g=T.useCallback(function(w){i.current=bu(w),s.current=void 0},[]),f=T.useCallback(function(w){d(w.type,Qb(w),w.target,o(w,e.lockRef.current))},[]),b=T.useCallback(function(w){d(w.type,bu(w),w.target,o(w,e.lockRef.current))},[]);T.useEffect(function(){return wa.push(h),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:b}),document.addEventListener("wheel",c,Sa),document.addEventListener("touchmove",c,Sa),document.addEventListener("touchstart",g,Sa),function(){wa=wa.filter(function(w){return w!==h}),document.removeEventListener("wheel",c,Sa),document.removeEventListener("touchmove",c,Sa),document.removeEventListener("touchstart",g,Sa)}},[]);var S=e.removeScrollBar,k=e.inert;return T.createElement(T.Fragment,null,k?T.createElement(h,{styles:kD(l)}):null,S?T.createElement(gD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function TD(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const RD=rD(u1,AD);var Fl=T.forwardRef(function(e,n){return T.createElement(ud,Cr({},e,{ref:n,sideCar:RD}))});Fl.classNames=ud.classNames;var DD=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Ca=new WeakMap,xu=new WeakMap,Su={},gp=0,m1=function(e){return e&&(e.host||m1(e.parentNode))},ND=function(e,n){return n.map(function(i){if(e.contains(i))return i;var s=m1(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})},MD=function(e,n,i,s){var l=ND(n,Array.isArray(e)?e:[e]);Su[i]||(Su[i]=new WeakMap);var h=Su[i],u=[],o=new Set,c=new Set(l),d=function(f){!f||o.has(f)||(o.add(f),d(f.parentNode))};l.forEach(d);var g=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(b){if(o.has(b))g(b);else try{var S=b.getAttribute(s),k=S!==null&&S!=="false",w=(Ca.get(b)||0)+1,_=(h.get(b)||0)+1;Ca.set(b,w),h.set(b,_),u.push(b),w===1&&k&&xu.set(b,!0),_===1&&b.setAttribute(i,"true"),k||b.setAttribute(s,"true")}catch(y){console.error("aria-hidden: cannot operate on ",b,y)}})};return g(n),o.clear(),gp++,function(){u.forEach(function(f){var b=Ca.get(f)-1,S=h.get(f)-1;Ca.set(f,b),h.set(f,S),b||(xu.has(f)||f.removeAttribute(s),xu.delete(f)),S||f.removeAttribute(i)}),gp--,gp||(Ca=new WeakMap,Ca=new WeakMap,xu=new WeakMap,Su={})}},dd=function(e,n,i){i===void 0&&(i="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),l=DD(e);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),MD(s,l,i,"aria-hidden")):function(){return null}},hd="Dialog",[g1]=Un(hd),[jD,pr]=g1(hd),v1=e=>{const{__scopeDialog:n,children:i,open:s,defaultOpen:l,onOpenChange:h,modal:u=!0}=e,o=T.useRef(null),c=T.useRef(null),[d,g]=si({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:hd});return m.jsx(jD,{scope:n,triggerRef:o,contentRef:c,contentId:Vt(),titleId:Vt(),descriptionId:Vt(),open:d,onOpenChange:g,onOpenToggle:T.useCallback(()=>g(f=>!f),[g]),modal:u,children:i})};v1.displayName=hd;var _1="DialogTrigger",y1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(_1,i),h=Xe(n,l.triggerRef);return m.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":zm(l.open),...s,ref:h,onClick:we(e.onClick,l.onOpenToggle)})});y1.displayName=_1;var Im="DialogPortal",[OD,b1]=g1(Im,{forceMount:void 0}),x1=e=>{const{__scopeDialog:n,forceMount:i,children:s,container:l}=e,h=pr(Im,n);return m.jsx(OD,{scope:n,forceMount:i,children:T.Children.map(s,u=>m.jsx(Xt,{present:i||h.open,children:m.jsx(eo,{asChild:!0,container:l,children:u})}))})};x1.displayName=Im;var Hu="DialogOverlay",S1=T.forwardRef((e,n)=>{const i=b1(Hu,e.__scopeDialog),{forceMount:s=i.forceMount,...l}=e,h=pr(Hu,e.__scopeDialog);return h.modal?m.jsx(Xt,{present:s||h.open,children:m.jsx(ID,{...l,ref:n})}):null});S1.displayName=Hu;var LD=Vi("DialogOverlay.RemoveScroll"),ID=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(Hu,i);return m.jsx(Fl,{as:LD,allowPinchZoom:!0,shards:[l.contentRef],children:m.jsx(je.div,{"data-state":zm(l.open),...s,ref:n,style:{pointerEvents:"auto",...s.style}})})}),Es="DialogContent",w1=T.forwardRef((e,n)=>{const i=b1(Es,e.__scopeDialog),{forceMount:s=i.forceMount,...l}=e,h=pr(Es,e.__scopeDialog);return m.jsx(Xt,{present:s||h.open,children:h.modal?m.jsx(BD,{...l,ref:n}):m.jsx(zD,{...l,ref:n})})});w1.displayName=Es;var BD=T.forwardRef((e,n)=>{const i=pr(Es,e.__scopeDialog),s=T.useRef(null),l=Xe(n,i.contentRef,s);return T.useEffect(()=>{const h=s.current;if(h)return dd(h)},[]),m.jsx(C1,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,h=>{var u;h.preventDefault(),(u=i.triggerRef.current)==null||u.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,h=>{const u=h.detail.originalEvent,o=u.button===0&&u.ctrlKey===!0;(u.button===2||o)&&h.preventDefault()}),onFocusOutside:we(e.onFocusOutside,h=>h.preventDefault())})}),zD=T.forwardRef((e,n)=>{const i=pr(Es,e.__scopeDialog),s=T.useRef(!1),l=T.useRef(!1);return m.jsx(C1,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var u,o;(u=e.onCloseAutoFocus)==null||u.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,d;(c=e.onInteractOutside)==null||c.call(e,h),h.defaultPrevented||(s.current=!0,h.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=h.target;((d=i.triggerRef.current)==null?void 0:d.contains(u))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&l.current&&h.preventDefault()}})}),C1=T.forwardRef((e,n)=>{const{__scopeDialog:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:h,...u}=e,o=pr(Es,i),c=T.useRef(null),d=Xe(n,c);return cd(),m.jsxs(m.Fragment,{children:[m.jsx(Pl,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:h,children:m.jsx(Ja,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":zm(o.open),...u,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(PD,{titleId:o.titleId}),m.jsx(HD,{contentRef:c,descriptionId:o.descriptionId})]})]})}),Bm="DialogTitle",k1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(Bm,i);return m.jsx(je.h2,{id:l.titleId,...s,ref:n})});k1.displayName=Bm;var E1="DialogDescription",A1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(E1,i);return m.jsx(je.p,{id:l.descriptionId,...s,ref:n})});A1.displayName=E1;var T1="DialogClose",R1=T.forwardRef((e,n)=>{const{__scopeDialog:i,...s}=e,l=pr(T1,i);return m.jsx(je.button,{type:"button",...s,ref:n,onClick:we(e.onClick,()=>l.onOpenChange(!1))})});R1.displayName=T1;function zm(e){return e?"open":"closed"}var D1="DialogTitleWarning",[S9,N1]=vR(D1,{contentName:Es,titleName:Bm,docsSlug:"dialog"}),PD=({titleId:e})=>{const n=N1(D1),i=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
460
-
461
- If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
462
-
463
- 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},FD="DialogDescriptionWarning",HD=({contentRef:e,descriptionId:n})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${N1(FD).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},Pm=v1,UD=y1,Fm=x1,Hm=S1,Um=w1,M1=k1,j1=A1,fd=R1;function $D(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 qD(e){const[n,i]=T.useState(void 0);return Yt(()=>{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 u,o;if("borderBoxSize"in h){const c=h.borderBoxSize,d=Array.isArray(c)?c[0]:c;u=d.inlineSize,o=d.blockSize}else u=e.offsetWidth,o=e.offsetHeight;i({width:u,height:o})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else i(void 0)},[e]),n}const VD=["top","right","bottom","left"],Gi=Math.min,zn=Math.max,Uu=Math.round,wu=Math.floor,Er=e=>({x:e,y:e}),GD={left:"right",right:"left",bottom:"top",top:"bottom"};function tm(e,n,i){return zn(e,Gi(n,i))}function ai(e,n){return typeof e=="function"?e(n):e}function oi(e){return e.split("-")[0]}function to(e){return e.split("-")[1]}function $m(e){return e==="x"?"y":"x"}function qm(e){return e==="y"?"height":"width"}function kr(e){const n=e[0];return n==="t"||n==="b"?"y":"x"}function Vm(e){return $m(kr(e))}function WD(e,n,i){i===void 0&&(i=!1);const s=to(e),l=Vm(e),h=qm(l);let u=l==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[h]>n.floating[h]&&(u=$u(u)),[u,$u(u)]}function KD(e){const n=$u(e);return[nm(e),n,nm(n)]}function nm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const e0=["left","right"],t0=["right","left"],YD=["top","bottom"],XD=["bottom","top"];function ZD(e,n,i){switch(e){case"top":case"bottom":return i?n?t0:e0:n?e0:t0;case"left":case"right":return n?YD:XD;default:return[]}}function QD(e,n,i,s){const l=to(e);let h=ZD(oi(e),i==="start",s);return l&&(h=h.map(u=>u+"-"+l),n&&(h=h.concat(h.map(nm)))),h}function $u(e){const n=oi(e);return GD[n]+e.slice(n.length)}function JD(e){return{top:0,right:0,bottom:0,left:0,...e}}function O1(e){return typeof e!="number"?JD(e):{top:e,right:e,bottom:e,left:e}}function qu(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 n0(e,n,i){let{reference:s,floating:l}=e;const h=kr(n),u=Vm(n),o=qm(u),c=oi(n),d=h==="y",g=s.x+s.width/2-l.width/2,f=s.y+s.height/2-l.height/2,b=s[o]/2-l[o]/2;let S;switch(c){case"top":S={x:g,y:s.y-l.height};break;case"bottom":S={x:g,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(to(n)){case"start":S[u]-=b*(i&&d?-1:1);break;case"end":S[u]+=b*(i&&d?-1:1);break}return S}async function eN(e,n){var i;n===void 0&&(n={});const{x:s,y:l,platform:h,rects:u,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:g="viewport",elementContext:f="floating",altBoundary:b=!1,padding:S=0}=ai(n,e),k=O1(S),_=o[b?f==="floating"?"reference":"floating":f],y=qu(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:d,rootBoundary:g,strategy:c})),v=f==="floating"?{x:s,y:l,width:u.floating.width,height:u.floating.height}:u.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},N=qu(h.convertOffsetParentRelativeRectToViewportRelativeRect?await h.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:x,strategy:c}):v);return{top:(y.top-N.top+k.top)/E.y,bottom:(N.bottom-y.bottom+k.bottom)/E.y,left:(y.left-N.left+k.left)/E.x,right:(N.right-y.right+k.right)/E.x}}const tN=50,nN=async(e,n,i)=>{const{placement:s="bottom",strategy:l="absolute",middleware:h=[],platform:u}=i,o=u.detectOverflow?u:{...u,detectOverflow:eN},c=await(u.isRTL==null?void 0:u.isRTL(n));let d=await u.getElementRects({reference:e,floating:n,strategy:l}),{x:g,y:f}=n0(d,s,c),b=s,S=0;const k={};for(let w=0;w<h.length;w++){const _=h[w];if(!_)continue;const{name:y,fn:v}=_,{x,y:E,data:N,reset:R}=await v({x:g,y:f,initialPlacement:s,placement:b,strategy:l,middlewareData:k,rects:d,platform:o,elements:{reference:e,floating:n}});g=x!=null?x:g,f=E!=null?E:f,k[y]={...k[y],...N},R&&S<tN&&(S++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(d=R.rects===!0?await u.getElementRects({reference:e,floating:n,strategy:l}):R.rects),{x:g,y:f}=n0(d,b,c)),w=-1)}return{x:g,y:f,placement:b,strategy:l,middlewareData:k}},rN=e=>({name:"arrow",options:e,async fn(n){const{x:i,y:s,placement:l,rects:h,platform:u,elements:o,middlewareData:c}=n,{element:d,padding:g=0}=ai(e,n)||{};if(d==null)return{};const f=O1(g),b={x:i,y:s},S=Vm(l),k=qm(S),w=await u.getDimensions(d),_=S==="y",y=_?"top":"left",v=_?"bottom":"right",x=_?"clientHeight":"clientWidth",E=h.reference[k]+h.reference[S]-b[S]-h.floating[k],N=b[S]-h.reference[S],R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d));let M=R?R[x]:0;(!M||!await(u.isElement==null?void 0:u.isElement(R)))&&(M=o.floating[x]||h.floating[k]);const D=E/2-N/2,O=M/2-w[k]/2-1,P=Gi(f[y],O),$=Gi(f[v],O),U=P,q=M-w[k]-$,Y=M/2-w[k]/2+D,K=tm(U,Y,q),V=!c.arrow&&to(l)!=null&&Y!==K&&h.reference[k]/2-(Y<U?P:$)-w[k]/2<0,J=V?Y<U?Y-U:Y-q:0;return{[S]:b[S]+J,data:{[S]:K,centerOffset:Y-K-J,...V&&{alignmentOffset:J}},reset:V}}}),iN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var i,s;const{placement:l,middlewareData:h,rects:u,initialPlacement:o,platform:c,elements:d}=n,{mainAxis:g=!0,crossAxis:f=!0,fallbackPlacements:b,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:w=!0,..._}=ai(e,n);if((i=h.arrow)!=null&&i.alignmentOffset)return{};const y=oi(l),v=kr(o),x=oi(o)===o,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=b||(x||!w?[$u(o)]:KD(o)),R=k!=="none";!b&&R&&N.push(...QD(o,w,k,E));const M=[o,...N],D=await c.detectOverflow(n,_),O=[];let P=((s=h.flip)==null?void 0:s.overflows)||[];if(g&&O.push(D[y]),f){const Y=WD(l,u,E);O.push(D[Y[0]],D[Y[1]])}if(P=[...P,{placement:l,overflows:O}],!O.every(Y=>Y<=0)){var $,U;const Y=((($=h.flip)==null?void 0:$.index)||0)+1,K=M[Y];if(K&&(!(f==="alignment"?v!==kr(K):!1)||P.every(ne=>kr(ne.placement)===v?ne.overflows[0]>0:!0)))return{data:{index:Y,overflows:P},reset:{placement:K}};let V=(U=P.filter(J=>J.overflows[0]<=0).sort((J,ne)=>J.overflows[1]-ne.overflows[1])[0])==null?void 0:U.placement;if(!V)switch(S){case"bestFit":{var q;const J=(q=P.filter(ne=>{if(R){const F=kr(ne.placement);return F===v||F==="y"}return!0}).map(ne=>[ne.placement,ne.overflows.filter(F=>F>0).reduce((F,j)=>F+j,0)]).sort((ne,F)=>ne[1]-F[1])[0])==null?void 0:q[0];J&&(V=J);break}case"initialPlacement":V=o;break}if(l!==V)return{reset:{placement:V}}}return{}}}};function r0(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function i0(e){return VD.some(n=>e[n]>=0)}const sN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:i,platform:s}=n,{strategy:l="referenceHidden",...h}=ai(e,n);switch(l){case"referenceHidden":{const u=await s.detectOverflow(n,{...h,elementContext:"reference"}),o=r0(u,i.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:i0(o)}}}case"escaped":{const u=await s.detectOverflow(n,{...h,altBoundary:!0}),o=r0(u,i.floating);return{data:{escapedOffsets:o,escaped:i0(o)}}}default:return{}}}}},L1=new Set(["left","top"]);async function aN(e,n){const{placement:i,platform:s,elements:l}=e,h=await(s.isRTL==null?void 0:s.isRTL(l.floating)),u=oi(i),o=to(i),c=kr(i)==="y",d=L1.has(u)?-1:1,g=h&&c?-1:1,f=ai(n,e);let{mainAxis:b,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*g,y:b*d}:{x:b*d,y:S*g}}const oN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var i,s;const{x:l,y:h,placement:u,middlewareData:o}=n,c=await aN(n,e);return u===((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:u}}}}},lN=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:u=!0,crossAxis:o=!1,limiter:c={fn:y=>{let{x:v,y:x}=y;return{x:v,y:x}}},...d}=ai(e,n),g={x:i,y:s},f=await h.detectOverflow(n,d),b=kr(oi(l)),S=$m(b);let k=g[S],w=g[b];if(u){const y=S==="y"?"top":"left",v=S==="y"?"bottom":"right",x=k+f[y],E=k-f[v];k=tm(x,k,E)}if(o){const y=b==="y"?"top":"left",v=b==="y"?"bottom":"right",x=w+f[y],E=w-f[v];w=tm(x,w,E)}const _=c.fn({...n,[S]:k,[b]:w});return{..._,data:{x:_.x-i,y:_.y-s,enabled:{[S]:u,[b]:o}}}}}},cN=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:i,y:s,placement:l,rects:h,middlewareData:u}=n,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=ai(e,n),g={x:i,y:s},f=kr(l),b=$m(f);let S=g[b],k=g[f];const w=ai(o,n),_=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const x=b==="y"?"height":"width",E=h.reference[b]-h.floating[x]+_.mainAxis,N=h.reference[b]+h.reference[x]-_.mainAxis;S<E?S=E:S>N&&(S=N)}if(d){var y,v;const x=b==="y"?"width":"height",E=L1.has(oi(l)),N=h.reference[f]-h.floating[x]+(E&&((y=u.offset)==null?void 0:y[f])||0)+(E?0:_.crossAxis),R=h.reference[f]+h.reference[x]+(E?0:((v=u.offset)==null?void 0:v[f])||0)-(E?_.crossAxis:0);k<N?k=N:k>R&&(k=R)}return{[b]:S,[f]:k}}}},uN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var i,s;const{placement:l,rects:h,platform:u,elements:o}=n,{apply:c=()=>{},...d}=ai(e,n),g=await u.detectOverflow(n,d),f=oi(l),b=to(l),S=kr(l)==="y",{width:k,height:w}=h.floating;let _,y;f==="top"||f==="bottom"?(_=f,y=b===(await(u.isRTL==null?void 0:u.isRTL(o.floating))?"start":"end")?"left":"right"):(y=f,_=b==="end"?"top":"bottom");const v=w-g.top-g.bottom,x=k-g.left-g.right,E=Gi(w-g[_],v),N=Gi(k-g[y],x),R=!n.middlewareData.shift;let M=E,D=N;if((i=n.middlewareData.shift)!=null&&i.enabled.x&&(D=x),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(M=v),R&&!b){const P=zn(g.left,0),$=zn(g.right,0),U=zn(g.top,0),q=zn(g.bottom,0);S?D=k-2*(P!==0||$!==0?P+$:zn(g.left,g.right)):M=w-2*(U!==0||q!==0?U+q:zn(g.top,g.bottom))}await c({...n,availableWidth:D,availableHeight:M});const O=await u.getDimensions(o.floating);return k!==O.width||w!==O.height?{reset:{rects:!0}}:{}}}};function pd(){return typeof window<"u"}function no(e){return I1(e)?(e.nodeName||"").toLowerCase():"#document"}function Fn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function Tr(e){var n;return(n=(I1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function I1(e){return pd()?e instanceof Node||e instanceof Fn(e).Node:!1}function hr(e){return pd()?e instanceof Element||e instanceof Fn(e).Element:!1}function li(e){return pd()?e instanceof HTMLElement||e instanceof Fn(e).HTMLElement:!1}function s0(e){return!pd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fn(e).ShadowRoot}function Hl(e){const{overflow:n,overflowX:i,overflowY:s,display:l}=fr(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+i)&&l!=="inline"&&l!=="contents"}function dN(e){return/^(table|td|th)$/.test(no(e))}function md(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const hN=/transform|translate|scale|rotate|perspective|filter/,fN=/paint|layout|strict|content/,xs=e=>!!e&&e!=="none";let vp;function Gm(e){const n=hr(e)?fr(e):e;return xs(n.transform)||xs(n.translate)||xs(n.scale)||xs(n.rotate)||xs(n.perspective)||!Wm()&&(xs(n.backdropFilter)||xs(n.filter))||hN.test(n.willChange||"")||fN.test(n.contain||"")}function pN(e){let n=Wi(e);for(;li(n)&&!Ba(n);){if(Gm(n))return n;if(md(n))return null;n=Wi(n)}return null}function Wm(){return vp==null&&(vp=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),vp}function Ba(e){return/^(html|body|#document)$/.test(no(e))}function fr(e){return Fn(e).getComputedStyle(e)}function gd(e){return hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wi(e){if(no(e)==="html")return e;const n=e.assignedSlot||e.parentNode||s0(e)&&e.host||Tr(e);return s0(n)?n.host:n}function B1(e){const n=Wi(e);return Ba(n)?e.ownerDocument?e.ownerDocument.body:e.body:li(n)&&Hl(n)?n:B1(n)}function kl(e,n,i){var s;n===void 0&&(n=[]),i===void 0&&(i=!0);const l=B1(e),h=l===((s=e.ownerDocument)==null?void 0:s.body),u=Fn(l);if(h){const o=rm(u);return n.concat(u,u.visualViewport||[],Hl(l)?l:[],o&&i?kl(o):[])}else return n.concat(l,kl(l,[],i))}function rm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function z1(e){const n=fr(e);let i=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const l=li(e),h=l?e.offsetWidth:i,u=l?e.offsetHeight:s,o=Uu(i)!==h||Uu(s)!==u;return o&&(i=h,s=u),{width:i,height:s,$:o}}function Km(e){return hr(e)?e:e.contextElement}function ja(e){const n=Km(e);if(!li(n))return Er(1);const i=n.getBoundingClientRect(),{width:s,height:l,$:h}=z1(n);let u=(h?Uu(i.width):i.width)/s,o=(h?Uu(i.height):i.height)/l;return(!u||!Number.isFinite(u))&&(u=1),(!o||!Number.isFinite(o))&&(o=1),{x:u,y:o}}const mN=Er(0);function P1(e){const n=Fn(e);return!Wm()||!n.visualViewport?mN:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function gN(e,n,i){return n===void 0&&(n=!1),!i||n&&i!==Fn(e)?!1:n}function As(e,n,i,s){n===void 0&&(n=!1),i===void 0&&(i=!1);const l=e.getBoundingClientRect(),h=Km(e);let u=Er(1);n&&(s?hr(s)&&(u=ja(s)):u=ja(e));const o=gN(h,i,s)?P1(h):Er(0);let c=(l.left+o.x)/u.x,d=(l.top+o.y)/u.y,g=l.width/u.x,f=l.height/u.y;if(h){const b=Fn(h),S=s&&hr(s)?Fn(s):s;let k=b,w=rm(k);for(;w&&s&&S!==k;){const _=ja(w),y=w.getBoundingClientRect(),v=fr(w),x=y.left+(w.clientLeft+parseFloat(v.paddingLeft))*_.x,E=y.top+(w.clientTop+parseFloat(v.paddingTop))*_.y;c*=_.x,d*=_.y,g*=_.x,f*=_.y,c+=x,d+=E,k=Fn(w),w=rm(k)}}return qu({width:g,height:f,x:c,y:d})}function vd(e,n){const i=gd(e).scrollLeft;return n?n.left+i:As(Tr(e)).left+i}function F1(e,n){const i=e.getBoundingClientRect(),s=i.left+n.scrollLeft-vd(e,i),l=i.top+n.scrollTop;return{x:s,y:l}}function vN(e){let{elements:n,rect:i,offsetParent:s,strategy:l}=e;const h=l==="fixed",u=Tr(s),o=n?md(n.floating):!1;if(s===u||o&&h)return i;let c={scrollLeft:0,scrollTop:0},d=Er(1);const g=Er(0),f=li(s);if((f||!f&&!h)&&((no(s)!=="body"||Hl(u))&&(c=gd(s)),f)){const S=As(s);d=ja(s),g.x=S.x+s.clientLeft,g.y=S.y+s.clientTop}const b=u&&!f&&!h?F1(u,c):Er(0);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-c.scrollLeft*d.x+g.x+b.x,y:i.y*d.y-c.scrollTop*d.y+g.y+b.y}}function _N(e){return Array.from(e.getClientRects())}function yN(e){const n=Tr(e),i=gd(e),s=e.ownerDocument.body,l=zn(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),h=zn(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let u=-i.scrollLeft+vd(e);const o=-i.scrollTop;return fr(s).direction==="rtl"&&(u+=zn(n.clientWidth,s.clientWidth)-l),{width:l,height:h,x:u,y:o}}const a0=25;function bN(e,n){const i=Fn(e),s=Tr(e),l=i.visualViewport;let h=s.clientWidth,u=s.clientHeight,o=0,c=0;if(l){h=l.width,u=l.height;const g=Wm();(!g||g&&n==="fixed")&&(o=l.offsetLeft,c=l.offsetTop)}const d=vd(s);if(d<=0){const g=s.ownerDocument,f=g.body,b=getComputedStyle(f),S=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,k=Math.abs(s.clientWidth-f.clientWidth-S);k<=a0&&(h-=k)}else d<=a0&&(h+=d);return{width:h,height:u,x:o,y:c}}function xN(e,n){const i=As(e,!0,n==="fixed"),s=i.top+e.clientTop,l=i.left+e.clientLeft,h=li(e)?ja(e):Er(1),u=e.clientWidth*h.x,o=e.clientHeight*h.y,c=l*h.x,d=s*h.y;return{width:u,height:o,x:c,y:d}}function o0(e,n,i){let s;if(n==="viewport")s=bN(e,i);else if(n==="document")s=yN(Tr(e));else if(hr(n))s=xN(n,i);else{const l=P1(e);s={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return qu(s)}function H1(e,n){const i=Wi(e);return i===n||!hr(i)||Ba(i)?!1:fr(i).position==="fixed"||H1(i,n)}function SN(e,n){const i=n.get(e);if(i)return i;let s=kl(e,[],!1).filter(o=>hr(o)&&no(o)!=="body"),l=null;const h=fr(e).position==="fixed";let u=h?Wi(e):e;for(;hr(u)&&!Ba(u);){const o=fr(u),c=Gm(u);!c&&o.position==="fixed"&&(l=null),(h?!c&&!l:!c&&o.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||Hl(u)&&!c&&H1(e,u))?s=s.filter(g=>g!==u):l=o,u=Wi(u)}return n.set(e,s),s}function wN(e){let{element:n,boundary:i,rootBoundary:s,strategy:l}=e;const u=[...i==="clippingAncestors"?md(n)?[]:SN(n,this._c):[].concat(i),s],o=o0(n,u[0],l);let c=o.top,d=o.right,g=o.bottom,f=o.left;for(let b=1;b<u.length;b++){const S=o0(n,u[b],l);c=zn(S.top,c),d=Gi(S.right,d),g=Gi(S.bottom,g),f=zn(S.left,f)}return{width:d-f,height:g-c,x:f,y:c}}function CN(e){const{width:n,height:i}=z1(e);return{width:n,height:i}}function kN(e,n,i){const s=li(n),l=Tr(n),h=i==="fixed",u=As(e,!0,h,n);let o={scrollLeft:0,scrollTop:0};const c=Er(0);function d(){c.x=vd(l)}if(s||!s&&!h)if((no(n)!=="body"||Hl(l))&&(o=gd(n)),s){const S=As(n,!0,h,n);c.x=S.x+n.clientLeft,c.y=S.y+n.clientTop}else l&&d();h&&!s&&l&&d();const g=l&&!s&&!h?F1(l,o):Er(0),f=u.left+o.scrollLeft-c.x-g.x,b=u.top+o.scrollTop-c.y-g.y;return{x:f,y:b,width:u.width,height:u.height}}function _p(e){return fr(e).position==="static"}function l0(e,n){if(!li(e)||fr(e).position==="fixed")return null;if(n)return n(e);let i=e.offsetParent;return Tr(e)===i&&(i=i.ownerDocument.body),i}function U1(e,n){const i=Fn(e);if(md(e))return i;if(!li(e)){let l=Wi(e);for(;l&&!Ba(l);){if(hr(l)&&!_p(l))return l;l=Wi(l)}return i}let s=l0(e,n);for(;s&&dN(s)&&_p(s);)s=l0(s,n);return s&&Ba(s)&&_p(s)&&!Gm(s)?i:s||pN(e)||i}const EN=async function(e){const n=this.getOffsetParent||U1,i=this.getDimensions,s=await i(e.floating);return{reference:kN(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function AN(e){return fr(e).direction==="rtl"}const TN={convertOffsetParentRelativeRectToViewportRelativeRect:vN,getDocumentElement:Tr,getClippingRect:wN,getOffsetParent:U1,getElementRects:EN,getClientRects:_N,getDimensions:CN,getScale:ja,isElement:hr,isRTL:AN};function $1(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function RN(e,n){let i=null,s;const l=Tr(e);function h(){var o;clearTimeout(s),(o=i)==null||o.disconnect(),i=null}function u(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),h();const d=e.getBoundingClientRect(),{left:g,top:f,width:b,height:S}=d;if(o||n(),!b||!S)return;const k=wu(f),w=wu(l.clientWidth-(g+b)),_=wu(l.clientHeight-(f+S)),y=wu(g),x={rootMargin:-k+"px "+-w+"px "+-_+"px "+-y+"px",threshold:zn(0,Gi(1,c))||1};let E=!0;function N(R){const M=R[0].intersectionRatio;if(M!==c){if(!E)return u();M?u(!1,M):s=setTimeout(()=>{u(!1,1e-7)},1e3)}M===1&&!$1(d,e.getBoundingClientRect())&&u(),E=!1}try{i=new IntersectionObserver(N,{...x,root:l.ownerDocument})}catch{i=new IntersectionObserver(N,x)}i.observe(e)}return u(!0),h}function DN(e,n,i,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:h=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=Km(e),g=l||h?[...d?kl(d):[],...n?kl(n):[]]:[];g.forEach(y=>{l&&y.addEventListener("scroll",i,{passive:!0}),h&&y.addEventListener("resize",i)});const f=d&&o?RN(d,i):null;let b=-1,S=null;u&&(S=new ResizeObserver(y=>{let[v]=y;v&&v.target===d&&S&&n&&(S.unobserve(n),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var x;(x=S)==null||x.observe(n)})),i()}),d&&!c&&S.observe(d),n&&S.observe(n));let k,w=c?As(e):null;c&&_();function _(){const y=As(e);w&&!$1(w,y)&&i(),w=y,k=requestAnimationFrame(_)}return i(),()=>{var y;g.forEach(v=>{l&&v.removeEventListener("scroll",i),h&&v.removeEventListener("resize",i)}),f==null||f(),(y=S)==null||y.disconnect(),S=null,c&&cancelAnimationFrame(k)}}const NN=oN,MN=lN,jN=iN,ON=uN,LN=sN,c0=rN,IN=cN,BN=(e,n,i)=>{const s=new Map,l={platform:TN,...i},h={...l.platform,_c:s};return nN(e,n,{...l,platform:h})};var zN=typeof document<"u",PN=function(){},Lu=zN?T.useLayoutEffect:PN;function Vu(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(!Vu(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)&&!Vu(e[h],n[h]))return!1}return!0}return e!==e&&n!==n}function q1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function u0(e,n){const i=q1(e);return Math.round(n*i)/i}function yp(e){const n=T.useRef(e);return Lu(()=>{n.current=e}),n}function FN(e){e===void 0&&(e={});const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:l,elements:{reference:h,floating:u}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[g,f]=T.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[b,S]=T.useState(s);Vu(b,s)||S(s);const[k,w]=T.useState(null),[_,y]=T.useState(null),v=T.useCallback(ne=>{ne!==R.current&&(R.current=ne,w(ne))},[]),x=T.useCallback(ne=>{ne!==M.current&&(M.current=ne,y(ne))},[]),E=h||k,N=u||_,R=T.useRef(null),M=T.useRef(null),D=T.useRef(g),O=c!=null,P=yp(c),$=yp(l),U=yp(d),q=T.useCallback(()=>{if(!R.current||!M.current)return;const ne={placement:n,strategy:i,middleware:b};$.current&&(ne.platform=$.current),BN(R.current,M.current,ne).then(F=>{const j={...F,isPositioned:U.current!==!1};Y.current&&!Vu(D.current,j)&&(D.current=j,Il.flushSync(()=>{f(j)}))})},[b,n,i,$,U]);Lu(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(ne=>({...ne,isPositioned:!1})))},[d]);const Y=T.useRef(!1);Lu(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Lu(()=>{if(E&&(R.current=E),N&&(M.current=N),E&&N){if(P.current)return P.current(E,N,q);q()}},[E,N,q,P,O]);const K=T.useMemo(()=>({reference:R,floating:M,setReference:v,setFloating:x}),[v,x]),V=T.useMemo(()=>({reference:E,floating:N}),[E,N]),J=T.useMemo(()=>{const ne={position:i,left:0,top:0};if(!V.floating)return ne;const F=u0(V.floating,g.x),j=u0(V.floating,g.y);return o?{...ne,transform:"translate("+F+"px, "+j+"px)",...q1(V.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:F,top:j}},[i,o,V.floating,g.x,g.y]);return T.useMemo(()=>({...g,update:q,refs:K,elements:V,floatingStyles:J}),[g,q,K,V,J])}const HN=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?c0({element:s.current,padding:l}).fn(i):{}:s?c0({element:s,padding:l}).fn(i):{}}}},UN=(e,n)=>{const i=NN(e);return{name:i.name,fn:i.fn,options:[e,n]}},$N=(e,n)=>{const i=MN(e);return{name:i.name,fn:i.fn,options:[e,n]}},qN=(e,n)=>({fn:IN(e).fn,options:[e,n]}),VN=(e,n)=>{const i=jN(e);return{name:i.name,fn:i.fn,options:[e,n]}},GN=(e,n)=>{const i=ON(e);return{name:i.name,fn:i.fn,options:[e,n]}},WN=(e,n)=>{const i=LN(e);return{name:i.name,fn:i.fn,options:[e,n]}},KN=(e,n)=>{const i=HN(e);return{name:i.name,fn:i.fn,options:[e,n]}};var YN="Arrow",V1=T.forwardRef((e,n)=>{const{children:i,width:s=10,height:l=5,...h}=e;return m.jsx(je.svg,{...h,ref:n,width:s,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});V1.displayName=YN;var XN=V1,Ym="Popper",[G1,Yi]=Un(Ym),[ZN,W1]=G1(Ym),K1=e=>{const{__scopePopper:n,children:i}=e,[s,l]=T.useState(null);return m.jsx(ZN,{scope:n,anchor:s,onAnchorChange:l,children:i})};K1.displayName=Ym;var Y1="PopperAnchor",X1=T.forwardRef((e,n)=>{const{__scopePopper:i,virtualRef:s,...l}=e,h=W1(Y1,i),u=T.useRef(null),o=Xe(n,u),c=T.useRef(null);return T.useEffect(()=>{const d=c.current;c.current=(s==null?void 0:s.current)||u.current,d!==c.current&&h.onAnchorChange(c.current)}),s?null:m.jsx(je.div,{...l,ref:o})});X1.displayName=Y1;var Xm="PopperContent",[QN,JN]=G1(Xm),Z1=T.forwardRef((e,n)=>{var W,H,te,ae,pe,ce,Oe,Ie;const{__scopePopper:i,side:s="bottom",sideOffset:l=0,align:h="center",alignOffset:u=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:g=0,sticky:f="partial",hideWhenDetached:b=!1,updatePositionStrategy:S="optimized",onPlaced:k,...w}=e,_=W1(Xm,i),[y,v]=T.useState(null),x=Xe(n,Ue=>v(Ue)),[E,N]=T.useState(null),R=qD(E),M=(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 g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},$=Array.isArray(d)?d:[d],U=$.length>0,q={padding:P,boundary:$.filter(tM),altBoundary:U},{refs:Y,floatingStyles:K,placement:V,isPositioned:J,middlewareData:ne}=FN({strategy:"fixed",placement:O,whileElementsMounted:(...Ue)=>DN(...Ue,{animationFrame:S==="always"}),elements:{reference:_.anchor},middleware:[UN({mainAxis:l+D,alignmentAxis:u}),c&&$N({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?qN():void 0,...q}),c&&VN({...q}),GN({...q,apply:({elements:Ue,rects:ut,availableWidth:Ne,availableHeight:gn})=>{const{width:Gt,height:sn}=ut.reference,Wt=Ue.floating.style;Wt.setProperty("--radix-popper-available-width",`${Ne}px`),Wt.setProperty("--radix-popper-available-height",`${gn}px`),Wt.setProperty("--radix-popper-anchor-width",`${Gt}px`),Wt.setProperty("--radix-popper-anchor-height",`${sn}px`)}}),E&&KN({element:E,padding:o}),nM({arrowWidth:M,arrowHeight:D}),b&&WN({strategy:"referenceHidden",...q})]}),[F,j]=eS(V),I=rn(k);Yt(()=>{J&&(I==null||I())},[J,I]);const L=(te=ne.arrow)==null?void 0:te.x,z=(ae=ne.arrow)==null?void 0:ae.y,Z=((pe=ne.arrow)==null?void 0:pe.centerOffset)!==0,[X,ee]=T.useState();return Yt(()=>{y&&ee(window.getComputedStyle(y).zIndex)},[y]),m.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:J?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(ce=ne.transformOrigin)==null?void 0:ce.x,(Oe=ne.transformOrigin)==null?void 0:Oe.y].join(" "),...((Ie=ne.hide)==null?void 0:Ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(QN,{scope:i,placedSide:F,onArrowChange:N,arrowX:L,arrowY:z,shouldHideArrow:Z,children:m.jsx(je.div,{"data-side":F,"data-align":j,...w,ref:x,style:{...w.style,animation:J?void 0:"none"}})})})});Z1.displayName=Xm;var Q1="PopperArrow",eM={top:"bottom",right:"left",bottom:"top",left:"right"},J1=T.forwardRef(function(n,i){const{__scopePopper:s,...l}=n,h=JN(Q1,s),u=eM[h.placedSide];return m.jsx("span",{ref:h.onArrowChange,style:{position:"absolute",left:h.arrowX,top:h.arrowY,[u]: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:m.jsx(XN,{...l,ref:i,style:{...l.style,display:"block"}})})});J1.displayName=Q1;function tM(e){return e!==null}var nM=e=>({name:"transformOrigin",options:e,fn(n){var _,y,v,x,E;const{placement:i,rects:s,middlewareData:l}=n,u=((_=l.arrow)==null?void 0:_.centerOffset)!==0,o=u?0:e.arrowWidth,c=u?0:e.arrowHeight,[d,g]=eS(i),f={start:"0%",center:"50%",end:"100%"}[g],b=((v=(y=l.arrow)==null?void 0:y.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 d==="bottom"?(k=u?f:`${b}px`,w=`${-c}px`):d==="top"?(k=u?f:`${b}px`,w=`${s.floating.height+c}px`):d==="right"?(k=`${-c}px`,w=u?f:`${S}px`):d==="left"&&(k=`${s.floating.width+c}px`,w=u?f:`${S}px`),{data:{x:k,y:w}}}});function eS(e){const[n,i="center"]=e.split("-");return[n,i]}var _d=K1,Ul=X1,yd=Z1,bd=J1,bp="rovingFocusGroup.onEntryFocus",rM={bubbles:!1,cancelable:!0},$l="RovingFocusGroup",[im,tS,iM]=Mm($l),[sM,xd]=Un($l,[iM]),[aM,oM]=sM($l),nS=T.forwardRef((e,n)=>m.jsx(im.Provider,{scope:e.__scopeRovingFocusGroup,children:m.jsx(im.Slot,{scope:e.__scopeRovingFocusGroup,children:m.jsx(lM,{...e,ref:n})})}));nS.displayName=$l;var lM=T.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:i,orientation:s,loop:l=!1,dir:h,currentTabStopId:u,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:g=!1,...f}=e,b=T.useRef(null),S=Xe(n,b),k=zl(h),[w,_]=si({prop:u,defaultProp:o!=null?o:null,onChange:c,caller:$l}),[y,v]=T.useState(!1),x=rn(d),E=tS(i),N=T.useRef(!1),[R,M]=T.useState(0);return T.useEffect(()=>{const D=b.current;if(D)return D.addEventListener(bp,x),()=>D.removeEventListener(bp,x)},[x]),m.jsx(aM,{scope:i,orientation:s,dir:k,loop:l,currentTabStopId:w,onItemFocus:T.useCallback(D=>_(D),[_]),onItemShiftTab:T.useCallback(()=>v(!0),[]),onFocusableItemAdd:T.useCallback(()=>M(D=>D+1),[]),onFocusableItemRemove:T.useCallback(()=>M(D=>D-1),[]),children:m.jsx(je.div,{tabIndex:y||R===0?-1:0,"data-orientation":s,...f,ref:S,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{N.current=!0}),onFocus:we(e.onFocus,D=>{const O=!N.current;if(D.target===D.currentTarget&&O&&!y){const P=new CustomEvent(bp,rM);if(D.currentTarget.dispatchEvent(P),!P.defaultPrevented){const $=E().filter(V=>V.focusable),U=$.find(V=>V.active),q=$.find(V=>V.id===w),K=[U,q,...$].filter(Boolean).map(V=>V.ref.current);sS(K,g)}}N.current=!1}),onBlur:we(e.onBlur,()=>v(!1))})})}),rS="RovingFocusGroupItem",iS=T.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:i,focusable:s=!0,active:l=!1,tabStopId:h,children:u,...o}=e,c=Vt(),d=h||c,g=oM(rS,i),f=g.currentTabStopId===d,b=tS(i),{onFocusableItemAdd:S,onFocusableItemRemove:k,currentTabStopId:w}=g;return T.useEffect(()=>{if(s)return S(),()=>k()},[s,S,k]),m.jsx(im.ItemSlot,{scope:i,id:d,focusable:s,active:l,children:m.jsx(je.span,{tabIndex:f?0:-1,"data-orientation":g.orientation,...o,ref:n,onMouseDown:we(e.onMouseDown,_=>{s?g.onItemFocus(d):_.preventDefault()}),onFocus:we(e.onFocus,()=>g.onItemFocus(d)),onKeyDown:we(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){g.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const y=dM(_,g.orientation,g.dir);if(y!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let x=b().filter(E=>E.focusable).map(E=>E.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const E=x.indexOf(_.currentTarget);x=g.loop?hM(x,E+1):x.slice(E+1)}setTimeout(()=>sS(x))}}),children:typeof u=="function"?u({isCurrentTabStop:f,hasTabStop:w!=null}):u})})});iS.displayName=rS;var cM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uM(e,n){return n!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function dM(e,n,i){const s=uM(e.key,i);if(!(n==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(n==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return cM[s]}function sS(e,n=!1){const i=document.activeElement;for(const s of e)if(s===i||(s.focus({preventScroll:n}),document.activeElement!==i))return}function hM(e,n){return e.map((i,s)=>e[(n+s)%e.length])}var aS=nS,oS=iS,sm=["Enter"," "],fM=["ArrowDown","PageUp","Home"],lS=["ArrowUp","PageDown","End"],pM=[...fM,...lS],mM={ltr:[...sm,"ArrowRight"],rtl:[...sm,"ArrowLeft"]},gM={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ql="Menu",[El,vM,_M]=Mm(ql),[Ms,cS]=Un(ql,[_M,Yi,xd]),Sd=Yi(),uS=xd(),[yM,js]=Ms(ql),[bM,Vl]=Ms(ql),dS=e=>{const{__scopeMenu:n,open:i=!1,children:s,dir:l,onOpenChange:h,modal:u=!0}=e,o=Sd(n),[c,d]=T.useState(null),g=T.useRef(!1),f=rn(h),b=zl(l);return T.useEffect(()=>{const S=()=>{g.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},k=()=>g.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})}},[]),m.jsx(_d,{...o,children:m.jsx(yM,{scope:n,open:i,onOpenChange:f,content:c,onContentChange:d,children:m.jsx(bM,{scope:n,onClose:T.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:g,dir:b,modal:u,children:s})})})};dS.displayName=ql;var xM="MenuAnchor",Zm=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e,l=Sd(i);return m.jsx(Ul,{...l,...s,ref:n})});Zm.displayName=xM;var Qm="MenuPortal",[SM,hS]=Ms(Qm,{forceMount:void 0}),fS=e=>{const{__scopeMenu:n,forceMount:i,children:s,container:l}=e,h=js(Qm,n);return m.jsx(SM,{scope:n,forceMount:i,children:m.jsx(Xt,{present:i||h.open,children:m.jsx(eo,{asChild:!0,container:l,children:s})})})};fS.displayName=Qm;var nr="MenuContent",[wM,Jm]=Ms(nr),pS=T.forwardRef((e,n)=>{const i=hS(nr,e.__scopeMenu),{forceMount:s=i.forceMount,...l}=e,h=js(nr,e.__scopeMenu),u=Vl(nr,e.__scopeMenu);return m.jsx(El.Provider,{scope:e.__scopeMenu,children:m.jsx(Xt,{present:s||h.open,children:m.jsx(El.Slot,{scope:e.__scopeMenu,children:u.modal?m.jsx(CM,{...l,ref:n}):m.jsx(kM,{...l,ref:n})})})})}),CM=T.forwardRef((e,n)=>{const i=js(nr,e.__scopeMenu),s=T.useRef(null),l=Xe(n,s);return T.useEffect(()=>{const h=s.current;if(h)return dd(h)},[]),m.jsx(eg,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:we(e.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})}),kM=T.forwardRef((e,n)=>{const i=js(nr,e.__scopeMenu);return m.jsx(eg,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})}),EM=Vi("MenuContent.ScrollLock"),eg=T.forwardRef((e,n)=>{const{__scopeMenu:i,loop:s=!1,trapFocus:l,onOpenAutoFocus:h,onCloseAutoFocus:u,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:f,onInteractOutside:b,onDismiss:S,disableOutsideScroll:k,...w}=e,_=js(nr,i),y=Vl(nr,i),v=Sd(i),x=uS(i),E=vM(i),[N,R]=T.useState(null),M=T.useRef(null),D=Xe(n,M,_.onContentChange),O=T.useRef(0),P=T.useRef(""),$=T.useRef(0),U=T.useRef(null),q=T.useRef("right"),Y=T.useRef(0),K=k?Fl:T.Fragment,V=k?{as:EM,allowPinchZoom:!0}:void 0,J=F=>{var W,H;const j=P.current+F,I=E().filter(te=>!te.disabled),L=document.activeElement,z=(W=I.find(te=>te.ref.current===L))==null?void 0:W.textValue,Z=I.map(te=>te.textValue),X=zM(Z,j,z),ee=(H=I.find(te=>te.textValue===X))==null?void 0:H.ref.current;(function te(ae){P.current=ae,window.clearTimeout(O.current),ae!==""&&(O.current=window.setTimeout(()=>te(""),1e3))})(j),ee&&setTimeout(()=>ee.focus())};T.useEffect(()=>()=>window.clearTimeout(O.current),[]),cd();const ne=T.useCallback(F=>{var I,L;return q.current===((I=U.current)==null?void 0:I.side)&&FM(F,(L=U.current)==null?void 0:L.area)},[]);return m.jsx(wM,{scope:i,searchRef:P,onItemEnter:T.useCallback(F=>{ne(F)&&F.preventDefault()},[ne]),onItemLeave:T.useCallback(F=>{var j;ne(F)||((j=M.current)==null||j.focus(),R(null))},[ne]),onTriggerLeave:T.useCallback(F=>{ne(F)&&F.preventDefault()},[ne]),pointerGraceTimerRef:$,onPointerGraceIntentChange:T.useCallback(F=>{U.current=F},[]),children:m.jsx(K,{...V,children:m.jsx(Pl,{asChild:!0,trapped:l,onMountAutoFocus:we(h,F=>{var j;F.preventDefault(),(j=M.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:m.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:f,onInteractOutside:b,onDismiss:S,children:m.jsx(aS,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:s,currentTabStopId:N,onCurrentTabStopIdChange:R,onEntryFocus:we(c,F=>{y.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(yd,{role:"menu","aria-orientation":"vertical","data-state":DS(_.open),"data-radix-menu-content":"",dir:y.dir,...v,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:we(w.onKeyDown,F=>{const I=F.target.closest("[data-radix-menu-content]")===F.currentTarget,L=F.ctrlKey||F.altKey||F.metaKey,z=F.key.length===1;I&&(F.key==="Tab"&&F.preventDefault(),!L&&z&&J(F.key));const Z=M.current;if(F.target!==Z||!pM.includes(F.key))return;F.preventDefault();const ee=E().filter(W=>!W.disabled).map(W=>W.ref.current);lS.includes(F.key)&&ee.reverse(),IM(ee)}),onBlur:we(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(O.current),P.current="")}),onPointerMove:we(e.onPointerMove,Al(F=>{const j=F.target,I=Y.current!==F.clientX;if(F.currentTarget.contains(j)&&I){const L=F.clientX>Y.current?"right":"left";q.current=L,Y.current=F.clientX}}))})})})})})})});pS.displayName=nr;var AM="MenuGroup",tg=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return m.jsx(je.div,{role:"group",...s,ref:n})});tg.displayName=AM;var TM="MenuLabel",mS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return m.jsx(je.div,{...s,ref:n})});mS.displayName=TM;var Gu="MenuItem",d0="menu.itemSelect",wd=T.forwardRef((e,n)=>{const{disabled:i=!1,onSelect:s,...l}=e,h=T.useRef(null),u=Vl(Gu,e.__scopeMenu),o=Jm(Gu,e.__scopeMenu),c=Xe(n,h),d=T.useRef(!1),g=()=>{const f=h.current;if(!i&&f){const b=new CustomEvent(d0,{bubbles:!0,cancelable:!0});f.addEventListener(d0,S=>s==null?void 0:s(S),{once:!0}),Qx(f,b),b.defaultPrevented?d.current=!1:u.onClose()}};return m.jsx(gS,{...l,ref:c,disabled:i,onClick:we(e.onClick,g),onPointerDown:f=>{var b;(b=e.onPointerDown)==null||b.call(e,f),d.current=!0},onPointerUp:we(e.onPointerUp,f=>{var b;d.current||(b=f.currentTarget)==null||b.click()}),onKeyDown:we(e.onKeyDown,f=>{const b=o.searchRef.current!=="";i||b&&f.key===" "||sm.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});wd.displayName=Gu;var gS=T.forwardRef((e,n)=>{const{__scopeMenu:i,disabled:s=!1,textValue:l,...h}=e,u=Jm(Gu,i),o=uS(i),c=T.useRef(null),d=Xe(n,c),[g,f]=T.useState(!1),[b,S]=T.useState("");return T.useEffect(()=>{var w;const k=c.current;k&&S(((w=k.textContent)!=null?w:"").trim())},[h.children]),m.jsx(El.ItemSlot,{scope:i,disabled:s,textValue:l!=null?l:b,children:m.jsx(oS,{asChild:!0,...o,focusable:!s,children:m.jsx(je.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...h,ref:d,onPointerMove:we(e.onPointerMove,Al(k=>{s?u.onItemLeave(k):(u.onItemEnter(k),k.defaultPrevented||k.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:we(e.onPointerLeave,Al(k=>u.onItemLeave(k))),onFocus:we(e.onFocus,()=>f(!0)),onBlur:we(e.onBlur,()=>f(!1))})})})}),RM="MenuCheckboxItem",vS=T.forwardRef((e,n)=>{const{checked:i=!1,onCheckedChange:s,...l}=e;return m.jsx(SS,{scope:e.__scopeMenu,checked:i,children:m.jsx(wd,{role:"menuitemcheckbox","aria-checked":Wu(i)?"mixed":i,...l,ref:n,"data-state":rg(i),onSelect:we(l.onSelect,()=>s==null?void 0:s(Wu(i)?!0:!i),{checkForDefaultPrevented:!1})})})});vS.displayName=RM;var _S="MenuRadioGroup",[DM,NM]=Ms(_S,{value:void 0,onValueChange:()=>{}}),yS=T.forwardRef((e,n)=>{const{value:i,onValueChange:s,...l}=e,h=rn(s);return m.jsx(DM,{scope:e.__scopeMenu,value:i,onValueChange:h,children:m.jsx(tg,{...l,ref:n})})});yS.displayName=_S;var bS="MenuRadioItem",xS=T.forwardRef((e,n)=>{const{value:i,...s}=e,l=NM(bS,e.__scopeMenu),h=i===l.value;return m.jsx(SS,{scope:e.__scopeMenu,checked:h,children:m.jsx(wd,{role:"menuitemradio","aria-checked":h,...s,ref:n,"data-state":rg(h),onSelect:we(s.onSelect,()=>{var u;return(u=l.onValueChange)==null?void 0:u.call(l,i)},{checkForDefaultPrevented:!1})})})});xS.displayName=bS;var ng="MenuItemIndicator",[SS,MM]=Ms(ng,{checked:!1}),wS=T.forwardRef((e,n)=>{const{__scopeMenu:i,forceMount:s,...l}=e,h=MM(ng,i);return m.jsx(Xt,{present:s||Wu(h.checked)||h.checked===!0,children:m.jsx(je.span,{...l,ref:n,"data-state":rg(h.checked)})})});wS.displayName=ng;var jM="MenuSeparator",CS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e;return m.jsx(je.div,{role:"separator","aria-orientation":"horizontal",...s,ref:n})});CS.displayName=jM;var OM="MenuArrow",kS=T.forwardRef((e,n)=>{const{__scopeMenu:i,...s}=e,l=Sd(i);return m.jsx(bd,{...l,...s,ref:n})});kS.displayName=OM;var LM="MenuSub",[w9,ES]=Ms(LM),pl="MenuSubTrigger",AS=T.forwardRef((e,n)=>{const i=js(pl,e.__scopeMenu),s=Vl(pl,e.__scopeMenu),l=ES(pl,e.__scopeMenu),h=Jm(pl,e.__scopeMenu),u=T.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=h,d={__scopeMenu:e.__scopeMenu},g=T.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return T.useEffect(()=>g,[g]),T.useEffect(()=>{const f=o.current;return()=>{window.clearTimeout(f),c(null)}},[o,c]),m.jsx(Zm,{asChild:!0,...d,children:m.jsx(gS,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":l.contentId,"data-state":DS(i.open),...e,ref:ii(n,l.onTriggerChange),onClick:f=>{var b;(b=e.onClick)==null||b.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),i.open||i.onOpenChange(!0))},onPointerMove:we(e.onPointerMove,Al(f=>{h.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!i.open&&!u.current&&(h.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{i.onOpenChange(!0),g()},100))})),onPointerLeave:we(e.onPointerLeave,Al(f=>{var S,k;g();const b=(S=i.content)==null?void 0:S.getBoundingClientRect();if(b){const w=(k=i.content)==null?void 0:k.dataset.side,_=w==="right",y=_?-5:5,v=b[_?"left":"right"],x=b[_?"right":"left"];h.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x:v,y:b.top},{x,y:b.top},{x,y:b.bottom},{x:v,y:b.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:we(e.onKeyDown,f=>{var S;const b=h.searchRef.current!=="";e.disabled||b&&f.key===" "||mM[s.dir].includes(f.key)&&(i.onOpenChange(!0),(S=i.content)==null||S.focus(),f.preventDefault())})})})});AS.displayName=pl;var TS="MenuSubContent",RS=T.forwardRef((e,n)=>{const i=hS(nr,e.__scopeMenu),{forceMount:s=i.forceMount,...l}=e,h=js(nr,e.__scopeMenu),u=Vl(nr,e.__scopeMenu),o=ES(TS,e.__scopeMenu),c=T.useRef(null),d=Xe(n,c);return m.jsx(El.Provider,{scope:e.__scopeMenu,children:m.jsx(Xt,{present:s||h.open,children:m.jsx(El.Slot,{scope:e.__scopeMenu,children:m.jsx(eg,{id:o.contentId,"aria-labelledby":o.triggerId,...l,ref:d,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var f;u.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:we(e.onFocusOutside,g=>{g.target!==o.trigger&&h.onOpenChange(!1)}),onEscapeKeyDown:we(e.onEscapeKeyDown,g=>{u.onClose(),g.preventDefault()}),onKeyDown:we(e.onKeyDown,g=>{var S;const f=g.currentTarget.contains(g.target),b=gM[u.dir].includes(g.key);f&&b&&(h.onOpenChange(!1),(S=o.trigger)==null||S.focus(),g.preventDefault())})})})})})});RS.displayName=TS;function DS(e){return e?"open":"closed"}function Wu(e){return e==="indeterminate"}function rg(e){return Wu(e)?"indeterminate":e?"checked":"unchecked"}function IM(e){const n=document.activeElement;for(const i of e)if(i===n||(i.focus(),document.activeElement!==n))return}function BM(e,n){return e.map((i,s)=>e[(n+s)%e.length])}function zM(e,n,i){const l=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,h=i?e.indexOf(i):-1;let u=BM(e,Math.max(h,0));l.length===1&&(u=u.filter(d=>d!==i));const c=u.find(d=>d.toLowerCase().startsWith(l.toLowerCase()));return c!==i?c:void 0}function PM(e,n){const{x:i,y:s}=e;let l=!1;for(let h=0,u=n.length-1;h<n.length;u=h++){const o=n[h],c=n[u],d=o.x,g=o.y,f=c.x,b=c.y;g>s!=b>s&&i<(f-d)*(s-g)/(b-g)+d&&(l=!l)}return l}function FM(e,n){if(!n)return!1;const i={x:e.clientX,y:e.clientY};return PM(i,n)}function Al(e){return n=>n.pointerType==="mouse"?e(n):void 0}var HM=dS,UM=Zm,$M=fS,qM=pS,VM=tg,GM=mS,WM=wd,KM=vS,YM=yS,XM=xS,ZM=wS,QM=CS,JM=kS,e3=AS,t3=RS,Cd="DropdownMenu",[n3]=Un(Cd,[cS]),mn=cS(),[r3,NS]=n3(Cd),MS=e=>{const{__scopeDropdownMenu:n,children:i,dir:s,open:l,defaultOpen:h,onOpenChange:u,modal:o=!0}=e,c=mn(n),d=T.useRef(null),[g,f]=si({prop:l,defaultProp:h!=null?h:!1,onChange:u,caller:Cd});return m.jsx(r3,{scope:n,triggerId:Vt(),triggerRef:d,contentId:Vt(),open:g,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(b=>!b),[f]),modal:o,children:m.jsx(HM,{...c,open:g,onOpenChange:f,dir:s,modal:o,children:i})})};MS.displayName=Cd;var jS="DropdownMenuTrigger",OS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,disabled:s=!1,...l}=e,h=NS(jS,i),u=mn(i);return m.jsx(UM,{asChild:!0,...u,children:m.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:ii(n,h.triggerRef),onPointerDown:we(e.onPointerDown,o=>{!s&&o.button===0&&o.ctrlKey===!1&&(h.onOpenToggle(),h.open||o.preventDefault())}),onKeyDown:we(e.onKeyDown,o=>{s||(["Enter"," "].includes(o.key)&&h.onOpenToggle(),o.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});OS.displayName=jS;var i3="DropdownMenuPortal",LS=e=>{const{__scopeDropdownMenu:n,...i}=e,s=mn(n);return m.jsx($M,{...s,...i})};LS.displayName=i3;var IS="DropdownMenuContent",BS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=NS(IS,i),h=mn(i),u=T.useRef(!1);return m.jsx(qM,{id:l.contentId,"aria-labelledby":l.triggerId,...h,...s,ref:n,onCloseAutoFocus:we(e.onCloseAutoFocus,o=>{var c;u.current||(c=l.triggerRef.current)==null||c.focus(),u.current=!1,o.preventDefault()}),onInteractOutside:we(e.onInteractOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,g=c.button===2||d;(!l.modal||g)&&(u.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)"}})});BS.displayName=IS;var s3="DropdownMenuGroup",a3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(VM,{...l,...s,ref:n})});a3.displayName=s3;var o3="DropdownMenuLabel",l3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(GM,{...l,...s,ref:n})});l3.displayName=o3;var c3="DropdownMenuItem",zS=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(WM,{...l,...s,ref:n})});zS.displayName=c3;var u3="DropdownMenuCheckboxItem",d3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(KM,{...l,...s,ref:n})});d3.displayName=u3;var h3="DropdownMenuRadioGroup",f3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(YM,{...l,...s,ref:n})});f3.displayName=h3;var p3="DropdownMenuRadioItem",m3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(XM,{...l,...s,ref:n})});m3.displayName=p3;var g3="DropdownMenuItemIndicator",v3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(ZM,{...l,...s,ref:n})});v3.displayName=g3;var _3="DropdownMenuSeparator",y3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(QM,{...l,...s,ref:n})});y3.displayName=_3;var b3="DropdownMenuArrow",x3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(JM,{...l,...s,ref:n})});x3.displayName=b3;var S3="DropdownMenuSubTrigger",w3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(e3,{...l,...s,ref:n})});w3.displayName=S3;var C3="DropdownMenuSubContent",k3=T.forwardRef((e,n)=>{const{__scopeDropdownMenu:i,...s}=e,l=mn(i);return m.jsx(t3,{...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)"}})});k3.displayName=C3;var E3=MS,A3=OS,T3=LS,R3=BS,D3=zS,N3="Label",PS=T.forwardRef((e,n)=>m.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())}}));PS.displayName=N3;var M3=PS;function am(e,[n,i]){return Math.min(i,Math.max(n,e))}var kd="Popover",[FS]=Un(kd,[Yi]),Gl=Yi(),[j3,Xi]=FS(kd),HS=e=>{const{__scopePopover:n,children:i,open:s,defaultOpen:l,onOpenChange:h,modal:u=!1}=e,o=Gl(n),c=T.useRef(null),[d,g]=T.useState(!1),[f,b]=si({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:kd});return m.jsx(_d,{...o,children:m.jsx(j3,{scope:n,contentId:Vt(),triggerRef:c,open:f,onOpenChange:b,onOpenToggle:T.useCallback(()=>b(S=>!S),[b]),hasCustomAnchor:d,onCustomAnchorAdd:T.useCallback(()=>g(!0),[]),onCustomAnchorRemove:T.useCallback(()=>g(!1),[]),modal:u,children:i})})};HS.displayName=kd;var US="PopoverAnchor",$S=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Xi(US,i),h=Gl(i),{onCustomAnchorAdd:u,onCustomAnchorRemove:o}=l;return T.useEffect(()=>(u(),()=>o()),[u,o]),m.jsx(Ul,{...h,...s,ref:n})});$S.displayName=US;var qS="PopoverTrigger",VS=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Xi(qS,i),h=Gl(i),u=Xe(n,l.triggerRef),o=m.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":XS(l.open),...s,ref:u,onClick:we(e.onClick,l.onOpenToggle)});return l.hasCustomAnchor?o:m.jsx(Ul,{asChild:!0,...h,children:o})});VS.displayName=qS;var ig="PopoverPortal",[O3,L3]=FS(ig,{forceMount:void 0}),GS=e=>{const{__scopePopover:n,forceMount:i,children:s,container:l}=e,h=Xi(ig,n);return m.jsx(O3,{scope:n,forceMount:i,children:m.jsx(Xt,{present:i||h.open,children:m.jsx(eo,{asChild:!0,container:l,children:s})})})};GS.displayName=ig;var za="PopoverContent",WS=T.forwardRef((e,n)=>{const i=L3(za,e.__scopePopover),{forceMount:s=i.forceMount,...l}=e,h=Xi(za,e.__scopePopover);return m.jsx(Xt,{present:s||h.open,children:h.modal?m.jsx(B3,{...l,ref:n}):m.jsx(z3,{...l,ref:n})})});WS.displayName=za;var I3=Vi("PopoverContent.RemoveScroll"),B3=T.forwardRef((e,n)=>{const i=Xi(za,e.__scopePopover),s=T.useRef(null),l=Xe(n,s),h=T.useRef(!1);return T.useEffect(()=>{const u=s.current;if(u)return dd(u)},[]),m.jsx(Fl,{as:I3,allowPinchZoom:!0,children:m.jsx(KS,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,u=>{var o;u.preventDefault(),h.current||(o=i.triggerRef.current)==null||o.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,u=>{const o=u.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,d=o.button===2||c;h.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:we(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})}),z3=T.forwardRef((e,n)=>{const i=Xi(za,e.__scopePopover),s=T.useRef(!1),l=T.useRef(!1);return m.jsx(KS,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var u,o;(u=e.onCloseAutoFocus)==null||u.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,d;(c=e.onInteractOutside)==null||c.call(e,h),h.defaultPrevented||(s.current=!0,h.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const u=h.target;((d=i.triggerRef.current)==null?void 0:d.contains(u))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&l.current&&h.preventDefault()}})}),KS=T.forwardRef((e,n)=>{const{__scopePopover:i,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:h,disableOutsidePointerEvents:u,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:g,...f}=e,b=Xi(za,i),S=Gl(i);return cd(),m.jsx(Pl,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:l,onUnmountAutoFocus:h,children:m.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:g,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onDismiss:()=>b.onOpenChange(!1),children:m.jsx(yd,{"data-state":XS(b.open),role:"dialog",id:b.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)"}})})})}),YS="PopoverClose",P3=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Xi(YS,i);return m.jsx(je.button,{type:"button",...s,ref:n,onClick:we(e.onClick,()=>l.onOpenChange(!1))})});P3.displayName=YS;var F3="PopoverArrow",H3=T.forwardRef((e,n)=>{const{__scopePopover:i,...s}=e,l=Gl(i);return m.jsx(bd,{...l,...s,ref:n})});H3.displayName=F3;function XS(e){return e?"open":"closed"}var U3=HS,$3=$S,q3=VS,V3=GS,G3=WS,sg="Progress",ag=100,[W3]=Un(sg),[K3,Y3]=W3(sg),ZS=T.forwardRef((e,n)=>{const{__scopeProgress:i,value:s=null,max:l,getValueLabel:h=X3,...u}=e;(l||l===0)&&!h0(l)&&console.error(Z3(`${l}`,"Progress"));const o=h0(l)?l:ag;s!==null&&!f0(s,o)&&console.error(Q3(`${s}`,"Progress"));const c=f0(s,o)?s:null,d=Ku(c)?h(c,o):void 0;return m.jsx(K3,{scope:i,value:c,max:o,children:m.jsx(je.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":Ku(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":ew(c,o),"data-value":c!=null?c:void 0,"data-max":o,...u,ref:n})})});ZS.displayName=sg;var QS="ProgressIndicator",JS=T.forwardRef((e,n)=>{var h;const{__scopeProgress:i,...s}=e,l=Y3(QS,i);return m.jsx(je.div,{"data-state":ew(l.value,l.max),"data-value":(h=l.value)!=null?h:void 0,"data-max":l.max,...s,ref:n})});JS.displayName=QS;function X3(e,n){return`${Math.round(e/n*100)}%`}function ew(e,n){return e==null?"indeterminate":e===n?"complete":"loading"}function Ku(e){return typeof e=="number"}function h0(e){return Ku(e)&&!isNaN(e)&&e>0}function f0(e,n){return Ku(e)&&!isNaN(e)&&e<=n&&e>=0}function Z3(e,n){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${n}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${ag}\`.`}function Q3(e,n){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${n}\`. The \`value\` prop must be:
464
- - a positive number
465
- - less than the value passed to \`max\` (or ${ag} if no \`max\` prop is set)
466
- - \`null\` or \`undefined\` if the progress is indeterminate.
467
-
468
- Defaulting to \`null\`.`}var J3=ZS,ej=JS;function tj(e,n){return T.useReducer((i,s)=>{const l=n[i][s];return l!=null?l:i},e)}var og="ScrollArea",[tw]=Un(og),[nj,rr]=tw(og),nw=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,type:s="hover",dir:l,scrollHideDelay:h=600,...u}=e,[o,c]=T.useState(null),[d,g]=T.useState(null),[f,b]=T.useState(null),[S,k]=T.useState(null),[w,_]=T.useState(null),[y,v]=T.useState(0),[x,E]=T.useState(0),[N,R]=T.useState(!1),[M,D]=T.useState(!1),O=Xe(n,$=>c($)),P=zl(l);return m.jsx(nj,{scope:i,type:s,dir:P,scrollHideDelay:h,scrollArea:o,viewport:d,onViewportChange:g,content:f,onContentChange:b,scrollbarX:S,onScrollbarXChange:k,scrollbarXEnabled:N,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:_,scrollbarYEnabled:M,onScrollbarYEnabledChange:D,onCornerWidthChange:v,onCornerHeightChange:E,children:m.jsx(je.div,{dir:P,...u,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});nw.displayName=og;var rw="ScrollAreaViewport",iw=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,children:s,nonce:l,...h}=e,u=rr(rw,i),o=T.useRef(null),c=Xe(n,o,u.onViewportChange);return m.jsxs(m.Fragment,{children:[m.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}),m.jsx(je.div,{"data-radix-scroll-area-viewport":"",...h,ref:c,style:{overflowX:u.scrollbarXEnabled?"scroll":"hidden",overflowY:u.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:u.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});iw.displayName=rw;var Rr="ScrollAreaScrollbar",sw=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=rr(Rr,e.__scopeScrollArea),{onScrollbarXEnabledChange:h,onScrollbarYEnabledChange:u}=l,o=e.orientation==="horizontal";return T.useEffect(()=>(o?h(!0):u(!0),()=>{o?h(!1):u(!1)}),[o,h,u]),l.type==="hover"?m.jsx(rj,{...s,ref:n,forceMount:i}):l.type==="scroll"?m.jsx(ij,{...s,ref:n,forceMount:i}):l.type==="auto"?m.jsx(aw,{...s,ref:n,forceMount:i}):l.type==="always"?m.jsx(lg,{...s,ref:n}):null});sw.displayName=Rr;var rj=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=rr(Rr,e.__scopeScrollArea),[h,u]=T.useState(!1);return T.useEffect(()=>{const o=l.scrollArea;let c=0;if(o){const d=()=>{window.clearTimeout(c),u(!0)},g=()=>{c=window.setTimeout(()=>u(!1),l.scrollHideDelay)};return o.addEventListener("pointerenter",d),o.addEventListener("pointerleave",g),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",d),o.removeEventListener("pointerleave",g)}}},[l.scrollArea,l.scrollHideDelay]),m.jsx(Xt,{present:i||h,children:m.jsx(aw,{"data-state":h?"visible":"hidden",...s,ref:n})})}),ij=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=rr(Rr,e.__scopeScrollArea),h=e.orientation==="horizontal",u=Ad(()=>c("SCROLL_END"),100),[o,c]=tj("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 d=window.setTimeout(()=>c("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(d)}},[o,l.scrollHideDelay,c]),T.useEffect(()=>{const d=l.viewport,g=h?"scrollLeft":"scrollTop";if(d){let f=d[g];const b=()=>{const S=d[g];f!==S&&(c("SCROLL"),u()),f=S};return d.addEventListener("scroll",b),()=>d.removeEventListener("scroll",b)}},[l.viewport,h,c,u]),m.jsx(Xt,{present:i||o!=="hidden",children:m.jsx(lg,{"data-state":o==="hidden"?"hidden":"visible",...s,ref:n,onPointerEnter:we(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:we(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),aw=T.forwardRef((e,n)=>{const i=rr(Rr,e.__scopeScrollArea),{forceMount:s,...l}=e,[h,u]=T.useState(!1),o=e.orientation==="horizontal",c=Ad(()=>{if(i.viewport){const d=i.viewport.offsetWidth<i.viewport.scrollWidth,g=i.viewport.offsetHeight<i.viewport.scrollHeight;u(o?d:g)}},10);return Pa(i.viewport,c),Pa(i.content,c),m.jsx(Xt,{present:s||h,children:m.jsx(lg,{"data-state":h?"visible":"hidden",...l,ref:n})})}),lg=T.forwardRef((e,n)=>{const{orientation:i="vertical",...s}=e,l=rr(Rr,e.__scopeScrollArea),h=T.useRef(null),u=T.useRef(0),[o,c]=T.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=dw(o.viewport,o.content),g={...s,sizes:o,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:b=>h.current=b,onThumbPointerUp:()=>u.current=0,onThumbPointerDown:b=>u.current=b};function f(b,S){return uj(b,u.current,o,S)}return i==="horizontal"?m.jsx(sj,{...g,ref:n,onThumbPositionChange:()=>{if(l.viewport&&h.current){const b=l.viewport.scrollLeft,S=p0(b,o,l.dir);h.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollLeft=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollLeft=f(b,l.dir))}}):i==="vertical"?m.jsx(aj,{...g,ref:n,onThumbPositionChange:()=>{if(l.viewport&&h.current){const b=l.viewport.scrollTop,S=p0(b,o);h.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollTop=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollTop=f(b))}}):null}),sj=T.forwardRef((e,n)=>{const{sizes:i,onSizesChange:s,...l}=e,h=rr(Rr,e.__scopeScrollArea),[u,o]=T.useState(),c=T.useRef(null),d=Xe(n,c,h.onScrollbarXChange);return T.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),m.jsx(lw,{"data-orientation":"horizontal",...l,ref:d,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":Ed(i)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,f)=>{if(h.viewport){const b=h.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),fw(b,f)&&g.preventDefault()}},onResize:()=>{c.current&&h.viewport&&u&&s({content:h.viewport.scrollWidth,viewport:h.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Xu(u.paddingLeft),paddingEnd:Xu(u.paddingRight)}})}})}),aj=T.forwardRef((e,n)=>{const{sizes:i,onSizesChange:s,...l}=e,h=rr(Rr,e.__scopeScrollArea),[u,o]=T.useState(),c=T.useRef(null),d=Xe(n,c,h.onScrollbarYChange);return T.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),m.jsx(lw,{"data-orientation":"vertical",...l,ref:d,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":Ed(i)+"px",...e.style},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,f)=>{if(h.viewport){const b=h.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),fw(b,f)&&g.preventDefault()}},onResize:()=>{c.current&&h.viewport&&u&&s({content:h.viewport.scrollHeight,viewport:h.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Xu(u.paddingTop),paddingEnd:Xu(u.paddingBottom)}})}})}),[oj,ow]=tw(Rr),lw=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,sizes:s,hasThumb:l,onThumbChange:h,onThumbPointerUp:u,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:g,onResize:f,...b}=e,S=rr(Rr,i),[k,w]=T.useState(null),_=Xe(n,O=>w(O)),y=T.useRef(null),v=T.useRef(""),x=S.viewport,E=s.content-s.viewport,N=rn(g),R=rn(c),M=Ad(f,10);function D(O){if(y.current){const P=O.clientX-y.current.left,$=O.clientY-y.current.top;d({x:P,y:$})}}return T.useEffect(()=>{const O=P=>{const $=P.target;(k==null?void 0:k.contains($))&&N(P,E)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[x,k,E,N]),T.useEffect(R,[s,R]),Pa(k,M),Pa(S.content,M),m.jsx(oj,{scope:i,scrollbar:k,hasThumb:l,onThumbChange:rn(h),onThumbPointerUp:rn(u),onThumbPositionChange:R,onThumbPointerDown:rn(o),children:m.jsx(je.div,{...b,ref:_,style:{position:"absolute",...b.style},onPointerDown:we(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),y.current=k.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),D(O))}),onPointerMove:we(e.onPointerMove,D),onPointerUp:we(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=""),y.current=null})})})}),Yu="ScrollAreaThumb",cw=T.forwardRef((e,n)=>{const{forceMount:i,...s}=e,l=ow(Yu,e.__scopeScrollArea);return m.jsx(Xt,{present:i||l.hasThumb,children:m.jsx(lj,{ref:n,...s})})}),lj=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,style:s,...l}=e,h=rr(Yu,i),u=ow(Yu,i),{onThumbPositionChange:o}=u,c=Xe(n,f=>u.onThumbChange(f)),d=T.useRef(void 0),g=Ad(()=>{d.current&&(d.current(),d.current=void 0)},100);return T.useEffect(()=>{const f=h.viewport;if(f){const b=()=>{if(g(),!d.current){const S=dj(f,o);d.current=S,o()}};return o(),f.addEventListener("scroll",b),()=>f.removeEventListener("scroll",b)}},[h.viewport,g,o]),m.jsx(je.div,{"data-state":u.hasThumb?"visible":"hidden",...l,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:we(e.onPointerDownCapture,f=>{const S=f.target.getBoundingClientRect(),k=f.clientX-S.left,w=f.clientY-S.top;u.onThumbPointerDown({x:k,y:w})}),onPointerUp:we(e.onPointerUp,u.onThumbPointerUp)})});cw.displayName=Yu;var cg="ScrollAreaCorner",uw=T.forwardRef((e,n)=>{const i=rr(cg,e.__scopeScrollArea),s=!!(i.scrollbarX&&i.scrollbarY);return i.type!=="scroll"&&s?m.jsx(cj,{...e,ref:n}):null});uw.displayName=cg;var cj=T.forwardRef((e,n)=>{const{__scopeScrollArea:i,...s}=e,l=rr(cg,i),[h,u]=T.useState(0),[o,c]=T.useState(0),d=!!(h&&o);return Pa(l.scrollbarX,()=>{var f;const g=((f=l.scrollbarX)==null?void 0:f.offsetHeight)||0;l.onCornerHeightChange(g),c(g)}),Pa(l.scrollbarY,()=>{var f;const g=((f=l.scrollbarY)==null?void 0:f.offsetWidth)||0;l.onCornerWidthChange(g),u(g)}),d?m.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 Xu(e){return e?parseInt(e,10):0}function dw(e,n){const i=e/n;return isNaN(i)?0:i}function Ed(e){const n=dw(e.viewport,e.content),i=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=(e.scrollbar.size-i)*n;return Math.max(s,18)}function uj(e,n,i,s="ltr"){const l=Ed(i),h=l/2,u=n||h,o=l-u,c=i.scrollbar.paddingStart+u,d=i.scrollbar.size-i.scrollbar.paddingEnd-o,g=i.content-i.viewport,f=s==="ltr"?[0,g]:[g*-1,0];return hw([c,d],f)(e)}function p0(e,n,i="ltr"){const s=Ed(n),l=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,h=n.scrollbar.size-l,u=n.content-n.viewport,o=h-s,c=i==="ltr"?[0,u]:[u*-1,0],d=am(e,c);return hw([0,u],[0,o])(d)}function hw(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 fw(e,n){return e>0&&e<n}var dj=(e,n=()=>{})=>{let i={left:e.scrollLeft,top:e.scrollTop},s=0;return(function l(){const h={left:e.scrollLeft,top:e.scrollTop},u=i.left!==h.left,o=i.top!==h.top;(u||o)&&n(),i=h,s=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(s)};function Ad(e,n){const i=rn(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 Pa(e,n){const i=rn(n);Yt(()=>{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 hj=nw,fj=iw,pj=uw,mj=[" ","Enter","ArrowUp","ArrowDown"],gj=[" ","Enter"],Ts="Select",[Td,Rd,vj]=Mm(Ts),[ro]=Un(Ts,[vj,Yi]),Dd=Yi(),[_j,Zi]=ro(Ts),[yj,bj]=ro(Ts),pw=e=>{const{__scopeSelect:n,children:i,open:s,defaultOpen:l,onOpenChange:h,value:u,defaultValue:o,onValueChange:c,dir:d,name:g,autoComplete:f,disabled:b,required:S,form:k}=e,w=Dd(n),[_,y]=T.useState(null),[v,x]=T.useState(null),[E,N]=T.useState(!1),R=zl(d),[M,D]=si({prop:s,defaultProp:l!=null?l:!1,onChange:h,caller:Ts}),[O,P]=si({prop:u,defaultProp:o,onChange:c,caller:Ts}),$=T.useRef(null),U=_?k||!!_.closest("form"):!0,[q,Y]=T.useState(new Set),K=Array.from(q).map(V=>V.props.value).join(";");return m.jsx(_d,{...w,children:m.jsxs(_j,{required:S,scope:n,trigger:_,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:N,contentId:Vt(),value:O,onValueChange:P,open:M,onOpenChange:D,dir:R,triggerPointerDownPosRef:$,disabled:b,children:[m.jsx(Td.Provider,{scope:n,children:m.jsx(yj,{scope:e.__scopeSelect,onNativeOptionAdd:T.useCallback(V=>{Y(J=>new Set(J).add(V))},[]),onNativeOptionRemove:T.useCallback(V=>{Y(J=>{const ne=new Set(J);return ne.delete(V),ne})},[]),children:i})}),U?m.jsxs(zw,{"aria-hidden":!0,required:S,tabIndex:-1,name:g,autoComplete:f,value:O,onChange:V=>P(V.target.value),disabled:b,form:k,children:[O===void 0?m.jsx("option",{value:""}):null,Array.from(q)]},K):null]})})};pw.displayName=Ts;var mw="SelectTrigger",gw=T.forwardRef((e,n)=>{const{__scopeSelect:i,disabled:s=!1,...l}=e,h=Dd(i),u=Zi(mw,i),o=u.disabled||s,c=Xe(n,u.onTriggerChange),d=Rd(i),g=T.useRef("touch"),[f,b,S]=Fw(w=>{const _=d().filter(x=>!x.disabled),y=_.find(x=>x.value===u.value),v=Hw(_,w,y);v!==void 0&&u.onValueChange(v.value)}),k=w=>{o||(u.onOpenChange(!0),S()),w&&(u.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return m.jsx(Ul,{asChild:!0,...h,children:m.jsx(je.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":Pw(u.value)?"":void 0,...l,ref:c,onClick:we(l.onClick,w=>{w.currentTarget.focus(),g.current!=="mouse"&&k(w)}),onPointerDown:we(l.onPointerDown,w=>{g.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:we(l.onKeyDown,w=>{const _=f.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&b(w.key),!(_&&w.key===" ")&&mj.includes(w.key)&&(k(),w.preventDefault())})})})});gw.displayName=mw;var vw="SelectValue",_w=T.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:l,children:h,placeholder:u="",...o}=e,c=Zi(vw,i),{onValueNodeHasChildrenChange:d}=c,g=h!==void 0,f=Xe(n,c.onValueNodeChange);return Yt(()=>{d(g)},[d,g]),m.jsx(je.span,{...o,ref:f,style:{pointerEvents:"none"},children:Pw(c.value)?m.jsx(m.Fragment,{children:u}):h})});_w.displayName=vw;var xj="SelectIcon",yw=T.forwardRef((e,n)=>{const{__scopeSelect:i,children:s,...l}=e;return m.jsx(je.span,{"aria-hidden":!0,...l,ref:n,children:s||"▼"})});yw.displayName=xj;var Sj="SelectPortal",bw=e=>m.jsx(eo,{asChild:!0,...e});bw.displayName=Sj;var Rs="SelectContent",xw=T.forwardRef((e,n)=>{const i=Zi(Rs,e.__scopeSelect),[s,l]=T.useState();if(Yt(()=>{l(new DocumentFragment)},[]),!i.open){const h=s;return h?Il.createPortal(m.jsx(Sw,{scope:e.__scopeSelect,children:m.jsx(Td.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),h):null}return m.jsx(ww,{...e,ref:n})});xw.displayName=Rs;var ur=10,[Sw,Qi]=ro(Rs),wj="SelectContentImpl",Cj=Vi("SelectContent.RemoveScroll"),ww=T.forwardRef((e,n)=>{const{__scopeSelect:i,position:s="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:h,onPointerDownOutside:u,side:o,sideOffset:c,align:d,alignOffset:g,arrowPadding:f,collisionBoundary:b,collisionPadding:S,sticky:k,hideWhenDetached:w,avoidCollisions:_,...y}=e,v=Zi(Rs,i),[x,E]=T.useState(null),[N,R]=T.useState(null),M=Xe(n,W=>E(W)),[D,O]=T.useState(null),[P,$]=T.useState(null),U=Rd(i),[q,Y]=T.useState(!1),K=T.useRef(!1);T.useEffect(()=>{if(x)return dd(x)},[x]),cd();const V=T.useCallback(W=>{const[H,...te]=U().map(ce=>ce.ref.current),[ae]=te.slice(-1),pe=document.activeElement;for(const ce of W)if(ce===pe||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===H&&N&&(N.scrollTop=0),ce===ae&&N&&(N.scrollTop=N.scrollHeight),ce==null||ce.focus(),document.activeElement!==pe))return},[U,N]),J=T.useCallback(()=>V([D,x]),[V,D,x]);T.useEffect(()=>{q&&J()},[q,J]);const{onOpenChange:ne,triggerPointerDownPosRef:F}=v;T.useEffect(()=>{if(x){let W={x:0,y:0};const H=ae=>{var pe,ce,Oe,Ie;W={x:Math.abs(Math.round(ae.pageX)-((ce=(pe=F.current)==null?void 0:pe.x)!=null?ce:0)),y:Math.abs(Math.round(ae.pageY)-((Ie=(Oe=F.current)==null?void 0:Oe.y)!=null?Ie:0))}},te=ae=>{W.x<=10&&W.y<=10?ae.preventDefault():x.contains(ae.target)||ne(!1),document.removeEventListener("pointermove",H),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",te,{capture:!0})}}},[x,ne,F]),T.useEffect(()=>{const W=()=>ne(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[ne]);const[j,I]=Fw(W=>{const H=U().filter(pe=>!pe.disabled),te=H.find(pe=>pe.ref.current===document.activeElement),ae=Hw(H,W,te);ae&&setTimeout(()=>ae.ref.current.focus())}),L=T.useCallback((W,H,te)=>{const ae=!K.current&&!te;(v.value!==void 0&&v.value===H||ae)&&(O(W),ae&&(K.current=!0))},[v.value]),z=T.useCallback(()=>x==null?void 0:x.focus(),[x]),Z=T.useCallback((W,H,te)=>{const ae=!K.current&&!te;(v.value!==void 0&&v.value===H||ae)&&$(W)},[v.value]),X=s==="popper"?om:Cw,ee=X===om?{side:o,sideOffset:c,align:d,alignOffset:g,arrowPadding:f,collisionBoundary:b,collisionPadding:S,sticky:k,hideWhenDetached:w,avoidCollisions:_}:{};return m.jsx(Sw,{scope:i,content:x,viewport:N,onViewportChange:R,itemRefCallback:L,selectedItem:D,onItemLeave:z,itemTextRefCallback:Z,focusSelectedItem:J,selectedItemText:P,position:s,isPositioned:q,searchRef:j,children:m.jsx(Fl,{as:Cj,allowPinchZoom:!0,children:m.jsx(Pl,{asChild:!0,trapped:v.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:we(l,W=>{var H;(H=v.trigger)==null||H.focus({preventScroll:!0}),W.preventDefault()}),children:m.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:u,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:m.jsx(X,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:W=>W.preventDefault(),...y,...ee,onPlaced:()=>Y(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:we(y.onKeyDown,W=>{const H=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!H&&W.key.length===1&&I(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ae=U().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,ce=ae.indexOf(pe);ae=ae.slice(ce+1)}setTimeout(()=>V(ae)),W.preventDefault()}})})})})})})});ww.displayName=wj;var kj="SelectItemAlignedPosition",Cw=T.forwardRef((e,n)=>{const{__scopeSelect:i,onPlaced:s,...l}=e,h=Zi(Rs,i),u=Qi(Rs,i),[o,c]=T.useState(null),[d,g]=T.useState(null),f=Xe(n,M=>g(M)),b=Rd(i),S=T.useRef(!1),k=T.useRef(!0),{viewport:w,selectedItem:_,selectedItemText:y,focusSelectedItem:v}=u,x=T.useCallback(()=>{if(h.trigger&&h.valueNode&&o&&d&&w&&_&&y){const M=h.trigger.getBoundingClientRect(),D=d.getBoundingClientRect(),O=h.valueNode.getBoundingClientRect(),P=y.getBoundingClientRect();if(h.dir!=="rtl"){const pe=P.left-D.left,ce=O.left-pe,Oe=M.left-ce,Ie=M.width+Oe,Ue=Math.max(Ie,D.width),ut=window.innerWidth-ur,Ne=am(ce,[ur,Math.max(ur,ut-Ue)]);o.style.minWidth=Ie+"px",o.style.left=Ne+"px"}else{const pe=D.right-P.right,ce=window.innerWidth-O.right-pe,Oe=window.innerWidth-M.right-ce,Ie=M.width+Oe,Ue=Math.max(Ie,D.width),ut=window.innerWidth-ur,Ne=am(ce,[ur,Math.max(ur,ut-Ue)]);o.style.minWidth=Ie+"px",o.style.right=Ne+"px"}const $=b(),U=window.innerHeight-ur*2,q=w.scrollHeight,Y=window.getComputedStyle(d),K=parseInt(Y.borderTopWidth,10),V=parseInt(Y.paddingTop,10),J=parseInt(Y.borderBottomWidth,10),ne=parseInt(Y.paddingBottom,10),F=K+V+q+ne+J,j=Math.min(_.offsetHeight*5,F),I=window.getComputedStyle(w),L=parseInt(I.paddingTop,10),z=parseInt(I.paddingBottom,10),Z=M.top+M.height/2-ur,X=U-Z,ee=_.offsetHeight/2,W=_.offsetTop+ee,H=K+V+W,te=F-H;if(H<=Z){const pe=$.length>0&&_===$[$.length-1].ref.current;o.style.bottom="0px";const ce=d.clientHeight-w.offsetTop-w.offsetHeight,Oe=Math.max(X,ee+(pe?z:0)+ce+J),Ie=H+Oe;o.style.height=Ie+"px"}else{const pe=$.length>0&&_===$[0].ref.current;o.style.top="0px";const Oe=Math.max(Z,K+w.offsetTop+(pe?L:0)+ee)+te;o.style.height=Oe+"px",w.scrollTop=H-Z+w.offsetTop}o.style.margin=`${ur}px 0`,o.style.minHeight=j+"px",o.style.maxHeight=U+"px",s==null||s(),requestAnimationFrame(()=>S.current=!0)}},[b,h.trigger,h.valueNode,o,d,w,_,y,h.dir,s]);Yt(()=>x(),[x]);const[E,N]=T.useState();Yt(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const R=T.useCallback(M=>{M&&k.current===!0&&(x(),v==null||v(),k.current=!1)},[x,v]);return m.jsx(Aj,{scope:i,contentWrapper:o,shouldExpandOnScrollRef:S,onScrollButtonChange:R,children:m.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:m.jsx(je.div,{...l,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});Cw.displayName=kj;var Ej="SelectPopperPosition",om=T.forwardRef((e,n)=>{const{__scopeSelect:i,align:s="start",collisionPadding:l=ur,...h}=e,u=Dd(i);return m.jsx(yd,{...u,...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)"}})});om.displayName=Ej;var[Aj,ug]=ro(Rs,{}),lm="SelectViewport",kw=T.forwardRef((e,n)=>{const{__scopeSelect:i,nonce:s,...l}=e,h=Qi(lm,i),u=ug(lm,i),o=Xe(n,h.onViewportChange),c=T.useRef(0);return m.jsxs(m.Fragment,{children:[m.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}),m.jsx(Td.Slot,{scope:i,children:m.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:we(l.onScroll,d=>{const g=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:b}=u;if(b!=null&&b.current&&f){const S=Math.abs(c.current-g.scrollTop);if(S>0){const k=window.innerHeight-ur*2,w=parseFloat(f.style.minHeight),_=parseFloat(f.style.height),y=Math.max(w,_);if(y<k){const v=y+S,x=Math.min(k,v),E=v-x;f.style.height=x+"px",f.style.bottom==="0px"&&(g.scrollTop=E>0?E:0,f.style.justifyContent="flex-end")}}}c.current=g.scrollTop})})})]})});kw.displayName=lm;var Ew="SelectGroup",[Tj,Rj]=ro(Ew),Aw=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=Vt();return m.jsx(Tj,{scope:i,id:l,children:m.jsx(je.div,{role:"group","aria-labelledby":l,...s,ref:n})})});Aw.displayName=Ew;var Tw="SelectLabel",Rw=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=Rj(Tw,i);return m.jsx(je.div,{id:l.id,...s,ref:n})});Rw.displayName=Tw;var Zu="SelectItem",[Dj,Dw]=ro(Zu),Nw=T.forwardRef((e,n)=>{const{__scopeSelect:i,value:s,disabled:l=!1,textValue:h,...u}=e,o=Zi(Zu,i),c=Qi(Zu,i),d=o.value===s,[g,f]=T.useState(h!=null?h:""),[b,S]=T.useState(!1),k=Xe(n,v=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,v,s,l)}),w=Vt(),_=T.useRef("touch"),y=()=>{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 m.jsx(Dj,{scope:i,value:s,disabled:l,textId:w,isSelected:d,onItemTextChange:T.useCallback(v=>{f(x=>{var E;return x||((E=v==null?void 0:v.textContent)!=null?E:"").trim()})},[]),children:m.jsx(Td.ItemSlot,{scope:i,value:s,disabled:l,textValue:g,children:m.jsx(je.div,{role:"option","aria-labelledby":w,"data-highlighted":b?"":void 0,"aria-selected":d&&b,"data-state":d?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...u,ref:k,onFocus:we(u.onFocus,()=>S(!0)),onBlur:we(u.onBlur,()=>S(!1)),onClick:we(u.onClick,()=>{_.current!=="mouse"&&y()}),onPointerUp:we(u.onPointerUp,()=>{_.current==="mouse"&&y()}),onPointerDown:we(u.onPointerDown,v=>{_.current=v.pointerType}),onPointerMove:we(u.onPointerMove,v=>{var x;_.current=v.pointerType,l?(x=c.onItemLeave)==null||x.call(c):_.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(u.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:we(u.onKeyDown,v=>{var E;((E=c.searchRef)==null?void 0:E.current)!==""&&v.key===" "||(gj.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Nw.displayName=Zu;var ml="SelectItemText",Mw=T.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:l,...h}=e,u=Zi(ml,i),o=Qi(ml,i),c=Dw(ml,i),d=bj(ml,i),[g,f]=T.useState(null),b=Xe(n,y=>f(y),c.onItemTextChange,y=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,y,c.value,c.disabled)}),S=g==null?void 0:g.textContent,k=T.useMemo(()=>m.jsx("option",{value:c.value,disabled:c.disabled,children:S},c.value),[c.disabled,c.value,S]),{onNativeOptionAdd:w,onNativeOptionRemove:_}=d;return Yt(()=>(w(k),()=>_(k)),[w,_,k]),m.jsxs(m.Fragment,{children:[m.jsx(je.span,{id:c.textId,...h,ref:b}),c.isSelected&&u.valueNode&&!u.valueNodeHasChildren?Il.createPortal(h.children,u.valueNode):null]})});Mw.displayName=ml;var jw="SelectItemIndicator",Ow=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return Dw(jw,i).isSelected?m.jsx(je.span,{"aria-hidden":!0,...s,ref:n}):null});Ow.displayName=jw;var cm="SelectScrollUpButton",Lw=T.forwardRef((e,n)=>{const i=Qi(cm,e.__scopeSelect),s=ug(cm,e.__scopeSelect),[l,h]=T.useState(!1),u=Xe(n,s.onScrollButtonChange);return Yt(()=>{if(i.viewport&&i.isPositioned){let o=function(){const d=c.scrollTop>0;h(d)};const c=i.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[i.viewport,i.isPositioned]),l?m.jsx(Bw,{...e,ref:u,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=i;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});Lw.displayName=cm;var um="SelectScrollDownButton",Iw=T.forwardRef((e,n)=>{const i=Qi(um,e.__scopeSelect),s=ug(um,e.__scopeSelect),[l,h]=T.useState(!1),u=Xe(n,s.onScrollButtonChange);return Yt(()=>{if(i.viewport&&i.isPositioned){let o=function(){const d=c.scrollHeight-c.clientHeight,g=Math.ceil(c.scrollTop)<d;h(g)};const c=i.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[i.viewport,i.isPositioned]),l?m.jsx(Bw,{...e,ref:u,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=i;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});Iw.displayName=um;var Bw=T.forwardRef((e,n)=>{const{__scopeSelect:i,onAutoScroll:s,...l}=e,h=Qi("SelectScrollButton",i),u=T.useRef(null),o=Rd(i),c=T.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return T.useEffect(()=>()=>c(),[c]),Yt(()=>{var g;const d=o().find(f=>f.ref.current===document.activeElement);(g=d==null?void 0:d.ref.current)==null||g.scrollIntoView({block:"nearest"})},[o]),m.jsx(je.div,{"aria-hidden":!0,...l,ref:n,style:{flexShrink:0,...l.style},onPointerDown:we(l.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(s,50))}),onPointerMove:we(l.onPointerMove,()=>{var d;(d=h.onItemLeave)==null||d.call(h),u.current===null&&(u.current=window.setInterval(s,50))}),onPointerLeave:we(l.onPointerLeave,()=>{c()})})}),Nj="SelectSeparator",Mj=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return m.jsx(je.div,{"aria-hidden":!0,...s,ref:n})});Mj.displayName=Nj;var dm="SelectArrow",jj=T.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,l=Dd(i),h=Zi(dm,i),u=Qi(dm,i);return h.open&&u.position==="popper"?m.jsx(bd,{...l,...s,ref:n}):null});jj.displayName=dm;var Oj="SelectBubbleInput",zw=T.forwardRef(({__scopeSelect:e,value:n,...i},s)=>{const l=T.useRef(null),h=Xe(s,l),u=$D(n);return T.useEffect(()=>{const o=l.current;if(!o)return;const c=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(c,"value").set;if(u!==n&&g){const f=new Event("change",{bubbles:!0});g.call(o,n),o.dispatchEvent(f)}},[u,n]),m.jsx(je.select,{...i,style:{...Jx,...i.style},ref:h,defaultValue:n})});zw.displayName=Oj;function Pw(e){return e===""||e===void 0}function Fw(e){const n=rn(e),i=T.useRef(""),s=T.useRef(0),l=T.useCallback(u=>{const o=i.current+u;n(o),(function c(d){i.current=d,window.clearTimeout(s.current),d!==""&&(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 Hw(e,n,i){const l=n.length>1&&Array.from(n).every(d=>d===n[0])?n[0]:n,h=i?e.indexOf(i):-1;let u=Lj(e,Math.max(h,0));l.length===1&&(u=u.filter(d=>d!==i));const c=u.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return c!==i?c:void 0}function Lj(e,n){return e.map((i,s)=>e[(n+s)%e.length])}var Ij=pw,Bj=gw,zj=_w,Pj=yw,Fj=bw,Hj=xw,Uj=kw,$j=Aw,qj=Rw,Vj=Nw,Gj=Mw,Wj=Ow,Kj=Lw,Yj=Iw,Xj="Separator",m0="horizontal",Zj=["horizontal","vertical"],Uw=T.forwardRef((e,n)=>{const{decorative:i,orientation:s=m0,...l}=e,h=Qj(s)?s:m0,o=i?{role:"none"}:{"aria-orientation":h==="vertical"?h:void 0,role:"separator"};return m.jsx(je.div,{"data-orientation":h,...o,...l,ref:n})});Uw.displayName=Xj;function Qj(e){return Zj.includes(e)}var Jj=Uw,Nd="Tabs",[e5]=Un(Nd,[xd]),$w=xd(),[t5,dg]=e5(Nd),qw=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,onValueChange:l,defaultValue:h,orientation:u="horizontal",dir:o,activationMode:c="automatic",...d}=e,g=zl(o),[f,b]=si({prop:s,onChange:l,defaultProp:h!=null?h:"",caller:Nd});return m.jsx(t5,{scope:i,baseId:Vt(),value:f,onValueChange:b,orientation:u,dir:g,activationMode:c,children:m.jsx(je.div,{dir:g,"data-orientation":u,...d,ref:n})})});qw.displayName=Nd;var Vw="TabsList",Gw=T.forwardRef((e,n)=>{const{__scopeTabs:i,loop:s=!0,...l}=e,h=dg(Vw,i),u=$w(i);return m.jsx(aS,{asChild:!0,...u,orientation:h.orientation,dir:h.dir,loop:s,children:m.jsx(je.div,{role:"tablist","aria-orientation":h.orientation,...l,ref:n})})});Gw.displayName=Vw;var Ww="TabsTrigger",Kw=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,disabled:l=!1,...h}=e,u=dg(Ww,i),o=$w(i),c=Zw(u.baseId,s),d=Qw(u.baseId,s),g=s===u.value;return m.jsx(oS,{asChild:!0,...o,focusable:!l,active:g,children:m.jsx(je.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":d,"data-state":g?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...h,ref:n,onMouseDown:we(e.onMouseDown,f=>{!l&&f.button===0&&f.ctrlKey===!1?u.onValueChange(s):f.preventDefault()}),onKeyDown:we(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&u.onValueChange(s)}),onFocus:we(e.onFocus,()=>{const f=u.activationMode!=="manual";!g&&!l&&f&&u.onValueChange(s)})})})});Kw.displayName=Ww;var Yw="TabsContent",Xw=T.forwardRef((e,n)=>{const{__scopeTabs:i,value:s,forceMount:l,children:h,...u}=e,o=dg(Yw,i),c=Zw(o.baseId,s),d=Qw(o.baseId,s),g=s===o.value,f=T.useRef(g);return T.useEffect(()=>{const b=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(b)},[]),m.jsx(Xt,{present:l||g,children:({present:b})=>m.jsx(je.div,{"data-state":g?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!b,id:d,tabIndex:0,...u,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:b&&h})})});Xw.displayName=Yw;function Zw(e,n){return`${e}-trigger-${n}`}function Qw(e,n){return`${e}-content-${n}`}var n5=qw,r5=Gw,i5=Kw,s5=Xw,[Md]=Un("Tooltip",[Yi]),jd=Yi(),Jw="TooltipProvider",a5=700,hm="tooltip.open",[o5,hg]=Md(Jw),eC=e=>{const{__scopeTooltip:n,delayDuration:i=a5,skipDelayDuration:s=300,disableHoverableContent:l=!1,children:h}=e,u=T.useRef(!0),o=T.useRef(!1),c=T.useRef(0);return T.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),m.jsx(o5,{scope:n,isOpenDelayedRef:u,delayDuration:i,onOpen:T.useCallback(()=>{window.clearTimeout(c.current),u.current=!1},[]),onClose:T.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>u.current=!0,s)},[s]),isPointerInTransitRef:o,onPointerInTransitChange:T.useCallback(d=>{o.current=d},[]),disableHoverableContent:l,children:h})};eC.displayName=Jw;var Tl="Tooltip",[l5,Wl]=Md(Tl),tC=e=>{const{__scopeTooltip:n,children:i,open:s,defaultOpen:l,onOpenChange:h,disableHoverableContent:u,delayDuration:o}=e,c=hg(Tl,e.__scopeTooltip),d=jd(n),[g,f]=T.useState(null),b=Vt(),S=T.useRef(0),k=u!=null?u:c.disableHoverableContent,w=o!=null?o:c.delayDuration,_=T.useRef(!1),[y,v]=si({prop:s,defaultProp:l!=null?l:!1,onChange:M=>{M?(c.onOpen(),document.dispatchEvent(new CustomEvent(hm))):c.onClose(),h==null||h(M)},caller:Tl}),x=T.useMemo(()=>y?_.current?"delayed-open":"instant-open":"closed",[y]),E=T.useCallback(()=>{window.clearTimeout(S.current),S.current=0,_.current=!1,v(!0)},[v]),N=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)},[]),m.jsx(_d,{...d,children:m.jsx(l5,{scope:n,contentId:b,open:y,stateAttribute:x,trigger:g,onTriggerChange:f,onTriggerEnter:T.useCallback(()=>{c.isOpenDelayedRef.current?R():E()},[c.isOpenDelayedRef,R,E]),onTriggerLeave:T.useCallback(()=>{k?N():(window.clearTimeout(S.current),S.current=0)},[N,k]),onOpen:E,onClose:N,disableHoverableContent:k,children:i})})};tC.displayName=Tl;var fm="TooltipTrigger",nC=T.forwardRef((e,n)=>{const{__scopeTooltip:i,...s}=e,l=Wl(fm,i),h=hg(fm,i),u=jd(i),o=T.useRef(null),c=Xe(n,o,l.onTriggerChange),d=T.useRef(!1),g=T.useRef(!1),f=T.useCallback(()=>d.current=!1,[]);return T.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.jsx(Ul,{asChild:!0,...u,children:m.jsx(je.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...s,ref:c,onPointerMove:we(e.onPointerMove,b=>{b.pointerType!=="touch"&&!g.current&&!h.isPointerInTransitRef.current&&(l.onTriggerEnter(),g.current=!0)}),onPointerLeave:we(e.onPointerLeave,()=>{l.onTriggerLeave(),g.current=!1}),onPointerDown:we(e.onPointerDown,()=>{l.open&&l.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:we(e.onFocus,()=>{d.current||l.onOpen()}),onBlur:we(e.onBlur,l.onClose),onClick:we(e.onClick,l.onClose)})})});nC.displayName=fm;var fg="TooltipPortal",[c5,u5]=Md(fg,{forceMount:void 0}),rC=e=>{const{__scopeTooltip:n,forceMount:i,children:s,container:l}=e,h=Wl(fg,n);return m.jsx(c5,{scope:n,forceMount:i,children:m.jsx(Xt,{present:i||h.open,children:m.jsx(eo,{asChild:!0,container:l,children:s})})})};rC.displayName=fg;var Fa="TooltipContent",iC=T.forwardRef((e,n)=>{const i=u5(Fa,e.__scopeTooltip),{forceMount:s=i.forceMount,side:l="top",...h}=e,u=Wl(Fa,e.__scopeTooltip);return m.jsx(Xt,{present:s||u.open,children:u.disableHoverableContent?m.jsx(sC,{side:l,...h,ref:n}):m.jsx(d5,{side:l,...h,ref:n})})}),d5=T.forwardRef((e,n)=>{const i=Wl(Fa,e.__scopeTooltip),s=hg(Fa,e.__scopeTooltip),l=T.useRef(null),h=Xe(n,l),[u,o]=T.useState(null),{trigger:c,onClose:d}=i,g=l.current,{onPointerInTransitChange:f}=s,b=T.useCallback(()=>{o(null),f(!1)},[f]),S=T.useCallback((k,w)=>{const _=k.currentTarget,y={x:k.clientX,y:k.clientY},v=m5(y,_.getBoundingClientRect()),x=g5(y,v),E=v5(w.getBoundingClientRect()),N=y5([...x,...E]);o(N),f(!0)},[f]);return T.useEffect(()=>()=>b(),[b]),T.useEffect(()=>{if(c&&g){const k=_=>S(_,g),w=_=>S(_,c);return c.addEventListener("pointerleave",k),g.addEventListener("pointerleave",w),()=>{c.removeEventListener("pointerleave",k),g.removeEventListener("pointerleave",w)}}},[c,g,S,b]),T.useEffect(()=>{if(u){const k=w=>{const _=w.target,y={x:w.clientX,y:w.clientY},v=(c==null?void 0:c.contains(_))||(g==null?void 0:g.contains(_)),x=!_5(y,u);v?b():x&&(b(),d())};return document.addEventListener("pointermove",k),()=>document.removeEventListener("pointermove",k)}},[c,g,u,d,b]),m.jsx(sC,{...e,ref:h})}),[h5,f5]=Md(Tl,{isInside:!1}),p5=uR("TooltipContent"),sC=T.forwardRef((e,n)=>{const{__scopeTooltip:i,children:s,"aria-label":l,onEscapeKeyDown:h,onPointerDownOutside:u,...o}=e,c=Wl(Fa,i),d=jd(i),{onClose:g}=c;return T.useEffect(()=>(document.addEventListener(hm,g),()=>document.removeEventListener(hm,g)),[g]),T.useEffect(()=>{if(c.trigger){const f=b=>{const S=b.target;S!=null&&S.contains(c.trigger)&&g()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,g]),m.jsx(Ja,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:u,onFocusOutside:f=>f.preventDefault(),onDismiss:g,children:m.jsxs(yd,{"data-state":c.stateAttribute,...d,...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:[m.jsx(p5,{children:s}),m.jsx(h5,{scope:i,isInside:!0,children:m.jsx(gR,{id:c.contentId,role:"tooltip",children:l||s})})]})})});iC.displayName=Fa;var aC="TooltipArrow",oC=T.forwardRef((e,n)=>{const{__scopeTooltip:i,...s}=e,l=jd(i);return f5(aC,i).isInside?null:m.jsx(bd,{...l,...s,ref:n})});oC.displayName=aC;function m5(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 g5(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 v5(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 _5(e,n){const{x:i,y:s}=e;let l=!1;for(let h=0,u=n.length-1;h<n.length;u=h++){const o=n[h],c=n[u],d=o.x,g=o.y,f=c.x,b=c.y;g>s!=b>s&&i<(f-d)*(s-g)/(b-g)+d&&(l=!l)}return l}function y5(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),b5(n)}function b5(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],u=n[n.length-2];if((h.x-u.x)*(l.y-u.y)>=(h.y-u.y)*(l.x-u.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],u=i[i.length-2];if((h.x-u.x)*(l.y-u.y)>=(h.y-u.y)*(l.x-u.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 x5=eC,S5=tC,w5=nC,C5=rC,k5=iC,E5=oC;const A5=(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},T5=(e,n)=>({classGroupId:e,validator:n}),lC=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),Qu="-",g0=[],R5="arbitrary..",D5=e=>{const n=M5(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return N5(u);const o=u.split(Qu),c=o[0]===""&&o.length>1?1:0;return cC(o,c,n)},getConflictingClassGroupIds:(u,o)=>{if(o){const c=s[u],d=i[u];return c?d?A5(d,c):c:d||g0}return i[u]||g0}}},cC=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],h=i.nextPart.get(l);if(h){const d=cC(e,n+1,h);if(d)return d}const u=i.validators;if(u===null)return;const o=n===0?e.join(Qu):e.slice(n).join(Qu),c=u.length;for(let d=0;d<c;d++){const g=u[d];if(g.validator(o))return g.classGroupId}},N5=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?R5+s:void 0})(),M5=e=>{const{theme:n,classGroups:i}=e;return j5(i,n)},j5=(e,n)=>{const i=lC();for(const s in e){const l=e[s];pg(l,i,s,n)}return i},pg=(e,n,i,s)=>{const l=e.length;for(let h=0;h<l;h++){const u=e[h];O5(u,n,i,s)}},O5=(e,n,i,s)=>{if(typeof e=="string"){L5(e,n,i);return}if(typeof e=="function"){I5(e,n,i,s);return}B5(e,n,i,s)},L5=(e,n,i)=>{const s=e===""?n:uC(n,e);s.classGroupId=i},I5=(e,n,i,s)=>{if(z5(e)){pg(e(s),n,i,s);return}n.validators===null&&(n.validators=[]),n.validators.push(T5(i,e))},B5=(e,n,i,s)=>{const l=Object.entries(e),h=l.length;for(let u=0;u<h;u++){const[o,c]=l[u];pg(c,uC(n,o),i,s)}},uC=(e,n)=>{let i=e;const s=n.split(Qu),l=s.length;for(let h=0;h<l;h++){const u=s[h];let o=i.nextPart.get(u);o||(o=lC(),i.nextPart.set(u,o)),i=o}return i},z5=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,P5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),s=Object.create(null);const l=(h,u)=>{i[h]=u,n++,n>e&&(n=0,s=i,i=Object.create(null))};return{get(h){let u=i[h];if(u!==void 0)return u;if((u=s[h])!==void 0)return l(h,u),u},set(h,u){h in i?i[h]=u:l(h,u)}}},pm="!",v0=":",F5=[],_0=(e,n,i,s,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:s,isExternal:l}),H5=e=>{const{prefix:n,experimentalParseClassName:i}=e;let s=l=>{const h=[];let u=0,o=0,c=0,d;const g=l.length;for(let w=0;w<g;w++){const _=l[w];if(u===0&&o===0){if(_===v0){h.push(l.slice(c,w)),c=w+1;continue}if(_==="/"){d=w;continue}}_==="["?u++:_==="]"?u--:_==="("?o++:_===")"&&o--}const f=h.length===0?l:l.slice(c);let b=f,S=!1;f.endsWith(pm)?(b=f.slice(0,-1),S=!0):f.startsWith(pm)&&(b=f.slice(1),S=!0);const k=d&&d>c?d-c:void 0;return _0(h,S,b,k)};if(n){const l=n+v0,h=s;s=u=>u.startsWith(l)?h(u.slice(l.length)):_0(F5,!1,u,void 0,!0)}if(i){const l=s;s=h=>i({className:h,parseClassName:l})}return s},U5=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 u=i[h],o=u[0]==="[",c=n.has(u);o||c?(l.length>0&&(l.sort(),s.push(...l),l=[]),s.push(u)):l.push(u)}return l.length>0&&(l.sort(),s.push(...l)),s}},$5=e=>({cache:P5(e.cacheSize),parseClassName:H5(e),sortModifiers:U5(e),...D5(e)}),q5=/\s+/,V5=(e,n)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:l,sortModifiers:h}=n,u=[],o=e.trim().split(q5);let c="";for(let d=o.length-1;d>=0;d-=1){const g=o[d],{isExternal:f,modifiers:b,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:w}=i(g);if(f){c=g+(c.length>0?" "+c:c);continue}let _=!!w,y=s(_?k.substring(0,w):k);if(!y){if(!_){c=g+(c.length>0?" "+c:c);continue}if(y=s(k),!y){c=g+(c.length>0?" "+c:c);continue}_=!1}const v=b.length===0?"":b.length===1?b[0]:h(b).join(":"),x=S?v+pm:v,E=x+y;if(u.indexOf(E)>-1)continue;u.push(E);const N=l(y,_);for(let R=0;R<N.length;++R){const M=N[R];u.push(x+M)}c=g+(c.length>0?" "+c:c)}return c},G5=(...e)=>{let n=0,i,s,l="";for(;n<e.length;)(i=e[n++])&&(s=dC(i))&&(l&&(l+=" "),l+=s);return l},dC=e=>{if(typeof e=="string")return e;let n,i="";for(let s=0;s<e.length;s++)e[s]&&(n=dC(e[s]))&&(i&&(i+=" "),i+=n);return i},W5=(e,...n)=>{let i,s,l,h;const u=c=>{const d=n.reduce((g,f)=>f(g),e());return i=$5(d),s=i.cache.get,l=i.cache.set,h=o,o(c)},o=c=>{const d=s(c);if(d)return d;const g=V5(c,i);return l(c,g),g};return h=u,(...c)=>h(G5(...c))},K5=[],qt=e=>{const n=i=>i[e]||K5;return n.isThemeGetter=!0,n},hC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Y5=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,X5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Z5=/\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$/,Q5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,J5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,e4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pi=e=>Y5.test(e),Ye=e=>!!e&&!Number.isNaN(Number(e)),Fi=e=>!!e&&Number.isInteger(Number(e)),xp=e=>e.endsWith("%")&&Ye(e.slice(0,-1)),Zr=e=>X5.test(e),pC=()=>!0,t4=e=>Z5.test(e)&&!Q5.test(e),mg=()=>!1,n4=e=>J5.test(e),r4=e=>e4.test(e),i4=e=>!Te(e)&&!De(e),s4=e=>Ji(e,vC,mg),Te=e=>hC.test(e),Ss=e=>Ji(e,_C,t4),y0=e=>Ji(e,f4,Ye),a4=e=>Ji(e,bC,pC),o4=e=>Ji(e,yC,mg),b0=e=>Ji(e,mC,mg),l4=e=>Ji(e,gC,r4),Cu=e=>Ji(e,xC,n4),De=e=>fC.test(e),ll=e=>Os(e,_C),c4=e=>Os(e,yC),x0=e=>Os(e,mC),u4=e=>Os(e,vC),d4=e=>Os(e,gC),ku=e=>Os(e,xC,!0),h4=e=>Os(e,bC,!0),Ji=(e,n,i)=>{const s=hC.exec(e);return s?s[1]?n(s[1]):i(s[2]):!1},Os=(e,n,i=!1)=>{const s=fC.exec(e);return s?s[1]?n(s[1]):i:!1},mC=e=>e==="position"||e==="percentage",gC=e=>e==="image"||e==="url",vC=e=>e==="length"||e==="size"||e==="bg-size",_C=e=>e==="length",f4=e=>e==="number",yC=e=>e==="family-name",bC=e=>e==="number"||e==="weight",xC=e=>e==="shadow",p4=()=>{const e=qt("color"),n=qt("font"),i=qt("text"),s=qt("font-weight"),l=qt("tracking"),h=qt("leading"),u=qt("breakpoint"),o=qt("container"),c=qt("spacing"),d=qt("radius"),g=qt("shadow"),f=qt("inset-shadow"),b=qt("text-shadow"),S=qt("drop-shadow"),k=qt("blur"),w=qt("perspective"),_=qt("aspect"),y=qt("ease"),v=qt("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"],N=()=>[...E(),De,Te],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],D=()=>[De,Te,c],O=()=>[Pi,"full","auto",...D()],P=()=>[Fi,"none","subgrid",De,Te],$=()=>["auto",{span:["full",Fi,De,Te]},Fi,De,Te],U=()=>[Fi,"auto",De,Te],q=()=>["auto","min","max","fr",De,Te],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...D()],J=()=>[Pi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],ne=()=>[Pi,"screen","full","dvw","lvw","svw","min","max","fit",...D()],F=()=>[Pi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],j=()=>[e,De,Te],I=()=>[...E(),x0,b0,{position:[De,Te]}],L=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",u4,s4,{size:[De,Te]}],Z=()=>[xp,ll,Ss],X=()=>["","none","full",d,De,Te],ee=()=>["",Ye,ll,Ss],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"],te=()=>[Ye,xp,x0,b0],ae=()=>["","none",k,De,Te],pe=()=>["none",Ye,De,Te],ce=()=>["none",Ye,De,Te],Oe=()=>[Ye,De,Te],Ie=()=>[Pi,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zr],breakpoint:[Zr],color:[pC],container:[Zr],"drop-shadow":[Zr],ease:["in","out","in-out"],font:[i4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zr],shadow:[Zr],spacing:["px",Ye],text:[Zr],"text-shadow":[Zr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pi,Te,De,_]}],container:["container"],columns:[{columns:[Ye,Te,De,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:N()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],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:[Fi,"auto",De,Te]}],basis:[{basis:[Pi,"full","auto",o,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,Pi,"auto","initial","none",Te]}],grow:[{grow:["",Ye,De,Te]}],shrink:[{shrink:["",Ye,De,Te]}],order:[{order:[Fi,"first","last","none",De,Te]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],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:J()}],"inline-size":[{inline:["auto",...ne()]}],"min-inline-size":[{"min-inline":["auto",...ne()]}],"max-inline-size":[{"max-inline":["none",...ne()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[o,"screen",...J()]}],"min-w":[{"min-w":[o,"screen","none",...J()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[u]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",i,ll,Ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,h4,a4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",xp,Te]}],"font-family":[{font:[c4,o4,n]}],"font-features":[{"font-features":[Te]}],"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,De,Te]}],"line-clamp":[{"line-clamp":[Ye,"none",De,y0]}],leading:[{leading:[h,...D()]}],"list-image":[{"list-image":["none",De,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",De,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",De,Ss]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[Ye,"auto",De,Te]}],"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",De,Te]}],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",De,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fi,De,Te],radial:["",De,Te],conic:[Fi,De,Te]},d4,l4]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,De,Te]}],"outline-w":[{outline:["",Ye,ll,Ss]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",g,ku,Cu]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",f,ku,Cu]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[Ye,Ss]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",b,ku,Cu]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[Ye,De,Te]}],"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":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[De,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"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":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",De,Te]}],filter:[{filter:["","none",De,Te]}],blur:[{blur:ae()}],brightness:[{brightness:[Ye,De,Te]}],contrast:[{contrast:[Ye,De,Te]}],"drop-shadow":[{"drop-shadow":["","none",S,ku,Cu]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",Ye,De,Te]}],"hue-rotate":[{"hue-rotate":[Ye,De,Te]}],invert:[{invert:["",Ye,De,Te]}],saturate:[{saturate:[Ye,De,Te]}],sepia:[{sepia:["",Ye,De,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",De,Te]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,De,Te]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,De,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,De,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,De,Te]}],"backdrop-invert":[{"backdrop-invert":["",Ye,De,Te]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,De,Te]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,De,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,De,Te]}],"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",De,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",De,Te]}],ease:[{ease:["linear","initial",y,De,Te]}],delay:[{delay:[Ye,De,Te]}],animate:[{animate:["none",v,De,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,De,Te]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:Oe()}],"skew-x":[{"skew-x":Oe()}],"skew-y":[{"skew-y":Oe()}],transform:[{transform:[De,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"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:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"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",De,Te]}],"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",De,Te]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[Ye,ll,Ss,y0]}],stroke:[{stroke:["none",...j()]}],"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"]}},m4=W5(p4);function _e(...e){return m4(od(e))}const g4=Qa("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 ke({className:e,variant:n="default",size:i="default",asChild:s=!1,...l}){const h=s?Bl:"button";return m.jsx(h,{"data-slot":"button","data-variant":n,"data-size":i,className:_e(g4({variant:n,size:i,className:e})),...l})}function Kl(){return{fetchWithAuth:T.useCallback(async(n,i={},s)=>{const{serverUrl:l,token:h}=s||{};let u=n;n.startsWith("/")&&l&&(u=`http://${l}${n}`);const o=new Headers(i.headers||{});return h&&o.set("Authorization",`Bearer ${h}`),fetch(u,{...i,headers:o})},[])}}function io({...e}){return m.jsx(Pm,{"data-slot":"dialog",...e})}function v4({...e}){return m.jsx(Fm,{"data-slot":"dialog-portal",...e})}function _4({...e}){return m.jsx(fd,{"data-slot":"dialog-close",...e})}function y4({className:e,...n}){return m.jsx(Hm,{"data-slot":"dialog-overlay",className:_e("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 so({className:e,children:n,showCloseButton:i=!0,...s}){return m.jsxs(v4,{children:[m.jsx(y4,{}),m.jsxs(Um,{"data-slot":"dialog-content",className:_e("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&&m.jsx(fd,{"data-slot":"dialog-close",asChild:!0,children:m.jsxs(ke,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[m.jsx(ei,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function ao({className:e,...n}){return m.jsx("div",{"data-slot":"dialog-header",className:_e("flex flex-col gap-2",e),...n})}function Od({className:e,showCloseButton:n=!1,children:i,...s}){return m.jsxs("div",{"data-slot":"dialog-footer",className:_e("-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&&m.jsx(fd,{asChild:!0,children:m.jsx(ke,{variant:"outline",children:"Close"})})]})}function oo({className:e,...n}){return m.jsx(M1,{"data-slot":"dialog-title",className:_e("text-base leading-none font-medium",e),...n})}function Yl({className:e,...n}){return m.jsx(j1,{"data-slot":"dialog-description",className:_e("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...n})}function Iu({className:e,type:n,...i}){return m.jsx("input",{type:n,"data-slot":"input",className:_e("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 lo=T.forwardRef(({className:e,children:n,...i},s)=>m.jsxs(hj,{"data-slot":"scroll-area",className:_e("relative overflow-hidden",e),...i,children:[m.jsx(fj,{ref:s,"data-slot":"scroll-area-viewport",className:"size-full min-w-0 rounded-[inherit] outline-none",style:{WebkitOverflowScrolling:"touch"},children:n}),m.jsx(b4,{}),m.jsx(pj,{})]}));lo.displayName="ScrollArea";function b4({className:e,orientation:n="vertical",...i}){return m.jsx(sw,{"data-slot":"scroll-area-scrollbar","data-orientation":n,orientation:n,className:_e("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:m.jsx(cw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}function x4(e){const i=e.replace(/\\/g,"/").split("/");return i.pop(),i.join("/")||"/"}function S4({open:e,onOpenChange:n,onSelect:i,initialPath:s,title:l="Select Folder"}){const[h,u]=T.useState(s||""),[o,c]=T.useState([]),[d,g]=T.useState(!1),[f,b]=T.useState(0),[S,k]=T.useState(null),[w,_]=T.useState(""),y=T.useRef(null),v=T.useRef(null),{fetchWithAuth:x}=Kl(),{activeServer:E}=Za(),N=T.useCallback(async U=>{g(!0),k(null),b(0),_("");try{const q=await x(`/api/fs/browse?path=${encodeURIComponent(U)}`,{},{serverUrl:E==null?void 0:E.url,token:E==null?void 0:E.token}),Y=await q.json();if(!q.ok)throw new Error(Y.message||"Failed to browse directory");const K=Y.files.filter(V=>V.type==="directory");c(K),u(Y.currentPath)}catch(q){k(q instanceof Error?q.message:"Failed to load directory"),c([])}finally{g(!1)}},[x,E]);T.useEffect(()=>{e&&N(s||"")},[e,s,N]),T.useEffect(()=>{b(0)},[w]);const R=o.filter(U=>U.name.toLowerCase().includes(w.toLowerCase())),M=()=>{const U=x4(h);U!==h&&N(U)},D=()=>{h&&(i(h),n(!1))},O=U=>{const q=h?`${h}/${U.name}`:U.name;N(q)},P=U=>{if(R.length!==0)switch(U.key){case"ArrowDown":U.preventDefault(),b(q=>Math.min(q+1,R.length-1));break;case"ArrowUp":U.preventDefault(),b(q=>Math.max(q-1,0));break;case"Enter":U.preventDefault(),R[f]&&O(R[f]);break;case"Escape":w&&(U.preventDefault(),_(""));break}};T.useEffect(()=>{if(v.current&&R.length>0){const U=v.current.children[f];U&&U.scrollIntoView({block:"nearest"})}},[f,R.length]),T.useEffect(()=>{e&&setTimeout(()=>{var U;return(U=y.current)==null?void 0:U.focus()},100)},[e]);const $=(U,q=50)=>{if(U.length<=q)return U;const Y=U.split("/");return Y.length<=2?U:".../"+Y.slice(-2).join("/")};return m.jsx(io,{open:e,onOpenChange:n,children:m.jsxs(so,{className:"sm:max-w-lg",onKeyDown:P,children:[m.jsx(ao,{children:m.jsx(oo,{children:l})}),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[m.jsx(ke,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:M,disabled:d||!h,children:m.jsx(SA,{className:"w-4 h-4"})}),m.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:h,children:$(h)||"Home"})]}),m.jsxs("div",{className:"relative",children:[m.jsx(Nm,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),m.jsx(Iu,{ref:y,placeholder:"Filter folders...",value:w,onChange:U=>_(U.target.value),className:"pl-8"})]}),m.jsx(lo,{className:"h-64 border rounded-md",children:d?m.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[m.jsx(Pn,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):S?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[m.jsx("span",{className:"text-destructive",children:S}),m.jsx(ke,{variant:"ghost",size:"sm",onClick:()=>N(h),className:"mt-2",children:"Retry"})]}):R.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[m.jsx(qi,{className:"w-8 h-8 mb-2 opacity-50"}),w?"No matching folders":"No folders in this directory"]}):m.jsx("div",{className:"p-1",ref:v,children:R.map((U,q)=>m.jsxs("button",{onClick:()=>{b(q)},onDoubleClick:()=>O(U),className:_e("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",q===f&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[m.jsx(qi,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),m.jsx("span",{className:"truncate flex-1",children:U.name}),q===f&&m.jsx(ni,{className:"w-4 h-4 text-primary"})]},U.path))})}),S&&m.jsx("p",{className:"text-xs text-destructive",children:S})]}),m.jsxs(Od,{children:[m.jsx(ke,{variant:"outline",onClick:()=>n(!1),children:"Cancel"}),m.jsx(ke,{onClick:D,disabled:!h||d,children:"Use This Folder"})]})]})})}var S0=1,w4=.9,C4=.8,k4=.17,Sp=.1,wp=.999,E4=.9999,A4=.99,T4=/[\\\/_+.#"@\[\(\{&]/,R4=/[\\\/_+.#"@\[\(\{&]/g,D4=/[\s-]/,SC=/[\s-]/g;function mm(e,n,i,s,l,h,u){if(h===n.length)return l===e.length?S0:A4;var o=`${l},${h}`;if(u[o]!==void 0)return u[o];for(var c=s.charAt(h),d=i.indexOf(c,l),g=0,f,b,S,k;d>=0;)f=mm(e,n,i,s,d+1,h+1,u),f>g&&(d===l?f*=S0:T4.test(e.charAt(d-1))?(f*=C4,S=e.slice(l,d-1).match(R4),S&&l>0&&(f*=Math.pow(wp,S.length))):D4.test(e.charAt(d-1))?(f*=w4,k=e.slice(l,d-1).match(SC),k&&l>0&&(f*=Math.pow(wp,k.length))):(f*=k4,l>0&&(f*=Math.pow(wp,d-l))),e.charAt(d)!==n.charAt(h)&&(f*=E4)),(f<Sp&&i.charAt(d-1)===s.charAt(h+1)||s.charAt(h+1)===s.charAt(h)&&i.charAt(d-1)!==s.charAt(h))&&(b=mm(e,n,i,s,d+1,h+2,u),b*Sp>f&&(f=b*Sp)),f>g&&(g=f),d=i.indexOf(c,d+1);return u[o]=g,g}function w0(e){return e.toLowerCase().replace(SC," ")}function N4(e,n,i){return e=i&&i.length>0?`${e+" "+i.join(" ")}`:e,mm(e,n,w0(e),w0(n),0,0,{})}var cl='[cmdk-group=""]',Cp='[cmdk-group-items=""]',M4='[cmdk-group-heading=""]',wC='[cmdk-item=""]',C0=`${wC}:not([aria-disabled="true"])`,gm="cmdk-item-select",Aa="data-value",j4=(e,n,i)=>N4(e,n,i),CC=T.createContext(void 0),Xl=()=>T.useContext(CC),kC=T.createContext(void 0),gg=()=>T.useContext(kC),EC=T.createContext(void 0),AC=T.forwardRef((e,n)=>{let i=Ta(()=>{var L,z;return{search:"",value:(z=(L=e.value)!=null?L:e.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),s=Ta(()=>new Set),l=Ta(()=>new Map),h=Ta(()=>new Map),u=Ta(()=>new Set),o=TC(e),{label:c,children:d,value:g,onValueChange:f,filter:b,shouldFilter:S,loop:k,disablePointerSelection:w=!1,vimBindings:_=!0,...y}=e,v=Vt(),x=Vt(),E=Vt(),N=T.useRef(null),R=q4();Ds(()=>{if(g!==void 0){let L=g.trim();i.current.value=L,M.emit()}},[g]),Ds(()=>{R(6,q)},[]);let M=T.useMemo(()=>({subscribe:L=>(u.current.add(L),()=>u.current.delete(L)),snapshot:()=>i.current,setState:(L,z,Z)=>{var X,ee,W,H;if(!Object.is(i.current[L],z)){if(i.current[L]=z,L==="search")U(),P(),R(1,$);else if(L==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(E);te?te.focus():(X=document.getElementById(v))==null||X.focus()}if(R(7,()=>{var te;i.current.selectedItemId=(te=Y())==null?void 0:te.id,M.emit()}),Z||R(5,q),((ee=o.current)==null?void 0:ee.value)!==void 0){let te=z!=null?z:"";(H=(W=o.current).onValueChange)==null||H.call(W,te);return}}M.emit()}},emit:()=>{u.current.forEach(L=>L())}}),[]),D=T.useMemo(()=>({value:(L,z,Z)=>{var X;z!==((X=h.current.get(L))==null?void 0:X.value)&&(h.current.set(L,{value:z,keywords:Z}),i.current.filtered.items.set(L,O(z,Z)),R(2,()=>{P(),M.emit()}))},item:(L,z)=>(s.current.add(L),z&&(l.current.has(z)?l.current.get(z).add(L):l.current.set(z,new Set([L]))),R(3,()=>{U(),P(),i.current.value||$(),M.emit()}),()=>{h.current.delete(L),s.current.delete(L),i.current.filtered.items.delete(L);let Z=Y();R(4,()=>{U(),(Z==null?void 0:Z.getAttribute("id"))===L&&$(),M.emit()})}),group:L=>(l.current.has(L)||l.current.set(L,new Set),()=>{h.current.delete(L),l.current.delete(L)}),filter:()=>o.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:E,labelId:x,listInnerRef:N}),[]);function O(L,z){var Z,X;let ee=(X=(Z=o.current)==null?void 0:Z.filter)!=null?X:j4;return L?ee(L,i.current.search,z):0}function P(){if(!i.current.search||o.current.shouldFilter===!1)return;let L=i.current.filtered.items,z=[];i.current.filtered.groups.forEach(X=>{let ee=l.current.get(X),W=0;ee.forEach(H=>{let te=L.get(H);W=Math.max(te,W)}),z.push([X,W])});let Z=N.current;K().sort((X,ee)=>{var W,H;let te=X.getAttribute("id"),ae=ee.getAttribute("id");return((W=L.get(ae))!=null?W:0)-((H=L.get(te))!=null?H:0)}).forEach(X=>{let ee=X.closest(Cp);ee?ee.appendChild(X.parentElement===ee?X:X.closest(`${Cp} > *`)):Z.appendChild(X.parentElement===Z?X:X.closest(`${Cp} > *`))}),z.sort((X,ee)=>ee[1]-X[1]).forEach(X=>{var ee;let W=(ee=N.current)==null?void 0:ee.querySelector(`${cl}[${Aa}="${encodeURIComponent(X[0])}"]`);W==null||W.parentElement.appendChild(W)})}function $(){let L=K().find(Z=>Z.getAttribute("aria-disabled")!=="true"),z=L==null?void 0:L.getAttribute(Aa);M.setState("value",z||void 0)}function U(){var L,z,Z,X;if(!i.current.search||o.current.shouldFilter===!1){i.current.filtered.count=s.current.size;return}i.current.filtered.groups=new Set;let ee=0;for(let W of s.current){let H=(z=(L=h.current.get(W))==null?void 0:L.value)!=null?z:"",te=(X=(Z=h.current.get(W))==null?void 0:Z.keywords)!=null?X:[],ae=O(H,te);i.current.filtered.items.set(W,ae),ae>0&&ee++}for(let[W,H]of l.current)for(let te of H)if(i.current.filtered.items.get(te)>0){i.current.filtered.groups.add(W);break}i.current.filtered.count=ee}function q(){var L,z,Z;let X=Y();X&&(((L=X.parentElement)==null?void 0:L.firstChild)===X&&((Z=(z=X.closest(cl))==null?void 0:z.querySelector(M4))==null||Z.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function Y(){var L;return(L=N.current)==null?void 0:L.querySelector(`${wC}[aria-selected="true"]`)}function K(){var L;return Array.from(((L=N.current)==null?void 0:L.querySelectorAll(C0))||[])}function V(L){let z=K()[L];z&&M.setState("value",z.getAttribute(Aa))}function J(L){var z;let Z=Y(),X=K(),ee=X.findIndex(H=>H===Z),W=X[ee+L];(z=o.current)!=null&&z.loop&&(W=ee+L<0?X[X.length-1]:ee+L===X.length?X[0]:X[ee+L]),W&&M.setState("value",W.getAttribute(Aa))}function ne(L){let z=Y(),Z=z==null?void 0:z.closest(cl),X;for(;Z&&!X;)Z=L>0?U4(Z,cl):$4(Z,cl),X=Z==null?void 0:Z.querySelector(C0);X?M.setState("value",X.getAttribute(Aa)):J(L)}let F=()=>V(K().length-1),j=L=>{L.preventDefault(),L.metaKey?F():L.altKey?ne(1):J(1)},I=L=>{L.preventDefault(),L.metaKey?V(0):L.altKey?ne(-1):J(-1)};return T.createElement(je.div,{ref:n,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:L=>{var z;(z=y.onKeyDown)==null||z.call(y,L);let Z=L.nativeEvent.isComposing||L.keyCode===229;if(!(L.defaultPrevented||Z))switch(L.key){case"n":case"j":{_&&L.ctrlKey&&j(L);break}case"ArrowDown":{j(L);break}case"p":case"k":{_&&L.ctrlKey&&I(L);break}case"ArrowUp":{I(L);break}case"Home":{L.preventDefault(),V(0);break}case"End":{L.preventDefault(),F();break}case"Enter":{L.preventDefault();let X=Y();if(X){let ee=new Event(gm);X.dispatchEvent(ee)}}}}},T.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:G4},c),Ld(e,L=>T.createElement(kC.Provider,{value:M},T.createElement(CC.Provider,{value:D},L))))}),O4=T.forwardRef((e,n)=>{var i,s;let l=Vt(),h=T.useRef(null),u=T.useContext(EC),o=Xl(),c=TC(e),d=(s=(i=c.current)==null?void 0:i.forceMount)!=null?s:u==null?void 0:u.forceMount;Ds(()=>{if(!d)return o.item(l,u==null?void 0:u.id)},[d]);let g=RC(l,h,[e.value,e.children,h],e.keywords),f=gg(),b=Ki(R=>R.value&&R.value===g.current),S=Ki(R=>d||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(gm,k),()=>R.removeEventListener(gm,k)},[S,e.onSelect,e.disabled]);function k(){var R,M;w(),(M=(R=c.current).onSelect)==null||M.call(R,g.current)}function w(){f.setState("value",g.current,!0)}if(!S)return null;let{disabled:_,value:y,onSelect:v,forceMount:x,keywords:E,...N}=e;return T.createElement(je.div,{ref:ii(h,n),...N,id:l,"cmdk-item":"",role:"option","aria-disabled":!!_,"aria-selected":!!b,"data-disabled":!!_,"data-selected":!!b,onPointerMove:_||o.getDisablePointerSelection()?void 0:w,onClick:_?void 0:k},e.children)}),L4=T.forwardRef((e,n)=>{let{heading:i,children:s,forceMount:l,...h}=e,u=Vt(),o=T.useRef(null),c=T.useRef(null),d=Vt(),g=Xl(),f=Ki(S=>l||g.filter()===!1?!0:S.search?S.filtered.groups.has(u):!0);Ds(()=>g.group(u),[]),RC(u,o,[e.value,e.heading,c]);let b=T.useMemo(()=>({id:u,forceMount:l}),[l]);return T.createElement(je.div,{ref:ii(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:d},i),Ld(e,S=>T.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?d:void 0},T.createElement(EC.Provider,{value:b},S))))}),I4=T.forwardRef((e,n)=>{let{alwaysRender:i,...s}=e,l=T.useRef(null),h=Ki(u=>!u.search);return!i&&!h?null:T.createElement(je.div,{ref:ii(l,n),...s,"cmdk-separator":"",role:"separator"})}),B4=T.forwardRef((e,n)=>{let{onValueChange:i,...s}=e,l=e.value!=null,h=gg(),u=Ki(d=>d.search),o=Ki(d=>d.selectedItemId),c=Xl();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:u,onChange:d=>{l||h.setState("search",d.target.value),i==null||i(d.target.value)}})}),z4=T.forwardRef((e,n)=>{let{children:i,label:s="Suggestions",...l}=e,h=T.useRef(null),u=T.useRef(null),o=Ki(d=>d.selectedItemId),c=Xl();return T.useEffect(()=>{if(u.current&&h.current){let d=u.current,g=h.current,f,b=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let S=d.offsetHeight;g.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return b.observe(d),()=>{cancelAnimationFrame(f),b.unobserve(d)}}},[]),T.createElement(je.div,{ref:ii(h,n),...l,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":s,id:c.listId},Ld(e,d=>T.createElement("div",{ref:ii(u,c.listInnerRef),"cmdk-list-sizer":""},d)))}),P4=T.forwardRef((e,n)=>{let{open:i,onOpenChange:s,overlayClassName:l,contentClassName:h,container:u,...o}=e;return T.createElement(Pm,{open:i,onOpenChange:s},T.createElement(Fm,{container:u},T.createElement(Hm,{"cmdk-overlay":"",className:l}),T.createElement(Um,{"aria-label":e.label,"cmdk-dialog":"",className:h},T.createElement(AC,{ref:n,...o}))))}),F4=T.forwardRef((e,n)=>Ki(i=>i.filtered.count===0)?T.createElement(je.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),H4=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},Ld(e,u=>T.createElement("div",{"aria-hidden":!0},u)))}),Ls=Object.assign(AC,{List:z4,Item:O4,Input:B4,Group:L4,Separator:I4,Dialog:P4,Empty:F4,Loading:H4});function U4(e,n){let i=e.nextElementSibling;for(;i;){if(i.matches(n))return i;i=i.nextElementSibling}}function $4(e,n){let i=e.previousElementSibling;for(;i;){if(i.matches(n))return i;i=i.previousElementSibling}}function TC(e){let n=T.useRef(e);return Ds(()=>{n.current=e}),n}var Ds=typeof window>"u"?T.useEffect:T.useLayoutEffect;function Ta(e){let n=T.useRef();return n.current===void 0&&(n.current=e()),n}function Ki(e){let n=gg(),i=()=>e(n.snapshot());return T.useSyncExternalStore(n.subscribe,i,i)}function RC(e,n,i,s=[]){let l=T.useRef(),h=Xl();return Ds(()=>{var u;let o=(()=>{var d;for(let g of i){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(d=g.current.textContent)==null?void 0:d.trim():l.current}})(),c=s.map(d=>d.trim());h.value(e,o,c),(u=n.current)==null||u.setAttribute(Aa,o),l.current=o}),l}var q4=()=>{let[e,n]=T.useState(),i=Ta(()=>new Map);return Ds(()=>{i.current.forEach(s=>s()),i.current=new Map},[e]),(s,l)=>{i.current.set(s,l),n({})}};function V4(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function Ld({asChild:e,children:n},i){return e&&T.isValidElement(n)?T.cloneElement(V4(n),{ref:n.ref},i(n.props.children)):i(n)}var G4={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function W4({className:e,...n}){return m.jsx("textarea",{"data-slot":"textarea",className:_e("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 K4({className:e,...n}){return m.jsx("div",{"data-slot":"input-group",role:"group",className:_e("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 Y4=Qa("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 X4({className:e,align:n="inline-start",...i}){return m.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":n,className:_e(Y4({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 vg({className:e,...n}){return m.jsx(Ls,{"data-slot":"command",className:_e("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...n})}function DC({className:e,...n}){return m.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:m.jsxs(K4,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[m.jsx(Ls.Input,{"data-slot":"command-input",className:_e("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n}),m.jsx(X4,{children:m.jsx(Nm,{className:"size-4 shrink-0 opacity-50"})})]})})}function _g({className:e,...n}){return m.jsx(Ls.List,{"data-slot":"command-list",className:_e("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...n})}function yg({className:e,...n}){return m.jsx(Ls.Empty,{"data-slot":"command-empty",className:_e("py-6 text-center text-sm",e),...n})}function Rl({className:e,...n}){return m.jsx(Ls.Group,{"data-slot":"command-group",className:_e("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 NC({className:e,...n}){return m.jsx(Ls.Separator,{"data-slot":"command-separator",className:_e("-mx-1 h-px bg-border",e),...n})}function Oa({className:e,children:n,...i}){return m.jsxs(Ls.Item,{"data-slot":"command-item",className:_e("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,m.jsx(ni,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function Id({...e}){return m.jsx(U3,{"data-slot":"popover",...e})}function bg({...e}){return m.jsx(q3,{"data-slot":"popover-trigger",...e})}function Bd({className:e,align:n="center",sideOffset:i=4,...s}){return m.jsx(V3,{children:m.jsx(G3,{"data-slot":"popover-content",align:n,sideOffset:i,className:_e("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 Z4({...e}){return m.jsx($3,{"data-slot":"popover-anchor",...e})}function Q4({workspaces:e,activeWorkspace:n,onSelectWorkspace:i,onCreateVirtualWorkspace:s,onCreatePhysicalWorkspace:l,isWorkspaceFavorited:h,onToggleFavorite:u}){const[o,c]=T.useState(!1),[d,g]=T.useState(!1);return m.jsxs(m.Fragment,{children:[m.jsxs(Id,{open:o,onOpenChange:c,children:[m.jsx(bg,{asChild:!0,children:m.jsxs(ke,{variant:"outline",role:"combobox","aria-expanded":o,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[m.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[n!=null&&n.isVirtual?m.jsx(Yp,{className:"size-4 flex-shrink-0 text-muted-foreground"}):m.jsx(qi,{className:"size-4 flex-shrink-0 text-muted-foreground"}),m.jsx("span",{className:"truncate",children:(n==null?void 0:n.name)||"Select workspace"})]}),m.jsx(zx,{className:"ml-auto size-4 shrink-0 opacity-50"})]})}),m.jsx(Bd,{className:"w-[240px] p-0 max-h-[80vh]",children:m.jsxs(vg,{children:[m.jsx(DC,{placeholder:"Search workspace..."}),m.jsxs(_g,{className:"max-h-[50vh] overflow-y-auto",children:[m.jsx(yg,{children:"No workspace found."}),m.jsx(Rl,{heading:"Workspaces",children:e.map(f=>m.jsxs(Oa,{onSelect:()=>{i(f),c(!1)},className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[f.isVirtual?m.jsx(Yp,{className:"size-4 text-muted-foreground"}):m.jsx(qi,{className:"size-4 text-muted-foreground"}),m.jsx("span",{children:f.name})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:b=>{b.stopPropagation(),u(f.id,f.name)},title:h(f.id)?"Remove from favorites":"Add to favorites",children:h(f.id)?m.jsx(Ib,{className:"size-4 fill-primary text-primary"}):m.jsx(Ib,{className:"size-4 text-muted-foreground"})}),m.jsx(ni,{className:_e("size-4",(n==null?void 0:n.id)===f.id?"opacity-100":"opacity-0")})]})]},f.id))}),m.jsx(NC,{}),m.jsxs(Rl,{children:[m.jsxs(Oa,{onSelect:()=>{s(),c(!1)},children:[m.jsx(Xa,{className:"size-4","data-icon":"inline-start"}),"Create virtual workspace"]}),m.jsxs(Oa,{onSelect:()=>{c(!1),g(!0)},children:[m.jsx(qi,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]})]})]})]})})]}),m.jsx(S4,{open:d,onOpenChange:g,onSelect:f=>{l(f),g(!1)},title:"Select Workspace Folder"})]})}function J4({onOpenAddServer:e,onServerSwitch:n}){const[i,s]=T.useState(!1),{servers:l,activeServer:h,switchServer:u}=Za();return m.jsxs(Id,{open:i,onOpenChange:s,children:[m.jsx(bg,{asChild:!0,children:m.jsxs(ke,{variant:"outline",role:"combobox","aria-expanded":i,"aria-label":"Select server",className:"w-full justify-between h-9",children:[m.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[m.jsx(ks,{className:"size-4 flex-shrink-0 text-muted-foreground"}),m.jsx("span",{className:"truncate",children:(h==null?void 0:h.name)||"Select server"})]}),m.jsx(zx,{className:"ml-auto size-4 shrink-0 opacity-50"})]})}),m.jsx(Bd,{className:"w-[240px] p-0 max-h-[80vh]",children:m.jsxs(vg,{children:[m.jsx(DC,{placeholder:"Search server..."}),m.jsxs(_g,{className:"max-h-[50vh] overflow-y-auto",children:[m.jsx(yg,{children:"No server found."}),m.jsx(Rl,{heading:"Servers",children:l.map(o=>m.jsxs(Oa,{onSelect:()=>{u(o.id),n==null||n(),s(!1)},className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(ks,{className:"size-4 text-muted-foreground"}),m.jsx("span",{children:o.name})]}),m.jsx(ni,{className:_e("size-4",(h==null?void 0:h.id)===o.id?"opacity-100":"opacity-0")})]},o.id))}),m.jsx(NC,{}),m.jsx(Rl,{children:m.jsxs(Oa,{onSelect:()=>{e(),s(!1)},children:[m.jsx(Xa,{className:"size-4","data-icon":"inline-start"}),"Add Server..."]})})]})]})})]})}const kp=640;function Zl(){const[e,n]=T.useState(void 0);return T.useEffect(()=>{const i=window.matchMedia(`(max-width: ${kp-1}px)`),s=()=>{n(window.innerWidth<kp)};return i.addEventListener("change",s),n(window.innerWidth<kp),()=>i.removeEventListener("change",s)},[]),!!e}function gl({className:e,orientation:n="horizontal",decorative:i=!0,...s}){return m.jsx(Jj,{"data-slot":"separator",decorative:i,orientation:n,className:_e("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...s})}function zd({...e}){return m.jsx(Pm,{"data-slot":"sheet",...e})}function eO({...e}){return m.jsx(UD,{"data-slot":"sheet-trigger",...e})}function tO({...e}){return m.jsx(Fm,{"data-slot":"sheet-portal",...e})}function nO({className:e,...n}){return m.jsx(Hm,{"data-slot":"sheet-overlay",className:_e("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 Pd({className:e,children:n,side:i="right",showCloseButton:s=!0,style:l,...h}){return m.jsxs(tO,{children:[m.jsx(nO,{}),m.jsxs(Um,{"data-slot":"sheet-content","data-side":i,className:_e("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 u=i==="left"||i==="right"?{top:"env(safe-area-inset-top, 0px)",bottom:"env(safe-area-inset-bottom, 0px)",height:"calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))"}:i==="top"?{top:"env(safe-area-inset-top, 0px)"}:i==="bottom"?{bottom:"env(safe-area-inset-bottom, 0px)"}:void 0;return u?{...u,...l}:l})(),...h,children:[n,s&&m.jsx(fd,{"data-slot":"sheet-close",asChild:!0,children:m.jsxs(ke,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[m.jsx(ei,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Fd({className:e,...n}){return m.jsx("div",{"data-slot":"sheet-header",className:_e("flex flex-col gap-0.5 p-4",e),...n})}function Hd({className:e,...n}){return m.jsx(M1,{"data-slot":"sheet-title",className:_e("text-base font-medium text-foreground",e),...n})}function rO({className:e,...n}){return m.jsx(j1,{"data-slot":"sheet-description",className:_e("text-sm text-muted-foreground",e),...n})}function Dl({delayDuration:e=0,...n}){return m.jsx(x5,{"data-slot":"tooltip-provider",delayDuration:e,...n})}function Ha({...e}){return m.jsx(S5,{"data-slot":"tooltip",...e})}function Ua({...e}){return m.jsx(w5,{"data-slot":"tooltip-trigger",...e})}function $a({className:e,sideOffset:n=0,children:i,...s}){return m.jsx(C5,{children:m.jsxs(k5,{"data-slot":"tooltip-content",sideOffset:n,className:_e("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,m.jsx(E5,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const iO="sidebar_state",sO=3600*24*7,aO="16rem",oO="18rem",lO="3rem",cO="b",MC=T.createContext(null);function xg(){const e=T.useContext(MC);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function uO({defaultOpen:e=!0,open:n,onOpenChange:i,className:s,style:l,children:h,...u}){const o=Zl(),[c,d]=T.useState(!1),[g,f]=T.useState(e),b=n!=null?n:g,S=T.useCallback(y=>{const v=typeof y=="function"?y(b):y;i?i(v):f(v),document.cookie=`${iO}=${v}; path=/; max-age=${sO}`},[i,b]),k=T.useCallback(()=>o?d(y=>!y):S(y=>!y),[o,S,d]);T.useEffect(()=>{const y=v=>{v.key===cO&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[k]);const w=b?"expanded":"collapsed",_=T.useMemo(()=>({state:w,open:b,setOpen:S,isMobile:o,openMobile:c,setOpenMobile:d,toggleSidebar:k}),[w,b,S,o,c,d,k]);return m.jsx(MC.Provider,{value:_,children:m.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":aO,"--sidebar-width-icon":lO,...l},className:_e("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",s),...u,children:h})})}function dO({side:e="left",variant:n="sidebar",collapsible:i="offcanvas",className:s,children:l,dir:h,...u}){const{isMobile:o,state:c,openMobile:d,setOpenMobile:g}=xg();return i==="none"?m.jsx("div",{"data-slot":"sidebar",className:_e("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",s),...u,children:l}):o?m.jsx(zd,{open:d,onOpenChange:g,...u,children:m.jsxs(Pd,{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":oO},side:e,children:[m.jsxs(Fd,{className:"sr-only",children:[m.jsx(Hd,{children:"Sidebar"}),m.jsx(rO,{children:"Displays the mobile sidebar."})]}),m.jsx("div",{className:"flex h-full w-full flex-col",children:l})]})}):m.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:[m.jsx("div",{"data-slot":"sidebar-gap",className:_e("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)")}),m.jsx("div",{"data-slot":"sidebar-container","data-side":e,className:_e("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))"},...u,children:m.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 k0({className:e,onClick:n,...i}){const{toggleSidebar:s}=xg();return m.jsxs(ke,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:_e(e),onClick:l=>{n==null||n(l),s()},...i,children:[m.jsx(yT,{}),m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function hO({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:_e("flex flex-col gap-2 p-2",e),...n})}function fO({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:_e("flex flex-col gap-2 p-2",e),...n})}function pO({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:_e("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...n})}function _l({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:_e("relative flex w-full min-w-0 flex-col p-2",e),...n})}function yl({className:e,asChild:n=!1,...i}){const s=n?Bl:"div";return m.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:_e("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 bl({className:e,...n}){return m.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:_e("w-full text-sm",e),...n})}function Da({className:e,...n}){return m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:_e("flex w-full min-w-0 flex-col gap-0",e),...n})}function Cs({className:e,...n}){return m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:_e("group/menu-item relative",e),...n})}const mO=Qa("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 La({asChild:e=!1,isActive:n=!1,variant:i="default",size:s="default",tooltip:l,className:h,...u}){const o=e?Bl:"button",{isMobile:c,state:d}=xg(),g=m.jsx(o,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":n,className:_e(mO({variant:i,size:s}),h),...u});return l?(typeof l=="string"&&(l={children:l}),m.jsxs(Ha,{children:[m.jsx(Ua,{asChild:!0,children:g}),m.jsx($a,{side:"right",align:"center",hidden:d!=="collapsed"||c,...l})]})):g}function gO({className:e,asChild:n=!1,showOnHover:i=!1,...s}){const l=n?Bl:"button";return m.jsx(l,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:_e("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 vO({className:e,...n}){return m.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:_e("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 qa({...e}){return m.jsx(DR,{"data-slot":"collapsible",...e})}function Va({...e}){return m.jsx(r1,{"data-slot":"collapsible-trigger",...e})}function Ga({...e}){return m.jsx(i1,{"data-slot":"collapsible-content",...e})}function _O({...e}){return m.jsx(E3,{"data-slot":"dropdown-menu",...e})}function yO({...e}){return m.jsx(A3,{"data-slot":"dropdown-menu-trigger",...e})}function bO({className:e,align:n="start",sideOffset:i=4,...s}){return m.jsx(T3,{children:m.jsx(R3,{"data-slot":"dropdown-menu-content",sideOffset:i,align:n,className:_e("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 Ep({className:e,inset:n,variant:i="default",...s}){return m.jsx(D3,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":i,className:_e("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 E0=Jn.memo(function({isClosed:n,onReopen:i,onClose:s,onDelete:l}){return m.jsxs(_O,{children:[m.jsx(yO,{asChild:!0,children:m.jsxs(gO,{showOnHover:!0,children:[m.jsx(PA,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Session actions"})]})}),m.jsx(bO,{align:"end",children:n?m.jsxs(m.Fragment,{children:[m.jsxs(Ep,{onClick:i,children:[m.jsx(Hx,{className:"size-4"}),"Restore"]}),m.jsxs(Ep,{onClick:l,className:"text-destructive focus:text-destructive",children:[m.jsx(Ll,{className:"size-4"}),"Delete permanently"]})]}):m.jsxs(Ep,{onClick:s,children:[m.jsx(ei,{className:"size-4"}),"Archive"]})})]})}),A0=Jn.memo(function({status:n,isStreaming:i,runningAt:s}){return i||n==="running"||!!s?m.jsx(Pn,{className:"size-3.5 animate-spin shrink-0"}):n==="error"?m.jsx(ad,{className:"size-3.5 shrink-0"}):m.jsx(Ol,{className:"size-3.5 shrink-0"})}),vm=Jn.memo(function e({session:n,allSessions:i,isActive:s,currentSessionId:l,streamingSessionId:h,onResumeSession:u,onCloseSession:o,onReopenSession:c,onDeleteSession:d}){const g=T.useMemo(()=>i.filter(w=>w.parentId===n.id),[i,n.id]),f=g.length>0,b=n.status==="closed",S=T.useMemo(()=>g.some(w=>w.id===l),[g,l]),k=n.id===h;return f?m.jsx(Dl,{delayDuration:300,children:m.jsx(qa,{defaultOpen:s||S,className:"group/collapsible",children:m.jsxs(Cs,{children:[m.jsxs("div",{className:"flex items-center w-full",children:[m.jsx(Va,{asChild:!0,children:m.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:m.jsx(ri,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),m.jsx(La,{isActive:s,onClick:()=>u(n.id),className:"flex-1 min-w-0",children:m.jsxs(Ha,{children:[m.jsx(Ua,{asChild:!0,children:m.jsxs("span",{className:"truncate flex items-center gap-2",children:[m.jsx(A0,{status:n.subagentStatus,isStreaming:k,runningAt:n.runningAt}),n.title||"Untitled"]})}),m.jsx($a,{side:"right",className:"max-w-xs",children:n.title||"Untitled"})]})}),m.jsx(E0,{isClosed:b,onReopen:()=>c(n.id),onClose:()=>o(n.id),onDelete:()=>d(n.id)})]}),m.jsx(Ga,{children:m.jsx(vO,{children:g.map(w=>m.jsx(e,{session:w,allSessions:i,isActive:l===w.id,currentSessionId:l,streamingSessionId:h,onResumeSession:u,onCloseSession:o,onReopenSession:c,onDeleteSession:d},w.id))})})]})})}):m.jsx(Dl,{delayDuration:300,children:m.jsx(Cs,{children:m.jsxs("div",{className:"flex items-center w-full",children:[m.jsx("div",{className:"shrink-0 size-7 p-1"}),m.jsx(La,{isActive:s,onClick:()=>u(n.id),className:"flex-1 min-w-0",children:m.jsxs(Ha,{children:[m.jsx(Ua,{asChild:!0,children:m.jsxs("span",{className:"truncate flex items-center gap-2",children:[m.jsx(A0,{status:n.subagentStatus,isStreaming:k,runningAt:n.runningAt}),n.title||"Untitled"]})}),m.jsx($a,{side:"right",className:"max-w-xs",children:n.title||"Untitled"})]})}),m.jsx(E0,{isClosed:b,onReopen:()=>c(n.id),onClose:()=>o(n.id),onDelete:()=>d(n.id)})]})})})}),xO=Qa("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 ln({className:e,variant:n="default",asChild:i=!1,...s}){const l=i?Bl:"span";return m.jsx(l,{"data-slot":"badge","data-variant":n,className:_e(xO({variant:n}),e),...s})}const SO=Jn.memo(function({allSessions:n,currentSession:i,currentSessionId:s,streamingSessionId:l,favoritedWorkspaceIds:h,workspaces:u,activeWorkspace:o,onSelectWorkspace:c,onResumeSession:d,onCloseSession:g,onReopenSession:f,onDeleteSession:b,onCreateSessionInWorkspace:S,connected:k}){const w=T.useMemo(()=>{const y=new Map(u.map(v=>[v.id,v]));return h.map(v=>y.get(v)).filter(v=>v!==void 0)},[u,h]),_=T.useMemo(()=>{const y=new Map;for(const v of w){const x=n.filter(E=>E.workspaceId===v.id&&E.status==="active"&&E.parentId===null).sort((E,N)=>new Date(N.updatedAt).getTime()-new Date(E.updatedAt).getTime());y.set(v.id,x)}return y},[n,w]);return w.length===0?m.jsxs(_l,{children:[m.jsx(yl,{children:"Overview"}),m.jsx(bl,{children:m.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}):m.jsxs(_l,{children:[m.jsx(yl,{children:"Overview"}),m.jsx(bl,{children:w.map(y=>{const v=y.id===(o==null?void 0:o.id),x=_.get(y.id)||[];return m.jsx(qa,{defaultOpen:v,className:"group/collapsible",children:m.jsxs(_l,{children:[m.jsx(yl,{asChild:!0,children:m.jsxs(Va,{className:"flex items-center justify-between w-full",onClick:()=>c(y),children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(ri,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),y.isVirtual?m.jsx(Yp,{className:"size-3.5"}):m.jsx(qi,{className:"size-3.5"}),m.jsx("span",{className:"truncate",children:y.name})]}),m.jsx(ln,{variant:"secondary",children:x.length})]})}),m.jsx(Ga,{children:m.jsxs(bl,{children:[m.jsx(Da,{children:m.jsx(Cs,{children:m.jsxs(La,{onClick:()=>S(y.id),disabled:!k,className:"w-full",children:[m.jsx(Xa,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"New Chat"})]})})}),m.jsx(Da,{children:x.length===0?m.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):x.map(E=>m.jsx(vm,{session:E,allSessions:n,isActive:(i==null?void 0:i.id)===E.id,currentSessionId:s,streamingSessionId:l,onResumeSession:d,onCloseSession:g,onReopenSession:f,onDeleteSession:b},E.id))})]})})]})},y.id)})})]})});function wO({sessions:e,currentSession:n,currentSessionId:i,streamingSessionId:s,connected:l,workspaces:h,activeWorkspace:u,allSessions:o,viewMode:c,favoritedWorkspaceIds:d,onCreateSession:g,onResumeSession:f,onCloseSession:b,onReopenSession:S,onDeleteSession:k,onSelectWorkspace:w,onCreateVirtualWorkspace:_,onCreatePhysicalWorkspace:y,onCreateSessionInWorkspace:v,onOpenSettings:x,onOpenMCP:E,onOpenAddServer:N,onServerSwitch:R}){const{quickConnections:M,addToQuickConnections:D,removeFromQuickConnections:O,activeServer:P}=Za(),{activeSessions:$,archivedSessions:U}=T.useMemo(()=>{const K=e.filter(V=>!V.parentId);return{activeSessions:K.filter(V=>V.status==="active"),archivedSessions:K.filter(V=>V.status==="closed")}},[e]),q=K=>M.some(V=>V.workspaceId===K&&V.serverId===(P==null?void 0:P.id)),Y=(K,V)=>{if(!P)return;const J=M.find(ne=>ne.workspaceId===K&&ne.serverId===P.id);J?O(J.id):D(P.id,P.name,K,V)};return m.jsxs(dO,{collapsible:"offcanvas",children:[m.jsxs(hO,{children:[m.jsxs("div",{className:"p-2 space-y-2",children:[m.jsx(J4,{onOpenAddServer:N,onServerSwitch:R}),c!=="overview"&&m.jsx(Q4,{workspaces:h,activeWorkspace:u,onSelectWorkspace:w,onCreateVirtualWorkspace:_,onCreatePhysicalWorkspace:y,isWorkspaceFavorited:q,onToggleFavorite:Y})]}),c!=="overview"&&m.jsx(Da,{children:m.jsx(Cs,{children:m.jsxs(La,{onClick:g,disabled:!l,className:"w-full",children:[m.jsx(Xa,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"New Chat"})]})})})]}),m.jsx(pO,{children:c==="overview"?m.jsx(SO,{allSessions:o,currentSession:n,currentSessionId:i,streamingSessionId:s,favoritedWorkspaceIds:d,workspaces:h,activeWorkspace:u,onSelectWorkspace:w,onResumeSession:f,onCloseSession:b,onReopenSession:S,onDeleteSession:k,onCreateSessionInWorkspace:v,connected:l}):m.jsxs(m.Fragment,{children:[$.length>0&&m.jsx(qa,{defaultOpen:!0,className:"group/collapsible",children:m.jsxs(_l,{children:[m.jsx(yl,{asChild:!0,children:m.jsxs(Va,{className:"flex items-center justify-between w-full",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(ri,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),m.jsx(ln,{variant:"secondary",children:$.length})]})}),m.jsx(Ga,{children:m.jsx(bl,{children:m.jsx(Da,{children:$.map(K=>m.jsx(vm,{session:K,allSessions:e,isActive:(n==null?void 0:n.id)===K.id,currentSessionId:i,streamingSessionId:s,onResumeSession:f,onCloseSession:b,onReopenSession:S,onDeleteSession:k},K.id))})})})]})}),U.length>0&&m.jsx(qa,{defaultOpen:!0,className:"group/collapsible",children:m.jsxs(_l,{children:[m.jsx(yl,{asChild:!0,children:m.jsxs(Va,{className:"flex items-center justify-between w-full",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(ri,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),m.jsx(ln,{variant:"secondary",children:U.length})]})}),m.jsx(Ga,{children:m.jsx(bl,{children:m.jsx(Da,{children:U.map(K=>m.jsx(vm,{session:K,allSessions:e,isActive:(n==null?void 0:n.id)===K.id,currentSessionId:i,streamingSessionId:s,onResumeSession:f,onCloseSession:b,onReopenSession:S,onDeleteSession:k},K.id))})})})]})}),$.length===0&&U.length===0&&m.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["No sessions yet.",m.jsx("br",{}),"Start a new chat to begin."]})]})}),m.jsx(fO,{className:"pb-4",children:m.jsxs(Da,{children:[m.jsx(Cs,{children:m.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[l?m.jsx(KT,{className:"size-3.5 text-success"}):m.jsx(Gx,{className:"size-3.5 text-destructive"}),m.jsx("span",{className:"text-xs text-muted-foreground",children:l?"Connected":"Disconnected"})]})}),m.jsx(Cs,{children:m.jsxs(La,{onClick:E,children:[m.jsx(ks,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"MCP Servers"})]})}),m.jsx(Cs,{children:m.jsx("div",{className:"flex items-center gap-1",children:m.jsxs(La,{onClick:x,children:[m.jsx(Ux,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"Settings"})]})})})]})})]})}const CO={".ts":{icon:Sr,color:"text-blue-500"},".tsx":{icon:Sr,color:"text-blue-500"},".js":{icon:Sr,color:"text-yellow-500"},".jsx":{icon:Sr,color:"text-yellow-500"},".json":{icon:Sr,color:"text-yellow-600"},".md":{icon:Sr,color:"text-gray-500"},".css":{icon:Sr,color:"text-purple-500"},".html":{icon:Sr,color:"text-orange-500"}};function jC({entry:e,workspaceId:n,parentPath:i,depth:s,onFileSelect:l,showHidden:h=!0,serverUrl:u,apiToken:o}){const{fetchWithAuth:c}=Kl(),[d,g]=T.useState(!1),[f,b]=T.useState([]),[S,k]=T.useState(!1),[w,_]=T.useState(!1),y=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(y)}&showHidden=${h}`,{},{serverUrl:u,token:o})).json();b(P.files||[]),_(!0)}catch(O){console.error("Failed to load children:",O)}finally{k(!1)}}},E=O=>{g(O),O&&v&&x()},N=()=>{!v&&l&&l({...e,path:y})},R=e.extension?CO[e.extension]:null,M=v?d?Zp:qi:(R==null?void 0:R.icon)||Sr,D=v?"text-amber-500":(R==null?void 0:R.color)||"text-muted-foreground";return v?m.jsxs(qa,{open:d,onOpenChange:E,children:[m.jsx(Va,{asChild:!0,children:m.jsxs("button",{className:_e("flex items-center gap-1.5 w-full min-w-0 overflow-x-hidden 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?m.jsx(Pn,{className:"w-3 h-3 animate-spin shrink-0"}):m.jsx(ri,{className:_e("w-3 h-3 shrink-0 transition-transform",d&&"rotate-90")}),m.jsx(M,{className:_e("w-4 h-4 shrink-0",D)}),m.jsx("span",{className:"truncate min-w-0 flex-1",children:e.name})]})}),m.jsx(Ga,{children:f.map(O=>m.jsx(jC,{entry:O,workspaceId:n,parentPath:y,depth:s+1,onFileSelect:l,showHidden:h,serverUrl:u,apiToken:o},`${y}/${O.path}`))})]}):m.jsxs("button",{onClick:N,className:_e("flex items-center gap-1.5 w-full min-w-0 overflow-x-hidden 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:[m.jsx(M,{className:_e("w-4 h-4 shrink-0",D)}),m.jsx("span",{className:"truncate min-w-0 flex-1",children:e.name})]})}function T0({workspaceId:e,serverUrl:n,apiToken:i,onFileSelect:s,showHidden:l=!0}){const[h,u]=T.useState([]),[o,c]=T.useState(""),[d,g]=T.useState(!0),[f,b]=T.useState(null),{fetchWithAuth:S}=Kl(),k=T.useCallback(async()=>{g(!0),b(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");u(_.files),c(_.currentPath)}catch(w){b(w instanceof Error?w.message:"Failed to load files")}finally{g(!1)}},[e,l,S,n,i]);return T.useEffect(()=>{k()},[k]),d?m.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[m.jsx(Pn,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):f?m.jsxs("div",{className:"p-4 text-sm text-destructive",children:[f,m.jsx(ke,{variant:"ghost",size:"sm",onClick:k,className:"ml-2",children:m.jsx(Na,{className:"w-3 h-3"})})]}):h.length===0?m.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",m.jsx(ke,{variant:"ghost",size:"sm",onClick:k,className:"ml-2",children:m.jsx(Na,{className:"w-3 h-3"})})]}):m.jsxs("div",{className:"flex flex-col h-full min-w-0 overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between min-w-0 overflow-hidden px-3 py-2",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide truncate min-w-0",children:"Files"}),m.jsx(ke,{variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0",onClick:k,children:m.jsx(Na,{className:"w-3 h-3"})})]}),m.jsx(lo,{className:"flex-1 min-h-0 min-w-0",children:m.jsx("div",{className:"px-2 pb-2 min-w-0 overflow-hidden",children:m.jsx("div",{className:"space-y-0.5",children:h.map(w=>m.jsx(jC,{entry:w,workspaceId:e,parentPath:o,depth:0,onFileSelect:s,showHidden:l,serverUrl:n,apiToken:i},w.path))})})})]})}function kO({workspaceId:e,searchQuery:n,selectedIndex:i,onSelect:s,onFilesChange:l,showHidden:h=!0,serverUrl:u,apiToken:o}){const[c,d]=T.useState([]),[g,f]=T.useState(!1),[b,S]=T.useState(n),{fetchWithAuth:k}=Kl();return T.useEffect(()=>{const w=setTimeout(()=>{S(n)},150);return()=>clearTimeout(w)},[n]),T.useEffect(()=>{if(!b||b.length<2){d([]),l([]);return}f(!0);const w=new AbortController;return k(`/api/workspaces/${e}/files?search=${encodeURIComponent(b)}&showHidden=${h}`,{signal:w.signal},{serverUrl:u,token:o}).then(_=>_.json()).then(_=>{const y=_.files||[];d(y),l(y)}).catch(_=>{_.name!=="AbortError"&&console.error("File search failed:",_)}).finally(()=>f(!1)),()=>w.abort()},[e,b,l,h,k,u,o]),!n||n.length<2?m.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}):g?m.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[m.jsx(Pn,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}):c.length===0?m.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',n,'"']}):m.jsxs("div",{className:"p-1",children:[c.map((w,_)=>m.jsxs("button",{onClick:()=>s(w),className:_e("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"?m.jsx(qi,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):m.jsx(Sr,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),m.jsx("span",{className:"truncate flex-1",children:w.path}),w.extension&&m.jsx("span",{className:"text-xs text-muted-foreground",children:w.extension})]},w.path)),m.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[c.length," result",c.length!==1?"s":""," •",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"})," navigate",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"})," select",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"})," close"]})]})}function EO({workspaceId:e,serverUrl:n,apiToken:i,isOpen:s,onClose:l}){const h=Zl();return e?h?m.jsx(zd,{open:s,onOpenChange:u=>!u&&l(),children:m.jsxs(Pd,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[m.jsx(Fd,{className:"sr-only",children:m.jsx(Hd,{children:"Files"})}),m.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[m.jsx("span",{className:"font-semibold text-sm",children:"Files"}),m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:l,children:m.jsx(ei,{className:"w-4 h-4"})})]}),m.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:m.jsx(T0,{workspaceId:e,serverUrl:n,apiToken:i,showHidden:!0},e)})]})}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:_e("relative w-64 bg-transparent transition-[width] duration-200 ease-linear",!s&&"w-0")}),m.jsxs("div",{className:_e("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:[m.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[m.jsx("span",{className:"font-semibold text-sm",children:"Files"}),m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:l,children:m.jsx(ei,{className:"w-4 h-4"})})]}),m.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:m.jsx(T0,{workspaceId:e,serverUrl:n,apiToken:i,showHidden:!0},e)})]})]}):null}var Ap={exports:{}},R0;function AO(){return R0||(R0=1,(function(e,n){(function(i,s){e.exports=s()})(globalThis,(()=>(()=>{var i={4567:function(u,o,c){var d=this&&this.__decorate||function(v,x,E,N){var R,M=arguments.length,D=M<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,N);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(M<3?R(D):M>3?R(x,E,D):R(x,E))||D);return M>3&&D&&Object.defineProperty(x,E,D),D},g=this&&this.__param||function(v,x){return function(E,N){x(E,N,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=c(9042),b=c(9924),S=c(844),k=c(4725),w=c(2585),_=c(3656);let y=o.AccessibilityManager=class extends S.Disposable{constructor(v,x,E,N){super(),this._terminal=v,this._coreBrowserService=E,this._renderService=N,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 b.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(`
469
- `)))),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===`
470
- `&&(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,N=E.lines.length.toString();for(let R=v;R<=x;R++){const M=E.lines.get(E.ydisp+R),D=[],O=(M==null?void 0:M.translateToString(!0,void 0,void 0,D))||"",P=(E.ydisp+R+1).toString(),$=this._rowElements[R];$&&(O.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=O,this._rowColumns.set($,D)),$.setAttribute("aria-posinset",P),$.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,x){const E=v.target,N=this._rowElements[x===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==N)return;let R,M;if(x===0?(R=E,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=E,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.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 N=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:N,offset:(P=(O=N.textContent)==null?void 0:O.length)!=null?P:0}),!this._rowContainer.contains(E.node))return;const R=({node:$,offset:U})=>{const q=$ instanceof Text?$.parentNode:$;let Y=parseInt(q==null?void 0:q.getAttribute("aria-posinset"),10)-1;if(isNaN(Y))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get(q);if(!K)return console.warn("columns is null. Race condition?"),null;let V=U<K.length?K[U]:K.slice(-1)[0]+1;return V>=this._terminal.cols&&(++Y,V=0),{row:Y,column:V}},M=R(x),D=R(E);if(M&&D){if(M.row>D.row||M.row===D.row&&M.column>=D.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(D.row-M.row)*this._terminal.cols-M.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=y=d([g(1,w.IInstantiationService),g(2,k.ICoreBrowserService),g(3,k.IRenderService)],y)},3614:(u,o)=>{function c(b){return b.replace(/\r?\n/g,"\r")}function d(b,S){return S?"\x1B[200~"+b+"\x1B[201~":b}function g(b,S,k,w){b=d(b=c(b),k.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(b,!0),S.value=""}function f(b,S,k){const w=k.getBoundingClientRect(),_=b.clientX-w.left-10,y=b.clientY-w.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${_}px`,S.style.top=`${y}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=d,o.copyHandler=function(b,S){b.clipboardData&&b.clipboardData.setData("text/plain",S.selectionText),b.preventDefault()},o.handlePasteEvent=function(b,S,k,w){b.stopPropagation(),b.clipboardData&&g(b.clipboardData.getData("text/plain"),S,k,w)},o.paste=g,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(b,S,k,w,_){f(b,S,k),_&&w.rightClickSelect(b),S.value=w.selectionText,S.select()}},7239:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const d=c(1505);o.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,f,b){this._css.set(g,f,b)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,b){this._color.set(g,f,b)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,d,g,f){c.addEventListener(d,g,f);let b=!1;return{dispose:()=>{b||(b=!0,c.removeEventListener(d,g,f))}}}},3551:function(u,o,c){var d=this&&this.__decorate||function(y,v,x,E){var N,R=arguments.length,M=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,x,E);else for(var D=y.length-1;D>=0;D--)(N=y[D])&&(M=(R<3?N(M):R>3?N(v,x,M):N(v,x))||M);return R>3&&M&&Object.defineProperty(v,x,M),M},g=this&&this.__param||function(y,v){return function(x,E){v(x,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=c(3656),b=c(8460),S=c(844),k=c(2585),w=c(4725);let _=o.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(y,v,x,E,N){super(),this._element=y,this._mouseService=v,this._renderService=x,this._bufferService=E,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.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(y){this._lastMouseEvent=y;const v=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const x=y.composedPath();for(let E=0;E<x.length;E++){const N=x[E];if(N.classList.contains("xterm"))break;if(N.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,v){var E,N;this._activeProviderReplies&&v||((E=this._activeProviderReplies)==null||E.forEach((R=>{R==null||R.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let x=!1;for(const[R,M]of this._linkProviderService.linkProviders.entries())v?(N=this._activeProviderReplies)!=null&&N.get(R)&&(x=this._checkLinkProviderResult(R,y,x)):M.provideLinks(y.y,(D=>{var P,$;if(this._isMouseOut)return;const O=D==null?void 0:D.map((U=>({link:U})));(P=this._activeProviderReplies)==null||P.set(R,O),x=this._checkLinkProviderResult(R,y,x),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,v){const x=new Set;for(let E=0;E<v.size;E++){const N=v.get(E);if(N)for(let R=0;R<N.length;R++){const M=N[R],D=M.link.range.start.y<y?0:M.link.range.start.x,O=M.link.range.end.y>y?this._bufferService.cols:M.link.range.end.x;for(let P=D;P<=O;P++){if(x.has(P)){N.splice(R--,1);break}x.add(P)}}}}_checkLinkProviderResult(y,v,x){var R;if(!this._activeProviderReplies)return x;const E=this._activeProviderReplies.get(y);let N=!1;for(let M=0;M<y;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(N=!0);if(!N&&E){const M=E.find((D=>this._linkAtPosition(D.link,v)));M&&(x=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let M=0;M<this._activeProviderReplies.size;M++){const D=(R=this._activeProviderReplies.get(M))==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(y){if(!this._currentLink)return;const v=this._positionFromMouseEvent(y,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,v){this._currentLink&&this._lastMouseEvent&&(!y||!v||this._currentLink.link.range.start.y>=y&&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(y){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(y.link,v)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.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,N,R;(E=this._currentLink)!=null&&E.state&&((R=(N=this._currentLink)==null?void 0:N.state)==null?void 0:R.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.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,N=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(E,N),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(y,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&&y.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(x,v.text)}_fireUnderlineEvent(y,v){const x=y.range,E=this._bufferService.buffer.ydisp,N=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(N)}_linkLeave(y,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&&y.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(x,v.text)}_linkAtPosition(y,v){const x=y.range.start.y*this._bufferService.cols+y.range.start.x,E=y.range.end.y*this._bufferService.cols+y.range.end.x,N=v.y*this._bufferService.cols+v.x;return x<=N&&N<=E}_positionFromMouseEvent(y,v,x){const E=x.getCoords(y,v,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,v,x,E,N){return{x1:y,y1:v,x2:x,y2:E,cols:this._bufferService.cols,fg:N}}};o.Linkifier=_=d([g(1,w.IMouseService),g(2,w.IRenderService),g(3,k.IBufferService),g(4,w.ILinkProviderService)],_)},9042:(u,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(u,o,c){var d=this&&this.__decorate||function(w,_,y,v){var x,E=arguments.length,N=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,_,y,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(N=(E<3?x(N):E>3?x(_,y,N):x(_,y))||N);return E>3&&N&&Object.defineProperty(_,y,N),N},g=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=c(511),b=c(2585);let S=o.OscLinkProvider=class{constructor(w,_,y){this._bufferService=w,this._optionsService=_,this._oscLinkService=y}provideLinks(w,_){var O;const y=this._bufferService.buffer.lines.get(w-1);if(!y)return void _(void 0);const v=[],x=this._optionsService.rawOptions.linkHandler,E=new f.CellData,N=y.getTrimmedLength();let R=-1,M=-1,D=!1;for(let P=0;P<N;P++)if(M!==-1||y.hasContent(P)){if(y.loadCell(P,E),E.hasExtendedAttrs()&&E.extended.urlId){if(M===-1){M=P,R=E.extended.urlId;continue}D=E.extended.urlId!==R}else M!==-1&&(D=!0);if(D||M!==-1&&P===N-1){const $=(O=this._oscLinkService.getLinkData(R))==null?void 0:O.uri;if($){const U={start:{x:M+1,y:w},end:{x:P+(D||P!==N-1?0:1),y:w}};let q=!1;if(!(x!=null&&x.allowNonHttpProtocols))try{const Y=new URL($);["http:","https:"].includes(Y.protocol)||(q=!0)}catch{q=!0}q||v.push({text:$,range:U,activate:(Y,K)=>x?x.activate(Y,K,U):k(0,K),hover:(Y,K)=>{var V;return(V=x==null?void 0:x.hover)==null?void 0:V.call(x,Y,K,U)},leave:(Y,K)=>{var V;return(V=x==null?void 0:x.leave)==null?void 0:V.call(x,Y,K,U)}})}D=!1,E.hasExtendedAttrs()&&E.extended.urlId?(M=P,R=E.extended.urlId):(M=-1,R=-1)}}_(v)}};function k(w,_){if(confirm(`Do you want to navigate to ${_}?
471
-
472
- WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=S=d([g(0,b.IBufferService),g(1,b.IOptionsService),g(2,b.IOscLinkService)],S)},6193:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,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,d,g){this._rowCount=g,c=c!==void 0?c:0,d=d!==void 0?d: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,d):d,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),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const d=c(3614),g=c(3656),f=c(3551),b=c(9042),S=c(3730),k=c(1680),w=c(3107),_=c(5744),y=c(2950),v=c(1296),x=c(428),E=c(4269),N=c(5114),R=c(8934),M=c(3230),D=c(9312),O=c(4725),P=c(6731),$=c(8055),U=c(8969),q=c(8460),Y=c(844),K=c(6114),V=c(8437),J=c(2584),ne=c(7399),F=c(5941),j=c(9074),I=c(2585),L=c(5435),z=c(4567),Z=c(779);class X extends U.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(W={}){super(W),this.browser=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.MutableDisposable),this._onCursorMove=this.register(new q.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new q.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new q.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new q.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new q.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new q.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new q.EventEmitter),this._onBlur=this.register(new q.EventEmitter),this._onA11yCharEmitter=this.register(new q.EventEmitter),this._onA11yTabEmitter=this.register(new q.EventEmitter),this._onWillOpen=this.register(new q.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.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,te)=>this.refresh(H,te)))),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,q.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,q.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,q.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,Y.toDisposable)((()=>{var H,te;this._customKeyEventHandler=void 0,(te=(H=this.element)==null?void 0:H.parentNode)==null||te.removeChild(this.element)})))}_handleColorEvent(W){if(this._themeService)for(const H of W){let te,ae="";switch(H.index){case 256:te="foreground",ae="10";break;case 257:te="background",ae="11";break;case 258:te="cursor",ae="12";break;default:te="ansi",ae="4;"+H.index}switch(H.type){case 0:const pe=$.color.toColorRGB(te==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[te]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${ae};${(0,F.toRgbString)(pe)}${J.C1_ESCAPED.ST}`);break;case 1:if(te==="ansi")this._themeService.modifyColors((ce=>ce.ansi[H.index]=$.channels.toColor(...H.color)));else{const ce=te;this._themeService.modifyColors((Oe=>Oe[ce]=$.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(J.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(J.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 te=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,pe=H.getWidth(te),ce=this._renderService.dimensions.css.cell.width*pe,Oe=this.buffer.y*this._renderService.dimensions.css.cell.height,Ie=te*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ie+"px",this.textarea.style.top=Oe+"px",this.textarea.style.width=ce+"px",this.textarea.style.height=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,d.copyHandler)(H,this._selectionService)})));const W=H=>(0,d.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,g.addDisposableDomListener)(this.element,"paste",W)),K.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,d.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,d.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,d.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(W=>this._keyUp(W)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(W=>this._keyDown(W)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(W=>this._keyPress(W)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(W=>this._compositionHelper.compositionupdate(W)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(W=>this._inputEvent(W)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(W){var te,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"),((te=this.element)==null?void 0:te.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,g.addDisposableDomListener)(this.screenElement,"mousemove",(ce=>this.updateCursorStyle(ce)))),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",b.promptLabel),K.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(N.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,g.addDisposableDomListener)(this.textarea,"focus",(ce=>this._handleTextAreaFocus(ce)))),this.register((0,g.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(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(O.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ce=>this._onRender.fire(ce)))),this.onResize((ce=>this._renderService.resize(ce.cols,ce.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.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((ce=>this.scrollLines(ce.amount,ce.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((ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ce=>this._renderService.handleSelectionChanged(ce.start,ce.end,ce.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ce=>{this.textarea.value=ce,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ce=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(ce=>this._selectionService.handleMouseDown(ce)))),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",(ce=>this._handleScreenReaderModeOptionChange(ce)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ce=>{!this._overviewRulerRenderer&&ce&&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 te(ce){const Oe=W._mouseService.getMouseReportCoords(ce,W.screenElement);if(!Oe)return!1;let Ie,Ue;switch(ce.overrideType||ce.type){case"mousemove":Ue=32,ce.buttons===void 0?(Ie=3,ce.button!==void 0&&(Ie=ce.button<3?ce.button:3)):Ie=1&ce.buttons?0:4&ce.buttons?1:2&ce.buttons?2:3;break;case"mouseup":Ue=0,Ie=ce.button<3?ce.button:3;break;case"mousedown":Ue=1,Ie=ce.button<3?ce.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(ce)===!1||W.viewport.getLinesScrolled(ce)===0)return!1;Ue=ce.deltaY<0?0:1,Ie=4;break;default:return!1}return!(Ue===void 0||Ie===void 0||Ie>4)&&W.coreMouseService.triggerMouseEvent({col:Oe.col,row:Oe.row,x:Oe.x,y:Oe.y,button:Ie,action:Ue,ctrl:ce.ctrlKey,alt:ce.altKey,shift:ce.shiftKey})}const ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:ce=>(te(ce),ce.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(ce)),wheel:ce=>(te(ce),this.cancel(ce,!0)),mousedrag:ce=>{ce.buttons&&te(ce)},mousemove:ce=>{ce.buttons||te(ce)}};this.register(this.coreMouseService.onProtocolChange((ce=>{ce?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ce)),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&ce?ae.mousemove||(H.addEventListener("mousemove",pe.mousemove),ae.mousemove=pe.mousemove):(H.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&ce?ae.wheel||(H.addEventListener("wheel",pe.wheel,{passive:!1}),ae.wheel=pe.wheel):(H.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&ce?ae.mouseup||(ae.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&ce?ae.mousedrag||(ae.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(H,"mousedown",(ce=>{if(ce.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ce))return te(ce),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(ce)}))),this.register((0,g.addDisposableDomListener)(H,"wheel",(ce=>{if(!ae.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ce)===!1)return!1;if(!this.buffer.hasScrollback){const Oe=this.viewport.getLinesScrolled(ce);if(Oe===0)return;const Ie=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ce.deltaY<0?"A":"B");let Ue="";for(let ut=0;ut<Math.abs(Oe);ut++)Ue+=Ie;return this.coreService.triggerDataEvent(Ue,!0),this.cancel(ce,!0)}return this.viewport.handleWheel(ce)?this.cancel(ce):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(H,"touchstart",(ce=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ce),this.cancel(ce)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(H,"touchmove",(ce=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ce)?void 0:this.cancel(ce)}),{passive:!1}))}refresh(W,H){var te;(te=this._renderService)==null||te.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,te=0){var ae;te===1?(super.scrollLines(W,H,te),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.scrollLines(W)}paste(W){(0,d.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,te){this._selectionService.setSelection(W,H,te)}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 te;(te=this._selectionService)==null||te.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 te=(0,ne.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),te.type===3||te.type===2){const ae=this.rows-1;return this.scrollLines(te.type===2?-ae:ae),this.cancel(W,!0)}return te.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(te.cancel&&this.cancel(W,!0),!te.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):(te.key!==J.C0.ETX&&te.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:te.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(te.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,H){const te=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"?te:te&&(!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 te,ae;(te=this._charSizeService)==null||te.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,te;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(),(te=this.viewport)==null||te.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(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case L.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),te=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${te};${H}t`);break;case L.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(`${J.C0.ESC}[6;${pe};${ae}t`)}}cancel(W,H){if(this.options.cancelEvents||H)return W.preventDefault(),W.stopPropagation(),!1}}o.Terminal=X},9924:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,g){this._rowCount=g,c=c!==void 0?c:0,d=d!==void 0?d: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,d):d;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=f-this._lastRefreshMs,S=this._debounceThresholdMS-b;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),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(u,o,c){var d=this&&this.__decorate||function(y,v,x,E){var N,R=arguments.length,M=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,x,E);else for(var D=y.length-1;D>=0;D--)(N=y[D])&&(M=(R<3?N(M):R>3?N(v,x,M):N(v,x))||M);return R>3&&M&&Object.defineProperty(v,x,M),M},g=this&&this.__param||function(y,v){return function(x,E){v(x,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const f=c(3656),b=c(4725),S=c(8460),k=c(844),w=c(2585);let _=o.Viewport=class extends k.Disposable{constructor(y,v,x,E,N,R,M,D){super(),this._viewportElement=y,this._scrollArea=v,this._bufferService=x,this._optionsService=E,this._charSizeService=N,this._renderService=R,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new 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(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,v){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(v<0&&this._viewportElement.scrollTop!==0||v>0&&x<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const v=this._getPixelsScrolled(y);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(y,v))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const v=y*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:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let v=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?v*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._currentRowHeight*this._bufferService.rows),v}getBufferElements(y,v){var D;let x,E="";const N=[],R=v!=null?v:this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let O=y;O<R;O++){const P=M.get(O);if(!P)continue;const $=(D=M.get(O+1))==null?void 0:D.isWrapped;if(E+=P.translateToString(!$),!$||O===M.length-1){const U=document.createElement("div");U.textContent=E,N.push(U),E.length>0&&(x=U),E=""}}return{bufferElements:N,cursorElement:x}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let v=this._applyScrollModifier(y.deltaY,y);return y.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):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(v*=this._bufferService.rows),v}_applyScrollModifier(y,v){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&v.altKey||x==="ctrl"&&v.ctrlKey||x==="shift"&&v.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const v=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,v!==0&&(this._viewportElement.scrollTop+=v,this._bubbleScroll(y,v))}};o.Viewport=_=d([g(2,w.IBufferService),g(3,w.IOptionsService),g(4,b.ICharSizeService),g(5,b.IRenderService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],_)},3107:function(u,o,c){var d=this&&this.__decorate||function(w,_,y,v){var x,E=arguments.length,N=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,_,y,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(N=(E<3?x(N):E>3?x(_,y,N):x(_,y))||N);return E>3&&N&&Object.defineProperty(_,y,N),N},g=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const f=c(4725),b=c(844),S=c(2585);let k=o.BufferDecorationRenderer=class extends b.Disposable{constructor(w,_,y,v,x){super(),this._screenElement=w,this._bufferService=_,this._coreBrowserService=y,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,b.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 y=(x=w.options.x)!=null?x:0;return y&&y>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 y=this._decorationElements.get(w);y||(y=this._createElement(w),w.element=y,this._decorationElements.set(w,y),this._container.appendChild(y),w.onDispose((()=>{this._decorationElements.delete(w),y.remove()}))),y.style.top=_*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(y)}}_refreshXPosition(w,_=w.element){var v;if(!_)return;const y=(v=w.options.x)!=null?v:0;(w.options.anchor||"left")==="right"?_.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":_.style.left=y?y*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=d([g(1,S.IBufferService),g(2,f.ICoreBrowserService),g(3,S.IDecorationService),g(4,f.IRenderService)],k)},5871:(u,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 d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,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,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,g){return d>=c.startBufferLine-this._linePadding[g||"full"]&&d<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(u,o,c){var d=this&&this.__decorate||function(x,E,N,R){var M,D=arguments.length,O=D<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,N):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,E,N,R);else for(var P=x.length-1;P>=0;P--)(M=x[P])&&(O=(D<3?M(O):D>3?M(E,N,O):M(E,N))||O);return D>3&&O&&Object.defineProperty(E,N,O),O},g=this&&this.__param||function(x,E){return function(N,R){E(N,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const f=c(5871),b=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},y={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,N,R,M,D,O){var $;super(),this._viewportElement=x,this._screenElement=E,this._bufferService=N,this._decorationService=R,this._renderService=M,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(),($=this._viewportElement.parentElement)==null||$.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 U;(U=this._canvas)==null||U.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const 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(),y.full=0,y.left=0,y.center=_.left,y.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(y[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=d([g(2,k.IBufferService),g(3,k.IDecorationService),g(4,b.IRenderService),g(5,k.IOptionsService),g(6,b.ICoreBrowserService)],v)},2950:function(u,o,c){var d=this&&this.__decorate||function(w,_,y,v){var x,E=arguments.length,N=E<3?_:v===null?v=Object.getOwnPropertyDescriptor(_,y):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(w,_,y,v);else for(var R=w.length-1;R>=0;R--)(x=w[R])&&(N=(E<3?x(N):E>3?x(_,y,N):x(_,y))||N);return E>3&&N&&Object.defineProperty(_,y,N),N},g=this&&this.__param||function(w,_){return function(y,v){_(y,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const f=c(4725),b=c(2585),S=c(2584);let k=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,_,y,v,x,E){this._textarea=w,this._compositionView=_,this._bufferService=y,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 y;this._isSendingComposition=!1,_.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(_.start,_.end):this._textarea.value.substring(_.start),y.length>0&&this._coreService.triggerDataEvent(y,!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,y=_.replace(w,"");this._dataAlreadySent=y,_.length>w.length?this._coreService.triggerDataEvent(y,!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),y=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=y+"px",this._compositionView.style.lineHeight=y+"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=d([g(2,b.IBufferService),g(3,b.IOptionsService),g(4,b.ICoreService),g(5,f.IRenderService)],k)},9806:(u,o)=>{function c(d,g,f){const b=f.getBoundingClientRect(),S=d.getComputedStyle(f),k=parseInt(S.getPropertyValue("padding-left")),w=parseInt(S.getPropertyValue("padding-top"));return[g.clientX-b.left-k,g.clientY-b.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(d,g,f,b,S,k,w,_,y){if(!k)return;const v=c(d,g,f);return v?(v[0]=Math.ceil((v[0]+(y?w/2:0))/w),v[1]=Math.ceil(v[1]/_),v[0]=Math.min(Math.max(v[0],1),b+(y?1:0)),v[1]=Math.min(Math.max(v[1],1),S),v):void 0}},9504:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const d=c(2584);function g(_,y,v,x){const E=_-f(_,v),N=y-f(y,v),R=Math.abs(E-N)-(function(M,D,O){let P=0;const $=M-f(M,O),U=D-f(D,O);for(let q=0;q<Math.abs($-U);q++){const Y=b(M,D)==="A"?-1:1,K=O.buffer.lines.get($+Y*q);K!=null&&K.isWrapped&&P++}return P})(_,y,v);return w(R,k(b(_,y),x))}function f(_,y){let v=0,x=y.buffer.lines.get(_),E=x==null?void 0:x.isWrapped;for(;E&&_>=0&&_<y.rows;)v++,x=y.buffer.lines.get(--_),E=x==null?void 0:x.isWrapped;return v}function b(_,y){return _>y?"A":"B"}function S(_,y,v,x,E,N){let R=_,M=y,D="";for(;R!==v||M!==x;)R+=E?1:-1,E&&R>N.cols-1?(D+=N.buffer.translateBufferLineToString(M,!1,_,R),R=0,_=0,M++):!E&&R<0&&(D+=N.buffer.translateBufferLineToString(M,!1,0,_+1),R=N.cols-1,_=R,M--);return D+N.buffer.translateBufferLineToString(M,!1,_,R)}function k(_,y){const v=y?"O":"[";return d.C0.ESC+v+_}function w(_,y){_=Math.floor(_);let v="";for(let x=0;x<_;x++)v+=y;return v}o.moveToCellSequence=function(_,y,v,x){const E=v.buffer.x,N=v.buffer.y;if(!v.buffer.hasScrollback)return(function(D,O,P,$,U,q){return g(O,$,U,q).length===0?"":w(S(D,O,D,O-f(O,U),!1,U).length,k("D",q))})(E,N,0,y,v,x)+g(N,y,v,x)+(function(D,O,P,$,U,q){let Y;Y=g(O,$,U,q).length>0?$-f($,U):O;const K=$,V=(function(J,ne,F,j,I,L){let z;return z=g(F,j,I,L).length>0?j-f(j,I):ne,J<F&&z<=j||J>=F&&z<j?"C":"D"})(D,O,P,$,U,q);return w(S(D,Y,P,K,V==="C",U).length,k(V,q))})(E,N,_,y,v,x);let R;if(N===y)return R=E>_?"D":"C",w(Math.abs(E-_),k(R,x));R=N>y?"D":"C";const M=Math.abs(N-y);return w((function(D,O){return O.cols-D})(N>y?_:E,v)+(M-1)*v.cols+1+((N>y?E:_)-1),k(R,x))}},1296:function(u,o,c){var d=this&&this.__decorate||function(q,Y,K,V){var J,ne=arguments.length,F=ne<3?Y:V===null?V=Object.getOwnPropertyDescriptor(Y,K):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(q,Y,K,V);else for(var j=q.length-1;j>=0;j--)(J=q[j])&&(F=(ne<3?J(F):ne>3?J(Y,K,F):J(Y,K))||F);return ne>3&&F&&Object.defineProperty(Y,K,F),F},g=this&&this.__param||function(q,Y){return function(K,V){Y(K,V,q)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const f=c(3787),b=c(2550),S=c(2223),k=c(6171),w=c(6052),_=c(4725),y=c(8055),v=c(8460),x=c(844),E=c(2585),N="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",D="xterm-bg-",O="xterm-focus",P="xterm-selection";let $=1,U=o.DomRenderer=class extends x.Disposable{constructor(q,Y,K,V,J,ne,F,j,I,L,z,Z,X){super(),this._terminal=q,this._document=Y,this._element=K,this._screenElement=V,this._viewportElement=J,this._helperContainer=ne,this._linkifier2=F,this._charSizeService=I,this._optionsService=L,this._bufferService=z,this._coreBrowserService=Z,this._themeService=X,this._terminalClass=$++,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((ee=>this._injectCss(ee)))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(N+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ee=>this._handleLinkHover(ee)))),this.register(this._linkifier2.onHideLinkUnderline((ee=>this._handleLinkLeave(ee)))),this.register((0,x.toDisposable)((()=>{this._element.classList.remove(N+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new b.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 q=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*q,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*q),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/q),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/q),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Y=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,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(q){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Y=`${this._terminalSelector} .${R} { color: ${q.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Y+=`${this._terminalSelector} .${R} .xterm-dim { color: ${y.color.multiplyOpacity(q.foreground,.5).css};}`,Y+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const K=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${V} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${J} { 0% { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css}; } 50% { background-color: inherit; color: ${q.cursor.css}; }}`,Y+=`${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 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: ${J} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${q.cursor.css}; color: ${q.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${q.cursor.css} !important; color: ${q.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${q.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${q.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${q.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Y+=`${this._terminalSelector} .${P} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${P} div { position: absolute; background-color: ${q.selectionBackgroundOpaque.css};}${this._terminalSelector} .${P} div { position: absolute; background-color: ${q.selectionInactiveBackgroundOpaque.css};}`;for(const[ne,F]of q.ansi.entries())Y+=`${this._terminalSelector} .${M}${ne} { color: ${F.css}; }${this._terminalSelector} .${M}${ne}.xterm-dim { color: ${y.color.multiplyOpacity(F,.5).css}; }${this._terminalSelector} .${D}${ne} { background-color: ${F.css}; }`;Y+=`${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(q.background).css}; }${this._terminalSelector} .${M}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(q.background),.5).css}; }${this._terminalSelector} .${D}${S.INVERTED_DEFAULT_COLOR} { background-color: ${q.foreground.css}; }`,this._themeStyleElement.textContent=Y}_setDefaultSpacing(){const q=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${q}px`,this._rowFactory.defaultSpacing=q}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(q,Y){for(let K=this._rowElements.length;K<=Y;K++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(q,Y){this._refreshRowElements(q,Y),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(q,Y,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(q,Y,K),this.renderRows(0,this._bufferService.rows-1),!q||!Y)return;this._selectionRenderModel.update(this._terminal,q,Y,K);const V=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,ne=this._selectionRenderModel.viewportCappedStartRow,F=this._selectionRenderModel.viewportCappedEndRow;if(ne>=this._bufferService.rows||F<0)return;const j=this._document.createDocumentFragment();if(K){const I=q[0]>Y[0];j.appendChild(this._createSelectionElement(ne,I?Y[0]:q[0],I?q[0]:Y[0],F-ne+1))}else{const I=V===ne?q[0]:0,L=ne===J?Y[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(ne,I,L));const z=F-ne-1;if(j.appendChild(this._createSelectionElement(ne+1,0,this._bufferService.cols,z)),ne!==F){const Z=J===F?Y[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(F,0,Z))}}this._selectionContainer.appendChild(j)}_createSelectionElement(q,Y,K,V=1){const J=this._document.createElement("div"),ne=Y*this.dimensions.css.cell.width;let F=this.dimensions.css.cell.width*(K-Y);return ne+F>this.dimensions.css.canvas.width&&(F=this.dimensions.css.canvas.width-ne),J.style.height=V*this.dimensions.css.cell.height+"px",J.style.top=q*this.dimensions.css.cell.height+"px",J.style.left=`${ne}px`,J.style.width=`${F}px`,J}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 q of this._rowElements)q.replaceChildren()}renderRows(q,Y){const K=this._bufferService.buffer,V=K.ybase+K.y,J=Math.min(K.x,this._bufferService.cols-1),ne=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let I=q;I<=Y;I++){const L=I+K.ydisp,z=this._rowElements[I],Z=K.lines.get(L);if(!z||!Z)break;z.replaceChildren(...this._rowFactory.createRow(Z,L,L===V,F,j,J,ne,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${N}${this._terminalClass}`}_handleLinkHover(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!0)}_handleLinkLeave(q){this._setCellUnderline(q.x1,q.x2,q.y1,q.y2,q.cols,!1)}_setCellUnderline(q,Y,K,V,J,ne){K<0&&(q=0),V<0&&(Y=0);const F=this._bufferService.rows-1;K=Math.max(Math.min(K,F),0),V=Math.max(Math.min(V,F),0),J=Math.min(J,this._bufferService.cols);const j=this._bufferService.buffer,I=j.ybase+j.y,L=Math.min(j.x,J-1),z=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,X=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=K;ee<=V;++ee){const W=ee+j.ydisp,H=this._rowElements[ee],te=j.lines.get(W);if(!H||!te)break;H.replaceChildren(...this._rowFactory.createRow(te,W,W===I,Z,X,L,z,this.dimensions.css.cell.width,this._widthCache,ne?ee===K?q:0:-1,ne?(ee===V?Y:J)-1:-1))}}};o.DomRenderer=U=d([g(7,E.IInstantiationService),g(8,_.ICharSizeService),g(9,E.IOptionsService),g(10,E.IBufferService),g(11,_.ICoreBrowserService),g(12,_.IThemeService)],U)},3787:function(u,o,c){var d=this&&this.__decorate||function(R,M,D,O){var P,$=arguments.length,U=$<3?M:O===null?O=Object.getOwnPropertyDescriptor(M,D):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(R,M,D,O);else for(var q=R.length-1;q>=0;q--)(P=R[q])&&(U=($<3?P(U):$>3?P(M,D,U):P(M,D))||U);return $>3&&U&&Object.defineProperty(M,D,U),U},g=this&&this.__param||function(R,M){return function(D,O){M(D,O,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const f=c(2223),b=c(643),S=c(511),k=c(2585),w=c(8055),_=c(4725),y=c(4269),v=c(6171),x=c(3734);let E=o.DomRendererRowFactory=class{constructor(R,M,D,O,P,$,U){this._document=R,this._characterJoinerService=M,this._optionsService=D,this._coreBrowserService=O,this._coreService=P,this._decorationService=$,this._themeService=U,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,D){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=D}createRow(R,M,D,O,P,$,U,q,Y,K,V){const J=[],ne=this._characterJoinerService.getJoinedCharacters(M),F=this._themeService.colors;let j,I=R.getNoBgTrimmedLength();D&&I<$+1&&(I=$+1);let L=0,z="",Z=0,X=0,ee=0,W=!1,H=0,te=!1,ae=0;const pe=[],ce=K!==-1&&V!==-1;for(let Oe=0;Oe<I;Oe++){R.loadCell(Oe,this._workCell);let Ie=this._workCell.getWidth();if(Ie===0)continue;let Ue=!1,ut=Oe,Ne=this._workCell;if(ne.length>0&&Oe===ne[0][0]){Ue=!0;const nt=ne.shift();Ne=new y.JoinedCellData(this._workCell,R.translateToString(!0,nt[0],nt[1]),nt[1]-nt[0]),ut=nt[1]-1,Ie=Ne.getWidth()}const gn=this._isCellInSelection(Oe,M),Gt=D&&Oe===$,sn=ce&&Oe>=K&&Oe<=V;let Wt=!1;this._decorationService.forEachDecorationAtCell(Oe,M,void 0,(nt=>{Wt=!0}));let $n=Ne.getChars()||b.WHITESPACE_CELL_CHAR;if($n===" "&&(Ne.isUnderline()||Ne.isOverline())&&($n=" "),ae=Ie*q-Y.get($n,Ne.isBold(),Ne.isItalic()),j){if(L&&(gn&&te||!gn&&!te&&Ne.bg===Z)&&(gn&&te&&F.selectionForeground||Ne.fg===X)&&Ne.extended.ext===ee&&sn===W&&ae===H&&!Gt&&!Ue&&!Wt){Ne.isInvisible()?z+=b.WHITESPACE_CELL_CHAR:z+=$n,L++;continue}L&&(j.textContent=z),j=this._document.createElement("span"),L=0,z=""}else j=this._document.createElement("span");if(Z=Ne.bg,X=Ne.fg,ee=Ne.extended.ext,W=sn,H=ae,te=gn,Ue&&$>=Oe&&$<=ut&&($=Oe),!this._coreService.isCursorHidden&&Gt&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&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(Ne.isBold()&&pe.push("xterm-bold"),Ne.isItalic()&&pe.push("xterm-italic"),Ne.isDim()&&pe.push("xterm-dim"),z=Ne.isInvisible()?b.WHITESPACE_CELL_CHAR:Ne.getChars()||b.WHITESPACE_CELL_CHAR,Ne.isUnderline()&&(pe.push(`xterm-underline-${Ne.extended.underlineStyle}`),z===" "&&(z=" "),!Ne.isUnderlineColorDefault()))if(Ne.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let nt=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&nt<8&&(nt+=8),j.style.textDecorationColor=F.ansi[nt].css}Ne.isOverline()&&(pe.push("xterm-overline"),z===" "&&(z=" ")),Ne.isStrikethrough()&&pe.push("xterm-strikethrough"),sn&&(j.style.textDecoration="underline");let Mt=Ne.getFgColor(),Tt=Ne.getFgColorMode(),Zt=Ne.getBgColor(),he=Ne.getBgColorMode();const Se=!!Ne.isInverse();if(Se){const nt=Mt;Mt=Zt,Zt=nt;const Rt=Tt;Tt=he,he=Rt}let Re,Pe,qe,wt=!1;switch(this._decorationService.forEachDecorationAtCell(Oe,M,void 0,(nt=>{nt.options.layer!=="top"&&wt||(nt.backgroundColorRGB&&(he=50331648,Zt=nt.backgroundColorRGB.rgba>>8&16777215,Re=nt.backgroundColorRGB),nt.foregroundColorRGB&&(Tt=50331648,Mt=nt.foregroundColorRGB.rgba>>8&16777215,Pe=nt.foregroundColorRGB),wt=nt.options.layer==="top")})),!wt&&gn&&(Re=this._coreBrowserService.isFocused?F.selectionBackgroundOpaque:F.selectionInactiveBackgroundOpaque,Zt=Re.rgba>>8&16777215,he=50331648,wt=!0,F.selectionForeground&&(Tt=50331648,Mt=F.selectionForeground.rgba>>8&16777215,Pe=F.selectionForeground)),wt&&pe.push("xterm-decoration-top"),he){case 16777216:case 33554432:qe=F.ansi[Zt],pe.push(`xterm-bg-${Zt}`);break;case 50331648:qe=w.channels.toColor(Zt>>16,Zt>>8&255,255&Zt),this._addStyle(j,`background-color:#${N((Zt>>>0).toString(16),"0",6)}`);break;default:Se?(qe=F.foreground,pe.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):qe=F.background}switch(Re||Ne.isDim()&&(Re=w.color.multiplyOpacity(qe,.5)),Tt){case 16777216:case 33554432:Ne.isBold()&&Mt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Mt+=8),this._applyMinimumContrast(j,qe,F.ansi[Mt],Ne,Re,void 0)||pe.push(`xterm-fg-${Mt}`);break;case 50331648:const nt=w.channels.toColor(Mt>>16&255,Mt>>8&255,255&Mt);this._applyMinimumContrast(j,qe,nt,Ne,Re,Pe)||this._addStyle(j,`color:#${N(Mt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,qe,F.foreground,Ne,Re,Pe)||Se&&pe.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}pe.length&&(j.className=pe.join(" "),pe.length=0),Gt||Ue||Wt?j.textContent=z:L++,ae!==this.defaultSpacing&&(j.style.letterSpacing=`${ae}px`),J.push(j),Oe=ut}return j&&L&&(j.textContent=z),J}_applyMinimumContrast(R,M,D,O,P,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,v.treatGlyphAsBackgroundColor)(O.getCode()))return!1;const U=this._getContrastCache(O);let q;if(P||$||(q=U.getColor(M.rgba,D.rgba)),q===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(O.isDim()?2:1);q=w.color.ensureContrastRatio(P||M,$||D,Y),U.setColor((P||M).rgba,($||D).rgba,q!=null?q:null)}return!!q&&(this._addStyle(R,`color:${q.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const D=this._selectionStart,O=this._selectionEnd;return!(!D||!O)&&(this._columnSelectMode?D[0]<=O[0]?R>=D[0]&&M>=D[1]&&R<O[0]&&M<=O[1]:R<D[0]&&M>=D[1]&&R>=O[0]&&M<=O[1]:M>D[1]&&M<O[1]||D[1]===O[1]&&M===D[1]&&R>=D[0]&&R<O[0]||D[1]<O[1]&&M===O[1]&&R<O[0]||D[1]<O[1]&&M===D[1]&&R>=D[0])}};function N(R,M,D){for(;R.length<D;)R=M+R;return R}o.DomRendererRowFactory=E=d([g(1,_.ICharacterJoinerService),g(2,k.IOptionsService),g(3,_.ICoreBrowserService),g(4,k.ICoreService),g(5,k.IDecorationService),g(6,_.IThemeService)],E)},2550:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,d){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 g=c.createElement("span");g.classList.add("xterm-char-measure-element");const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.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=[g,f,b,S],this._container.appendChild(g),this._container.appendChild(f),this._container.appendChild(b),this._container.appendChild(S),d.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,d,g,f){c===this._font&&d===this._fontSize&&g===this._weight&&f===this._weightBold||(this._font=c,this._fontSize=d,this._weight=g,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(c,d,g){let f=0;if(!d&&!g&&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 b=c;d&&(b+="B"),g&&(b+="I");let S=this._holey.get(b);if(S===void 0){let k=0;d&&(k|=1),g&&(k|=2),S=this._measure(c,k),S>0&&this._holey.set(b,S)}return S}_measure(c,d){const g=this._measureElements[d];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(u,o)=>{function c(g){return 57508<=g&&g<=57558}function d(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=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(g){if(!g)throw new Error("value must not be falsy");return g},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},o.isEmoji=d,o.allowRescaling=function(g,f,b,S){return f===1&&b>Math.ceil(1.5*S)&&g!==void 0&&g>255&&!d(g)&&!c(g)&&!(function(k){return 57344<=k&&k<=63743})(g)},o.treatGlyphAsBackgroundColor=function(g){return c(g)||(function(f){return 9472<=f&&f<=9631})(g)},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(g,f,b=0){return(g-(2*Math.round(f)-b))%(2*Math.round(f))}},6052:(u,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(g,f,b,S=!1){if(this.selectionStart=f,this.selectionEnd=b,!f||!b||f[0]===b[0]&&f[1]===b[1])return void this.clear();const k=g.buffers.active.ydisp,w=f[1]-k,_=b[1]-k,y=Math.max(w,0),v=Math.min(_,g.rows-1);y>=g.rows||v<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=w,this.viewportEndRow=_,this.viewportCappedStartRow=y,this.viewportCappedEndRow=v,this.startCol=f[0],this.endCol=b[0])}isCellSelected(g,f,b){return!!this.hasSelection&&(b-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&b>=this.viewportCappedStartRow&&f<this.endCol&&b<=this.viewportCappedEndRow:f<this.startCol&&b>=this.viewportCappedStartRow&&f>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&f>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(u,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,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[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(u,o,c){var d=this&&this.__decorate||function(v,x,E,N){var R,M=arguments.length,D=M<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,N);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(M<3?R(D):M>3?R(x,E,D):R(x,E))||D);return M>3&&D&&Object.defineProperty(x,E,D),D},g=this&&this.__param||function(v,x){return function(E,N){x(E,N,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const f=c(2585),b=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 b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(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=d([g(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,N){super(),this._document=x,this._parentElement=E,this._optionsService=N,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 y 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(u,o,c){var d=this&&this.__decorate||function(y,v,x,E){var N,R=arguments.length,M=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,v,x,E);else for(var D=y.length-1;D>=0;D--)(N=y[D])&&(M=(R<3?N(M):R>3?N(v,x,M):N(v,x))||M);return R>3&&M&&Object.defineProperty(v,x,M),M},g=this&&this.__param||function(y,v){return function(x,E){v(x,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const f=c(3734),b=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 OC{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=[],N=x.translateToString(!0);let R=0,M=0,D=0,O=x.getFg(0),P=x.getBg(0);for(let $=0;$<x.getTrimmedLength();$++)if(x.loadCell($,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==O||this._workCell.bg!==P){if($-R>1){const U=this._getJoinedRanges(N,D,M,x,R);for(let q=0;q<U.length;q++)E.push(U[q])}R=$,D=M,O=this._workCell.fg,P=this._workCell.bg}M+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const $=this._getJoinedRanges(N,D,M,x,R);for(let U=0;U<$.length;U++)E.push($[U])}return E}_getJoinedRanges(v,x,E,N,R){const M=v.substring(x,E);let D=[];try{D=this._characterJoiners[0].handler(M)}catch(O){console.error(O)}for(let O=1;O<this._characterJoiners.length;O++)try{const P=this._characterJoiners[O].handler(M);for(let $=0;$<P.length;$++)OC._mergeRanges(D,P[$])}catch(P){console.error(P)}return this._stringRangesToCellRanges(D,N,R),D}_stringRangesToCellRanges(v,x,E){let N=0,R=!1,M=0,D=v[N];if(D){for(let O=E;O<this._bufferService.cols;O++){const P=x.getWidth(O),$=x.getString(O).length||b.WHITESPACE_CELL_CHAR.length;if(P!==0){if(!R&&D[0]<=M&&(D[0]=O,R=!0),D[1]<=M){if(D[1]=O,D=v[++N],!D)break;D[0]<=M?(D[0]=O,R=!0):R=!1}M+=$}}D&&(D[1]=this._bufferService.cols)}}static _mergeRanges(v,x){let E=!1;for(let N=0;N<v.length;N++){const R=v[N];if(E){if(x[1]<=R[0])return v[N-1][1]=x[1],v;if(x[1]<=R[1])return v[N-1][1]=Math.max(x[1],R[1]),v.splice(N,1),v;v.splice(N,1),N--}else{if(x[1]<=R[0])return v.splice(N,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=_=d([g(0,k.IBufferService)],_)},5114:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const d=c(844),g=c(8460),f=c(3656);class b extends d.Disposable{constructor(w,_,y){super(),this._textarea=w,this._window=_,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((v=>this._screenDprMonitor.setWindow(v)))),this.register((0,g.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=b;class S extends d.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.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:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const d=c(844);class g extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const S=this.linkProviders.indexOf(b);S!==-1&&this.linkProviders.splice(S,1)}}}}o.LinkProviderService=g},8934:function(u,o,c){var d=this&&this.__decorate||function(k,w,_,y){var v,x=arguments.length,E=x<3?w:y===null?y=Object.getOwnPropertyDescriptor(w,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(k,w,_,y);else for(var N=k.length-1;N>=0;N--)(v=k[N])&&(E=(x<3?v(E):x>3?v(w,_,E):v(w,_))||E);return x>3&&E&&Object.defineProperty(w,_,E),E},g=this&&this.__param||function(k,w){return function(_,y){w(_,y,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const f=c(4725),b=c(9806);let S=o.MouseService=class{constructor(k,w){this._renderService=k,this._charSizeService=w}getCoords(k,w,_,y,v){return(0,b.getCoords)(window,k,w,_,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,v)}getMouseReportCoords(k,w){const _=(0,b.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=d([g(0,f.IRenderService),g(1,f.ICharSizeService)],S)},3230:function(u,o,c){var d=this&&this.__decorate||function(v,x,E,N){var R,M=arguments.length,D=M<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,N);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(M<3?R(D):M>3?R(x,E,D):R(x,E))||D);return M>3&&D&&Object.defineProperty(x,E,D),D},g=this&&this.__param||function(v,x){return function(E,N){x(E,N,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const f=c(6193),b=c(4725),S=c(8460),k=c(844),w=c(7226),_=c(2585);let y=o.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(v,x,E,N,R,M,D,O){super(),this._rowCount=v,this._charSizeService=N,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,$)=>this._renderRows(P,$)),D),this.register(this._renderDebouncer),this.register(D.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.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(M.cols,M.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.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((N=>this._handleIntersectionChange(N[N.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 N;this._selectionState.start=v,this._selectionState.end=x,this._selectionState.columnSelectMode=E,(N=this._renderer.value)==null||N.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=y=d([g(2,_.IOptionsService),g(3,b.ICharSizeService),g(4,_.IDecorationService),g(5,_.IBufferService),g(6,b.ICoreBrowserService),g(7,b.IThemeService)],y)},9312:function(u,o,c){var d=this&&this.__decorate||function(D,O,P,$){var U,q=arguments.length,Y=q<3?O:$===null?$=Object.getOwnPropertyDescriptor(O,P):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(D,O,P,$);else for(var K=D.length-1;K>=0;K--)(U=D[K])&&(Y=(q<3?U(Y):q>3?U(O,P,Y):U(O,P))||Y);return q>3&&Y&&Object.defineProperty(O,P,Y),Y},g=this&&this.__param||function(D,O){return function(P,$){O(P,$,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const f=c(9806),b=c(9504),S=c(456),k=c(4725),w=c(8460),_=c(844),y=c(6114),v=c(4841),x=c(511),E=c(2585),N=" ",R=new RegExp(N,"g");let M=o.SelectionService=class extends _.Disposable{constructor(D,O,P,$,U,q,Y,K,V){super(),this._element=D,this._screenElement=O,this._linkifier=P,this._bufferService=$,this._coreService=U,this._mouseService=q,this._optionsService=Y,this._renderService=K,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=J=>this._handleMouseMove(J),this._mouseUpListener=J=>this._handleMouseUp(J),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((J=>this._handleTrim(J))),this.register(this._bufferService.buffers.onBufferActivate((J=>this._handleBufferActivate(J)))),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,$=[];if(this._activeSelectionMode===3){if(D[0]===O[0])return"";const U=D[0]<O[0]?D[0]:O[0],q=D[0]<O[0]?O[0]:D[0];for(let Y=D[1];Y<=O[1];Y++){const K=P.translateBufferLineToString(Y,!0,U,q);$.push(K)}}else{const U=D[1]===O[1]?O[0]:void 0;$.push(P.translateBufferLineToString(D[1],!0,D[0],U));for(let q=D[1]+1;q<=O[1]-1;q++){const Y=P.lines.get(q),K=P.translateBufferLineToString(q,!0);Y!=null&&Y.isWrapped?$[$.length-1]+=K:$.push(K)}if(D[1]!==O[1]){const q=P.lines.get(O[1]),Y=P.translateBufferLineToString(O[1],!0,0,O[0]);q&&q.isWrapped?$[$.length-1]+=Y:$.push(Y)}}return $.map((U=>U.replace(R," "))).join(y.isWindows?`\r
473
- `:`
474
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(D){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.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,$=this._model.finalSelectionEnd;return!!(P&&$&&O)&&this._areCoordsInSelection(O,P,$)}isCellInSelection(D,O){const P=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!P||!$)&&this._areCoordsInSelection([D,O],P,$)}_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 U,q;const P=(q=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:q.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 $=this._getMouseBufferCoords(D);return!!$&&(this._selectWordAt($,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 y.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&&!(y.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 $=P.lines.get(this._model.selectionEnd[1]);$&&$.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 $=(0,b.moveToCellSequence)(P[0]-1,P[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!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 $=0;O>=$;$++){const U=D.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?P--:U>1&&O!==$&&(P+=U-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,$=!0){if(D[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,q=U.lines.get(D[1]);if(!q)return;const Y=U.translateBufferLineToString(D[1],!1);let K=this._convertViewportColToCharacterIndex(q,D[0]),V=K;const J=D[0]-K;let ne=0,F=0,j=0,I=0;if(Y.charAt(K)===" "){for(;K>0&&Y.charAt(K-1)===" ";)K--;for(;V<Y.length&&Y.charAt(V+1)===" ";)V++}else{let Z=D[0],X=D[0];q.getWidth(Z)===0&&(ne++,Z--),q.getWidth(X)===2&&(F++,X++);const ee=q.getString(X).length;for(ee>1&&(I+=ee-1,V+=ee-1);Z>0&&K>0&&!this._isCharWordSeparator(q.loadCell(Z-1,this._workCell));){q.loadCell(Z-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,Z--):W>1&&(j+=W-1,K-=W-1),K--,Z--}for(;X<q.length&&V+1<Y.length&&!this._isCharWordSeparator(q.loadCell(X+1,this._workCell));){q.loadCell(X+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(F++,X++):W>1&&(I+=W-1,V+=W-1),V++,X++}}V++;let L=K+J-ne+j,z=Math.min(this._bufferService.cols,V-K+ne+F-j-I);if(O||Y.slice(K,V).trim()!==""){if(P&&L===0&&q.getCodePoint(0)!==32){const Z=U.lines.get(D[1]-1);if(Z&&q.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const X=this._getWordAt([this._bufferService.cols-1,D[1]-1],!1,!0,!1);if(X){const ee=this._bufferService.cols-X.start;L-=ee,z+=ee}}}if($&&L+z===this._bufferService.cols&&q.getCodePoint(this._bufferService.cols-1)!==32){const Z=U.lines.get(D[1]+1);if(Z!=null&&Z.isWrapped&&Z.getCodePoint(0)!==32){const X=this._getWordAt([0,D[1]+1],!1,!1,!0);X&&(z+=X.length)}}return{start:L,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=M=d([g(3,E.IBufferService),g(4,E.ICoreService),g(5,k.IMouseService),g(6,E.IOptionsService),g(7,k.IRenderService),g(8,k.ICoreBrowserService)],M)},4725:(u,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 d=c(8343);o.ICharSizeService=(0,d.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),o.IMouseService=(0,d.createDecorator)("MouseService"),o.IRenderService=(0,d.createDecorator)("RenderService"),o.ISelectionService=(0,d.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,d.createDecorator)("ThemeService"),o.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(u,o,c){var d=this&&this.__decorate||function(M,D,O,P){var $,U=arguments.length,q=U<3?D:P===null?P=Object.getOwnPropertyDescriptor(D,O):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(M,D,O,P);else for(var Y=M.length-1;Y>=0;Y--)($=M[Y])&&(q=(U<3?$(q):U>3?$(D,O,q):$(D,O))||q);return U>3&&q&&Object.defineProperty(D,O,q),q},g=this&&this.__param||function(M,D){return function(O,P){D(O,P,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const f=c(7239),b=c(8055),S=c(8460),k=c(844),w=c(2585),_=b.css.toColor("#ffffff"),y=b.css.toColor("#000000"),v=b.css.toColor("#ffffff"),x=b.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],D=[0,95,135,175,215,255];for(let O=0;O<216;O++){const P=D[O/36%6|0],$=D[O/6%6|0],U=D[O%6];M.push({css:b.channels.toCss(P,$,U),rgba:b.channels.toRgba(P,$,U)})}for(let O=0;O<24;O++){const P=8+10*O;M.push({css:b.channels.toCss(P,P,P),rgba:b.channels.toRgba(P,P,P)})}return M})());let N=o.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,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:y,cursor:v,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:b.color.blend(y,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:b.color.blend(y,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(M={}){const D=this._colors;if(D.foreground=R(M.foreground,_),D.background=R(M.background,y),D.cursor=R(M.cursor,v),D.cursorAccent=R(M.cursorAccent,x),D.selectionBackgroundTransparent=R(M.selectionBackground,E),D.selectionBackgroundOpaque=b.color.blend(D.background,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,D.selectionBackgroundTransparent),D.selectionInactiveBackgroundOpaque=b.color.blend(D.background,D.selectionInactiveBackgroundTransparent),D.selectionForeground=M.selectionForeground?R(M.selectionForeground,b.NULL_COLOR):void 0,D.selectionForeground===b.NULL_COLOR&&(D.selectionForeground=void 0),b.color.isOpaque(D.selectionBackgroundTransparent)&&(D.selectionBackgroundTransparent=b.color.opacity(D.selectionBackgroundTransparent,.3)),b.color.isOpaque(D.selectionInactiveBackgroundTransparent)&&(D.selectionInactiveBackgroundTransparent=b.color.opacity(D.selectionInactiveBackgroundTransparent,.3)),D.ansi=o.DEFAULT_ANSI_COLORS.slice(),D.ansi[0]=R(M.black,o.DEFAULT_ANSI_COLORS[0]),D.ansi[1]=R(M.red,o.DEFAULT_ANSI_COLORS[1]),D.ansi[2]=R(M.green,o.DEFAULT_ANSI_COLORS[2]),D.ansi[3]=R(M.yellow,o.DEFAULT_ANSI_COLORS[3]),D.ansi[4]=R(M.blue,o.DEFAULT_ANSI_COLORS[4]),D.ansi[5]=R(M.magenta,o.DEFAULT_ANSI_COLORS[5]),D.ansi[6]=R(M.cyan,o.DEFAULT_ANSI_COLORS[6]),D.ansi[7]=R(M.white,o.DEFAULT_ANSI_COLORS[7]),D.ansi[8]=R(M.brightBlack,o.DEFAULT_ANSI_COLORS[8]),D.ansi[9]=R(M.brightRed,o.DEFAULT_ANSI_COLORS[9]),D.ansi[10]=R(M.brightGreen,o.DEFAULT_ANSI_COLORS[10]),D.ansi[11]=R(M.brightYellow,o.DEFAULT_ANSI_COLORS[11]),D.ansi[12]=R(M.brightBlue,o.DEFAULT_ANSI_COLORS[12]),D.ansi[13]=R(M.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),D.ansi[14]=R(M.brightCyan,o.DEFAULT_ANSI_COLORS[14]),D.ansi[15]=R(M.brightWhite,o.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const O=Math.min(D.ansi.length-16,M.extendedAnsi.length);for(let P=0;P<O;P++)D.ansi[P+16]=R(M.extendedAnsi[P],o.DEFAULT_ANSI_COLORS[P+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[M]=this._restoreColors.ansi[M]}else for(let D=0;D<this._restoreColors.ansi.length;++D)this._colors.ansi[D]=this._restoreColors.ansi[D]}modifyColors(M){M(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(M,D){if(M!==void 0)try{return b.css.toColor(M)}catch{}return D}o.ThemeService=N=d([g(0,w.IOptionsService)],N)},6349:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const d=c(8460),g=c(844);class f extends g.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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 y=k-1;y>=0;y--)this.set(S+y+w,this.get(S+y));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:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(d,g=5){if(typeof d!="object")return d;const f=Array.isArray(d)?[]:{};for(const b in d)f[b]=g<=1?d[b]:d[b]&&c(d[b],g-1);return f}},8055:(u,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,d=0,g=0,f=0;var b,S,k,w,_;function y(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,N,R,M){return M!==void 0?`#${y(E)}${y(N)}${y(R)}${y(M)}`:`#${y(E)}${y(N)}${y(R)}`},x.toRgba=function(E,N,R,M=255){return(E<<24|N<<16|R<<8|M)>>>0},x.toColor=function(E,N,R,M){return{css:x.toCss(E,N,R,M),rgba:x.toRgba(E,N,R,M)}}})(b||(o.channels=b={})),(function(x){function E(N,R){return f=Math.round(255*R),[c,d,g]=_.toChannels(N.rgba),{css:b.toCss(c,d,g,f),rgba:b.toRgba(c,d,g,f)}}x.blend=function(N,R){if(f=(255&R.rgba)/255,f===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,D=R.rgba>>16&255,O=R.rgba>>8&255,P=N.rgba>>24&255,$=N.rgba>>16&255,U=N.rgba>>8&255;return c=P+Math.round((M-P)*f),d=$+Math.round((D-$)*f),g=U+Math.round((O-U)*f),{css:b.toCss(c,d,g),rgba:b.toRgba(c,d,g)}},x.isOpaque=function(N){return(255&N.rgba)==255},x.ensureContrastRatio=function(N,R,M){const D=_.ensureContrastRatio(N.rgba,R.rgba,M);if(D)return b.toColor(D>>24&255,D>>16&255,D>>8&255)},x.opaque=function(N){const R=(255|N.rgba)>>>0;return[c,d,g]=_.toChannels(R),{css:b.toCss(c,d,g),rgba:R}},x.opacity=E,x.multiplyOpacity=function(N,R){return f=255&N.rgba,E(N,f*R/255)},x.toColorRGB=function(N){return[N.rgba>>24&255,N.rgba>>16&255,N.rgba>>8&255]}})(S||(o.color=S={})),(function(x){let E,N;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(E=M,E.globalCompositeOperation="copy",N=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),d=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),b.toColor(c,d,g);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),f=parseInt(R.slice(4,5).repeat(2),16),b.toColor(c,d,g,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 M=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(M)return c=parseInt(M[1]),d=parseInt(M[2]),g=parseInt(M[3]),f=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),b.toColor(c,d,g,f);if(!E||!N)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=N,E.fillStyle=R,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,d,g,f]=E.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(c,d,g,f),css:R}}})(k||(o.css=k={})),(function(x){function E(N,R,M){const D=N/255,O=R/255,P=M/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(N){return E(N>>16&255,N>>8&255,255&N)},x.relativeLuminance2=E})(w||(o.rgb=w={})),(function(x){function E(R,M,D){const O=R>>24&255,P=R>>16&255,$=R>>8&255;let U=M>>24&255,q=M>>16&255,Y=M>>8&255,K=v(w.relativeLuminance2(U,q,Y),w.relativeLuminance2(O,P,$));for(;K<D&&(U>0||q>0||Y>0);)U-=Math.max(0,Math.ceil(.1*U)),q-=Math.max(0,Math.ceil(.1*q)),Y-=Math.max(0,Math.ceil(.1*Y)),K=v(w.relativeLuminance2(U,q,Y),w.relativeLuminance2(O,P,$));return(U<<24|q<<16|Y<<8|255)>>>0}function N(R,M,D){const O=R>>24&255,P=R>>16&255,$=R>>8&255;let U=M>>24&255,q=M>>16&255,Y=M>>8&255,K=v(w.relativeLuminance2(U,q,Y),w.relativeLuminance2(O,P,$));for(;K<D&&(U<255||q<255||Y<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),q=Math.min(255,q+Math.ceil(.1*(255-q))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),K=v(w.relativeLuminance2(U,q,Y),w.relativeLuminance2(O,P,$));return(U<<24|q<<16|Y<<8|255)>>>0}x.blend=function(R,M){if(f=(255&M)/255,f===1)return M;const D=M>>24&255,O=M>>16&255,P=M>>8&255,$=R>>24&255,U=R>>16&255,q=R>>8&255;return c=$+Math.round((D-$)*f),d=U+Math.round((O-U)*f),g=q+Math.round((P-q)*f),b.toRgba(c,d,g)},x.ensureContrastRatio=function(R,M,D){const O=w.relativeLuminance(R>>8),P=w.relativeLuminance(M>>8);if(v(O,P)<D){if(P<O){const q=E(R,M,D),Y=v(O,w.relativeLuminance(q>>8));if(Y<D){const K=N(R,M,D);return Y>v(O,w.relativeLuminance(K>>8))?q:K}return q}const $=N(R,M,D),U=v(O,w.relativeLuminance($>>8));if(U<D){const q=E(R,M,D);return U>v(O,w.relativeLuminance(q>>8))?$:q}return $}},x.reduceLuminance=E,x.increaseLuminance=N,x.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(_||(o.rgba=_={})),o.toPaddedHex=y,o.contrastRatio=v},8969:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const d=c(844),g=c(2585),f=c(4348),b=c(7866),S=c(744),k=c(7302),w=c(6975),_=c(8460),y=c(1753),v=c(1480),x=c(7994),E=c(9282),N=c(5435),R=c(5981),M=c(2660);let D=!1;class O extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new _.EventEmitter),this._onScroll.event(($=>{var U;(U=this._onScrollApi)==null||U.fire($.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($){for(const U in $)this.optionsService.options[U]=$[U]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new d.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($)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new N.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((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((U,q)=>this._inputHandler.parse(U,q)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,U){this._writeBuffer.write($,U)}writeSync($,U){this._logService.logLevel<=g.LogLevelEnum.WARN&&!D&&(this._logService.warn("writeSync is unreliable and will be removed soon."),D=!0),this._writeBuffer.writeSync($,U)}input($,U=!0){this.coreService.triggerDataEvent($,U)}resize($,U){isNaN($)||isNaN(U)||($=Math.max($,S.MINIMUM_COLS),U=Math.max(U,S.MINIMUM_ROWS),this._bufferService.resize($,U))}scroll($,U=!1){this._bufferService.scroll($,U)}scrollLines($,U,q){this._bufferService.scrollLines($,U,q)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const U=$-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler($,U){return this._inputHandler.registerEscHandler($,U)}registerDcsHandler($,U){return this._inputHandler.registerDcsHandler($,U)}registerCsiHandler($,U){return this._inputHandler.registerCsiHandler($,U)}registerOscHandler($,U){return this._inputHandler.registerOscHandler($,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?$=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const U of $)U.dispose()}))}}}o.CoreTerminal=O},8460:(u,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 d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,d){const g=[];for(let f=0;f<this._listeners.length;f++)g.push(this._listeners[f]);for(let f=0;f<g.length;f++)g[f].call(void 0,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,d){return c((g=>d.fire(g)))},o.runAndSubscribe=function(c,d){return d(void 0),c((g=>d(g)))}},5435:function(u,o,c){var d=this&&this.__decorate||function(ne,F,j,I){var L,z=arguments.length,Z=z<3?F:I===null?I=Object.getOwnPropertyDescriptor(F,j):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(ne,F,j,I);else for(var X=ne.length-1;X>=0;X--)(L=ne[X])&&(Z=(z<3?L(Z):z>3?L(F,j,Z):L(F,j))||Z);return z>3&&Z&&Object.defineProperty(F,j,Z),Z},g=this&&this.__param||function(ne,F){return function(j,I){F(j,I,ne)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const f=c(2584),b=c(7116),S=c(2015),k=c(844),w=c(482),_=c(8437),y=c(8460),v=c(643),x=c(511),E=c(3734),N=c(2585),R=c(1480),M=c(6242),D=c(6351),O=c(5941),P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function U(ne,F){if(ne>24)return F.setWinLines||!1;switch(ne){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 q;(function(ne){ne[ne.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ne[ne.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(q||(o.WindowsOptionsReportType=q={}));let Y=0;class K extends k.Disposable{getAttrData(){return this._curAttrData}constructor(F,j,I,L,z,Z,X,ee,W=new S.EscapeSequenceParser){super(),this._bufferService=F,this._charsetService=j,this._coreService=I,this._logService=L,this._optionsService=z,this._oscLinkService=Z,this._coreMouseService=X,this._unicodeService=ee,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 y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.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,te)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:te.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,te,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:te,data:ae})})),this._parser.setDcsHandlerFallback(((H,te,ae)=>{te==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:te,payload:ae})})),this._parser.setPrintHandler(((H,te,ae)=>this.print(H,te,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 M.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new M.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new M.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new M.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new M.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new M.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new M.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new M.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new M.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new M.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new M.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 b.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,te)=>this.requestStatusString(H,te))))}_preserveStack(F,j,I,L){this._parseStack.paused=!0,this._parseStack.cursorStartX=F,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=I,this._parseStack.position=L}_logSlowResolvingAsync(F){this._logService.logLevel<=N.LogLevelEnum.WARN&&Promise.race([F,new Promise(((j,I)=>setTimeout((()=>I("#SLOW_TIMEOUT")),5e3)))]).catch((j=>{if(j!=="#SLOW_TIMEOUT")throw j;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(F,j){let I,L=this._activeBuffer.x,z=this._activeBuffer.y,Z=0;const X=this._parseStack.paused;if(X){if(I=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(I),I;L=this._parseStack.cursorStartX,z=this._parseStack.cursorStartY,this._parseStack.paused=!1,F.length>$&&(Z=this._parseStack.position+$)}if(this._logService.logLevel<=N.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<$&&(this._parseBuffer=new Uint32Array(Math.min(F.length,$))),X||this._dirtyRowTracker.clearRange(),F.length>$)for(let H=Z;H<F.length;H+=$){const te=H+$<F.length?H+$:F.length,ae=typeof F=="string"?this._stringDecoder.decode(F.substring(H,te),this._parseBuffer):this._utf8Decoder.decode(F.subarray(H,te),this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,ae))return this._preserveStack(L,z,ae,H),this._logSlowResolvingAsync(I),I}else if(!X){const H=typeof F=="string"?this._stringDecoder.decode(F,this._parseBuffer):this._utf8Decoder.decode(F,this._parseBuffer);if(I=this._parser.parse(this._parseBuffer,H))return this._preserveStack(L,z,H,0),this._logSlowResolvingAsync(I),I}this._activeBuffer.x===L&&this._activeBuffer.y===z||this._onCursorMove.fire();const ee=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(ee,this._bufferService.rows-1))}print(F,j,I){let L,z;const Z=this._charsetService.charset,X=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,te=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&I-j>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,te);let pe=this._parser.precedingJoinState;for(let ce=j;ce<I;++ce){if(L=F[ce],L<127&&Z){const ut=Z[String.fromCharCode(L)];ut&&(L=ut.charCodeAt(0))}const Oe=this._unicodeService.charProperties(L,pe);z=R.UnicodeService.extractWidth(Oe);const Ie=R.UnicodeService.extractShouldJoin(Oe),Ue=Ie?R.UnicodeService.extractWidth(pe):0;if(pe=Oe,X&&this._onA11yChar.fire((0,w.stringFromCodePoint)(L)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+z-Ue>ee){if(W){const ut=ae;let Ne=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),Ue>0&&ae instanceof _.BufferLine&&ae.copyCellsFrom(ut,Ne,0,Ue,!1);Ne<ee;)ut.setCellFromCodepoint(Ne++,0,1,te)}else if(this._activeBuffer.x=ee-1,z===2)continue}if(Ie&&this._activeBuffer.x){const ut=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-ut,L,z);for(let Ne=z-Ue;--Ne>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}else if(H&&(ae.insertCells(this._activeBuffer.x,z-Ue,this._activeBuffer.getNullCell(te)),ae.getWidth(ee-1)===2&&ae.setCellFromCodepoint(ee-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,te)),ae.setCellFromCodepoint(this._activeBuffer.x++,L,z,te),z>0)for(;--z;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}this._parser.precedingJoinState=pe,this._activeBuffer.x<ee&&I-j>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,te),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(F,j){return F.final!=="t"||F.prefix||F.intermediates?this._parser.registerCsiHandler(F,j):this._parser.registerCsiHandler(F,(I=>!U(I.params[0],this._optionsService.rawOptions.windowOptions)||j(I)))}registerDcsHandler(F,j){return this._parser.registerDcsHandler(F,new D.DcsHandler(j))}registerEscHandler(F,j){return this._parser.registerEscHandler(F,j)}registerOscHandler(F,j){return this._parser.registerOscHandler(F,new M.OscHandler(j))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var 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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const 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,j){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=F,this._activeBuffer.y=this._activeBuffer.scrollTop+j):(this._activeBuffer.x=F,this._activeBuffer.y=j),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(F,j){this._restrictCursor(),this._setCursor(this._activeBuffer.x+F,this._activeBuffer.y+j)}cursorUp(F){const j=this._activeBuffer.y-this._activeBuffer.scrollTop;return j>=0?this._moveCursor(0,-Math.min(j,F.params[0]||1)):this._moveCursor(0,-(F.params[0]||1)),!0}cursorDown(F){const j=this._activeBuffer.scrollBottom-this._activeBuffer.y;return j>=0?this._moveCursor(0,Math.min(j,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 j=F.params[0];return j===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:j===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=F.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(F){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=F.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(F){const j=F.params[0];return j===1&&(this._curAttrData.bg|=536870912),j!==2&&j!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(F,j,I,L=!1,z=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);Z.replaceCells(j,I,this._activeBuffer.getNullCell(this._eraseAttrData()),z),L&&(Z.isWrapped=!1)}_resetBufferLine(F,j=!1){const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);I&&(I.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+F),I.isWrapped=!1)}eraseInDisplay(F,j=!1){let I;switch(this._restrictCursor(this._bufferService.cols),F.params[0]){case 0:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);I<this._bufferService.rows;I++)this._resetBufferLine(I,j);this._dirtyRowTracker.markDirty(I);break;case 1:for(I=this._activeBuffer.y,this._dirtyRowTracker.markDirty(I),this._eraseInBufferLine(I,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(I+1).isWrapped=!1);I--;)this._resetBufferLine(I,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(I=this._bufferService.rows,this._dirtyRowTracker.markDirty(I-1);I--;)this._resetBufferLine(I,j);this._dirtyRowTracker.markDirty(0);break;case 3:const L=this._activeBuffer.lines.length-this._bufferService.rows;L>0&&(this._activeBuffer.lines.trimStart(L),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-L,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-L,0),this._onScroll.fire(0))}return!0}eraseInLine(F,j=!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,j);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,j);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,j)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(F){this._restrictCursor();let j=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y,L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-L+1;for(;j--;)this._activeBuffer.lines.splice(z-1,1),this._activeBuffer.lines.splice(I,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 j=F.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=this._activeBuffer.ybase+this._activeBuffer.y;let L;for(L=this._bufferService.rows-1-this._activeBuffer.scrollBottom,L=this._bufferService.rows-1+this._activeBuffer.ybase-L;j--;)this._activeBuffer.lines.splice(I,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}insertChars(F){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.deleteCells(this._activeBuffer.x,F.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(F){let j=F.params[0]||1;for(;j--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(F){let j=F.params[0]||1;for(;j--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(_.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 j=F.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);L.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),L.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 j=F.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);L.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),L.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 j=F.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);L.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),L.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 j=F.params[0]||1;for(let I=this._activeBuffer.scrollTop;I<=this._activeBuffer.scrollBottom;++I){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);L.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),L.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(F){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.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 j=this._parser.precedingJoinState;if(!j)return!0;const I=F.params[0]||1,L=R.UnicodeService.extractWidth(j),z=this._activeBuffer.x-L,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(z),X=new Uint32Array(Z.length*I);let ee=0;for(let H=0;H<Z.length;){const te=Z.codePointAt(H)||0;X[ee++]=te,H+=te>65535?2:1}let W=ee;for(let H=1;H<I;++H)X.copyWithin(W,0,ee),W+=ee;return this.print(X,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 j=0;j<F.length;j++)switch(F.params[j]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(F){for(let j=0;j<F.length;j++)switch(F.params[j]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.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 j=0;j<F.length;j++)switch(F.params[j]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(F){for(let j=0;j<F.length;j++)switch(F.params[j]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),F.params[j]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(F,j){const I=this._coreService.decPrivateModes,{activeProtocol:L,activeEncoding:z}=this._coreMouseService,Z=this._coreService,{buffers:X,cols:ee}=this._bufferService,{active:W,alt:H}=X,te=this._optionsService.rawOptions,ae=Ie=>Ie?1:2,pe=F.params[0];return ce=pe,Oe=j?pe===2?4:pe===4?ae(Z.modes.insertMode):pe===12?3:pe===20?ae(te.convertEol):0:pe===1?ae(I.applicationCursorKeys):pe===3?te.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:pe===6?ae(I.origin):pe===7?ae(I.wraparound):pe===8?3:pe===9?ae(L==="X10"):pe===12?ae(te.cursorBlink):pe===25?ae(!Z.isCursorHidden):pe===45?ae(I.reverseWraparound):pe===66?ae(I.applicationKeypad):pe===67?4:pe===1e3?ae(L==="VT200"):pe===1002?ae(L==="DRAG"):pe===1003?ae(L==="ANY"):pe===1004?ae(I.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(I.bracketedPasteMode):0,Z.triggerDataEvent(`${f.C0.ESC}[${j?"":"?"}${ce};${Oe}$y`),!0;var ce,Oe}_updateAttrColor(F,j,I,L,z){return j===2?(F|=50331648,F&=-16777216,F|=E.AttributeData.fromColorRGB([I,L,z])):j===5&&(F&=-50331904,F|=33554432|255&I),F}_extractColor(F,j,I){const L=[0,0,-1,0,0,0];let z=0,Z=0;do{if(L[Z+z]=F.params[j+Z],F.hasSubParams(j+Z)){const X=F.getSubParams(j+Z);let ee=0;do L[1]===5&&(z=1),L[Z+ee+1+z]=X[ee];while(++ee<X.length&&ee+Z+1+z<L.length);break}if(L[1]===5&&Z+z>=2||L[1]===2&&Z+z>=5)break;L[1]&&(z=1)}while(++Z+j<F.length&&Z+z<L.length);for(let X=2;X<L.length;++X)L[X]===-1&&(L[X]=0);switch(L[0]){case 38:I.fg=this._updateAttrColor(I.fg,L[1],L[3],L[4],L[5]);break;case 48:I.bg=this._updateAttrColor(I.bg,L[1],L[3],L[4],L[5]);break;case 58:I.extended=I.extended.clone(),I.extended.underlineColor=this._updateAttrColor(I.extended.underlineColor,L[1],L[3],L[4],L[5])}return Z}_processUnderline(F,j){j.extended=j.extended.clone(),(!~F||F>5)&&(F=1),j.extended.underlineStyle=F,j.fg|=268435456,F===0&&(j.fg&=-268435457),j.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 j=F.length;let I;const L=this._curAttrData;for(let z=0;z<j;z++)I=F.params[z],I>=30&&I<=37?(L.fg&=-50331904,L.fg|=16777216|I-30):I>=40&&I<=47?(L.bg&=-50331904,L.bg|=16777216|I-40):I>=90&&I<=97?(L.fg&=-50331904,L.fg|=16777224|I-90):I>=100&&I<=107?(L.bg&=-50331904,L.bg|=16777224|I-100):I===0?this._processSGR0(L):I===1?L.fg|=134217728:I===3?L.bg|=67108864:I===4?(L.fg|=268435456,this._processUnderline(F.hasSubParams(z)?F.getSubParams(z)[0]:1,L)):I===5?L.fg|=536870912:I===7?L.fg|=67108864:I===8?L.fg|=1073741824:I===9?L.fg|=2147483648:I===2?L.bg|=134217728:I===21?this._processUnderline(2,L):I===22?(L.fg&=-134217729,L.bg&=-134217729):I===23?L.bg&=-67108865:I===24?(L.fg&=-268435457,this._processUnderline(0,L)):I===25?L.fg&=-536870913:I===27?L.fg&=-67108865:I===28?L.fg&=-1073741825:I===29?L.fg&=2147483647:I===39?(L.fg&=-67108864,L.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):I===49?(L.bg&=-67108864,L.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):I===38||I===48||I===58?z+=this._extractColor(F,z,L):I===53?L.bg|=1073741824:I===55?L.bg&=-1073741825:I===59?(L.extended=L.extended.clone(),L.extended.underlineColor=-1,L.updateExtended()):I===100?(L.fg&=-67108864,L.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,L.bg&=-67108864,L.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",I);return!0}deviceStatus(F){switch(F.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${j};${I}R`)}return!0}deviceStatusPrivate(F){if(F.params[0]===6){const j=this._activeBuffer.y+1,I=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${j};${I}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 j=F.params[0]||1;switch(j){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const I=j%2==1;return this._optionsService.options.cursorBlink=I,!0}setScrollRegion(F){const j=F.params[0]||1;let I;return(F.length<2||(I=F.params[1])>this._bufferService.rows||I===0)&&(I=this._bufferService.rows),I>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=I-1,this._setCursor(0,0)),!0}windowOptions(F){if(!U(F.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=F.length>1?F.params[1]:0;switch(F.params[0]){case 14:j!==2&&this._onRequestWindowsOptionsReport.fire(q.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(q.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:j!==0&&j!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),j!==0&&j!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:j!==0&&j!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),j!==0&&j!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(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 j=[],I=F.split(";");for(;I.length>1;){const L=I.shift(),z=I.shift();if(/^\d+$/.exec(L)){const Z=parseInt(L);if(J(Z))if(z==="?")j.push({type:0,index:Z});else{const X=(0,O.parseColor)(z);X&&j.push({type:1,index:Z,color:X})}}}return j.length&&this._onColor.fire(j),!0}setHyperlink(F){const j=F.split(";");return!(j.length<2)&&(j[1]?this._createHyperlink(j[0],j[1]):!j[0]&&this._finishHyperlink())}_createHyperlink(F,j){this._getCurrentLinkId()&&this._finishHyperlink();const I=F.split(":");let L;const z=I.findIndex((Z=>Z.startsWith("id=")));return z!==-1&&(L=I[z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:L,uri:j}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(F,j){const I=F.split(";");for(let L=0;L<I.length&&!(j>=this._specialColors.length);++L,++j)if(I[L]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const z=(0,O.parseColor)(I[L]);z&&this._onColor.fire([{type:1,index:this._specialColors[j],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 j=[],I=F.split(";");for(let L=0;L<I.length;++L)if(/^\d+$/.exec(I[L])){const z=parseInt(I[L]);J(z)&&j.push({type:2,index:z})}return j.length&&this._onColor.fire(j),!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,b.DEFAULT_CHARSET),!0}selectCharset(F){return F.length!==2?(this.selectDefaultCharset(),!0):(F[0]==="/"||this._charsetService.setgCharset(P[F[0]],b.CHARSETS[F[1]]||b.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 j=0;j<this._bufferService.rows;++j){const I=this._activeBuffer.ybase+this._activeBuffer.y+j,L=this._activeBuffer.lines.get(I);L&&(L.fill(F),L.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(F,j){const I=this._bufferService.buffer,L=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${I.scrollTop+1};${I.scrollBottom+1}r`:F==="m"?"P1$r0m":F===" q"?`P1$r${{block:2,underline:4,bar:6}[L.cursorStyle]-(L.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(F,j){this._dirtyRowTracker.markRangeDirty(F,j)}}o.InputHandler=K;let V=class{constructor(ne){this._bufferService=ne,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ne){ne<this.start?this.start=ne:ne>this.end&&(this.end=ne)}markRangeDirty(ne,F){ne>F&&(Y=ne,ne=F,F=Y),ne<this.start&&(this.start=ne),F>this.end&&(this.end=F)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(ne){return 0<=ne&&ne<256}V=d([g(0,N.IBufferService)],V)},844:(u,o)=>{function c(d){for(const g of d)g.dispose();d.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 d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},o.toDisposable=function(d){return{dispose:d}},o.disposeArray=c,o.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,f,b){this._data[g]||(this._data[g]={}),this._data[g][f]=b}get(g,f){return this._data[g]?this._data[g][f]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(d,g,f,b,S){this._data.get(d,g)||this._data.set(d,g,new c),this._data.get(d,g).set(f,b,S)}get(d,g,f,b){var S;return(S=this._data.get(d,g))==null?void 0:S.get(f,b)}clear(){this._data.clear()}}},6114:(u,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,d=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 g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),o.isIpad=d==="iPad",o.isIphone=d==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),o.isLinux=d.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,g){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===d)}values(){return[...this._array].values()}_search(d){let g=0,f=this._array.length-1;for(;f>=g;){let b=g+f>>1;const S=this._getKey(this._array[b]);if(S>d)f=b-1;else{if(!(S<d)){for(;b>0&&this._getKey(this._array[b-1])===d;)b--;return b}g=b+1}}return g}}},7226:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const d=c(6114);class g{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(),y=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),y=S.timeRemaining(),1.5*w>y)return _-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-k))}ms`),void this._start();_=y}this.clear()}}class f extends g{_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=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:f,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const d=c(643);o.updateWindowsModeWrappedState=function(g){const f=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),b=f==null?void 0:f.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&b&&(S.isWrapped=b[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&b[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(u,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 d}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 d{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,b=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=b}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=d},9092:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const d=c(6349),g=c(7226),f=c(3734),b=c(8437),S=c(4634),k=c(511),w=c(643),_=c(4863),y=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=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.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 g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.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 b.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=b.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 d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(v,x){const E=this.getNullCell(b.DEFAULT_ATTR_DATA);let N=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++)N+=+this.lines.get(D).resize(v,E);let M=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 b.BufferLine(v,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.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),M&&(this.y+=M),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 M=0;M<this.lines.length;M++)N+=+this.lines.get(M).resize(v,E);this._cols=v,this._rows=x,this._memoryCleanupQueue.clear(),N>.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(b.DEFAULT_ATTR_DATA));if(E.length>0){const N=(0,S.reflowLargerCreateNewLayout)(this.lines,E);(0,S.reflowLargerApplyNewLayout)(this.lines,N.layout),this._reflowLargerAdjustViewport(v,x,N.countRemoved)}}_reflowLargerAdjustViewport(v,x,E){const N=this.getNullCell(b.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 b.BufferLine(v,N))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(v,x){const E=this.getNullCell(b.DEFAULT_ATTR_DATA),N=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let D=this.lines.get(M);if(!D||!D.isWrapped&&D.getTrimmedLength()<=v)continue;const O=[D];for(;D.isWrapped&&M>0;)D=this.lines.get(--M),O.unshift(D);const P=this.ybase+this.y;if(P>=M&&P<M+O.length)continue;const $=O[O.length-1].getTrimmedLength(),U=(0,S.reflowSmallerGetNewLineLengths)(O,this._cols,v),q=U.length-O.length;let Y;Y=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+q):Math.max(0,this.lines.length-this.lines.maxLength+q);const K=[];for(let I=0;I<q;I++){const L=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);K.push(L)}K.length>0&&(N.push({start:M+O.length+R,newLines:K}),R+=K.length),O.push(...K);let V=U.length-1,J=U[V];J===0&&(V--,J=U[V]);let ne=O.length-q-1,F=$;for(;ne>=0;){const I=Math.min(F,J);if(O[V]===void 0)break;if(O[V].copyCellsFrom(O[ne],F-I,J-I,I,!0),J-=I,J===0&&(V--,J=U[V]),F-=I,F===0){ne--;const L=Math.max(ne,0);F=(0,S.getWrappedLineTrimmedLength)(O,L,this._cols)}}for(let I=0;I<O.length;I++)U[I]<v&&O[I].setCell(U[I],E);let j=q-Y;for(;j-- >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+q,this.ybase+x-1)}if(N.length>0){const M=[],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,$=0,U=N[$];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let q=0;for(let V=Math.min(this.lines.maxLength-1,O+R-1);V>=0;V--)if(U&&U.start>P+q){for(let J=U.newLines.length-1;J>=0;J--)this.lines.set(V--,U.newLines[J]);V++,M.push({index:P+1,amount:U.newLines.length}),q+=U.newLines.length,U=N[++$]}else this.lines.set(V,D[P--]);let Y=0;for(let V=M.length-1;V>=0;V--)M[V].index+=Y,this.lines.onInsertEmitter.fire(M[V]),Y+=M[V].amount;const K=Math.max(0,O+R-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(v,x,E=0,N){const R=this.lines.get(v);return R?R.translateToString(x,E,N):""}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:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const d=c(3734),g=c(511),f=c(643),b=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let S=0;class k{constructor(_,y,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const x=y||g.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 y=this._data[3*_+0],v=2097151&y;return[this._data[3*_+1],2097152&y?this._combined[_]:v?(0,b.stringFromCodePoint)(v):"",y>>22,2097152&y?this._combined[_].charCodeAt(this._combined[_].length-1):v]}set(_,y){this._data[3*_+1]=y[f.CHAR_DATA_ATTR_INDEX],y[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=y[1],this._data[3*_+0]=2097152|_|y[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[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 y=this._data[3*_+0];return 2097152&y?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&y}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const y=this._data[3*_+0];return 2097152&y?this._combined[_]:2097151&y?(0,b.stringFromCodePoint)(2097151&y):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,y){return S=3*_,y.content=this._data[S+0],y.fg=this._data[S+1],y.bg=this._data[S+2],2097152&y.content&&(y.combinedData=this._combined[_]),268435456&y.bg&&(y.extended=this._extendedAttrs[_]),y}setCell(_,y){2097152&y.content&&(this._combined[_]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[_]=y.extended),this._data[3*_+0]=y.content,this._data[3*_+1]=y.fg,this._data[3*_+2]=y.bg}setCellFromCodepoint(_,y,v,x){268435456&x.bg&&(this._extendedAttrs[_]=x.extended),this._data[3*_+0]=y|v<<22,this._data[3*_+1]=x.fg,this._data[3*_+2]=x.bg}addCodepointToCell(_,y,v){let x=this._data[3*_+0];2097152&x?this._combined[_]+=(0,b.stringFromCodePoint)(y):2097151&x?(this._combined[_]=(0,b.stringFromCodePoint)(2097151&x)+(0,b.stringFromCodePoint)(y),x&=-2097152,x|=2097152):x=y|4194304,v&&(x&=-12582913,x|=v<<22),this._data[3*_+0]=x}insertCells(_,y,v){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length-_){const x=new g.CellData;for(let E=this.length-_-y-1;E>=0;--E)this.setCell(_+y+E,this.loadCell(_+E,x));for(let E=0;E<y;++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(_,y,v){if(_%=this.length,y<this.length-_){const x=new g.CellData;for(let E=0;E<this.length-_-y;++E)this.setCell(_+E,this.loadCell(_+y+E,x));for(let E=this.length-y;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(_,y,v,x=!1){if(x)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,v);_<y&&_<this.length;)this.isProtected(_)||this.setCell(_,v),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,v),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,v);_<y&&_<this.length;)this.setCell(_++,v)}resize(_,y){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,y)}else{this._data=this._data.subarray(0,v);const x=Object.keys(this._combined);for(let N=0;N<x.length;N++){const R=parseInt(x[N],10);R>=_&&delete this._combined[R]}const E=Object.keys(this._extendedAttrs);for(let N=0;N<E.length;N++){const R=parseInt(E[N],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(_,y=!1){if(y)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 y in _._combined)this._combined[y]=_._combined[y];this._extendedAttrs={};for(const y in _._extendedAttrs)this._extendedAttrs[y]=_._extendedAttrs[y];this.isWrapped=_.isWrapped}clone(){const _=new k(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const y in this._combined)_._combined[y]=this._combined[y];for(const y in this._extendedAttrs)_._extendedAttrs[y]=this._extendedAttrs[y];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(_,y,v,x,E){const N=_._data;if(E)for(let M=x-1;M>=0;M--){for(let D=0;D<3;D++)this._data[3*(v+M)+D]=N[3*(y+M)+D];268435456&N[3*(y+M)+2]&&(this._extendedAttrs[v+M]=_._extendedAttrs[y+M])}else for(let M=0;M<x;M++){for(let D=0;D<3;D++)this._data[3*(v+M)+D]=N[3*(y+M)+D];268435456&N[3*(y+M)+2]&&(this._extendedAttrs[v+M]=_._extendedAttrs[y+M])}const R=Object.keys(_._combined);for(let M=0;M<R.length;M++){const D=parseInt(R[M],10);D>=y&&(this._combined[D-y+v]=_._combined[D])}}translateToString(_,y,v,x){y=y!=null?y:0,v=v!=null?v:this.length,_&&(v=Math.min(v,this.getTrimmedLength())),x&&(x.length=0);let E="";for(;y<v;){const N=this._data[3*y+0],R=2097151&N,M=2097152&N?this._combined[y]:R?(0,b.stringFromCodePoint)(R):f.WHITESPACE_CELL_CHAR;if(E+=M,x)for(let D=0;D<M.length;++D)x.push(y);y+=N>>22||1}return x&&x.push(y),E}}o.BufferLine=k},4841:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,d){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 d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,o)=>{function c(d,g,f){if(g===d.length-1)return d[g].getTrimmedLength();const b=!d[g].hasContent(f-1)&&d[g].getWidth(f-1)===1,S=d[g+1].getWidth(0)===2;return b&&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(d,g,f,b,S){const k=[];for(let w=0;w<d.length-1;w++){let _=w,y=d.get(++_);if(!y.isWrapped)continue;const v=[d.get(w)];for(;_<d.length&&y.isWrapped;)v.push(y),y=d.get(++_);if(b>=w&&b<_){w+=v.length-1;continue}let x=0,E=c(v,x,g),N=1,R=0;for(;N<v.length;){const D=c(v,N,g),O=D-R,P=f-E,$=Math.min(O,P);v[x].copyCellsFrom(v[N],R,E,$,!1),E+=$,E===f&&(x++,E=0),R+=$,R===D&&(N++,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 M=0;for(let D=v.length-1;D>0&&(D>x||v[D].getTrimmedLength()===0);D--)M++;M>0&&(k.push(w+v.length-M),k.push(M)),w+=v.length-1}return k},o.reflowLargerCreateNewLayout=function(d,g){const f=[];let b=0,S=g[b],k=0;for(let w=0;w<d.length;w++)if(S===w){const _=g[++b];d.onDeleteEmitter.fire({index:w-k,amount:_}),w+=_-1,k+=_,S=g[++b]}else f.push(w);return{layout:f,countRemoved:k}},o.reflowLargerApplyNewLayout=function(d,g){const f=[];for(let b=0;b<g.length;b++)f.push(d.get(g[b]));for(let b=0;b<f.length;b++)d.set(b,f[b]);d.length=g.length},o.reflowSmallerGetNewLineLengths=function(d,g,f){const b=[],S=d.map(((y,v)=>c(d,v,g))).reduce(((y,v)=>y+v));let k=0,w=0,_=0;for(;_<S;){if(S-_<f){b.push(S-_);break}k+=f;const y=c(d,w,g);k>y&&(k-=y,w++);const v=d[w].getWidth(k-1)===2;v&&k--;const x=v?f-1:f;b.push(x),_+=x}return b},o.getWrappedLineTrimmedLength=c},5295:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const d=c(8460),g=c(844),f=c(9092);class b extends g.Disposable{constructor(k,w){super(),this._optionsService=k,this._bufferService=w,this._onBufferActivate=this.register(new d.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=b},511:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const d=c(482),g=c(643),f=c(3734);class b 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 b;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,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(k[g.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(k[g.CHAR_DATA_CHAR_INDEX].length===2){const _=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const y=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(_-55296)+y-56320+65536|k[g.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=k[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[g.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=k[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=b},643:(u,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:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const d=c(8460),g=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 d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}o.Marker=f,f._nextId=1},7116:(u,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:(u,o)=>{var c,d,g;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=`
475
- `,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="Ÿ"})(d||(o.C1=d={})),(function(f){f.ST=`${c.ESC}\\`})(g||(o.C1_ESCAPED=g={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const d=c(2584),g={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,b,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=b?d.C0.ESC+"OA":d.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=b?d.C0.ESC+"OD":d.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=b?d.C0.ESC+"OC":d.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=b?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":d.C0.DEL,f.altKey&&(w.key=d.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=d.C0.ESC+"[Z";break}w.key=d.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,w.cancel=!0;break;case 27:w.key=d.C0.ESC,f.altKey&&(w.key=d.C0.ESC+d.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"D",w.key===d.C0.ESC+"[1;3D"&&(w.key=d.C0.ESC+(S?"b":"[1;5D"))):w.key=b?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"C",w.key===d.C0.ESC+"[1;3C"&&(w.key=d.C0.ESC+(S?"f":"[1;5C"))):w.key=b?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"A",S||w.key!==d.C0.ESC+"[1;3A"||(w.key=d.C0.ESC+"[1;5A")):w.key=b?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(f.metaKey)break;_?(w.key=d.C0.ESC+"[1;"+(_+1)+"B",S||w.key!==d.C0.ESC+"[1;3B"||(w.key=d.C0.ESC+"[1;5B")):w.key=b?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=d.C0.ESC+"[2~");break;case 46:w.key=_?d.C0.ESC+"[3;"+(_+1)+"~":d.C0.ESC+"[3~";break;case 36:w.key=_?d.C0.ESC+"[1;"+(_+1)+"H":b?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:w.key=_?d.C0.ESC+"[1;"+(_+1)+"F":b?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=d.C0.ESC+"[5;"+(_+1)+"~":w.key=d.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=d.C0.ESC+"[6;"+(_+1)+"~":w.key=d.C0.ESC+"[6~";break;case 112:w.key=_?d.C0.ESC+"[1;"+(_+1)+"P":d.C0.ESC+"OP";break;case 113:w.key=_?d.C0.ESC+"[1;"+(_+1)+"Q":d.C0.ESC+"OQ";break;case 114:w.key=_?d.C0.ESC+"[1;"+(_+1)+"R":d.C0.ESC+"OR";break;case 115:w.key=_?d.C0.ESC+"[1;"+(_+1)+"S":d.C0.ESC+"OS";break;case 116:w.key=_?d.C0.ESC+"[15;"+(_+1)+"~":d.C0.ESC+"[15~";break;case 117:w.key=_?d.C0.ESC+"[17;"+(_+1)+"~":d.C0.ESC+"[17~";break;case 118:w.key=_?d.C0.ESC+"[18;"+(_+1)+"~":d.C0.ESC+"[18~";break;case 119:w.key=_?d.C0.ESC+"[19;"+(_+1)+"~":d.C0.ESC+"[19~";break;case 120:w.key=_?d.C0.ESC+"[20;"+(_+1)+"~":d.C0.ESC+"[20~";break;case 121:w.key=_?d.C0.ESC+"[21;"+(_+1)+"~":d.C0.ESC+"[21~";break;case 122:w.key=_?d.C0.ESC+"[23;"+(_+1)+"~":d.C0.ESC+"[23~";break;case 123:w.key=_?d.C0.ESC+"[24;"+(_+1)+"~":d.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=d.C0.US),f.key==="@"&&(w.key=d.C0.NUL)):f.keyCode===65&&(w.type=1);else{const y=g[f.keyCode],v=y==null?void 0:y[f.shiftKey?1:0];if(v)w.key=d.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=d.C0.ESC+E}else if(f.keyCode===32)w.key=d.C0.ESC+(f.ctrlKey?d.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=d.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=d.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=d.C0.DEL:f.keyCode===219?w.key=d.C0.ESC:f.keyCode===220?w.key=d.C0.FS:f.keyCode===221&&(w.key=d.C0.GS)}return w}},482:(u,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,d=0,g=c.length){let f="";for(let b=d;b<g;++b){let S=c[b];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,d){const g=c.length;if(!g)return 0;let f=0,b=0;if(this._interim){const S=c.charCodeAt(b++);56320<=S&&S<=57343?d[f++]=1024*(this._interim-55296)+S-56320+65536:(d[f++]=this._interim,d[f++]=S),this._interim=0}for(let S=b;S<g;++S){const k=c.charCodeAt(S);if(55296<=k&&k<=56319){if(++S>=g)return this._interim=k,f;const w=c.charCodeAt(S);56320<=w&&w<=57343?d[f++]=1024*(k-55296)+w-56320+65536:(d[f++]=k,d[f++]=w)}else k!==65279&&(d[f++]=k)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const g=c.length;if(!g)return 0;let f,b,S,k,w=0,_=0,y=0;if(this.interim[0]){let E=!1,N=this.interim[0];N&=(224&N)==192?31:(240&N)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)N<<=6,N|=R;const D=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,O=D-M;for(;y<O;){if(y>=g)return 0;if(R=c[y++],(192&R)!=128){y--,E=!0;break}this.interim[M++]=R,N<<=6,N|=63&R}E||(D===2?N<128?y--:d[w++]=N:D===3?N<2048||N>=55296&&N<=57343||N===65279||(d[w++]=N):N<65536||N>1114111||(d[w++]=N)),this.interim.fill(0)}const v=g-4;let x=y;for(;x<g;){for(;!(!(x<v)||128&(f=c[x])||128&(b=c[x+1])||128&(S=c[x+2])||128&(k=c[x+3]));)d[w++]=f,d[w++]=b,d[w++]=S,d[w++]=k,x+=4;if(f=c[x++],f<128)d[w++]=f;else if((224&f)==192){if(x>=g)return this.interim[0]=f,w;if(b=c[x++],(192&b)!=128){x--;continue}if(_=(31&f)<<6|63&b,_<128){x--;continue}d[w++]=_}else if((240&f)==224){if(x>=g)return this.interim[0]=f,w;if(b=c[x++],(192&b)!=128){x--;continue}if(x>=g)return this.interim[0]=f,this.interim[1]=b,w;if(S=c[x++],(192&S)!=128){x--;continue}if(_=(15&f)<<12|(63&b)<<6|63&S,_<2048||_>=55296&&_<=57343||_===65279)continue;d[w++]=_}else if((248&f)==240){if(x>=g)return this.interim[0]=f,w;if(b=c[x++],(192&b)!=128){x--;continue}if(x>=g)return this.interim[0]=f,this.interim[1]=b,w;if(S=c[x++],(192&S)!=128){x--;continue}if(x>=g)return this.interim[0]=f,this.interim[1]=b,this.interim[2]=S,w;if(k=c[x++],(192&k)!=128){x--;continue}if(_=(7&f)<<18|(63&b)<<12|(63&S)<<6|63&k,_<65536||_>1114111)continue;d[w++]=_}}return w}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const d=c(1480),g=[[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 b;o.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let S=0;S<g.length;++S)b.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?b[S]:(function(k,w){let _,y=0,v=w.length-1;if(k<w[0][0]||k>w[v][1])return!1;for(;v>=y;)if(_=y+v>>1,k>w[_][1])y=_+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 y=d.UnicodeService.extractWidth(k);y===0?_=!1:y>w&&(w=y)}return d.UnicodeService.createPropertyValue(0,w,_)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const d=c(8460),g=c(844);class f extends g.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 d.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],y=this._action(_,k);if(y){const x=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void y.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:(u,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})$/,d=/^[\da-f]+$/;function g(f,b){const S=f.toString(16),k=S.length<2?"0"+S:S;switch(b){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 b=f.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const S=c.exec(b);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(b.indexOf("#")===0&&(b=b.slice(1),d.exec(b)&&[3,6,9,12].includes(b.length))){const S=b.length/3,k=[0,0,0];for(let w=0;w<3;++w){const _=parseInt(b.slice(S*w,S*w+S),16);k[w]=S===1?_<<4:S===2?_:S===3?_>>4:_>>8}return k}},o.toRgbString=function(f,b=16){const[S,k,w]=f;return`rgb:${g(S,b)}/${g(k,b)}/${g(w,b)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const d=c(482),g=c(8742),f=c(5770),b=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(k,w){this._handlers[k]===void 0&&(this._handlers[k]=[]);const _=this._handlers[k];return _.push(w),{dispose:()=>{const y=_.indexOf(w);y!==-1&&_.splice(y,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=b,this._ident=0}hook(k,w){if(this.reset(),this._ident=k,this._active=this._handlers[k]||b,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 y=this._active.length-1;y>=0;y--)this._active[y].put(k,w,_);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(k,w,_))}unhook(k,w=!0){if(this._active.length){let _=!1,y=this._active.length-1,v=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,_=w,v=this._stack.fallThrough,this._stack.paused=!1),!v&&_===!1){for(;y>=0&&(_=this._active[y].unhook(k),_!==!0);y--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,_;y--}for(;y>=0;y--)if(_=this._active[y].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",k);this._active=b,this._ident=0}};const S=new g.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,d.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:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const d=c(844),g=c(8742),f=c(6242),b=c(6351);class S{constructor(y){this.table=new Uint8Array(y)}setDefault(y,v){this.table.fill(y<<4|v)}add(y,v,x,E){this.table[v<<8|y]=x<<4|E}addMany(y,v,x,E){for(let N=0;N<y.length;N++)this.table[v<<8|y[N]]=x<<4|E}}o.TransitionTable=S;const k=160;o.VT500_TRANSITION_TABLE=(function(){const _=new S(4095),y=Array.apply(null,Array(256)).map(((M,D)=>D)),v=(M,D)=>y.slice(M,D),x=v(32,127),E=v(0,24);E.push(25),E.push.apply(E,v(28,32));const N=v(0,14);let R;for(R in _.setDefault(1,0),_.addMany(x,0,2,0),N)_.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 d.Disposable{constructor(y=o.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.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,d.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 b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,v=[64,126]){let x=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=y.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let N=0;N<y.intermediates.length;++N){const R=y.intermediates.charCodeAt(N);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=R}}if(y.final.length!==1)throw new Error("final must be a single byte");const E=y.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(y){const v=[];for(;y;)v.push(String.fromCharCode(255&y)),y>>=8;return v.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,v){const x=this._identifier(y,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const E=this._escHandlers[x];return E.push(v),{dispose:()=>{const N=E.indexOf(v);N!==-1&&E.splice(N,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,v){this._executeHandlers[y.charCodeAt(0)]=v}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,v){const x=this._identifier(y);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const E=this._csiHandlers[x];return E.push(v),{dispose:()=>{const N=E.indexOf(v);N!==-1&&E.splice(N,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,v){return this._dcsParser.registerHandler(this._identifier(y),v)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,v){return this._oscParser.registerHandler(y,v)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,v,x,E,N){this._parseStack.state=y,this._parseStack.handlers=v,this._parseStack.handlerPos=x,this._parseStack.transition=E,this._parseStack.chunkPos=N}parse(y,v,x){let E,N=0,R=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=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(N=y[this._parseStack.chunkPos],E=this._dcsParser.unhook(N!==24&&N!==26,x),E)return E;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(N=y[this._parseStack.chunkPos],E=this._oscParser.end(N!==24&&N!==26,x),E)return E;N===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let D=M;D<v;++D){switch(N=y[D],R=this._transitions.table[this.currentState<<8|(N<160?N:k)],R>>4){case 2:for(let q=D+1;;++q){if(q>=v||(N=y[q])<32||N>126&&N<k){this._printHandler(y,D,q),D=q-1;break}if(++q>=v||(N=y[q])<32||N>126&&N<k){this._printHandler(y,D,q),D=q-1;break}if(++q>=v||(N=y[q])<32||N>126&&N<k){this._printHandler(y,D,q),D=q-1;break}if(++q>=v||(N=y[q])<32||N>126&&N<k){this._printHandler(y,D,q),D=q-1;break}}break;case 3:this._executeHandlers[N]?this._executeHandlers[N]():this._executeHandlerFb(N),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:D,code:N,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const O=this._csiHandlers[this._collect<<8|N];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|N,this._params),this.precedingJoinState=0;break;case 8:do switch(N){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(N-48)}while(++D<v&&(N=y[D])>47&&N<60);D--;break;case 9:this._collect<<=8,this._collect|=N;break;case 10:const $=this._escHandlers[this._collect<<8|N];let U=$?$.length-1:-1;for(;U>=0&&(E=$[U](),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(4,$,U,R,D),E;U<0&&this._escHandlerFb(this._collect<<8|N),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|N,this._params);break;case 13:for(let q=D+1;;++q)if(q>=v||(N=y[q])===24||N===26||N===27||N>127&&N<k){this._dcsParser.put(y,D,q),D=q-1;break}break;case 14:if(E=this._dcsParser.unhook(N!==24&&N!==26),E)return this._preserveStack(6,[],0,R,D),E;N===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 q=D+1;;q++)if(q>=v||(N=y[q])<32||N>127&&N<k){this._oscParser.put(y,D,q),D=q-1;break}break;case 6:if(E=this._oscParser.end(N!==24&&N!==26),E)return this._preserveStack(5,[],0,R,D),E;N===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}o.EscapeSequenceParser=w},6242:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const d=c(5770),g=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(b,S){this._handlers[b]===void 0&&(this._handlers[b]=[]);const k=this._handlers[b];return k.push(S),{dispose:()=>{const w=k.indexOf(S);w!==-1&&k.splice(w,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].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 b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,S,k){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(b,S,k);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(b,S,k))}start(){this.reset(),this._state=1}put(b,S,k){if(this._state!==3){if(this._state===1)for(;S<k;){const w=b[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(b,S,k)}}end(b,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(b),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",b);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,S,k){this._hitLimit||(this._data+=(0,g.utf32ToString)(b,S,k),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let S=!1;if(this._hitLimit)S=!1;else if(b&&(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:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class d{static fromArray(f){const b=new d;if(!f.length)return b;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)b.addSubParam(k[w]);else b.addParam(k)}return b}constructor(f=32,b=32){if(this.maxLength=f,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new d(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 b=0;b<this.length;++b){f.push(this.params[b]);const S=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];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 b=this._subParamsIdx[f]>>8,S=255&this._subParamsIdx[f];return S-b>0?this._subParams.subarray(b,S):null}getSubParamsAll(){const f={};for(let b=0;b<this.length;++b){const S=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-S>0&&(f[b]=this._subParams.slice(S,k))}return f}addDigit(f){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,k=S[b-1];S[b-1]=~k?Math.min(10*k+f,c):f}}o.Params=d},5741:(u,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,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){d=g;break}if(d===-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(d,1)}}},8771:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const d=c(3785),g=c(511);o.BufferApiView=class{constructor(f,b){this._buffer=f,this.type=b}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 b=this._buffer.lines.get(f);if(b)return new d.BufferLineApiView(b)}getNullCell(){return new g.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const d=c(511);o.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,f){if(!(g<0||g>=this._line.length))return f?(this._line.loadCell(g,f),f):this._line.loadCell(g,new d.CellData)}translateToString(g,f,b){return this._line.translateToString(g,f,b)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const d=c(8771),g=c(8460),f=c(844);class b extends f.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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=b},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,(g=>d(g.toArray())))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,((g,f)=>d(g,f.toArray())))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(u,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(u,o,c){var d=this&&this.__decorate||function(_,y,v,x){var E,N=arguments.length,R=N<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,y,v,x);else for(var M=_.length-1;M>=0;M--)(E=_[M])&&(R=(N<3?E(R):N>3?E(y,v,R):E(y,v))||R);return N>3&&R&&Object.defineProperty(y,v,R),R},g=this&&this.__param||function(_,y){return function(v,x){y(v,x,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=c(8460),b=c(844),S=c(5295),k=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends b.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(_,y){this.cols=_,this.rows=y,this.buffers.resize(_,y),this._onResize.fire({cols:_,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,y=!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(_,y),this._cachedBlankLine=x),x.isWrapped=y;const E=v.ybase+v.scrollTop,N=v.ybase+v.scrollBottom;if(v.scrollTop===0){const R=v.lines.isFull;N===v.lines.length-1?R?v.lines.recycle().copyFrom(x):v.lines.push(x.clone()):v.lines.splice(N+1,0,x.clone()),R?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const R=N-E+1;v.lines.shiftElements(E+1,R-1,-1),v.lines.set(N,x.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(_,y,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&&(y||this._onScroll.fire(x.ydisp))}};o.BufferService=w=d([g(0,k.IOptionsService)],w)},7994:(u,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,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(u,o,c){var d=this&&this.__decorate||function(x,E,N,R){var M,D=arguments.length,O=D<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,N):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(x,E,N,R);else for(var P=x.length-1;P>=0;P--)(M=x[P])&&(O=(D<3?M(O):D>3?M(E,N,O):M(E,N))||O);return D>3&&O&&Object.defineProperty(E,N,O),O},g=this&&this.__param||function(x,E){return function(N,R){E(N,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=c(2585),b=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 N=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(N|=64,N|=x.action):(N|=3&x.button,4&x.button&&(N|=64),8&x.button&&(N|=128),x.action===32?N|=32:x.action!==0||E||(N|=3)),N}const _=String.fromCharCode,y={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 b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const N of Object.keys(k))this.addProtocol(N,k[N]);for(const N of Object.keys(y))this.addEncoding(N,y[N]);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,N){if(N){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=d([g(0,f.IBufferService),g(1,f.ICoreService)],v)},6975:function(u,o,c){var d=this&&this.__decorate||function(v,x,E,N){var R,M=arguments.length,D=M<3?x:N===null?N=Object.getOwnPropertyDescriptor(x,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,x,E,N);else for(var O=v.length-1;O>=0;O--)(R=v[O])&&(D=(M<3?R(D):M>3?R(x,E,D):R(x,E))||D);return M>3&&D&&Object.defineProperty(x,E,D),D},g=this&&this.__param||function(v,x){return function(E,N){x(E,N,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=c(1439),b=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 y=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 b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.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((N=>N.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=y=d([g(0,k.IBufferService),g(1,k.ILogService),g(2,k.IOptionsService)],y)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const d=c(8055),g=c(8460),f=c(844),b=c(6106);let S=0,k=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((v=>v==null?void 0:v.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.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 M,D,O;let N=0,R=0;for(const P of this._decorations.getKeyIterator(x))N=(M=P.options.x)!=null?M:0,R=N+((D=P.options.width)!=null?D:1),v>=N&&v<R&&(!E||((O=P.options.layer)!=null?O:"bottom")===E)&&(yield P)}forEachDecorationAtCell(v,x,E,N){this._decorations.forEachByKey(x,(R=>{var M,D,O;S=(M=R.options.x)!=null?M:0,k=S+((D=R.options.width)!=null?D:1),v>=S&&v<k&&(!E||((O=R.options.layer)!=null?O:"bottom")===E)&&N(R)}))}}o.DecorationService=w;class _ extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(v){super(),this.options=v,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.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:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const d=c(2585),g=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(d.IInstantiationService,this)}setService(b,S){this._services.set(b,S)}getService(b){return this._services.get(b)}createInstance(b,...S){const k=(0,g.getServiceDependencies)(b).sort(((y,v)=>y.index-v.index)),w=[];for(const y of k){const v=this._services.get(y.id);if(!v)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${y.id}.`);w.push(v)}const _=k.length>0?k[0].index:S.length;if(S.length!==_)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${_+1} conflicts with ${S.length} static arguments`);return new b(...S,...w)}}},7866:function(u,o,c){var d=this&&this.__decorate||function(_,y,v,x){var E,N=arguments.length,R=N<3?y:x===null?x=Object.getOwnPropertyDescriptor(y,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,y,v,x);else for(var M=_.length-1;M>=0;M--)(E=_[M])&&(R=(N<3?E(R):N>3?E(y,v,R):E(y,v))||R);return N>3&&R&&Object.defineProperty(y,v,R),R},g=this&&this.__param||function(_,y){return function(v,x){y(v,x,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=c(844),b=c(2585),S={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let k,w=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=b.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 y=0;y<_.length;y++)typeof _[y]=="function"&&(_[y]=_[y]())}_log(_,y,v){this._evalLazyOptionalParams(v),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...v)}trace(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.TRACE&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.trace.bind(this._optionsService.options.logger))!=null?x:console.log,_,y)}debug(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.debug.bind(this._optionsService.options.logger))!=null?x:console.log,_,y)}info(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.INFO&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.info.bind(this._optionsService.options.logger))!=null?x:console.info,_,y)}warn(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.WARN&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.warn.bind(this._optionsService.options.logger))!=null?x:console.warn,_,y)}error(_,...y){var v,x;this._logLevel<=b.LogLevelEnum.ERROR&&this._log((x=(v=this._optionsService.options.logger)==null?void 0:v.error.bind(this._optionsService.options.logger))!=null?x:console.error,_,y)}};o.LogService=w=d([g(0,b.IOptionsService)],w),o.setTraceLogger=function(_){k=_},o.traceCall=function(_,y,v){if(typeof v.value!="function")throw new Error("not supported");const x=v.value;v.value=function(...E){if(k.logLevel!==b.LogLevelEnum.TRACE)return x.apply(this,E);k.trace(`GlyphRenderer#${x.name}(${E.map((R=>JSON.stringify(R))).join(", ")})`);const N=x.apply(this,E);return k.trace(`GlyphRenderer#${x.name} return`,N),N}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const d=c(8460),g=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 b=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends g.Disposable{constructor(w){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...o.DEFAULT_OPTIONS};for(const y in w)if(y in _)try{const v=w[y];_[y]=this._sanitizeAndValidateOption(y,v)}catch(v){console.error(v)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,_){return this.onOptionChange((y=>{y===w&&_(this.rawOptions[w])}))}onMultipleOptionChange(w,_){return this.onOptionChange((y=>{w.indexOf(y)!==-1&&_()}))}_setupOptions(){const w=y=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},_=(y,v)=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);v=this._sanitizeAndValidateOption(y,v),this.rawOptions[y]!==v&&(this.rawOptions[y]=v,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const v={get:w.bind(this,y),set:_.bind(this,y)};Object.defineProperty(this.options,y,v)}}_sanitizeAndValidateOption(w,_){switch(w){case"cursorStyle":if(_||(_=o.DEFAULT_OPTIONS[w]),!(function(y){return y==="block"||y==="underline"||y==="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;_=b.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(u,o,c){var d=this&&this.__decorate||function(S,k,w,_){var y,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--)(y=S[E])&&(x=(v<3?y(x):v>3?y(k,w,x):y(k,w))||x);return v>3&&x&&Object.defineProperty(k,w,x),x},g=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 b=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),N={data:S,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(N,E))),this._dataByLinkId.set(N.id,N),N.id}const w=S,_=this._getEntryIdKey(w),y=this._entriesWithId.get(_);if(y)return this.addLineToLink(y.id,k.ybase+k.y),y.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=b=d([g(0,f.IBufferService)],b)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",d="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(g){return g[d]||[]},o.createDecorator=function(g){if(o.serviceRegistry.has(g))return o.serviceRegistry.get(g);const f=function(b,S,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,_,y){_[c]===_?_[d].push({id:w,index:y}):(_[d]=[{id:w,index:y}],_[c]=_)})(f,b,k)};return f.toString=()=>g,o.serviceRegistry.set(g,f),f}},2585:(u,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 d=c(8343);var g;o.IBufferService=(0,d.createDecorator)("BufferService"),o.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),o.ICoreService=(0,d.createDecorator)("CoreService"),o.ICharsetService=(0,d.createDecorator)("CharsetService"),o.IInstantiationService=(0,d.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"})(g||(o.LogLevelEnum=g={})),o.ILogService=(0,d.createDecorator)("LogService"),o.IOptionsService=(0,d.createDecorator)("OptionsService"),o.IOscLinkService=(0,d.createDecorator)("OscLinkService"),o.IUnicodeService=(0,d.createDecorator)("UnicodeService"),o.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const d=c(8460),g=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 d.EventEmitter,this.onChange=this._onChange.event;const S=new g.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 y=0;y<_;++y){let v=S.charCodeAt(y);if(55296<=v&&v<=56319){if(++y>=_)return k+this.wcwidth(v);const N=S.charCodeAt(y);56320<=N&&N<=57343?v=1024*(v-55296)+N-56320+65536:k+=this.wcwidth(N)}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(u){var o=s[u];if(o!==void 0)return o.exports;var c=s[u]={exports:{}};return i[u].call(c.exports,c,c.exports,l),c.exports}var h={};return(()=>{var u=h;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=l(9042),c=l(3236),d=l(844),g=l(5741),f=l(8285),b=l(7975),S=l(7090),k=["cols","rows"];class w extends d.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],x=(E,N)=>{this._checkReadonlyOptions(E),this._core.options[E]=N};for(const E in this._core.options){const N={get:v.bind(this,E),set:x.bind(this,E)};Object.defineProperty(this._publicOptions,E,N)}}_checkReadonlyOptions(y){if(k.includes(y))throw new Error(`Option "${y}" 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 b.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 y=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:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const v in y)this._publicOptions[v]=y[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,v=!0){this._core.input(y,v)}resize(y,v){this._verifyIntegers(y,v),this._core.resize(y,v)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){var v,x,E;return this._checkProposedApi(),this._verifyPositiveIntegers((v=y.x)!=null?v:0,(x=y.width)!=null?x:0,(E=y.height)!=null?E:0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,v,x){this._verifyIntegers(y,v,x),this._core.select(y,v,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,v){this._verifyIntegers(y,v),this._core.selectLines(y,v)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,v){this._core.write(y,v)}writeln(y,v){this._core.write(y),this._core.write(`\r
476
- `,v)}paste(y){this._core.paste(y)}refresh(y,v){this._verifyIntegers(y,v),this._core.refresh(y,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return o}_verifyIntegers(...y){for(const v of y)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const v of y)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}u.Terminal=w})(),h})()))})(Ap)),Ap.exports}var TO=AO(),Tp={exports:{}},D0;function RO(){return D0||(D0=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 u=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),d=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),f=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),b=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(b/h.css.cell.width)),rows:Math.max(1,Math.floor(f/h.css.cell.height))}}}})(),i})()))})(Tp)),Tp.exports}var DO=RO(),Rp={exports:{}},N0;function NO(){return N0||(N0=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={6:(u,o)=>{function c(g){try{const f=new URL(g),b=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 g.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(g,f,b,S={}){this._terminal=g,this._regex=f,this._handler=b,this._options=S}provideLinks(g,f){const b=d.computeLink(g,this._regex,this._terminal,this._handler);f(this._addCallbacks(b))}_addCallbacks(g){return g.map((f=>(f.leave=this._options.leave,f.hover=(b,S)=>{if(this._options.hover){const{range:k}=f;this._options.hover(b,S,k)}},f)))}};class d{static computeLink(f,b,S,k){const w=new RegExp(b.source,(b.flags||"")+"g"),[_,y]=d._getWindowedLineStrings(f-1,S),v=_.join("");let x;const E=[];for(;x=w.exec(v);){const N=x[0];if(!c(N))continue;const[R,M]=d._mapStrIdx(S,y,0,x.index),[D,O]=d._mapStrIdx(S,R,M,N.length);if(R===-1||M===-1||D===-1||O===-1)continue;const P={start:{x:M+1,y:R+1},end:{x:O,y:D+1}};E.push({range:P,text:N,activate:k})}return E}static _getWindowedLineStrings(f,b){let S,k=f,w=f,_=0,y="";const v=[];if(S=b.buffer.active.getLine(f)){const x=S.translateToString(!0);if(S.isWrapped&&x[0]!==" "){for(_=0;(S=b.buffer.active.getLine(--k))&&_<2048&&(y=S.translateToString(!0),_+=y.length,v.push(y),S.isWrapped&&y.indexOf(" ")===-1););v.reverse()}for(v.push(x),_=0;(S=b.buffer.active.getLine(++w))&&S.isWrapped&&_<2048&&(y=S.translateToString(!0),_+=y.length,v.push(y),y.indexOf(" ")===-1););}return[v,k]}static _mapStrIdx(f,b,S,k){const w=f.buffer.active,_=w.getNullCell();let y=S;for(;k;){const v=w.getLine(b);if(!v)return[-1,-1];for(let x=y;x<v.length;++x){v.getCell(x,_);const E=_.getChars();if(_.getWidth()&&(k-=E.length||1,x===v.length-1&&E==="")){const N=w.getLine(b+1);N&&N.isWrapped&&(N.getCell(0,_),_.getWidth()===2&&(k+=1))}if(k<0)return[b,x]}b++,y=0}return[b,y]}}o.LinkComputer=d}},s={};function l(u){var o=s[u];if(o!==void 0)return o.exports;var c=s[u]={exports:{}};return i[u](c,c.exports,l),c.exports}var h={};return(()=>{var u=h;Object.defineProperty(u,"__esModule",{value:!0}),u.WebLinksAddon=void 0;const o=l(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(g,f){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}u.WebLinksAddon=class{constructor(g=d,f={}){this._handler=g,this._options=f}activate(g){this._terminal=g;const f=this._options,b=f.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,b,this._handler,f))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})()))})(Rp)),Rp.exports}var MO=NO();const Hi={INPUT:1,RESIZE:2,CLOSE:3,OUTPUT:4,EXIT:5,ERROR:6,INIT_ACK:7,TITLE:8};function Dp(e,n){const i=new Uint8Array(1+n.length);return i[0]=e,i.set(n,1),i}function jO(e,n){const{serverUrl:i,apiToken:s,cwd:l}=n,h=T.useRef(null),u=T.useRef(null),o=T.useRef(null),c=T.useRef("disconnected"),d=T.useRef(!1),g=T.useRef(0),f=T.useRef(n.onStatusChange),b=T.useRef(n.onExit),S=T.useRef(n.onSessionInit),k=T.useRef(n.onTitleChange);T.useEffect(()=>{f.current=n.onStatusChange,b.current=n.onExit,S.current=n.onSessionInit,k.current=n.onTitleChange});const w=T.useRef(i),_=T.useRef(s),y=T.useRef(l),v=T.useRef(n.serverSessionId);T.useEffect(()=>{w.current=i,_.current=s,y.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(d.current)return;const O=++g.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 $=v.current,U=$?`ws://${w.current}/ws/terminal?token=${_.current}&cwd=${encodeURIComponent(y.current)}&sessionId=${$}`:`ws://${w.current}/ws/terminal?token=${_.current}&cwd=${encodeURIComponent(y.current)}`,q=new WebSocket(U);q.binaryType="arraybuffer",q.onopen=()=>{if(g.current!==O){q.close();return}if(o.current=q,h.current&&u.current)try{u.current.fit()}catch{}},q.onmessage=Y=>{var ne,F,j,I,L,z,Z,X;if(g.current!==O||!(Y.data instanceof ArrayBuffer))return;const K=new Uint8Array(Y.data);if(K.length<1)return;const V=K[0],J=K.slice(1);switch(V){case Hi.OUTPUT:{const ee=new TextDecoder().decode(J);(ne=h.current)==null||ne.write(ee);break}case Hi.EXIT:{const{exitCode:ee}=JSON.parse(new TextDecoder().decode(J));x("exited"),(F=h.current)==null||F.writeln(`\r
477
- [Process exited with code ${ee}]`),(j=b.current)==null||j.call(b,ee),q.close();break}case Hi.ERROR:{const{message:ee}=JSON.parse(new TextDecoder().decode(J));x("disconnected"),(I=h.current)==null||I.writeln(`\r
478
- [Error: ${ee}]`);break}case Hi.INIT_ACK:{const ee=JSON.parse(new TextDecoder().decode(J));(L=S.current)==null||L.call(S,ee),ee.isReconnect&&ee.status==="exited"?(x("exited"),(z=h.current)==null||z.writeln(`\r
479
- [Process exited with code ${ee.exitCode} while disconnected]`),(Z=b.current)==null||Z.call(b,ee.exitCode)):x("connected");break}case Hi.TITLE:{const{title:ee}=JSON.parse(new TextDecoder().decode(J));(X=k.current)==null||X.call(k,ee);break}}},q.onclose=()=>{var Y;g.current===O&&(o.current=null,c.current==="connecting"?(x("disconnected"),(Y=h.current)==null||Y.writeln(`\r
480
- [Connection failed]`)):c.current==="connected"&&x("disconnected"))},q.onerror=()=>{}},[x]);T.useEffect(()=>{const O=e();if(!O){console.log("[useTerminal] MAIN EFFECT: no container, returning early");return}N.current=!0,d.current=!1;const P=new TO.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)"}}),$=new DO.FitAddon,U=new MO.WebLinksAddon;P.loadAddon($),P.loadAddon(U);let q=!1;const Y=requestAnimationFrame(()=>{if(!(q||!O.isConnected))if(P.open(O),P.cols<=1||P.rows<=1){const K=()=>{if(!q){try{if($.fit(),P.cols>1&&P.rows>1)return}catch{}requestAnimationFrame(K)}};requestAnimationFrame(K)}else try{$.fit()}catch{}});return h.current=P,u.current=$,P.onData(K=>{const V=o.current;if(!V||V.readyState!==WebSocket.OPEN)return;const J=new TextEncoder().encode(K);V.send(Dp(Hi.INPUT,J))}),P.onResize(({cols:K,rows:V})=>{const J=o.current;if(!J||J.readyState!==WebSocket.OPEN)return;const ne=new TextEncoder().encode(JSON.stringify({cols:K,rows:V}));J.send(Dp(Hi.RESIZE,ne))}),E(),()=>{q=!0,cancelAnimationFrame(Y),d.current=!0;const K=o.current;K&&(K.onopen=null,K.onclose=null,K.onmessage=null,K.onerror=null,K.close(),o.current=null),P.dispose(),h.current=null,u.current=null}},[e,E]);const N=T.useRef(!0);T.useEffect(()=>{if(N.current){N.current=!1;return}const O=o.current;O&&(O.close(),o.current=null),!d.current&&h.current&&E()},[i,s,l,E]);const R=T.useCallback(()=>{var O;try{(O=u.current)==null||O.fit()}catch{}},[]),M=T.useCallback(()=>{var O;(O=h.current)==null||O.focus()},[]),D=T.useCallback(()=>{var P;const O=o.current;if(O){try{O.send(Dp(Hi.CLOSE,new Uint8Array(0)))}catch{}O.close(),o.current=null}(P=h.current)==null||P.dispose(),h.current=null,u.current=null,d.current=!0},[]);return{fit:R,focus:M,destroy:D}}function OO({serverUrl:e,apiToken:n,cwd:i,serverSessionId:s,onStatusChange:l,onExit:h,onSessionInit:u,onTitleChange:o}){const c=T.useRef(null),d=T.useCallback(()=>c.current,[]),{fit:g,focus:f}=jO(d,{serverUrl:e,apiToken:n,cwd:i,serverSessionId:s,onStatusChange:l,onExit:h,onSessionInit:u,onTitleChange:o});return T.useEffect(()=>{const b=c.current;if(!b)return;const S=new ResizeObserver(()=>{requestAnimationFrame(()=>g())});return S.observe(b),()=>{S.disconnect()}},[g]),T.useEffect(()=>{const b=c.current;if(!b)return;let S=0;const k=10,w=setInterval(()=>{if(S++,S>k){clearInterval(w);return}b.offsetParent!==null&&(clearInterval(w),requestAnimationFrame(()=>g()))},100);return()=>{clearInterval(w)}},[g]),m.jsx("div",{ref:c,className:"w-full h-full",onFocus:f})}function LO(){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 IO=5,BO=300,zO=200,PO=.7;function FO({workspaceId:e,workspacePath:n,workspaceName:i,serverUrl:s,apiToken:l,isOpen:h,onClose:u}){var F,j,I;const o=Zl(),c=LO(),[d,g]=T.useState(new Map),[f,b]=T.useState(new Map),[S,k]=T.useState(BO),w=T.useRef(!1),_=T.useRef(0),y=T.useRef(0),v=T.useRef(new Set),x=e?(F=d.get(e))!=null?F:[]:[],E=e?f.get(e):void 0,R=(e&&(I=(j=d.get(e))==null?void 0:j.length)!=null?I:0)<IO,M=T.useCallback(async L=>{if(!(!s||!l||v.current.has(L))){v.current.add(L);try{const z=await fetch(`http://${s}/api/workspaces/${L}/terminals`,{headers:{Authorization:`Bearer ${l}`}});if(!z.ok)return;const Z=await z.json();if(!Z.sessions||Z.sessions.length===0)return;const X=Z.sessions.map(ee=>({id:crypto.randomUUID(),serverSessionId:ee.id,workspaceId:L,workspacePath:ee.cwd,title:ee.title,status:"disconnected"}));g(ee=>{var pe;const W=(pe=ee.get(L))!=null?pe:[],H=new Set(W.map(ce=>ce.serverSessionId).filter(Boolean)),te=X.filter(ce=>!H.has(ce.serverSessionId));if(te.length===0)return ee;if(W.length>0){for(const ce of te)fetch(`http://${s}/api/workspaces/${L}/terminals/${ce.serverSessionId}`,{method:"DELETE",headers:{Authorization:`Bearer ${l}`}}).catch(()=>{});return ee}const ae=new Map(ee);return ae.set(L,[...W,...te]),ae}),b(ee=>{const W=new Map(ee);return W.has(L)||W.set(L,X[0].id),W})}catch(z){console.log("[TerminalPanel] fetchExistingSessions FAILED",z)}finally{v.current.delete(L)}}},[s,l]);T.useEffect(()=>{!e||!h||M(e)},[e,h,M]);const D=T.useCallback((L,z)=>{g(Z=>{const X=new Map(Z);for(const[ee,W]of X.entries()){const H=W.map(te=>te.id===L?{...te,status:z}:te);H.some(te=>te.id===L)&&X.set(ee,H)}return X})},[]),O=T.useCallback((L,z)=>{g(Z=>{const X=new Map(Z);for(const[ee,W]of X.entries()){const H=W.map(te=>te.id===L?{...te,serverSessionId:z.sessionId,title:z.title||te.title}:te);H.some(te=>te.id===L)&&X.set(ee,H)}return X})},[]),P=T.useCallback((L,z)=>{g(Z=>{const X=new Map(Z);for(const[ee,W]of X.entries()){const H=W.map(te=>te.id===L?{...te,title:z}:te);H.some(te=>te.id===L)&&X.set(ee,H)}return X})},[]),$=T.useCallback(()=>{if(!e||!n||!R)return;const L={id:crypto.randomUUID(),serverSessionId:null,workspaceId:e,workspacePath:n,title:"main",status:"connecting"};g(z=>{var ee;const Z=new Map(z),X=(ee=Z.get(e))!=null?ee:[];return Z.set(e,[...X,L]),Z}),b(z=>{const Z=new Map(z);return Z.set(e,L.id),Z})},[e,n,R]),U=T.useCallback(L=>{const z=[...d.values()].flat().find(Z=>Z.id===L);z!=null&&z.serverSessionId&&s&&l&&fetch(`http://${s}/api/workspaces/${z.workspaceId}/terminals/${z.serverSessionId}`,{method:"DELETE",headers:{Authorization:`Bearer ${l}`}}).catch(()=>{}),g(Z=>{const X=new Map(Z);for(const[ee,W]of X.entries()){const H=W.filter(te=>te.id!==L);H.length<W.length&&X.set(ee,H)}return X}),b(Z=>{var ee,W;const X=new Map(Z);for(const[H,te]of X.entries())if(te===L){const ae=(W=(ee=d.get(H))==null?void 0:ee.filter(pe=>pe.id!==L))!=null?W:[];ae.length>0?X.set(H,ae[ae.length-1].id):X.delete(H)}return X})},[d,s,l]),q=T.useCallback(L=>{L.preventDefault(),w.current=!0;const z="touches"in L?L.touches[0].clientY:L.clientY;_.current=z,y.current=S;const Z=ee=>{if(!w.current)return;const W="touches"in ee?ee.touches[0].clientY:ee.clientY,H=_.current-W,te=window.innerHeight*PO,ae=Math.min(Math.max(y.current+H,zO),te);k(ae)},X=()=>{w.current=!1,document.removeEventListener("mousemove",Z),document.removeEventListener("mouseup",X),document.removeEventListener("touchmove",Z),document.removeEventListener("touchend",X)};document.addEventListener("mousemove",Z),document.addEventListener("mouseup",X),document.addEventListener("touchmove",Z,{passive:!1}),document.addEventListener("touchend",X)},[S]);if(!e||!n||!s||!l)return m.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 K=`[${i||n.split("/").pop()||"ws"}]`,V=L=>{switch(L){case"connecting":return"bg-warning";case"connected":return"bg-success";case"disconnected":return"bg-muted-foreground";case"exited":return"bg-error"}},J=()=>m.jsxs("div",{className:"flex items-center gap-0.5 overflow-x-auto px-1 min-h-[32px]",children:[x.map(L=>m.jsxs("div",{className:_e("group flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer rounded-sm whitespace-nowrap border border-transparent",L.id===E?"bg-accent text-accent-foreground border-border":"text-muted-foreground hover:bg-muted"),onClick:()=>b(z=>{const Z=new Map(z);return Z.set(e,L.id),Z}),children:[m.jsx("span",{className:_e("w-1.5 h-1.5 rounded-full shrink-0",V(L.status))}),m.jsxs("span",{children:[K," ",L.title]}),m.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-destructive transition-opacity ml-0.5",onClick:z=>{z.stopPropagation(),U(L.id)},children:m.jsx(ei,{className:"w-3 h-3"})})]},L.id)),R&&m.jsx(ke,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:$,title:"New terminal tab",children:m.jsx(Xa,{className:"w-3.5 h-3.5"})})]}),ne=()=>m.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:[x.map(L=>m.jsx("div",{className:_e("w-full h-full",L.id!==E?"invisible absolute inset-0 pointer-events-none":"relative"),children:m.jsx(HO,{tab:L,serverUrl:s,apiToken:l,onStatusChange:z=>D(L.id,z),onSessionInit:z=>O(L.id,z),onTitleChange:z=>P(L.id,z)},L.id)},L.id)),x.length===0&&m.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?m.jsx(zd,{open:h,onOpenChange:Z=>!Z&&u(),children:m.jsxs(Pd,{side:"top",className:"p-0 bg-background [&>button]:hidden flex flex-col",style:{height:z},children:[m.jsx(Fd,{className:"sr-only",children:m.jsx(Hd,{children:"Terminal"})}),m.jsxs("div",{className:"flex items-center justify-between p-2 border-b border-border shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Bb,{className:"w-4 h-4"}),m.jsx("span",{className:"font-semibold text-sm",children:"Terminal"})]}),m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:u,children:m.jsx(ei,{className:"w-4 h-4"})})]}),J(),ne()]})}):null}return m.jsxs("div",{className:_e(!h&&"hidden"),children:[m.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:q,onTouchStart:q,children:m.jsx("div",{className:"w-10 h-0.5 bg-muted-foreground/30 rounded-full"})}),m.jsxs("div",{className:"flex flex-col border-t border-border bg-background overflow-hidden shrink-0",style:{height:S},children:[m.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Bb,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("span",{className:"font-medium text-xs text-muted-foreground",children:"Terminal"})]}),m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:u,children:m.jsx(ei,{className:"w-3.5 h-3.5"})})]}),J(),ne()]})]})}function HO({tab:e,serverUrl:n,apiToken:i,onStatusChange:s,onSessionInit:l,onTitleChange:h}){const u=T.useRef(s),o=T.useRef(l),c=T.useRef(h);T.useEffect(()=>{u.current=s,o.current=l,c.current=h});const d=T.useCallback(b=>{u.current(b)},[]),g=T.useCallback(b=>{o.current(b)},[]),f=T.useCallback(b=>{c.current(b)},[]);return m.jsx(OO,{serverUrl:n,apiToken:i,cwd:e.workspacePath,serverSessionId:e.serverSessionId,onStatusChange:d,onSessionInit:g,onTitleChange:f})}function UO(e){return e.role==="assistant"}const $O=Qa("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 Bu({className:e,variant:n,...i}){return m.jsx("div",{"data-slot":"alert",role:"alert",className:_e($O({variant:n}),e),...i})}function zu({className:e,...n}){return m.jsx("div",{"data-slot":"alert-description",className:_e("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 qO({className:e,value:n,...i}){return m.jsx(J3,{"data-slot":"progress",className:_e("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",e),...i,children:m.jsx(ej,{"data-slot":"progress-indicator",className:"size-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(n||0)}%)`}})})}function Eu(e){return e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"k":e.toString()}function VO(e){return e>=60?"critical":e>=40?"warning":"normal"}function GO({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)),u=VO(h);return s?m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsxs("span",{className:"text-xs font-mono",children:[Eu(e),"/",Eu(l)]}),m.jsx(Dl,{children:m.jsxs(Ha,{children:[m.jsx(Ua,{asChild:!0,children:m.jsx(Ob,{className:"size-3 text-muted-foreground cursor-help"})}),m.jsxs($a,{side:"bottom",children:[m.jsxs("p",{className:"text-xs",children:["Model: ",i]}),m.jsxs("p",{className:"text-xs",children:[h,"% of context window used"]})]})]})})]}):m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-xs text-muted-foreground",children:"Tokens:"}),m.jsxs("span",{className:"text-xs font-mono",children:[Eu(e),"/",Eu(l)]})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(qO,{value:h,className:_e("h-1 w-20",u==="critical"&&"[&>div]:bg-destructive",u==="warning"&&"[&>div]:bg-warning",u==="normal"&&"[&>div]:bg-primary")}),m.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["(",h,"%)"]})]})]}),m.jsx(Dl,{children:m.jsxs(Ha,{children:[m.jsx(Ua,{asChild:!0,children:m.jsx(Ob,{className:"size-3.5 text-muted-foreground cursor-help"})}),m.jsx($a,{side:"bottom",children:m.jsxs("p",{className:"text-xs",children:["Model: ",i]})})]})})]})}function Sg({...e}){return m.jsx(Ij,{"data-slot":"select",...e})}function WO({className:e,...n}){return m.jsx($j,{"data-slot":"select-group",className:_e("scroll-my-1 p-1",e),...n})}function Wa({...e}){return m.jsx(zj,{"data-slot":"select-value",...e})}function wg({className:e,size:n="default",children:i,...s}){return m.jsxs(Bj,{"data-slot":"select-trigger","data-size":n,className:_e("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,m.jsx(Pj,{asChild:!0,children:m.jsx(Ya,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function Cg({className:e,children:n,position:i="item-aligned",align:s="center",...l}){return m.jsx(Fj,{children:m.jsxs(Hj,{"data-slot":"select-content","data-align-trigger":i==="item-aligned",className:_e("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:[m.jsx(YO,{}),m.jsx(Uj,{"data-position":i,className:_e("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}),m.jsx(XO,{})]})})}function KO({className:e,...n}){return m.jsx(qj,{"data-slot":"select-label",className:_e("px-1.5 py-1 text-xs text-muted-foreground",e),...n})}function Ju({className:e,children:n,...i}){return m.jsxs(Vj,{"data-slot":"select-item",className:_e("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:[m.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:m.jsx(Wj,{children:m.jsx(ni,{className:"pointer-events-none"})})}),m.jsx(Gj,{children:n})]})}function YO({className:e,...n}){return m.jsx(Kj,{"data-slot":"select-scroll-up-button",className:_e("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:m.jsx(kA,{})})}function XO({className:e,...n}){return m.jsx(Yj,{"data-slot":"select-scroll-down-button",className:_e("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...n,children:m.jsx(Ya,{})})}function ti({className:e,...n}){return m.jsx(M3,{"data-slot":"label",className:_e("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 ZO(e){switch(e){case"budget":return"$";case"standard":return"$$";case"premium":return"$$$";default:return""}}function QO({models:e,selectedModelId:n,onChangeModel:i,disabled:s,iconOnly:l=!1,connectedProviderIds:h,connectableProviderIds:u}){const o=e.reduce((d,g)=>(d[g.providerName]||(d[g.providerName]=[]),d[g.providerName].push(g),d),{}),c=d=>{const g=e.find(f=>f.id===d);g&&i(d,g.providerId)};return m.jsxs("div",{className:"flex items-center gap-2",children:[!l&&m.jsx(ti,{className:"text-xs text-muted-foreground",children:"Model:"}),m.jsxs(Sg,{value:n||"",onValueChange:c,disabled:s,children:[m.jsx(wg,{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?m.jsxs(m.Fragment,{children:[m.jsx(BA,{className:"size-4"}),m.jsx(Wa,{className:"sr-only"})]}):m.jsx(Wa,{placeholder:"Select model"})}),m.jsx(Cg,{children:Object.entries(o).map(([d,g])=>m.jsxs(WO,{children:[m.jsx(KO,{children:d}),g.map(f=>m.jsx(Ju,{value:f.id,disabled:(u==null?void 0:u.has(f.providerId))&&!(h!=null&&h.has(f.providerId)),children:m.jsxs("span",{className:"flex items-center gap-2",children:[f.name,m.jsx("span",{className:"text-muted-foreground text-xs",children:ZO(f.tier)}),(u==null?void 0:u.has(f.providerId))&&(h==null?void 0:h.has(f.providerId))&&m.jsx(ln,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:"Sub"}),(u==null?void 0:u.has(f.providerId))&&!(h!=null&&h.has(f.providerId))&&m.jsx(ln,{variant:"outline",className:"text-[10px] px-1 py-0 h-4",children:"OAuth"})]})},f.id))]},d))})]})]})}const JO={low:"Low",medium:"Medium",high:"High",xhigh:"X-High",minimal:"Minimal",max:"Max"};function eL(e){return JO[e]||e.charAt(0).toUpperCase()+e.slice(1)}function tL({variants:e,selectedVariant:n,onChangeVariant:i,disabled:s,iconOnly:l=!1}){if(!e||Object.keys(e).length===0)return null;const h=Object.keys(e),u=o=>{i(o==="__none__"?null:o)};return m.jsxs("div",{className:"flex items-center gap-2",children:[!l&&m.jsx(ti,{className:"text-xs text-muted-foreground",children:"Thinking:"}),m.jsxs(Sg,{value:n||"__none__",onValueChange:u,disabled:s,children:[m.jsx(wg,{className:l?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[120px] h-8 text-sm",children:l?m.jsxs(m.Fragment,{children:[m.jsx(_A,{className:"size-4"}),m.jsx(Wa,{className:"sr-only"})]}):m.jsx(Wa,{placeholder:"Default"})}),m.jsxs(Cg,{children:[m.jsx(Ju,{value:"__none__",children:"Default"}),h.map(o=>m.jsx(Ju,{value:o,children:eL(o)},o))]})]})]})}function nL({preconfigs:e,selectedPreconfigId:n,onChangePreconfig:i,disabled:s,iconOnly:l=!1}){return m.jsxs("div",{className:"flex items-center gap-2",children:[!l&&m.jsx(ti,{className:"text-xs text-muted-foreground",children:"Config:"}),m.jsxs(Sg,{value:n||"",onValueChange:i,disabled:s,children:[m.jsx(wg,{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?m.jsxs(m.Fragment,{children:[m.jsx(Ux,{className:"size-4"}),m.jsx(Wa,{className:"sr-only"})]}):m.jsx(Wa,{placeholder:"Select config"})}),m.jsx(Cg,{children:e.map(h=>m.jsxs(Ju,{value:h.id,children:[h.name,h.isDefault&&m.jsx("span",{className:"ml-2 text-muted-foreground text-xs",children:"(default)"})]},h.id))})]})]})}function rL({session:e,preconfigs:n,models:i,usage:s,modelName:l,onChangePreconfig:h,onChangeModel:u,onChangeVariant:o,onRename:c,onNavigateBack:d,isStreaming:g,onInterrupt:f,onCompact:b,isCompacting:S,canCompact:k,connectedProviderIds:w,connectableProviderIds:_,selectedVariant:y,variants:v}){var K;const[x,E]=T.useState(!1),[N,R]=T.useState(e.title||""),M=T.useRef(null),D=Zl();T.useEffect(()=>{x&&M.current&&(M.current.focus(),M.current.select())},[x]);const O=()=>{R(e.title||""),E(!0)},P=()=>{const V=N.trim();V&&V!==e.title&&c(e.id,V),E(!1)},$=V=>{V.key==="Enter"?P():V.key==="Escape"&&(R(e.title||""),E(!1))},U=e.selectedModel||((K=n.find(V=>V.id===e.preconfigId))==null?void 0:K.model)||l,q=i.find(V=>V.id===U),Y=q==null?void 0:q.contextWindow;return m.jsxs("header",{className:"flex flex-col border-b border-border bg-card",children:[m.jsx("div",{className:"flex items-center justify-start px-4 py-2",children:m.jsxs("div",{className:"flex items-center gap-3",children:[e.parentId&&d&&m.jsxs(ke,{variant:"ghost",size:"sm",onClick:d,className:"h-7",children:[m.jsx(fA,{className:"size-4","data-icon":"inline-start"}),"Back"]}),x?m.jsx("input",{ref:M,type:"text",value:N,onChange:V=>R(V.target.value),onBlur:P,onKeyDown:$,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}):m.jsx("h2",{className:"text-lg font-semibold cursor-pointer px-2 py-0.5 -mx-2 rounded hover:bg-accent transition-colors",onDoubleClick:O,children:e.title||"Untitled Session"}),m.jsx(ln,{variant:"outline",className:"font-mono text-xs",children:e.id.slice(0,8)}),e.status==="closed"&&m.jsxs(ln,{variant:"secondary",children:[m.jsx(dA,{className:"size-3","data-icon":"inline-start"}),"Archived"]})]})}),m.jsx(gl,{}),m.jsxs("div",{className:"inline-flex align-middle items-center gap-3 sm:gap-4 px-4 py-2 flex-wrap",children:[m.jsx(GO,{promptTokens:s.promptTokens,completionTokens:s.completionTokens,totalTokens:s.totalTokens,contextWindow:Y,modelName:l,compact:D}),m.jsx(gl,{orientation:"vertical",className:"hidden sm:block"}),m.jsx(QO,{models:i,selectedModelId:U,onChangeModel:u,disabled:e.status==="closed"||!!e.parentId,iconOnly:D,connectedProviderIds:w,connectableProviderIds:_}),m.jsx(tL,{variants:v,selectedVariant:y,onChangeVariant:o,disabled:e.status==="closed"||!!e.parentId,iconOnly:D}),m.jsx(nL,{preconfigs:n,selectedPreconfigId:e.preconfigId,onChangePreconfig:h,disabled:e.status==="closed"||!!e.parentId,iconOnly:D}),m.jsx(gl,{orientation:"vertical",className:"hidden sm:block"}),b&&m.jsxs(m.Fragment,{children:[m.jsxs(ke,{variant:"outline",size:D?"icon":"sm",onClick:b,disabled:g||S||!k,title:S?"Compacting...":"Compact older messages",children:[m.jsx(Fx,{className:"size-4"}),!D&&m.jsx("span",{className:"ml-1",children:S?"Compacting...":"Compact"})]}),m.jsx(gl,{orientation:"vertical",className:"hidden sm:block"})]}),m.jsxs(ke,{variant:g?"destructive":"outline",size:D?"icon":"sm",onClick:f,disabled:!f,className:g?"":"opacity-60 hover:opacity-100",title:g?"Interrupt operation":"Interrupt (no active operation)",children:[m.jsx(qx,{className:"size-4"}),!D&&m.jsx("span",{className:"ml-1",children:"Stop"})]})]})]})}function M0({open:e,onOpenChange:n,title:i,description:s,confirmLabel:l="Confirm",cancelLabel:h="Cancel",onConfirm:u,variant:o="default"}){const c=()=>{u(),n(!1)};return m.jsx(io,{open:e,onOpenChange:n,children:m.jsxs(so,{showCloseButton:!1,children:[m.jsxs(ao,{children:[m.jsx(oo,{children:i}),m.jsx(Yl,{children:s})]}),m.jsxs(Od,{children:[m.jsx(_4,{asChild:!0,children:m.jsx(ke,{variant:"outline",children:h})}),m.jsx(ke,{onClick:c,variant:o==="destructive"?"destructive":"default",children:l})]})]})})}function iL({message:e,textContent:n,children:i,isQueued:s=!1,onRemove:l,onRevert:h,canRevert:u=!1,onFork:o,canFork:c=!1}){const[d,g]=T.useState(!1),[f,b]=T.useState(!1),[S,k]=T.useState(!1),w=e.role==="user",_=async()=>{const y=n||"";await navigator.clipboard.writeText(y),g(!0),setTimeout(()=>g(!1),2e3)};return m.jsxs("div",{className:_e("flex flex-col gap-1 mb-4 animate-slide-up min-w-0",w?"items-end":"items-start"),children:[m.jsx("div",{className:_e("flex items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground",w?"mr-3":"ml-3"),children:w?m.jsxs(m.Fragment,{children:[!s&&m.jsxs(m.Fragment,{children:[u&&h&&m.jsx(ke,{variant:"ghost",size:"icon",onClick:()=>b(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Revert to this point",children:m.jsx(UT,{className:"size-3"})}),c&&o&&m.jsx(ke,{variant:"ghost",size:"icon",onClick:()=>k(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Fork from this point",children:m.jsx(QA,{className:"size-3"})}),m.jsx(ke,{variant:"ghost",size:"icon",onClick:_,className:"size-5 text-muted-foreground hover:text-foreground",children:d?m.jsx(ni,{className:"size-3"}):m.jsx(Cl,{className:"size-3"})})]}),m.jsx(Vx,{className:"size-3"}),e.role]}):m.jsxs(m.Fragment,{children:[m.jsx(mA,{className:"size-3"}),e.role,m.jsx(ke,{variant:"ghost",size:"icon",onClick:_,className:"size-5 text-muted-foreground hover:text-foreground",children:d?m.jsx(ni,{className:"size-3"}):m.jsx(Cl,{className:"size-3"})})]})}),m.jsxs("div",{className:_e("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&&m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 pb-2 border-b border-muted-foreground/20",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[m.jsx(Px,{className:"size-3 animate-pulse"}),m.jsx("span",{children:"Pending"})]}),l&&m.jsx(ke,{variant:"ghost",size:"icon",onClick:l,className:"size-6 text-muted-foreground hover:text-destructive hover:bg-destructive/10",title:"Remove from queue",children:m.jsx(ei,{className:"size-3"})})]}),m.jsx("div",{className:"min-w-0",children:i})]}),m.jsx(M0,{open:f,onOpenChange:b,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"}),m.jsx(M0,{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 sL=Object.create,Ud=Object.defineProperty,aL=Object.defineProperties,oL=Object.getOwnPropertyDescriptor,lL=Object.getOwnPropertyDescriptors,LC=Object.getOwnPropertyNames,ed=Object.getOwnPropertySymbols,cL=Object.getPrototypeOf,kg=Object.prototype.hasOwnProperty,IC=Object.prototype.propertyIsEnumerable,j0=(e,n,i)=>n in e?Ud(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,Ar=(e,n)=>{for(var i in n||(n={}))kg.call(n,i)&&j0(e,i,n[i]);if(ed)for(var i of ed(n))IC.call(n,i)&&j0(e,i,n[i]);return e},$d=(e,n)=>aL(e,lL(n)),BC=(e,n)=>{var i={};for(var s in e)kg.call(e,s)&&n.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&ed)for(var s of ed(e))n.indexOf(s)<0&&IC.call(e,s)&&(i[s]=e[s]);return i},uL=(e,n)=>function(){return n||(0,e[LC(e)[0]])((n={exports:{}}).exports,n),n.exports},dL=(e,n)=>{for(var i in n)Ud(e,i,{get:n[i],enumerable:!0})},hL=(e,n,i,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of LC(n))!kg.call(e,l)&&l!==i&&Ud(e,l,{get:()=>n[l],enumerable:!(s=oL(n,l))||s.enumerable});return e},fL=(e,n,i)=>(i=e!=null?sL(cL(e)):{},hL(!e||!e.__esModule?Ud(i,"default",{value:e,enumerable:!0}):i,e)),pL=uL({"../../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={},u={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 y,v;switch(u.util.type(w)){case"Object":if(v=u.util.objId(w),_[v])return _[v];y={},_[v]=y;for(var x in w)w.hasOwnProperty(x)&&(y[x]=k(w[x],_));return y;case"Array":return v=u.util.objId(w),_[v]?_[v]:(y=[],_[v]=y,w.forEach(function(E,N){y[N]=k(E,_)}),y);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 y="no-"+w;k;){var v=k.classList;if(v.contains(w))return!0;if(v.contains(y))return!1;k=k.parentElement}return!!_}},languages:{plain:h,plaintext:h,text:h,txt:h,extend:function(k,w){var _=u.util.clone(u.languages[k]);for(var y in w)_[y]=w[y];return _},insertBefore:function(k,w,_,y){y=y||u.languages;var v=y[k],x={};for(var E in v)if(v.hasOwnProperty(E)){if(E==w)for(var N in _)_.hasOwnProperty(N)&&(x[N]=_[N]);_.hasOwnProperty(E)||(x[E]=v[E])}var R=y[k];return y[k]=x,u.languages.DFS(u.languages,function(M,D){D===R&&M!=k&&(this[M]=x)}),x},DFS:function k(w,_,y,v){v=v||{};var x=u.util.objId;for(var E in w)if(w.hasOwnProperty(E)){_.call(w,E,w[E],y||E);var N=w[E],R=u.util.type(N);R==="Object"&&!v[x(N)]?(v[x(N)]=!0,k(N,_,null,v)):R==="Array"&&!v[x(N)]&&(v[x(N)]=!0,k(N,_,E,v))}}},plugins:{},highlight:function(k,w,_){var y={code:k,grammar:w,language:_};if(u.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=u.tokenize(y.code,y.grammar),u.hooks.run("after-tokenize",y),o.stringify(u.util.encode(y.tokens),y.language)},tokenize:function(k,w){var _=w.rest;if(_){for(var y in _)w[y]=_[y];delete w.rest}var v=new g;return f(v,v.head,k),d(k,v,w,v.head,0),S(v)},hooks:{all:{},add:function(k,w){var _=u.hooks.all;_[k]=_[k]||[],_[k].push(w)},run:function(k,w){var _=u.hooks.all[k];if(!(!_||!_.length))for(var y=0,v;v=_[y++];)v(w)}},Token:o};function o(k,w,_,y){this.type=k,this.content=w,this.alias=_,this.length=(y||"").length|0}o.stringify=function k(w,_){if(typeof w=="string")return w;if(Array.isArray(w)){var y="";return w.forEach(function(R){y+=k(R,_)}),y}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)),u.hooks.run("wrap",v);var E="";for(var N in v.attributes)E+=" "+N+'="'+(v.attributes[N]||"").replace(/"/g,"&quot;")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+E+">"+v.content+"</"+v.tag+">"};function c(k,w,_,y){k.lastIndex=w;var v=k.exec(_);if(v&&y&&v[1]){var x=v[1].length;v.index+=x,v[0]=v[0].slice(x)}return v}function d(k,w,_,y,v,x){for(var E in _)if(!(!_.hasOwnProperty(E)||!_[E])){var N=_[E];N=Array.isArray(N)?N:[N];for(var R=0;R<N.length;++R){if(x&&x.cause==E+","+R)return;var M=N[R],D=M.inside,O=!!M.lookbehind,P=!!M.greedy,$=M.alias;if(P&&!M.pattern.global){var U=M.pattern.toString().match(/[imsuy]*$/)[0];M.pattern=RegExp(M.pattern.source,U+"g")}for(var q=M.pattern||M,Y=y.next,K=v;Y!==w.tail&&!(x&&K>=x.reach);K+=Y.value.length,Y=Y.next){var V=Y.value;if(w.length>k.length)return;if(!(V instanceof o)){var J=1,ne;if(P){if(ne=c(q,K,k,O),!ne||ne.index>=k.length)break;var L=ne.index,F=ne.index+ne[0].length,j=K;for(j+=Y.value.length;L>=j;)Y=Y.next,j+=Y.value.length;if(j-=Y.value.length,K=j,Y.value instanceof o)continue;for(var I=Y;I!==w.tail&&(j<F||typeof I.value=="string");I=I.next)J++,j+=I.value.length;J--,V=k.slice(K,j),ne.index-=K}else if(ne=c(q,0,V,O),!ne)continue;var L=ne.index,z=ne[0],Z=V.slice(0,L),X=V.slice(L+z.length),ee=K+V.length;x&&ee>x.reach&&(x.reach=ee);var W=Y.prev;Z&&(W=f(w,W,Z),K+=Z.length),b(w,W,J);var H=new o(E,D?u.tokenize(z,D):z,$,z);if(Y=f(w,W,H),X&&f(w,Y,X),J>1){var te={cause:E+","+R,reach:ee};d(k,w,_,Y.prev,K,te),x&&te.reach>x.reach&&(x.reach=te.reach)}}}}}}function g(){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 y=w.next,v={value:_,prev:w,next:y};return w.next=v,y.prev=v,k.length++,v}function b(k,w,_){for(var y=w.next,v=0;v<_&&y!==k.tail;v++)y=y.next;w.next=y,y.prev=w,k.length-=v}function S(k){for(var w=[],_=k.head.next;_!==k.tail;)w.push(_.value),_=_.next;return w}return u})();n.exports=i,i.default=i}}),ve=fL(pL());ve.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]},ve.languages.markup.tag.inside["attr-value"].inside.entity=ve.languages.markup.entity,ve.languages.markup.doctype.inside["internal-subset"].inside=ve.languages.markup,ve.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(ve.languages.markup.tag,"addInlined",{value:function(e,s){var i={},i=(i["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:ve.languages[s]},i.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}}),s=(i["language-"+s]={pattern:/[\s\S]+/,inside:ve.languages[s]},{});s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},ve.languages.insertBefore("markup","cdata",s)}}),Object.defineProperty(ve.languages.markup.tag,"addAttribute",{value:function(e,n){ve.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:ve.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),ve.languages.html=ve.languages.markup,ve.languages.mathml=ve.languages.markup,ve.languages.svg=ve.languages.markup,ve.languages.xml=ve.languages.extend("markup",{}),ve.languages.ssml=ve.languages.xml,ve.languages.atom=ve.languages.xml,ve.languages.rss=ve.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"}}})(ve),ve.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:/[{}[\];(),.:]/},ve.languages.javascript=ve.languages.extend("clike",{"class-name":[ve.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}|\?\?=?|\?\.?|[~:]/}),ve.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,ve.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:ve.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:ve.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:ve.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:ve.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:ve.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),ve.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:ve.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"}}),ve.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),ve.languages.markup&&(ve.languages.markup.tag.addInlined("script","javascript"),ve.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")),ve.languages.js=ve.languages.javascript,ve.languages.actionscript=ve.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:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),ve.languages.actionscript["class-name"].alias="function",delete ve.languages.actionscript.parameter,delete ve.languages.actionscript["literal-property"],ve.languages.markup&&ve.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:ve.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})(ve),(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},u="doc-comment";if(o=e.languages[l]){var o,c=o[u];if((c=c||(o=e.languages.insertBefore(l,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[u])instanceof RegExp&&(c=o[u]={pattern:c}),Array.isArray(c))for(var d=0,g=c.length;d<g;d++)c[d]instanceof RegExp&&(c[d]={pattern:c[d]}),h(c[d]);else h(c)}})}}),n.addSupport(["java","javascript","php"],n)})(ve),(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"))})(ve),(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})})(ve),(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 u(o,c){c=(c||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<value>>/g,function(){return o});return RegExp(d,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:u(/\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:u(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:u(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:u(h),lookbehind:!0,greedy:!0},number:{pattern:u(/[+-]?(?: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})(ve),(function(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function i(d){return d=d.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+d+")")}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,u=(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(d){["url","bold","italic","strike","code-snippet"].forEach(function(g){d!==g&&(e.languages.markdown[d].inside.content.inside[g]=e.languages.markdown[g])})}),e.hooks.add("after-tokenize",function(d){d.language!=="markdown"&&d.language!=="md"||(function g(f){if(f&&typeof f!="string")for(var b=0,S=f.length;b<S;b++){var k,w=f[b];w.type!=="code"?g(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]))}})(d.tokens)}),e.hooks.add("wrap",function(d){if(d.type==="code-block"){for(var g="",f=0,b=d.classes.length;f<b;f++){var S=d.classes[f],S=/language-(.+)/.exec(S);if(S){g=S[1];break}}var k,w=e.languages[g];w?d.content=e.highlight((function(_){return _=_.replace(u,""),_=_.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(y,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]||y})})(d.content),w,g):g&&g!=="none"&&e.plugins.autoloader&&(k="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),d.attributes.id=k,e.plugins.autoloader.loadLanguages(g,function(){var _=document.getElementById(k);_&&(_.innerHTML=e.highlight(_.textContent,e.languages[g],g))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),o={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(ve),ve.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:ve.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+/},ve.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"])&&g(1).content==="("){i+=2;var h=b(/^\($/,/^\)$/);if(h===-1)continue;for(;i<h;i++){var u=g(0);u.type==="variable"&&(S(u,"variable-input"),l.push(u.content))}i=h+1}if(f(["punctuation","property-query"])&&g(0).content==="{"&&(i++,S(g(0),"property-mutation"),0<l.length)){var o=b(/^\{$/,/^\}$/);if(o!==-1)for(var c=i;c<o;c++){var d=n[c];d.type==="variable"&&0<=l.indexOf(d.content)&&S(d,"variable-input")}}}}function g(k){return n[i+k]}function f(k,w){w=w||0;for(var _=0;_<k.length;_++){var y=g(_+w);if(!y||y.type!==k[_])return}return 1}function b(k,w){for(var _=1,y=i;y<n.length;y++){var v=n[y],x=v.content;if(v.type==="punctuation"&&typeof x=="string"){if(k.test(x))_++;else if(w.test(x)&&--_===0)return y}}return-1}function S(k,w){var _=k.alias;_?Array.isArray(_)||(k.alias=_=[_]):k.alias=_=[],_.push(w)}}),ve.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 u(f,b){if(e.languages[f])return{pattern:RegExp("((?:"+b+")\\s*)"+i),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:f}}}}function o(f,b,S){return f={code:f,grammar:b,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,b,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(""),b,S),y=Object.keys(w);return k=0,(function v(x){for(var E=0;E<x.length;E++){if(k>=y.length)return;var N,R,M,D,O,P,$,U=x[E];typeof U=="string"||typeof U.content=="string"?(N=y[k],($=(P=typeof U=="string"?U:U.content).indexOf(N))!==-1&&(++k,R=P.substring(0,$),O=w[N],M=void 0,(D={})["interpolation-punctuation"]=l,(D=e.tokenize(O,D)).length===3&&((M=[1,1]).push.apply(M,o(D[1],e.languages.javascript,"javascript")),D.splice.apply(D,M)),M=new e.Token("interpolation",D,s.alias,O),D=P.substring($+N.length),O=[],R&&O.push(R),O.push(M),D&&(v(P=[D]),O.push.apply(O,P)),typeof U=="string"?(x.splice.apply(x,[E,1].concat(O)),E+=O.length-1):U.content=O)):($=U.content,Array.isArray($)?v($):v([$]))}})(_),new e.Token(S,_,"language-"+S,f)}e.languages.javascript["template-string"]=[u("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),u("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),u("svg",/\bsvg/.source),u("markdown",/\b(?:markdown|md)/.source),u("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),u("sql",/\bsql/.source),n].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function g(f){return typeof f=="string"?f:Array.isArray(f)?f.map(g).join(""):g(f.content)}e.hooks.add("after-tokenize",function(f){f.language in d&&(function b(S){for(var k=0,w=S.length;k<w;k++){var _,y,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"&&(y=g(x),x=x.alias,x=Array.isArray(x)?x[0]:x,v=e.languages[x])&&(_[1]=c(y,v,x))):b(_):typeof _!="string"&&b([_]))}})(f.tokens)})})(ve),(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})(ve),(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)})(ve),(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})})(ve),ve.languages.n4js=ve.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/}),ve.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),ve.languages.n4jsd=ve.languages.n4js,(function(e){function n(u,o){return RegExp(u.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]*/}})(ve),(function(e){var n=e.util.clone(e.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,l=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function h(c,d){return c=c.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return l}),RegExp(c,d)}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 u(c){for(var d=[],g=0;g<c.length;g++){var f=c[g],b=!1;typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?0<d.length&&d[d.length-1].tagName===o(f.content[0].content[1])&&d.pop():f.content[f.content.length-1].content!=="/>"&&d.push({tagName:o(f.content[0].content[1]),openedBraces:0}):0<d.length&&f.type==="punctuation"&&f.content==="{"?d[d.length-1].openedBraces++:0<d.length&&0<d[d.length-1].openedBraces&&f.type==="punctuation"&&f.content==="}"?d[d.length-1].openedBraces--:b=!0),(b||typeof f=="string")&&0<d.length&&d[d.length-1].openedBraces===0&&(b=o(f),g<c.length-1&&(typeof c[g+1]=="string"||c[g+1].type==="plain-text")&&(b+=o(c[g+1]),c.splice(g+1,1)),0<g&&(typeof c[g-1]=="string"||c[g-1].type==="plain-text")&&(b=o(c[g-1])+b,c.splice(g-1,1),g--),c[g]=new e.Token("plain-text",b,null,b)),f.content&&typeof f.content!="string"&&u(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"||u(c.tokens)})})(ve),(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})(ve),ve.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:/[{}[\]();,.:\\]/},ve.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=ve.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})(ve),ve.languages.c=ve.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|[?:~]|[-+*/%&|^!=<>]=?/}),ve.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),ve.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},ve.languages.c.string],char:ve.languages.c.char,comment:ve.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:ve.languages.c}}}}),ve.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 ve.languages.c.boolean,ve.languages.objectivec=ve.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 ve.languages.objectivec["class-name"],ve.languages.objc=ve.languages.objectivec,ve.languages.reason=ve.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/}),ve.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 ve.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})(ve),ve.languages.go=ve.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/}),ve.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete ve.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"])})(ve),ve.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:/[{}[\];(),.:]/},ve.languages.python["string-interpolation"].inside.interpolation.inside.rest=ve.languages.python,ve.languages.py=ve.languages.python,ve.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"}},ve.languages.webmanifest=ve.languages.json;var Nl={};dL(Nl,{dracula:()=>gL,duotoneDark:()=>_L,duotoneLight:()=>bL,github:()=>SL,gruvboxMaterialDark:()=>ZL,gruvboxMaterialLight:()=>JL,jettwaveDark:()=>$L,jettwaveLight:()=>VL,nightOwl:()=>CL,nightOwlLight:()=>EL,oceanicNext:()=>TL,okaidia:()=>DL,oneDark:()=>WL,oneLight:()=>YL,palenight:()=>ML,shadesOfPurple:()=>OL,synthwave84:()=>IL,ultramin:()=>zL,vsDark:()=>zC,vsLight:()=>HL});var mL={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)"}}]},gL=mL,vL={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"}}]},_L=vL,yL={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"}}]},bL=yL,xL={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"}}]},SL=xL,wL={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)"}}]},CL=wL,kL={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)"}}]},EL=kL,In={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},AL={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:In.keyword}},{types:["attr-value"],style:{color:In.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:In.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:In.primitive}},{types:["boolean"],style:{color:In.boolean}},{types:["tag"],style:{color:In.tag}},{types:["string"],style:{color:In.string}},{types:["punctuation"],style:{color:In.string}},{types:["selector","char","builtin","inserted"],style:{color:In.char}},{types:["function"],style:{color:In.function}},{types:["operator","entity","url","variable"],style:{color:In.variable}},{types:["keyword"],style:{color:In.keyword}},{types:["atrule","class-name"],style:{color:In.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},TL=AL,RL={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"}}]},DL=RL,NL={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)"}}]},ML=NL,jL={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)"}}]},OL=jL,LL={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"}}]},IL=LL,BL={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)"}}]},zL=BL,PL={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)"}}]},zC=PL,FL={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)"}}]},HL=FL,UL={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"}}]},$L=UL,qL={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"}}]},VL=qL,GL={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%)"}}]},WL=GL,KL={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%)"}}]},YL=KL,XL={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"}}]},ZL=XL,QL={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"}}]},JL=QL,e6=e=>T.useCallback(n=>{var i=n,{className:s,style:l,line:h}=i,u=BC(i,["className","style","line"]);const o=$d(Ar({},u),{className:od("token-line",s)});return typeof e=="object"&&"plain"in e&&(o.style=e.plain),typeof l=="object"&&(o.style=Ar(Ar({},o.style||{}),l)),o},[e]),t6=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:u}=s,o=BC(s,["token","className","style"]);const c=$d(Ar({},o),{className:od("token",...l.types,h),children:l.content,style:n(l)});return u!=null&&(c.style=Ar(Ar({},c.style||{}),u)),c},[n])},n6=/\r\n|\r|\n/,O0=e=>{e.length===0?e.push({types:["plain"],content:`
481
- `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
482
- `,e[0].empty=!0)},L0=(e,n)=>{const i=e.length;return i>0&&e[i-1]===n?e:e.concat(n)},r6=e=>{const n=[[]],i=[e],s=[0],l=[e.length];let h=0,u=0,o=[];const c=[o];for(;u>-1;){for(;(h=s[u]++)<l[u];){let d,g=n[u];const b=i[u][h];if(typeof b=="string"?(g=u>0?g:["plain"],d=b):(g=L0(g,b.type),b.alias&&(g=L0(g,b.alias)),d=b.content),typeof d!="string"){u++,n.push(g),i.push(d),s.push(0),l.push(d.length);continue}const S=d.split(n6),k=S.length;o.push({types:g,content:S[0]});for(let w=1;w<k;w++)O0(o),c.push(o=[]),o.push({types:g,content:S[w]})}u--,n.pop(),i.pop(),s.pop(),l.pop()}return O0(o),c},I0=r6,i6=({prism:e,code:n,grammar:i,language:s})=>T.useMemo(()=>{if(i==null)return I0([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),I0(l.tokens)},[n,i,s,e]),s6=(e,n)=>{const{plain:i}=e,s=e.styles.reduce((l,h)=>{const{languages:u,style:o}=h;return u&&!u.includes(n)||h.types.forEach(c=>{const d=Ar(Ar({},l[c]),o);l[c]=d}),l},{});return s.root=i,s.plain=$d(Ar({},i),{backgroundColor:void 0}),s},a6=s6,o6=({children:e,language:n,code:i,theme:s,prism:l})=>{const h=n.toLowerCase(),u=a6(s,h),o=e6(u),c=t6(u),d=l.languages[h],g=i6({prism:l,language:h,code:i,grammar:d});return e({tokens:g,className:`prism-code language-${h}`,style:u!=null?u.root:{},getLineProps:o,getTokenProps:c})},Eg=e=>T.createElement(o6,$d(Ar({},e),{prism:e.prism||ve,theme:e.theme||zC,code:e.code,language:e.language}));/*! Bundled license information:
483
-
484
- prismjs/prism.js:
485
- (**
486
- * Prism: Lightweight, robust, elegant syntax highlighting
487
- *
488
- * @license MIT <https://opensource.org/licenses/MIT>
489
- * @author Lea Verou <https://lea.verou.me>
490
- * @namespace
491
- * @public
492
- *)
493
- */function l6(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 c6({type:e,content:n,lineNumber:i,newLineNumber:s,language:l}){const h=_e("flex font-mono text-xs",e==="added"&&"bg-green-500/20",e==="removed"&&"bg-red-500/20",e==="context"&&"bg-muted/30"),u=_e("font-bold w-4 select-none",e==="added"&&"text-green-400",e==="removed"&&"text-red-400",e==="context"&&"text-muted-foreground/50");return m.jsxs("div",{className:h,children:[m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:i!=null?i:""}),m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:s!=null?s:""}),m.jsxs("span",{className:"pl-2 flex-1 whitespace-pre flex",children:[m.jsxs("span",{className:u,children:[e==="added"&&"+",e==="removed"&&"-",e==="context"&&" "]}),m.jsx(Eg,{theme:Nl.oneDark,code:n,language:l,children:({tokens:o,getTokenProps:c})=>m.jsx(m.Fragment,{children:o.map((d,g)=>m.jsx("span",{children:d.map((f,b)=>m.jsx("span",{...c({token:f})},b))},g))})})]})]})}function B0({hunks:e,path:n,language:i,additions:s,deletions:l}){const[h,u]=T.useState(!0),o=i||l6(n);return m.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[m.jsx("button",{onClick:()=>u(!h),className:"px-1 py-1 hover:bg-muted rounded",children:h?m.jsx(Ya,{className:"size-3"}):m.jsx(ri,{className:"size-3"})}),m.jsx(Dm,{className:"size-3"}),m.jsx("span",{className:"font-mono pr-2",children:n}),s!==void 0&&l!==void 0&&m.jsxs("span",{className:"ml-auto mr-2 text-muted-foreground",children:["+",s," -",l]})]}),h&&m.jsx("div",{style:{backgroundColor:"#282c34"},children:e.map((c,d)=>m.jsx("div",{className:"divide-y divide-white/5",children:c.changes.map((g,f)=>m.jsx(c6,{...g,language:o},f))},d))})]})})}function u6(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 d6=({content:e,path:n,language:i,created:s,highlightLines:l=[]})=>{const[h,u]=T.useState(!0),o=i||u6(n),c=new Set(l);return m.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[m.jsx("button",{onClick:()=>u(!h),className:"flex items-center gap-2 px-2 py-1 hover:bg-muted",children:h?m.jsx(Ya,{className:"size-3"}):m.jsx(ri,{className:"size-3"})}),m.jsx(Dm,{className:"size-3"}),m.jsx("span",{className:"font-mono pr-2",children:n}),s===!1?m.jsxs("span",{className:"flex items-center gap-1 text-warning ml-auto mr-2",children:[m.jsx(vl,{className:"size-3"}),"Overwrote"]}):m.jsxs("span",{className:"flex items-center gap-1 text-success ml-auto mr-2",children:[m.jsx(ni,{className:"size-3"}),"Created"]})]}),h&&m.jsx("div",{style:{backgroundColor:"#282c34"},children:m.jsx(Eg,{theme:Nl.oneDark,code:e,language:o,children:({tokens:d,getTokenProps:g})=>m.jsx(m.Fragment,{children:d.map((f,b)=>m.jsxs("div",{className:`flex font-mono text-xs ${c.has(b+1)?"bg-yellow-500/20":""}`,children:[m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:b+1}),m.jsx("span",{className:"pl-2 flex-1 whitespace-pre",children:f.map((S,k)=>m.jsx("span",{...g({token:S})},k))})]},b))})})})]})})};function h6({message:e="Success"}){return m.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[m.jsx(Ol,{className:"size-4"}),m.jsx("span",{className:"break-all",children:e})]})}const f6={edit:GA,plus:Xa,trash:Ll,search:Nm};function p6({text:e}){const[n,i]=T.useState(!1),s=async()=>{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)};return m.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:n?m.jsx("span",{className:"text-success text-xs",children:"Copied!"}):m.jsx(Cl,{className:"size-3"})})}function m6({title:e,groups:n,files:i,total:s}){const h=n||(i?[{label:"Files",files:i||[],icon:void 0}]:[]);return h.length===0?null:m.jsxs("div",{className:"flex flex-col gap-3",children:[e&&m.jsxs("div",{className:"text-sm font-medium text-foreground",children:[e,s!==void 0&&m.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",s," files)"]})]}),h.map((u,o)=>m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[u.icon&&m.jsx("span",{className:"flex items-center",children:(()=>{const c=f6[u.icon];return m.jsx(c,{className:"size-3"})})()}),m.jsx("span",{children:u.label}),m.jsxs("span",{className:"text-muted-foreground/50",children:["(",u.files.length,")"]})]}),m.jsx("div",{className:"flex flex-col gap-0.5 pl-5",children:u.files.map((c,d)=>m.jsxs("div",{className:"flex items-center gap-2 text-xs group",children:[m.jsx(Dm,{className:"size-3 text-muted-foreground shrink-0"}),m.jsx("span",{className:"font-mono text-foreground/80 truncate",children:c.path}),c.line!==void 0&&m.jsxs("span",{className:"text-muted-foreground shrink-0",children:[":",c.line]}),c.action&&m.jsx("span",{className:_e("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}),m.jsx(p6,{text:c.path})]},d))})]},o))]})}function g6({command:e,stdout:n,stderr:i,exitCode:s}){const l=s===0;return m.jsxs("div",{className:"visualization-container border border-white/10 rounded-md overflow-hidden",children:[m.jsxs("div",{className:"bg-muted px-3 py-2 flex items-center justify-between",children:[m.jsxs("div",{className:"font-mono text-xs text-muted-foreground truncate flex-1 mr-2",children:[m.jsx("span",{className:"text-muted-foreground",children:"$ "}),m.jsx("span",{className:"text-foreground",children:e})]}),m.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)&&m.jsxs("div",{className:"bg-black px-3 py-2 font-mono text-xs overflow-x-auto",children:[n&&m.jsx("pre",{className:"text-gray-300 whitespace-pre-wrap",children:n}),i&&m.jsx("pre",{className:"text-red-400 whitespace-pre-wrap mt-1",children:i})]})]})}const v6={pending:{icon:jA,color:"text-muted-foreground"},in_progress:{icon:Pn,color:"text-warning",animate:!0},completed:{icon:Ol,color:"text-success"},cancelled:{icon:ad,color:"text-destructive"}},_6={high:{label:"high",className:"bg-destructive/20 text-destructive"},medium:{label:"",className:""},low:{label:"low",className:"text-muted-foreground"}};function y6({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,m.jsxs("div",{className:"flex flex-col gap-3 w-full overflow-hidden",children:[(e||n.length>0)&&m.jsxs("div",{className:"text-sm font-medium text-foreground",children:[e||"Todo List",m.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",n.length,")"]}),i>0&&m.jsxs("span",{className:"ml-2 text-success text-xs",children:[i," completed"]})]}),m.jsx("div",{className:"flex flex-col gap-1 w-full",children:n.map((s,l)=>{const h=v6[s.status],u=h.icon,o=_6[s.priority];return m.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[m.jsx(u,{className:_e("size-4 shrink-0",h.color,h.animate&&"animate-spin")}),m.jsx("span",{className:_e("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"&&m.jsx("span",{className:_e("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"&&m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o.label})]},l)})})]})}function b6({visualization:e}){if(!e)return null;switch(e.type){case"diff":return m.jsx(B0,{path:e.path,hunks:e.hunks,language:e.language,additions:e.additions,deletions:e.deletions,matchInfo:e.matchInfo});case"diffs":return m.jsx("div",{className:"space-y-3",children:e.items.map((n,i)=>m.jsx(B0,{path:n.path,hunks:n.hunks,language:n.language,additions:n.additions,deletions:n.deletions,matchInfo:n.matchInfo},`${n.path}-${i}`))});case"code":return m.jsx(d6,{path:e.path,content:e.content,language:e.language,created:e.created,highlightLines:e.highlightLines});case"file-list":return m.jsx(m6,{title:e.title,groups:e.groups,files:e.files,total:e.total});case"table":return m.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 m.jsx("div",{className:"prose prose-sm dark:prose-invert",children:e.content});case"none":return m.jsx(h6,{message:e.message});case"shell-output":return m.jsx(g6,{command:e.command,stdout:e.stdout,stderr:e.stderr,exitCode:e.exitCode});case"todo-list":return m.jsx(y6,{title:e.title,items:e.items});default:return null}}function x6(e){switch(e){case"pending":return m.jsx(Px,{className:"size-3 text-warning"});case"running":return m.jsx(Pn,{className:"size-3 text-warning animate-spin"});case"completed":return m.jsx(Ol,{className:"size-3 text-success"});case"error":return m.jsx(ad,{className:"size-3 text-destructive"});default:return null}}function S6(e){if(e&&typeof e=="object"&&"_visualization"in e)return e._visualization}function w6({part:e,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s}){const[l,h]=T.useState(!1),[u,o]=T.useState(!1),c=e.state,d=c.status,g=d==="completed"&&"output"in c?S6(c.output):void 0,f=d==="pending"?n.find(w=>w.toolCallId===e.callId):void 0;let b=null;if(e.name==="task"){if("childSessionId"in c&&c.childSessionId)b=c.childSessionId;else if(d==="completed"&&"output"in c){const _=(typeof c.output=="string"?c.output:"").match(/task_id:\s*([a-f0-9-]{36})/i);_&&(b=_[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 m.jsxs("div",{className:"my-1",children:[m.jsxs(qa,{open:l,onOpenChange:h,children:[m.jsx(Va,{asChild:!0,children:m.jsxs("div",{className:"flex items-center gap-2 py-1 cursor-pointer hover:text-foreground transition-colors text-muted-foreground",children:[l?m.jsx(Ya,{className:"size-4 text-muted-foreground"}):m.jsx(ri,{className:"size-4 text-muted-foreground"}),m.jsx(XT,{className:"size-3"}),m.jsx("span",{className:"text-xs truncate max-w-[120px] sm:max-w-none",children:e.name}),!l&&m.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}),m.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[x6(d),b&&s&&m.jsxs(ke,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 sm:w-auto sm:px-2",onClick:w=>{w.stopPropagation(),s(b)},title:"View session",children:[m.jsx(Xp,{className:"size-3"}),m.jsx("span",{className:"hidden sm:inline ml-1",children:"View"})]})]})]})}),m.jsx(Ga,{children:m.jsxs("div",{className:"pl-5 pb-2 flex flex-col gap-2",children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Input"}),m.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)})]}),(d==="running"||d==="completed")&&b&&s&&m.jsxs(ke,{variant:"outline",className:"w-full",size:"sm",onClick:()=>s(b),children:[m.jsx(Xp,{className:"size-4","data-icon":"inline-start"}),d==="running"?"Watch Subagent":"View Session"]}),d==="completed"&&"output"in c&&m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center justify-between mb-1",children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:"Output"}),m.jsx(ke,{variant:"ghost",size:"icon",onClick:S,className:"size-6",children:u?m.jsx(ni,{className:"size-3 text-success"}):m.jsx(Cl,{className:"size-3"})})]}),m.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)})]}),d==="error"&&"error"in c&&m.jsxs("div",{children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Error"}),m.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})]})]})})]}),d==="pending"&&f&&m.jsxs("div",{className:"border border-warning/50 bg-warning/10 rounded-md p-3 flex flex-col gap-3 mt-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Qp,{className:"size-4 text-warning"}),m.jsx(ln,{variant:"outline",className:"text-warning border-warning",children:f.permissionType}),m.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:f.permissionKey})]}),f.message&&m.jsx("p",{className:"text-sm",children:f.message}),f.dangerous&&m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive font-medium",children:[m.jsx(Qp,{className:"size-4"}),"This operation is marked as dangerous"]}),m.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[m.jsx(ke,{variant:"outline",size:"sm",onClick:()=>i(e.callId,!1,!1),children:"Deny"}),m.jsx(ke,{variant:"secondary",size:"sm",onClick:()=>i(e.callId,!0,!1),children:"Approve"}),m.jsx(ke,{size:"sm",onClick:()=>i(e.callId,!0,!0),children:"Always Allow"})]})]}),d==="completed"&&g&&m.jsx("div",{className:"mt-2",children:m.jsx(b6,{visualization:g})})]})}function C6({prompts:e,query:n,selectedIndex:i,onSelect:s}){const l=e.filter(h=>h.name.toLowerCase().includes(n.toLowerCase()));return l.length===0?m.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No prompts matching "/',n,'"']}):m.jsxs("div",{className:"p-1",children:[l.map((h,u)=>m.jsxs("button",{onClick:()=>s(h),className:_e("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",u===i&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[m.jsx(uT,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"font-mono text-xs",children:["/",h.name]}),m.jsx("div",{className:"text-xs text-muted-foreground truncate",children:h.description})]})]},h.name)),m.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[l.length," prompt",l.length!==1?"s":""," •",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"})," navigate",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"})," select",m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"})," close"]})]})}function k6({workspaceId:e,debounceMs:n=150}){const[i,s]=T.useState(""),[l,h]=T.useState(!1),[u,o]=T.useState([]),c=T.useCallback(f=>{const b={type:"file",path:f.path,display:f.name};return o(S=>[...S,b]),h(!1),s(""),b},[]),d=T.useCallback((f,b,S)=>{const k=f.lastIndexOf("@",b);if(k===-1)return{text:f,cursorPos:b};const w=f.slice(0,k)+`@${S.path}`+f.slice(b),_=k+S.path.length+1;return{text:w,cursorPos:_}},[]),g=T.useCallback(f=>{const b=/@([^\s@]+)/g,S=[];let k;for(;(k=b.exec(f))!==null;){const w=k[1];u.some(_=>_.path===w)&&!S.some(_=>_.path===w)&&S.push({type:"file",path:w,display:w.split("/").pop()||w})}return S},[u]);return{query:i,setQuery:s,showAutocomplete:l,setShowAutocomplete:h,mentions:u,handleFileSelect:c,insertMention:d,extractMentions:g}}function E6(e,n){return n?e.content.includes("ARG")?e.content.replace("ARG",n):`${e.content}
494
- ${n}`:e.content}function A6(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 T6({onSendMessage:e,disabled:n,isStreaming:i,onStopStreaming:s,placeholder:l="Type a message...",workspaceId:h,serverUrl:u,apiToken:o,prompts:c=[]}){const[d,g]=T.useState(""),[f,b]=T.useState(0),[S,k]=T.useState([]),[w,_]=T.useState(0),[y,v]=T.useState("none"),[x,E]=T.useState(""),N=T.useRef(null),{query:R,setQuery:M,showAutocomplete:D,setShowAutocomplete:O,handleFileSelect:P,insertMention:$}=k6({workspaceId:h||""});T.useEffect(()=>{_(0)},[S,x,c]),T.useEffect(()=>{const I=N.current;I&&(I.style.height="auto",I.style.height=`${Math.min(I.scrollHeight,150)}px`)},[d]);const U=c.filter(I=>I.name.toLowerCase().includes(x.toLowerCase())),q=y==="prompts"&&c.length>0,Y=y==="files"&&D&&!!h,K=T.useCallback(I=>{const L=I.target.value,z=I.target.selectionStart||0;g(L),b(z);const Z=L.lastIndexOf("/",z);if(Z!==-1){const ee=Z>0?L[Z-1]:`
495
- `,W=L.slice(Z+1,z);if((ee===`
496
- `||ee===" "||ee==="")&&!W.includes(" ")){E(W),v("prompts");return}}const X=L.lastIndexOf("@",z);if(X!==-1){const ee=L.slice(X+1,z);if(!ee.includes(" ")){M(ee),O(!0),v("files");return}}v("none"),O(!1)},[M,O]),V=T.useCallback(I=>{const L=P(I),z=$(d,f,L);g(z.text),v("none"),O(!1),k([]),setTimeout(()=>{N.current&&(N.current.focus(),N.current.setSelectionRange(z.cursorPos,z.cursorPos))},0)},[d,f,P,$,O]),J=T.useCallback(I=>{const L=d.lastIndexOf("/",f),z=d.slice(0,L),Z=d.slice(L+1),X=Z.indexOf(" "),ee=X!==-1?Z.slice(X):"",W=`${z}/${I.name}${ee}`,H=L+1+I.name.length+0;g(W),v("none"),setTimeout(()=>{N.current&&(N.current.focus(),N.current.setSelectionRange(H,H))},0)},[d,f]),ne=I=>{if(I==null||I.preventDefault(),!d.trim()||n)return;const L=A6(d);if(L){const z=c.find(Z=>Z.name===L.command);if(z){const Z=E6(z,L.rest);e(Z),g("");return}}e(d.trim()),g("")},F=I=>{if(q&&U.length>0)switch(I.key){case"ArrowDown":I.preventDefault(),_(L=>Math.min(L+1,U.length-1));return;case"ArrowUp":I.preventDefault(),_(L=>Math.max(L-1,0));return;case"Enter":if(I.shiftKey)return;I.preventDefault(),U[w]&&J(U[w]);return;case"Tab":I.preventDefault(),U[w]&&J(U[w]);return;case"Escape":I.preventDefault(),v("none");return}if(Y&&S.length>0)switch(I.key){case"ArrowDown":I.preventDefault(),_(L=>Math.min(L+1,S.length-1));return;case"ArrowUp":I.preventDefault(),_(L=>Math.max(L-1,0));return;case"Enter":I.preventDefault(),S[w]&&V(S[w]);return;case"Escape":I.preventDefault(),O(!1),v("none");return;case"Tab":I.preventDefault(),S[w]&&V(S[w]);return}I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),ne())},j=T.useCallback(I=>{k(I)},[]);return i&&s?m.jsx("div",{className:"p-4 border-t border-border bg-card",children:m.jsxs("div",{className:"flex items-center justify-center gap-3",children:[m.jsxs("div",{className:"animate-pulse flex items-center gap-2 text-muted-foreground",children:[m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce"}),m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.1s]"}),m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.2s]"}),m.jsx("span",{className:"text-sm ml-2",children:"Generating..."})]}),m.jsxs(ke,{variant:"outline",size:"sm",onClick:s,children:[m.jsx(qx,{className:"size-4","data-icon":"inline-start"}),"Stop"]})]})}):m.jsxs("form",{onSubmit:ne,className:"p-4 border-t border-border bg-card",children:[m.jsxs("div",{className:"flex gap-3 items-end",children:[m.jsx("div",{className:"flex-1 relative",children:m.jsxs(Id,{open:q||Y,onOpenChange:I=>{I||(v("none"),O(!1))},children:[m.jsx(Z4,{asChild:!0,children:m.jsx(W4,{ref:N,value:d,onChange:K,onKeyDown:F,placeholder:l,disabled:n,className:_e("min-h-[44px] max-h-[150px] resize-none pr-12","focus-visible:ring-1"),rows:1})}),m.jsx(Bd,{className:"w-72 p-0",align:"start",side:"top",sideOffset:8,onOpenAutoFocus:I=>I.preventDefault(),onCloseAutoFocus:I=>I.preventDefault(),children:Y?m.jsx(kO,{workspaceId:h||"",searchQuery:R,selectedIndex:w,onSelect:V,onFilesChange:j,serverUrl:u,apiToken:o}):m.jsx(C6,{prompts:c,query:x,selectedIndex:w,onSelect:J})})]})}),m.jsx(ke,{type:"submit",disabled:!d.trim()||n,size:"default",className:"h-11",children:m.jsx(RT,{className:"size-4"})})]}),m.jsxs("div",{className:"mt-2 text-xs text-muted-foreground text-center flex items-center justify-center gap-1",children:[m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"/"}),m.jsx("span",{children:"prompts"}),m.jsx("span",{className:"mx-2",children:"•"}),m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Enter"}),m.jsx("span",{children:"to send"}),m.jsx("span",{className:"mx-2",children:"•"}),m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Shift + Enter"}),m.jsx("span",{children:"for new line"})]})]})}function R6(e,n){const i={};return(e[e.length-1]===""?[...e,""]:e).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const D6=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N6=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M6={};function z0(e,n){return(M6.jsx?N6:D6).test(e)}const j6=/[ \t\n\f\r]/g;function O6(e){return typeof e=="object"?e.type==="text"?P0(e.value):!1:P0(e)}function P0(e){return e.replace(j6,"")===""}class Ql{constructor(n,i,s){this.normal=i,this.property=n,s&&(this.space=s)}}Ql.prototype.normal={};Ql.prototype.property={};Ql.prototype.space=void 0;function PC(e,n){const i={},s={};for(const l of e)Object.assign(i,l.property),Object.assign(s,l.normal);return new Ql(i,s,n)}function _m(e){return e.toLowerCase()}class En{constructor(n,i){this.attribute=i,this.property=n}}En.prototype.attribute="";En.prototype.booleanish=!1;En.prototype.boolean=!1;En.prototype.commaOrSpaceSeparated=!1;En.prototype.commaSeparated=!1;En.prototype.defined=!1;En.prototype.mustUseProperty=!1;En.prototype.number=!1;En.prototype.overloadedBoolean=!1;En.prototype.property="";En.prototype.spaceSeparated=!1;En.prototype.space=void 0;let L6=0;const Ke=Is(),Ht=Is(),ym=Is(),xe=Is(),St=Is(),Ia=Is(),Bn=Is();function Is(){return 2**++L6}const bm=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:Ht,commaOrSpaceSeparated:Bn,commaSeparated:Ia,number:xe,overloadedBoolean:ym,spaceSeparated:St},Symbol.toStringTag,{value:"Module"})),Np=Object.keys(bm);class Ag extends En{constructor(n,i,s,l){let h=-1;if(super(n,i),F0(this,"space",l),typeof s=="number")for(;++h<Np.length;){const u=Np[h];F0(this,Np[h],(s&bm[u])===bm[u])}}}Ag.prototype.defined=!0;function F0(e,n,i){i&&(e[n]=i)}function co(e){const n={},i={};for(const[s,l]of Object.entries(e.properties)){const h=new Ag(s,e.transform(e.attributes||{},s),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(h.mustUseProperty=!0),n[s]=h,i[_m(s)]=s,i[_m(h.attribute)]=s}return new Ql(n,i,e.space)}const FC=co({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:St,ariaCurrent:null,ariaDescribedBy:St,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:St,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:St,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:St,ariaLevel:xe,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:St,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:St,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Ht,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function HC(e,n){return n in e?e[n]:n}function UC(e,n){return HC(e,n.toLowerCase())}const I6=co({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ia,acceptCharset:St,accessKey:St,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:St,autoFocus:Ke,autoPlay:Ke,blocking:St,capture:null,charSet:null,checked:Ke,cite:null,className:St,cols:xe,colSpan:null,content:null,contentEditable:Ht,controls:Ke,controlsList:St,coords:xe|Ia,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:ym,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:St,height:xe,hidden:ym,high:xe,href:null,hrefLang:null,htmlFor:St,httpEquiv:St,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:St,itemRef:St,itemScope:Ke,itemType:St,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,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:Ke,optimum:xe,pattern:null,ping:St,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:St,required:Ke,reversed:Ke,rows:xe,rowSpan:xe,sandbox:St,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:Ht,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:St,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ke,disableRemotePlayback:Ke,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:UC}),B6=co({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:Bn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:St,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:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,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:Ia,g2:Ia,glyphName:Ia,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:Bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,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:xe,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:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:St,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Bn,rev:Bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Bn,requiredFeatures:Bn,requiredFonts:Bn,requiredFormats:Bn,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:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:Bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Bn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:HC}),$C=co({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()}}),qC=co({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:UC}),VC=co({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),z6={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"},P6=/[A-Z]/g,H0=/-[a-z]/g,F6=/^data[-\w.:]+$/i;function H6(e,n){const i=_m(n);let s=n,l=En;if(i in e.normal)return e.property[e.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&F6.test(n)){if(n.charAt(4)==="-"){const h=n.slice(5).replace(H0,$6);s="data"+h.charAt(0).toUpperCase()+h.slice(1)}else{const h=n.slice(4);if(!H0.test(h)){let u=h.replace(P6,U6);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}l=Ag}return new l(s,n)}function U6(e){return"-"+e.toLowerCase()}function $6(e){return e.charAt(1).toUpperCase()}const q6=PC([FC,I6,$C,qC,VC],"html"),Tg=PC([FC,B6,$C,qC,VC],"svg");function V6(e){return e.join(" ").trim()}var ka={},Mp,U0;function G6(){if(U0)return Mp;U0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,i=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,h=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
497
- `,d="/",g="*",f="",b="comment",S="declaration";function k(_,y){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];y=y||{};var v=1,x=1;function E(Y){var K=Y.match(n);K&&(v+=K.length);var V=Y.lastIndexOf(c);x=~V?Y.length-V:x+Y.length}function N(){var Y={line:v,column:x};return function(K){return K.position=new R(Y),O(),K}}function R(Y){this.start=Y,this.end={line:v,column:x},this.source=y.source}R.prototype.content=_;function M(Y){var K=new Error(y.source+":"+v+":"+x+": "+Y);if(K.reason=Y,K.filename=y.source,K.line=v,K.column=x,K.source=_,!y.silent)throw K}function D(Y){var K=Y.exec(_);if(K){var V=K[0];return E(V),_=_.slice(V.length),K}}function O(){D(i)}function P(Y){var K;for(Y=Y||[];K=$();)K!==!1&&Y.push(K);return Y}function $(){var Y=N();if(!(d!=_.charAt(0)||g!=_.charAt(1))){for(var K=2;f!=_.charAt(K)&&(g!=_.charAt(K)||d!=_.charAt(K+1));)++K;if(K+=2,f===_.charAt(K-1))return M("End of comment missing");var V=_.slice(2,K-2);return x+=2,E(V),_=_.slice(K),x+=2,Y({type:b,comment:V})}}function U(){var Y=N(),K=D(s);if(K){if($(),!D(l))return M("property missing ':'");var V=D(h),J=Y({type:S,property:w(K[0].replace(e,f)),value:V?w(V[0].replace(e,f)):f});return D(u),J}}function q(){var Y=[];P(Y);for(var K;K=U();)K!==!1&&(Y.push(K),P(Y));return Y}return O(),q()}function w(_){return _?_.replace(o,f):f}return Mp=k,Mp}var $0;function W6(){if($0)return ka;$0=1;var e=ka&&ka.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ka,"__esModule",{value:!0}),ka.default=i;const n=e(G6());function i(s,l){let h=null;if(!s||typeof s!="string")return h;const u=(0,n.default)(s),o=typeof l=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:g}=c;o?l(d,g,c):g&&(h=h||{},h[d]=g)}),h}return ka}var ul={},q0;function K6(){if(q0)return ul;q0=1,Object.defineProperty(ul,"__esModule",{value:!0}),ul.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,i=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,h=function(d){return!d||i.test(d)||e.test(d)},u=function(d,g){return g.toUpperCase()},o=function(d,g){return"".concat(g,"-")},c=function(d,g){return g===void 0&&(g={}),h(d)?d:(d=d.toLowerCase(),g.reactCompat?d=d.replace(l,o):d=d.replace(s,o),d.replace(n,u))};return ul.camelCase=c,ul}var dl,V0;function Y6(){if(V0)return dl;V0=1;var e=dl&&dl.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},n=e(W6()),i=K6();function s(l,h){var u={};return!l||typeof l!="string"||(0,n.default)(l,function(o,c){o&&c&&(u[(0,i.camelCase)(o,h)]=c)}),u}return s.default=s,dl=s,dl}var X6=Y6();const Z6=sd(X6),GC=WC("end"),Rg=WC("start");function WC(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 Q6(e){const n=Rg(e),i=GC(e);if(n&&i)return{start:n,end:i}}function xl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?G0(e.position):"start"in e||"end"in e?G0(e):"line"in e||"column"in e?xm(e):""}function xm(e){return W0(e&&e.line)+":"+W0(e&&e.column)}function G0(e){return xm(e&&e.start)+"-"+xm(e&&e.end)}function W0(e){return e&&typeof e=="number"?e:1}class un extends Error{constructor(n,i,s){super(),typeof i=="string"&&(s=i,i=void 0);let l="",h={},u=!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&&(u=!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=xl(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=u&&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}}un.prototype.file="";un.prototype.name="";un.prototype.reason="";un.prototype.message="";un.prototype.stack="";un.prototype.column=void 0;un.prototype.line=void 0;un.prototype.ancestors=void 0;un.prototype.cause=void 0;un.prototype.fatal=void 0;un.prototype.place=void 0;un.prototype.ruleId=void 0;un.prototype.source=void 0;const Dg={}.hasOwnProperty,J6=new Map,eI=/[A-Z]/g,tI=new Set(["table","tbody","thead","tfoot","tr"]),nI=new Set(["td","th"]),KC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function rI(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=dI(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=uI(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"?Tg:q6,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},h=YC(l,e,void 0);return h&&typeof h!="string"?h:l.create(e,l.Fragment,{children:h||void 0},void 0)}function YC(e,n,i){if(n.type==="element")return iI(e,n,i);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return sI(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return oI(e,n,i);if(n.type==="mdxjsEsm")return aI(e,n);if(n.type==="root")return lI(e,n,i);if(n.type==="text")return cI(e,n)}function iI(e,n,i){const s=e.schema;let l=s;n.tagName.toLowerCase()==="svg"&&s.space==="html"&&(l=Tg,e.schema=l),e.ancestors.push(n);const h=ZC(e,n.tagName,!1),u=hI(e,n);let o=Mg(e,n);return tI.has(n.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!O6(c):!0})),XC(e,u,h,n),Ng(u,o),e.ancestors.pop(),e.schema=s,e.create(n,h,u,i)}function sI(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)}Ml(e,n.position)}function aI(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Ml(e,n.position)}function oI(e,n,i){const s=e.schema;let l=s;n.name==="svg"&&s.space==="html"&&(l=Tg,e.schema=l),e.ancestors.push(n);const h=n.name===null?e.Fragment:ZC(e,n.name,!0),u=fI(e,n),o=Mg(e,n);return XC(e,u,h,n),Ng(u,o),e.ancestors.pop(),e.schema=s,e.create(n,h,u,i)}function lI(e,n,i){const s={};return Ng(s,Mg(e,n)),e.create(n,e.Fragment,s,i)}function cI(e,n){return n.value}function XC(e,n,i,s){typeof i!="string"&&i!==e.Fragment&&e.passNode&&(n.node=s)}function Ng(e,n){if(n.length>0){const i=n.length>1?n:n[0];i&&(e.children=i)}}function uI(e,n,i){return s;function s(l,h,u,o){const d=Array.isArray(u.children)?i:n;return o?d(h,u,o):d(h,u)}}function dI(e,n){return i;function i(s,l,h,u){const o=Array.isArray(h.children),c=Rg(s);return n(l,h,u,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function hI(e,n){const i={};let s,l;for(l in n.properties)if(l!=="children"&&Dg.call(n.properties,l)){const h=pI(e,l,n.properties[l]);if(h){const[u,o]=h;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&nI.has(n.tagName)?s=o:i[u]=o}}if(s){const h=i.style||(i.style={});h[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return i}function fI(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 u=h.expression;u.type;const o=u.properties[0];o.type,Object.assign(i,e.evaluater.evaluateExpression(o.argument))}else Ml(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 Ml(e,n.position);else h=s.value===null?!0:s.value;i[l]=h}return i}function Mg(e,n){const i=[];let s=-1;const l=e.passKeys?new Map:J6;for(;++s<n.children.length;){const h=n.children[s];let u;if(e.passKeys){const c=h.type==="element"?h.tagName:h.type==="mdxJsxFlowElement"||h.type==="mdxJsxTextElement"?h.name:void 0;if(c){const d=l.get(c)||0;u=c+"-"+d,l.set(c,d+1)}}const o=YC(e,h,u);o!==void 0&&i.push(o)}return i}function pI(e,n,i){const s=H6(e.schema,n);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=s.commaSeparated?R6(i):V6(i)),s.property==="style"){let l=typeof i=="object"?i:mI(e,String(i));return e.stylePropertyNameCase==="css"&&(l=gI(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&s.space?z6[s.property]||s.property:s.attribute,i]}}function mI(e,n){try{return Z6(n,{reactCompat:!0})}catch(i){if(e.ignoreInvalidStyle)return{};const s=i,l=new un("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=KC+"#cannot-parse-style-attribute",l}}function ZC(e,n,i){let s;if(!i)s={type:"Literal",value:n};else if(n.includes(".")){const l=n.split(".");let h=-1,u;for(;++h<l.length;){const o=z0(l[h])?{type:"Identifier",name:l[h]}:{type:"Literal",value:l[h]};u=u?{type:"MemberExpression",object:u,property:o,computed:!!(h&&o.type==="Literal"),optional:!1}:o}s=u}else s=z0(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(s.type==="Literal"){const l=s.value;return Dg.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(s);Ml(e)}function Ml(e,n){const i=new un("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=KC+"#cannot-handle-mdx-estrees-without-createevaluater",i}function gI(e){const n={};let i;for(i in e)Dg.call(e,i)&&(n[vI(i)]=e[i]);return n}function vI(e){let n=e.replace(eI,_I);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function _I(e){return"-"+e.toLowerCase()}const jp={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"]},yI={};function jg(e,n){const i=yI,s=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,l=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return QC(e,s,l)}function QC(e,n,i){if(bI(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 K0(e.children,n,i)}return Array.isArray(e)?K0(e,n,i):""}function K0(e,n,i){const s=[];let l=-1;for(;++l<e.length;)s[l]=QC(e[l],n,i);return s.join("")}function bI(e){return!!(e&&typeof e=="object")}const Y0=document.createElement("i");function Og(e){const n="&"+e+";";Y0.innerHTML=n;const i=Y0.textContent;return i.charCodeAt(i.length-1)===59&&e!=="semi"||i===n?!1:i}function Hn(e,n,i,s){const l=e.length;let h=0,u;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,i=i>0?i:0,s.length<1e4)u=Array.from(s),u.unshift(n,i),e.splice(...u);else for(i&&e.splice(n,i);h<s.length;)u=s.slice(h,h+1e4),u.unshift(n,0),e.splice(...u),h+=1e4,n+=1e4}function er(e,n){return e.length>0?(Hn(e,e.length,0,n),e):n}const X0={}.hasOwnProperty;function JC(e){const n={};let i=-1;for(;++i<e.length;)xI(n,e[i]);return n}function xI(e,n){let i;for(i in n){const l=(X0.call(e,i)?e[i]:void 0)||(e[i]={}),h=n[i];let u;if(h)for(u in h){X0.call(l,u)||(l[u]=[]);const o=h[u];SI(l[u],Array.isArray(o)?o:o?[o]:[])}}}function SI(e,n){let i=-1;const s=[];for(;++i<n.length;)(n[i].add==="after"?e:s).push(n[i]);Hn(e,0,0,s)}function ek(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 dr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const pn=es(/[A-Za-z]/),cn=es(/[\dA-Za-z]/),wI=es(/[#-'*+\--9=?A-Z^-~]/);function td(e){return e!==null&&(e<32||e===127)}const Sm=es(/\d/),CI=es(/[\dA-Fa-f]/),kI=es(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const qd=es(new RegExp("\\p{P}|\\p{S}","u")),Ns=es(/\s/);function es(e){return n;function n(i){return i!==null&&i>-1&&e.test(String.fromCharCode(i))}}function uo(e){const n=[];let i=-1,s=0,l=0;for(;++i<e.length;){const h=e.charCodeAt(i);let u="";if(h===37&&cn(e.charCodeAt(i+1))&&cn(e.charCodeAt(i+2)))l=2;else if(h<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(h))||(u=String.fromCharCode(h));else if(h>55295&&h<57344){const o=e.charCodeAt(i+1);h<56320&&o>56319&&o<57344?(u=String.fromCharCode(h,o),l=1):u="�"}else u=String.fromCharCode(h);u&&(n.push(e.slice(s,i),encodeURIComponent(u)),s=i+l+1,u=""),l&&(i+=l,l=0)}return n.join("")+e.slice(s)}function it(e,n,i,s){const l=s?s-1:Number.POSITIVE_INFINITY;let h=0;return u;function u(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 EI={tokenize:AI};function AI(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"),it(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,u(o)}function u(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),u)}}const TI={tokenize:RI},Z0={tokenize:DI};function RI(e){const n=this,i=[];let s=0,l,h,u;return o;function o(x){if(s<i.length){const E=i[s];return n.containerState=E[1],e.attempt(E[0].continuation,c,d)(x)}return d(x)}function c(x){if(s++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&v();const E=n.events.length;let N=E,R;for(;N--;)if(n.events[N][0]==="exit"&&n.events[N][1].type==="chunkFlow"){R=n.events[N][1].end;break}y(s);let M=E;for(;M<n.events.length;)n.events[M][1].end={...R},M++;return Hn(n.events,N+1,0,n.events.slice(E)),n.events.length=M,d(x)}return o(x)}function d(x){if(s===i.length){if(!l)return b(x);if(l.currentConstruct&&l.currentConstruct.concrete)return k(x);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Z0,g,f)(x)}function g(x){return l&&v(),y(s),b(x)}function f(x){return n.parser.lazy[n.now().line]=s!==i.length,u=n.now().offset,k(x)}function b(x){return n.containerState={},e.attempt(Z0,S,k)(x)}function S(x){return s++,i.push([n.currentConstruct,n.containerState]),b(x)}function k(x){if(x===null){l&&v(),y(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),y(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 N=n.sliceStream(x);if(E&&N.push(null),x.previous=h,h&&(h.next=x),h=x,l.defineSkip(x.start),l.write(N),n.parser.lazy[x.start.line]){let R=l.events.length;for(;R--;)if(l.events[R][1].start.offset<u&&(!l.events[R][1].end||l.events[R][1].end.offset>u))return;const M=n.events.length;let D=M,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(y(s),R=M;R<n.events.length;)n.events[R][1].end={...P},R++;Hn(n.events,D+1,0,n.events.slice(M)),n.events.length=R}}function y(x){let E=i.length;for(;E-- >x;){const N=i[E];n.containerState=N[1],N[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 DI(e,n,i){return it(e,e.attempt(this.parser.constructs.document,n,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ka(e){if(e===null||xt(e)||Ns(e))return 1;if(qd(e))return 2}function Vd(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 wm={name:"attention",resolveAll:NI,tokenize:MI};function NI(e,n){let i=-1,s,l,h,u,o,c,d,g;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},b={...e[i][1].start};Q0(f,-c),Q0(b,c),u={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[s][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[i][1].start},end:b},h={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[i][1].start}},l={type:c>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[s][1].end={...u.start},e[i][1].start={...o.end},d=[],e[s][1].end.offset-e[s][1].start.offset&&(d=er(d,[["enter",e[s][1],n],["exit",e[s][1],n]])),d=er(d,[["enter",l,n],["enter",u,n],["exit",u,n],["enter",h,n]]),d=er(d,Vd(n.parser.constructs.insideSpan.null,e.slice(s+1,i),n)),d=er(d,[["exit",h,n],["enter",o,n],["exit",o,n],["exit",l,n]]),e[i][1].end.offset-e[i][1].start.offset?(g=2,d=er(d,[["enter",e[i][1],n],["exit",e[i][1],n]])):g=0,Hn(e,s-1,i-s+3,d),i=s+d.length-g-2;break}}for(i=-1;++i<e.length;)e[i][1].type==="attentionSequence"&&(e[i][1].type="data");return e}function MI(e,n){const i=this.parser.constructs.attentionMarkers.null,s=this.previous,l=Ka(s);let h;return u;function u(c){return h=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===h)return e.consume(c),o;const d=e.exit("attentionSequence"),g=Ka(c),f=!g||g===2&&l||i.includes(c),b=!l||l===2&&g||i.includes(s);return d._open=!!(h===42?f:f&&(l||!b)),d._close=!!(h===42?b:b&&(g||!f)),n(c)}}function Q0(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const jI={name:"autolink",tokenize:OI};function OI(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 pn(S)?(e.consume(S),u):S===64?i(S):d(S)}function u(S){return S===43||S===45||S===46||cn(S)?(s=1,o(S)):d(S)}function o(S){return S===58?(e.consume(S),s=0,c):(S===43||S===45||S===46||cn(S))&&s++<32?(e.consume(S),o):(s=0,d(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||td(S)?i(S):(e.consume(S),c)}function d(S){return S===64?(e.consume(S),g):wI(S)?(e.consume(S),d):i(S)}function g(S){return cn(S)?f(S):i(S)}function f(S){return S===46?(e.consume(S),s=0,g):S===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(S),e.exit("autolinkMarker"),e.exit("autolink"),n):b(S)}function b(S){if((S===45||cn(S))&&s++<63){const k=S===45?b:f;return e.consume(S),k}return i(S)}}const Jl={partial:!0,tokenize:LI};function LI(e,n,i){return s;function s(h){return Je(h)?it(e,l,"linePrefix")(h):l(h)}function l(h){return h===null||Be(h)?n(h):i(h)}}const tk={continuation:{tokenize:BI},exit:zI,name:"blockQuote",tokenize:II};function II(e,n,i){const s=this;return l;function l(u){if(u===62){const o=s.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),h}return i(u)}function h(u){return Je(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function BI(e,n,i){const s=this;return l;function l(u){return Je(u)?it(e,h,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):h(u)}function h(u){return e.attempt(tk,n,i)(u)}}function zI(e){e.exit("blockQuote")}const nk={name:"characterEscape",tokenize:PI};function PI(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 kI(h)?(e.enter("characterEscapeValue"),e.consume(h),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):i(h)}}const rk={name:"characterReference",tokenize:FI};function FI(e,n,i){const s=this;let l=0,h,u;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"),d):(e.enter("characterReferenceValue"),h=31,u=cn,g(f))}function d(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),h=6,u=CI,g):(e.enter("characterReferenceValue"),h=7,u=Sm,g(f))}function g(f){if(f===59&&l){const b=e.exit("characterReferenceValue");return u===cn&&!Og(s.sliceSerialize(b))?i(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(f)&&l++<h?(e.consume(f),g):i(f)}}const J0={partial:!0,tokenize:UI},ex={concrete:!0,name:"codeFenced",tokenize:HI};function HI(e,n,i){const s=this,l={partial:!0,tokenize:N};let h=0,u=0,o;return c;function c(R){return d(R)}function d(R){const M=s.events[s.events.length-1];return h=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,o=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===o?(u++,e.consume(R),g):u<3?i(R):(e.exit("codeFencedFenceSequence"),Je(R)?it(e,f,"whitespace")(R):f(R))}function f(R){return R===null||Be(R)?(e.exit("codeFencedFence"),s.interrupt?n(R):e.check(J0,w,E)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===null||Be(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(R)):Je(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,S,"whitespace")(R)):R===96&&R===o?i(R):(e.consume(R),b)}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"),y}function y(R){return h>0&&Je(R)?it(e,v,"linePrefix",h+1)(R):v(R)}function v(R){return R===null||Be(R)?e.check(J0,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 N(R,M,D){let O=0;return P;function P(K){return R.enter("lineEnding"),R.consume(K),R.exit("lineEnding"),$}function $(K){return R.enter("codeFencedFence"),Je(K)?it(R,U,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):U(K)}function U(K){return K===o?(R.enter("codeFencedFenceSequence"),q(K)):D(K)}function q(K){return K===o?(O++,R.consume(K),q):O>=u?(R.exit("codeFencedFenceSequence"),Je(K)?it(R,Y,"whitespace")(K):Y(K)):D(K)}function Y(K){return K===null||Be(K)?(R.exit("codeFencedFence"),M(K)):D(K)}}}function UI(e,n,i){const s=this;return l;function l(u){return u===null?i(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),h)}function h(u){return s.parser.lazy[s.now().line]?i(u):n(u)}}const Op={name:"codeIndented",tokenize:qI},$I={partial:!0,tokenize:VI};function qI(e,n,i){const s=this;return l;function l(d){return e.enter("codeIndented"),it(e,h,"linePrefix",5)(d)}function h(d){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(d):i(d)}function u(d){return d===null?c(d):Be(d)?e.attempt($I,u,c)(d):(e.enter("codeFlowValue"),o(d))}function o(d){return d===null||Be(d)?(e.exit("codeFlowValue"),u(d)):(e.consume(d),o)}function c(d){return e.exit("codeIndented"),n(d)}}function VI(e,n,i){const s=this;return l;function l(u){return s.parser.lazy[s.now().line]?i(u):Be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):it(e,h,"linePrefix",5)(u)}function h(u){const o=s.events[s.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(u):Be(u)?l(u):i(u)}}const GI={name:"codeText",previous:KI,resolve:WI,tokenize:YI};function WI(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 KI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function YI(e,n,i){let s=0,l,h;return u;function u(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,g(f)):Be(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||Be(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),d)}function g(f){return f===96?(e.consume(f),l++,g):l===s?(e.exit("codeTextSequence"),e.exit("codeText"),n(f)):(h.type="codeTextData",d(f))}}class XI{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&&hl(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),hl(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),hl(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);hl(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);hl(this.left,i.reverse())}}}function hl(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 ik(e){const n={};let i=-1,s,l,h,u,o,c,d;const g=new XI(e);for(;++i<g.length;){for(;i in n;)i=n[i];if(s=g.get(i),i&&s[1].type==="chunkFlow"&&g.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,ZI(g,i)),i=n[i],d=!0);else if(s[1]._container){for(h=i,l=void 0;h--;)if(u=g.get(h),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),u[1].type="lineEnding",l=h);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;l&&(s[1].end={...g.get(l)[1].start},o=g.slice(l,i),o.unshift(s),g.splice(l,i-l+1,o))}}return Hn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!d}function ZI(e,n){const i=e.get(n)[1],s=e.get(n)[2];let l=n-1;const h=[];let u=i._tokenizer;u||(u=s.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const o=u.events,c=[],d={};let g,f,b=-1,S=i,k=0,w=0;const _=[w];for(;S;){for(;e.get(++l)[1]!==S;);h.push(l),S._tokenizer||(g=s.sliceStream(S),S.next||g.push(null),f&&u.defineSkip(S.start),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),S._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),f=S,S=S.next}for(S=i;++b<o.length;)o[b][0]==="exit"&&o[b-1][0]==="enter"&&o[b][1].type===o[b-1][1].type&&o[b][1].start.line!==o[b][1].end.line&&(w=b+1,_.push(w),S._tokenizer=void 0,S.previous=void 0,S=S.next);for(u.events=[],S?(S._tokenizer=void 0,S.previous=void 0):_.pop(),b=_.length;b--;){const y=o.slice(_[b],_[b+1]),v=h.pop();c.push([v,v+y.length-1]),e.splice(v,2,y)}for(c.reverse(),b=-1;++b<c.length;)d[k+c[b][0]]=k+c[b][1],k+=c[b][1]-c[b][0]-1;return d}const QI={resolve:eB,tokenize:tB},JI={partial:!0,tokenize:nB};function eB(e){return ik(e),e}function tB(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(JI,u,h)(o):(e.consume(o),l)}function h(o){return e.exit("chunkContent"),e.exit("content"),n(o)}function u(o){return e.consume(o),e.exit("chunkContent"),i.next=e.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,l}}function nB(e,n,i){const s=this;return l;function l(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),it(e,h,"linePrefix")}function h(u){if(u===null||Be(u))return i(u);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(u):e.interrupt(s.parser.constructs.flow,i,n)(u)}}function sk(e,n,i,s,l,h,u,o,c){const d=c||Number.POSITIVE_INFINITY;let g=0;return f;function f(y){return y===60?(e.enter(s),e.enter(l),e.enter(h),e.consume(y),e.exit(h),b):y===null||y===32||y===41||td(y)?i(y):(e.enter(s),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(y))}function b(y){return y===62?(e.enter(h),e.consume(y),e.exit(h),e.exit(l),e.exit(s),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),S(y))}function S(y){return y===62?(e.exit("chunkString"),e.exit(o),b(y)):y===null||y===60||Be(y)?i(y):(e.consume(y),y===92?k:S)}function k(y){return y===60||y===62||y===92?(e.consume(y),S):S(y)}function w(y){return!g&&(y===null||y===41||xt(y))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(s),n(y)):g<d&&y===40?(e.consume(y),g++,w):y===41?(e.consume(y),g--,w):y===null||y===32||y===40||td(y)?i(y):(e.consume(y),y===92?_:w)}function _(y){return y===40||y===41||y===92?(e.consume(y),w):w(y)}}function ak(e,n,i,s,l,h){const u=this;let o=0,c;return d;function d(S){return e.enter(s),e.enter(l),e.consume(S),e.exit(l),e.enter(h),g}function g(S){return o>999||S===null||S===91||S===93&&!c||S===94&&!o&&"_hiddenFootnoteSupport"in u.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"),g):(e.enter("chunkString",{contentType:"string"}),f(S))}function f(S){return S===null||S===91||S===93||Be(S)||o++>999?(e.exit("chunkString"),g(S)):(e.consume(S),c||(c=!Je(S)),S===92?b:f)}function b(S){return S===91||S===92||S===93?(e.consume(S),o++,f):f(S)}}function ok(e,n,i,s,l,h){let u;return o;function o(b){return b===34||b===39||b===40?(e.enter(s),e.enter(l),e.consume(b),e.exit(l),u=b===40?41:b,c):i(b)}function c(b){return b===u?(e.enter(l),e.consume(b),e.exit(l),e.exit(s),n):(e.enter(h),d(b))}function d(b){return b===u?(e.exit(h),c(u)):b===null?i(b):Be(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),it(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===u||b===null||Be(b)?(e.exit("chunkString"),d(b)):(e.consume(b),b===92?f:g)}function f(b){return b===u||b===92?(e.consume(b),g):g(b)}}function Sl(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)?it(e,s,i?"linePrefix":"lineSuffix")(l):n(l)}}const rB={name:"definition",tokenize:sB},iB={partial:!0,tokenize:aB};function sB(e,n,i){const s=this;let l;return h;function h(S){return e.enter("definition"),u(S)}function u(S){return ak.call(s,e,o,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(S)}function o(S){return l=dr(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 xt(S)?Sl(e,d)(S):d(S)}function d(S){return sk(e,g,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(S)}function g(S){return e.attempt(iB,f,f)(S)}function f(S){return Je(S)?it(e,b,"whitespace")(S):b(S)}function b(S){return S===null||Be(S)?(e.exit("definition"),s.parser.defined.push(l),n(S)):i(S)}}function aB(e,n,i){return s;function s(o){return xt(o)?Sl(e,l)(o):i(o)}function l(o){return ok(e,h,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function h(o){return Je(o)?it(e,u,"whitespace")(o):u(o)}function u(o){return o===null||Be(o)?n(o):i(o)}}const oB={name:"hardBreakEscape",tokenize:lB};function lB(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 cB={name:"headingAtx",resolve:uB,tokenize:dB};function uB(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"},Hn(e,s,i-s+1,[["enter",l,n],["enter",h,n],["exit",h,n],["exit",l,n]])),e}function dB(e,n,i){let s=0;return l;function l(g){return e.enter("atxHeading"),h(g)}function h(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&s++<6?(e.consume(g),u):g===null||xt(g)?(e.exit("atxHeadingSequence"),o(g)):i(g)}function o(g){return g===35?(e.enter("atxHeadingSequence"),c(g)):g===null||Be(g)?(e.exit("atxHeading"),n(g)):Je(g)?it(e,o,"whitespace")(g):(e.enter("atxHeadingText"),d(g))}function c(g){return g===35?(e.consume(g),c):(e.exit("atxHeadingSequence"),o(g))}function d(g){return g===null||g===35||xt(g)?(e.exit("atxHeadingText"),o(g)):(e.consume(g),d)}}const hB=["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"],tx=["pre","script","style","textarea"],fB={concrete:!0,name:"htmlFlow",resolveTo:gB,tokenize:vB},pB={partial:!0,tokenize:yB},mB={partial:!0,tokenize:_B};function gB(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 vB(e,n,i){const s=this;let l,h,u,o,c;return d;function d(z){return g(z)}function g(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),b):z===47?(e.consume(z),h=!0,w):z===63?(e.consume(z),l=3,s.interrupt?n:j):pn(z)?(e.consume(z),u=String.fromCharCode(z),_):i(z)}function b(z){return z===45?(e.consume(z),l=2,S):z===91?(e.consume(z),l=5,o=0,k):pn(z)?(e.consume(z),l=4,s.interrupt?n:j):i(z)}function S(z){return z===45?(e.consume(z),s.interrupt?n:j):i(z)}function k(z){const Z="CDATA[";return z===Z.charCodeAt(o++)?(e.consume(z),o===Z.length?s.interrupt?n:U:k):i(z)}function w(z){return pn(z)?(e.consume(z),u=String.fromCharCode(z),_):i(z)}function _(z){if(z===null||z===47||z===62||xt(z)){const Z=z===47,X=u.toLowerCase();return!Z&&!h&&tx.includes(X)?(l=1,s.interrupt?n(z):U(z)):hB.includes(u.toLowerCase())?(l=6,Z?(e.consume(z),y):s.interrupt?n(z):U(z)):(l=7,s.interrupt&&!s.parser.lazy[s.now().line]?i(z):h?v(z):x(z))}return z===45||cn(z)?(e.consume(z),u+=String.fromCharCode(z),_):i(z)}function y(z){return z===62?(e.consume(z),s.interrupt?n:U):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||pn(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||cn(z)?(e.consume(z),E):N(z)}function N(z){return z===61?(e.consume(z),R):Je(z)?(e.consume(z),N):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,M):Je(z)?(e.consume(z),R):D(z)}function M(z){return z===c?(e.consume(z),c=null,O):z===null||Be(z)?i(z):(e.consume(z),M)}function D(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||xt(z)?N(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),$):i(z)}function $(z){return z===null||Be(z)?U(z):Je(z)?(e.consume(z),$):i(z)}function U(z){return z===45&&l===2?(e.consume(z),V):z===60&&l===1?(e.consume(z),J):z===62&&l===4?(e.consume(z),I):z===63&&l===3?(e.consume(z),j):z===93&&l===5?(e.consume(z),F):Be(z)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(pB,L,q)(z)):z===null||Be(z)?(e.exit("htmlFlowData"),q(z)):(e.consume(z),U)}function q(z){return e.check(mB,Y,L)(z)}function Y(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),K}function K(z){return z===null||Be(z)?q(z):(e.enter("htmlFlowData"),U(z))}function V(z){return z===45?(e.consume(z),j):U(z)}function J(z){return z===47?(e.consume(z),u="",ne):U(z)}function ne(z){if(z===62){const Z=u.toLowerCase();return tx.includes(Z)?(e.consume(z),I):U(z)}return pn(z)&&u.length<8?(e.consume(z),u+=String.fromCharCode(z),ne):U(z)}function F(z){return z===93?(e.consume(z),j):U(z)}function j(z){return z===62?(e.consume(z),I):z===45&&l===2?(e.consume(z),j):U(z)}function I(z){return z===null||Be(z)?(e.exit("htmlFlowData"),L(z)):(e.consume(z),I)}function L(z){return e.exit("htmlFlow"),n(z)}}function _B(e,n,i){const s=this;return l;function l(u){return Be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),h):i(u)}function h(u){return s.parser.lazy[s.now().line]?i(u):n(u)}}function yB(e,n,i){return s;function s(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Jl,n,i)}}const bB={name:"htmlText",tokenize:xB};function xB(e,n,i){const s=this;let l,h,u;return o;function o(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),c}function c(j){return j===33?(e.consume(j),d):j===47?(e.consume(j),N):j===63?(e.consume(j),x):pn(j)?(e.consume(j),D):i(j)}function d(j){return j===45?(e.consume(j),g):j===91?(e.consume(j),h=0,k):pn(j)?(e.consume(j),v):i(j)}function g(j){return j===45?(e.consume(j),S):i(j)}function f(j){return j===null?i(j):j===45?(e.consume(j),b):Be(j)?(u=f,J(j)):(e.consume(j),f)}function b(j){return j===45?(e.consume(j),S):f(j)}function S(j){return j===62?V(j):j===45?b(j):f(j)}function k(j){const I="CDATA[";return j===I.charCodeAt(h++)?(e.consume(j),h===I.length?w:k):i(j)}function w(j){return j===null?i(j):j===93?(e.consume(j),_):Be(j)?(u=w,J(j)):(e.consume(j),w)}function _(j){return j===93?(e.consume(j),y):w(j)}function y(j){return j===62?V(j):j===93?(e.consume(j),y):w(j)}function v(j){return j===null||j===62?V(j):Be(j)?(u=v,J(j)):(e.consume(j),v)}function x(j){return j===null?i(j):j===63?(e.consume(j),E):Be(j)?(u=x,J(j)):(e.consume(j),x)}function E(j){return j===62?V(j):x(j)}function N(j){return pn(j)?(e.consume(j),R):i(j)}function R(j){return j===45||cn(j)?(e.consume(j),R):M(j)}function M(j){return Be(j)?(u=M,J(j)):Je(j)?(e.consume(j),M):V(j)}function D(j){return j===45||cn(j)?(e.consume(j),D):j===47||j===62||xt(j)?O(j):i(j)}function O(j){return j===47?(e.consume(j),V):j===58||j===95||pn(j)?(e.consume(j),P):Be(j)?(u=O,J(j)):Je(j)?(e.consume(j),O):V(j)}function P(j){return j===45||j===46||j===58||j===95||cn(j)?(e.consume(j),P):$(j)}function $(j){return j===61?(e.consume(j),U):Be(j)?(u=$,J(j)):Je(j)?(e.consume(j),$):O(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?i(j):j===34||j===39?(e.consume(j),l=j,q):Be(j)?(u=U,J(j)):Je(j)?(e.consume(j),U):(e.consume(j),Y)}function q(j){return j===l?(e.consume(j),l=void 0,K):j===null?i(j):Be(j)?(u=q,J(j)):(e.consume(j),q)}function Y(j){return j===null||j===34||j===39||j===60||j===61||j===96?i(j):j===47||j===62||xt(j)?O(j):(e.consume(j),Y)}function K(j){return j===47||j===62||xt(j)?O(j):i(j)}function V(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),n):i(j)}function J(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),ne}function ne(j){return Je(j)?it(e,F,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return e.enter("htmlTextData"),u(j)}}const Lg={name:"labelEnd",resolveAll:kB,resolveTo:EB,tokenize:AB},SB={tokenize:TB},wB={tokenize:RB},CB={tokenize:DB};function kB(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&&Hn(e,0,e.length,i),e}function EB(e,n){let i=e.length,s=0,l,h,u,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(u){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"&&(u=i);const c={type:e[h][1].type==="labelLink"?"link":"image",start:{...e[h][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[h][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[h+s+2][1].end},end:{...e[u-2][1].start}};return o=[["enter",c,n],["enter",d,n]],o=er(o,e.slice(h+1,h+s+3)),o=er(o,[["enter",g,n]]),o=er(o,Vd(n.parser.constructs.insideSpan.null,e.slice(h+s+4,u-3),n)),o=er(o,[["exit",g,n],e[u-2],e[u-1],["exit",d,n]]),o=er(o,e.slice(u+1)),o=er(o,[["exit",c,n]]),Hn(e,h,e.length,o),e}function AB(e,n,i){const s=this;let l=s.events.length,h,u;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(b){return h?h._inactive?f(b):(u=s.parser.defined.includes(dr(s.sliceSerialize({start:h.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),c):i(b)}function c(b){return b===40?e.attempt(SB,g,u?g:f)(b):b===91?e.attempt(wB,g,u?d:f)(b):u?g(b):f(b)}function d(b){return e.attempt(CB,g,f)(b)}function g(b){return n(b)}function f(b){return h._balanced=!0,i(b)}}function TB(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 xt(f)?Sl(e,h)(f):h(f)}function h(f){return f===41?g(f):sk(e,u,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function u(f){return xt(f)?Sl(e,c)(f):g(f)}function o(f){return i(f)}function c(f){return f===34||f===39||f===40?ok(e,d,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):g(f)}function d(f){return xt(f)?Sl(e,g)(f):g(f)}function g(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),n):i(f)}}function RB(e,n,i){const s=this;return l;function l(o){return ak.call(s,e,h,u,"reference","referenceMarker","referenceString")(o)}function h(o){return s.parser.defined.includes(dr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?n(o):i(o)}function u(o){return i(o)}}function DB(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 NB={name:"labelStartImage",resolveAll:Lg.resolveAll,tokenize:MB};function MB(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"),u):i(o)}function u(o){return o===94&&"_hiddenFootnoteSupport"in s.parser.constructs?i(o):n(o)}}const jB={name:"labelStartLink",resolveAll:Lg.resolveAll,tokenize:OB};function OB(e,n,i){const s=this;return l;function l(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),h}function h(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?i(u):n(u)}}const Lp={name:"lineEnding",tokenize:LB};function LB(e,n){return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),it(e,n,"linePrefix")}}const Pu={name:"thematicBreak",tokenize:IB};function IB(e,n,i){let s=0,l;return h;function h(d){return e.enter("thematicBreak"),u(d)}function u(d){return l=d,o(d)}function o(d){return d===l?(e.enter("thematicBreakSequence"),c(d)):s>=3&&(d===null||Be(d))?(e.exit("thematicBreak"),n(d)):i(d)}function c(d){return d===l?(e.consume(d),s++,c):(e.exit("thematicBreakSequence"),Je(d)?it(e,o,"whitespace")(d):o(d))}}const kn={continuation:{tokenize:FB},exit:UB,name:"list",tokenize:PB},BB={partial:!0,tokenize:$B},zB={partial:!0,tokenize:HB};function PB(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,u=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:Sm(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(Pu,i,d)(S):d(S);if(!s.interrupt||S===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(S)}return i(S)}function c(S){return Sm(S)&&++u<10?(e.consume(S),c):(!s.interrupt||u<2)&&(s.containerState.marker?S===s.containerState.marker:S===41||S===46)?(e.exit("listItemValue"),d(S)):i(S)}function d(S){return e.enter("listItemMarker"),e.consume(S),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||S,e.check(Jl,s.interrupt?i:g,e.attempt(BB,b,f))}function g(S){return s.containerState.initialBlankLine=!0,h++,b(S)}function f(S){return Je(S)?(e.enter("listItemPrefixWhitespace"),e.consume(S),e.exit("listItemPrefixWhitespace"),b):i(S)}function b(S){return s.containerState.size=h+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(S)}}function FB(e,n,i){const s=this;return s.containerState._closeFlow=void 0,e.check(Jl,l,h);function l(o){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,it(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,u(o)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(zB,n,u)(o))}function u(o){return s.containerState._closeFlow=!0,s.interrupt=void 0,it(e,e.attempt(kn,n,i),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function HB(e,n,i){const s=this;return it(e,l,"listItemIndent",s.containerState.size+1);function l(h){const u=s.events[s.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===s.containerState.size?n(h):i(h)}}function UB(e){e.exit(this.containerState.type)}function $B(e,n,i){const s=this;return it(e,l,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(h){const u=s.events[s.events.length-1];return!Je(h)&&u&&u[1].type==="listItemPrefixWhitespace"?n(h):i(h)}}const nx={name:"setextUnderline",resolveTo:qB,tokenize:VB};function qB(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 u={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",u,n]),e.splice(h+1,0,["exit",e[s][1],n]),e[s][1].end={...e[h][1].end}):e[s][1]=u,e.push(["exit",u,n]),e}function VB(e,n,i){const s=this;let l;return h;function h(d){let g=s.events.length,f;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){f=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),l=d,u(d)):i(d)}function u(d){return e.enter("setextHeadingLineSequence"),o(d)}function o(d){return d===l?(e.consume(d),o):(e.exit("setextHeadingLineSequence"),Je(d)?it(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||Be(d)?(e.exit("setextHeadingLine"),n(d)):i(d)}}const GB={tokenize:WB};function WB(e){const n=this,i=e.attempt(Jl,s,e.attempt(this.parser.constructs.flowInitial,l,it(e,e.attempt(this.parser.constructs.flow,l,e.attempt(QI,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 KB={resolveAll:ck()},YB=lk("string"),XB=lk("text");function lk(e){return{resolveAll:ck(e==="text"?ZB:void 0),tokenize:n};function n(i){const s=this,l=this.parser.constructs[e],h=i.attempt(l,u,o);return u;function u(g){return d(g)?h(g):o(g)}function o(g){if(g===null){i.consume(g);return}return i.enter("data"),i.consume(g),c}function c(g){return d(g)?(i.exit("data"),h(g)):(i.consume(g),c)}function d(g){if(g===null)return!0;const f=l[g];let b=-1;if(f)for(;++b<f.length;){const S=f[b];if(!S.previous||S.previous.call(s,s.previous))return!0}return!1}}}function ck(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 ZB(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,u=-1,o=0,c;for(;h--;){const d=l[h];if(typeof d=="string"){for(u=d.length;d.charCodeAt(u-1)===32;)o++,u--;if(u)break;u=-1}else if(d===-2)c=!0,o++;else if(d!==-1){h++;break}}if(n._contentTypeTextTrailing&&i===e.length&&(o=0),o){const d={type:i===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:h?u:s.start._bufferIndex+u,_index:s.start._index+h,line:s.end.line,column:s.end.column-o,offset:s.end.offset-o},end:{...s.end}};s.end={...d.start},s.start.offset===s.end.offset?Object.assign(s,d):(e.splice(i,0,["enter",d,n],["exit",d,n]),i+=2)}i++}return e}const QB={42:kn,43:kn,45:kn,48:kn,49:kn,50:kn,51:kn,52:kn,53:kn,54:kn,55:kn,56:kn,57:kn,62:tk},JB={91:rB},ez={[-2]:Op,[-1]:Op,32:Op},tz={35:cB,42:Pu,45:[nx,Pu],60:fB,61:nx,95:Pu,96:ex,126:ex},nz={38:rk,92:nk},rz={[-5]:Lp,[-4]:Lp,[-3]:Lp,33:NB,38:rk,42:wm,60:[jI,bB],91:jB,92:[oB,nk],93:Lg,95:wm,96:GI},iz={null:[wm,KB]},sz={null:[42,95]},az={null:[]},oz=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:sz,contentInitial:JB,disable:az,document:QB,flow:tz,flowInitial:ez,insideSpan:iz,string:nz,text:rz},Symbol.toStringTag,{value:"Module"}));function lz(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 u=[],o=[];const c={attempt:M(N),check:M(R),consume:v,enter:x,exit:E,interrupt:M(R,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:S,write:f};let g=n.tokenize.call(d,c);return n.resolveAll&&h.push(n),d;function f($){return u=er(u,$),_(),u[u.length-1]!==null?[]:(D(n,0),d.events=Vd(h,d.events,d),d.events)}function b($,U){return uz(S($),U)}function S($){return cz(u,$)}function k(){const{_bufferIndex:$,_index:U,line:q,column:Y,offset:K}=s;return{_bufferIndex:$,_index:U,line:q,column:Y,offset:K}}function w($){l[$.line]=$.column,P()}function _(){let $;for(;s._index<u.length;){const U=u[s._index];if(typeof U=="string")for($=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===$&&s._bufferIndex<U.length;)y(U.charCodeAt(s._bufferIndex));else y(U)}}function y($){g=g($)}function v($){Be($)?(s.line++,s.column=1,s.offset+=$===-3?2:1,P()):$!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===u[s._index].length&&(s._bufferIndex=-1,s._index++)),d.previous=$}function x($,U){const q=U||{};return q.type=$,q.start=k(),d.events.push(["enter",q,d]),o.push(q),q}function E($){const U=o.pop();return U.end=k(),d.events.push(["exit",U,d]),U}function N($,U){D($,U.from)}function R($,U){U.restore()}function M($,U){return q;function q(Y,K,V){let J,ne,F,j;return Array.isArray(Y)?L(Y):"tokenize"in Y?L([Y]):I(Y);function I(ee){return W;function W(H){const te=H!==null&&ee[H],ae=H!==null&&ee.null,pe=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return L(pe)(H)}}function L(ee){return J=ee,ne=0,ee.length===0?V:z(ee[ne])}function z(ee){return W;function W(H){return j=O(),F=ee,ee.partial||(d.currentConstruct=ee),ee.name&&d.parser.constructs.disable.null.includes(ee.name)?X():ee.tokenize.call(U?Object.assign(Object.create(d),U):d,c,Z,X)(H)}}function Z(ee){return $(F,j),K}function X(ee){return j.restore(),++ne<J.length?z(J[ne]):V}}}function D($,U){$.resolveAll&&!h.includes($)&&h.push($),$.resolve&&Hn(d.events,U,d.events.length-U,$.resolve(d.events.slice(U),d)),$.resolveTo&&(d.events=$.resolveTo(d.events,d))}function O(){const $=k(),U=d.previous,q=d.currentConstruct,Y=d.events.length,K=Array.from(o);return{from:Y,restore:V};function V(){s=$,d.previous=U,d.currentConstruct=q,d.events.length=Y,o=K,P()}}function P(){s.line in l&&s.column<2&&(s.column=l[s.line],s.offset+=l[s.line]-1)}}function cz(e,n){const i=n.start._index,s=n.start._bufferIndex,l=n.end._index,h=n.end._bufferIndex;let u;if(i===l)u=[e[i].slice(s,h)];else{if(u=e.slice(i,l),s>-1){const o=u[0];typeof o=="string"?u[0]=o.slice(s):u.shift()}h>0&&u.push(e[l].slice(0,h))}return u}function uz(e,n){let i=-1;const s=[];let l;for(;++i<e.length;){const h=e[i];let u;if(typeof h=="string")u=h;else switch(h){case-5:{u="\r";break}case-4:{u=`
498
- `;break}case-3:{u=`\r
499
- `;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&l)continue;u=" ";break}default:u=String.fromCharCode(h)}l=h===-2,s.push(u)}return s.join("")}function dz(e){const s={constructs:JC([oz,...(e||{}).extensions||[]]),content:l(EI),defined:[],document:l(TI),flow:l(GB),lazy:{},string:l(YB),text:l(XB)};return s;function l(h){return u;function u(o){return lz(s,h,o)}}}function hz(e){for(;!ik(e););return e}const rx=/[\0\t\n\r]/g;function fz(){let e=1,n="",i=!0,s;return l;function l(h,u,o){const c=[];let d,g,f,b,S;for(h=n+(typeof h=="string"?h.toString():new TextDecoder(u||void 0).decode(h)),f=0,n="",i&&(h.charCodeAt(0)===65279&&f++,i=void 0);f<h.length;){if(rx.lastIndex=f,d=rx.exec(h),b=d&&d.index!==void 0?d.index:h.length,S=h.charCodeAt(b),!d){n=h.slice(f);break}if(S===10&&f===b&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),f<b&&(c.push(h.slice(f,b)),e+=b-f),S){case 0:{c.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,c.push(-2);e++<g;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}f=b+1}return o&&(s&&c.push(-5),n&&c.push(n),c.push(null)),c}}const pz=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function mz(e){return e.replace(pz,gz)}function gz(e,n,i){if(n)return n;if(i.charCodeAt(0)===35){const l=i.charCodeAt(1),h=l===120||l===88;return ek(i.slice(h?2:1),h?16:10)}return Og(i)||e}const uk={}.hasOwnProperty;function vz(e,n,i){return n&&typeof n=="object"&&(i=n,n=void 0),_z(i)(hz(dz(i).document().write(fz()(e,n,!0))))}function _z(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:h(Gt),autolinkProtocol:O,autolinkEmail:O,atxHeading:h(Ue),blockQuote:h(ae),characterEscape:O,characterReference:O,codeFenced:h(pe),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:h(pe,u),codeText:h(ce,u),codeTextData:O,data:O,codeFlowValue:O,definition:h(Oe),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:h(Ie),hardBreakEscape:h(ut),hardBreakTrailing:h(ut),htmlFlow:h(Ne,u),htmlFlowData:O,htmlText:h(Ne,u),htmlTextData:O,image:h(gn),label:u,link:h(Gt),listItem:h(Wt),listItemValue:b,listOrdered:h(sn,f),listUnordered:h(sn),paragraph:h($n),reference:z,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:h(Ue),strong:h(Mt),thematicBreak:h(Zt)},exit:{atxHeading:c(),atxHeadingSequence:N,autolink:c(),autolinkEmail:te,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:ee,characterReference:W,codeFenced:c(_),codeFencedFence:w,codeFencedFenceInfo:S,codeFencedFenceMeta:k,codeFlowValue:P,codeIndented:c(y),codeText:c(K),codeTextData:P,data:P,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(q),htmlFlowData:P,htmlText:c(Y),htmlTextData:P,image:c(J),label:F,labelText:ne,lineEnding:$,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:j,resourceTitleString:I,resource:L,setextHeading:c(D),setextHeadingLineSequence:M,setextHeadingText:R,strong:c(),thematicBreak:c()}};dk(n,(e||{}).mdastExtensions||[]);const i={};return s;function s(he){let Se={type:"root",children:[]};const Re={stack:[Se],tokenStack:[],config:n,enter:o,exit:d,buffer:u,resume:g,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]];uk.call(wt,he[qe][1].type)&&wt[he[qe][1].type].call(Object.assign({sliceSerialize:he[qe][2].sliceSerialize},Re),he[qe][1])}if(Re.tokenStack.length>0){const wt=Re.tokenStack[Re.tokenStack.length-1];(wt[1]||ix).call(Re,void 0,wt[0])}for(Se.position={start:Ui(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:Ui(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},qe=-1;++qe<n.transforms.length;)Se=n.transforms[qe](Se)||Se;return Se}function l(he,Se,Re){let Pe=Se-1,qe=-1,wt=!1,nt,Rt,jt,Qt;for(;++Pe<=Re;){const lt=he[Pe];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?qe++:qe--,Qt=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(nt&&!Qt&&!qe&&!jt&&(jt=Pe),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!qe&&lt[0]==="enter"&&lt[1].type==="listItemPrefix"||qe===-1&&lt[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(nt){let mr=Pe;for(Rt=void 0;mr--;){const dn=he[mr];if(dn[1].type==="lineEnding"||dn[1].type==="lineEndingBlank"){if(dn[0]==="exit")continue;Rt&&(he[Rt][1].type="lineEndingBlank",wt=!0),dn[1].type="lineEnding",Rt=mr}else if(!(dn[1].type==="linePrefix"||dn[1].type==="blockQuotePrefix"||dn[1].type==="blockQuotePrefixWhitespace"||dn[1].type==="blockQuoteMarker"||dn[1].type==="listItemIndent"))break}jt&&(!Rt||jt<Rt)&&(nt._spread=!0),nt.end=Object.assign({},Rt?he[Rt][1].start:lt[1].end),he.splice(Rt||Pe,0,["exit",nt,lt[2]]),Pe++,Re++}if(lt[1].type==="listItemPrefix"){const mr={type:"listItem",_spread:!1,start:Object.assign({},lt[1].start),end:void 0};nt=mr,he.splice(Pe,0,["enter",mr,lt[2]]),Pe++,Re++,jt=void 0,Qt=!0}}}return he[Se][1]._spread=wt,Re}function h(he,Se){return Re;function Re(Pe){o.call(this,he(Pe),Pe),Se&&Se.call(this,Pe)}}function u(){this.stack.push({type:"fragment",children:[]})}function o(he,Se,Re){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([Se,Re||void 0]),he.position={start:Ui(Se.start),end:void 0}}function c(he){return Se;function Se(Re){he&&he.call(this,Re),d.call(this,Re)}}function d(he,Se){const Re=this.stack.pop(),Pe=this.tokenStack.pop();if(Pe)Pe[0].type!==he.type&&(Se?Se.call(this,he,Pe[0]):(Pe[1]||ix).call(this,he,Pe[0]));else throw new Error("Cannot close `"+he.type+"` ("+xl({start:he.start,end:he.end})+"): it’s not open");Re.position.end=Ui(he.end)}function g(){return jg(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function b(he){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function S(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=he}function k(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=he}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he.replace(/(\r?\n|\r)$/g,"")}function v(he){const Se=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Se,Re.identifier=dr(this.sliceSerialize(he)).toLowerCase()}function x(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function E(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function N(he){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Re=this.sliceSerialize(he).length;Se.depth=Re}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function M(he){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function O(he){const Re=this.stack[this.stack.length-1].children;let Pe=Re[Re.length-1];(!Pe||Pe.type!=="text")&&(Pe=Tt(),Pe.position={start:Ui(he.start),end:void 0},Re.push(Pe)),this.stack.push(Pe)}function P(he){const Se=this.stack.pop();Se.value+=this.sliceSerialize(he),Se.position.end=Ui(he.end)}function $(he){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=Se.children[Se.children.length-1];Re.position.end=Ui(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(Se.type)&&(O.call(this,he),P.call(this,he))}function U(){this.data.atHardBreak=!0}function q(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function Y(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function K(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.value=he}function V(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function J(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=Se,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function ne(he){const Se=this.sliceSerialize(he),Re=this.stack[this.stack.length-2];Re.label=mz(Se),Re.identifier=dr(Se).toLowerCase()}function F(){const he=this.stack[this.stack.length-1],Se=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const Pe=he.children;Re.children=Pe}else Re.alt=Se}function j(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.url=he}function I(){const he=this.resume(),Se=this.stack[this.stack.length-1];Se.title=he}function L(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function Z(he){const Se=this.resume(),Re=this.stack[this.stack.length-1];Re.label=Se,Re.identifier=dr(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function X(he){this.data.characterReferenceType=he.type}function ee(he){const Se=this.sliceSerialize(he),Re=this.data.characterReferenceType;let Pe;Re?(Pe=ek(Se,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Pe=Og(Se);const qe=this.stack[this.stack.length-1];qe.value+=Pe}function W(he){const Se=this.stack.pop();Se.position.end=Ui(he.end)}function H(he){P.call(this,he);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(he)}function te(he){P.call(this,he);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(he)}function ae(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function ce(){return{type:"inlineCode",value:""}}function Oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function Ue(){return{type:"heading",depth:0,children:[]}}function ut(){return{type:"break"}}function Ne(){return{type:"html",value:""}}function gn(){return{type:"image",title:null,url:"",alt:null}}function Gt(){return{type:"link",title:null,url:"",children:[]}}function sn(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Wt(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function $n(){return{type:"paragraph",children:[]}}function Mt(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function Zt(){return{type:"thematicBreak"}}}function Ui(e){return{line:e.line,column:e.column,offset:e.offset}}function dk(e,n){let i=-1;for(;++i<n.length;){const s=n[i];Array.isArray(s)?dk(e,s):yz(e,s)}}function yz(e,n){let i;for(i in n)if(uk.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 ix(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+xl({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+xl({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+xl({start:n.start,end:n.end})+") is still open")}function bz(e){const n=this;n.parser=i;function i(s){return vz(s,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function xz(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 Sz(e,n){const i={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,i),[e.applyData(n,i),{type:"text",value:`
500
- `}]}function wz(e,n){const i=n.value?n.value+`
501
- `:"",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 Cz(e,n){const i={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function kz(e,n){const i={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Ez(e,n){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(n.identifier).toUpperCase(),l=uo(s.toLowerCase()),h=e.footnoteOrder.indexOf(s);let u,o=e.footnoteCounts.get(s);o===void 0?(o=0,e.footnoteOrder.push(s),u=e.footnoteOrder.length):u=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(u)}]};e.patch(n,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,d),e.applyData(n,d)}function Az(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 Tz(e,n){if(e.options.allowDangerousHtml){const i={type:"raw",value:n.value};return e.patch(n,i),e.applyData(n,i)}}function hk(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 u=l[l.length-1];return u&&u.type==="text"?u.value+=s:l.push({type:"text",value:s}),l}function Rz(e,n){const i=String(n.identifier).toUpperCase(),s=e.definitionById.get(i);if(!s)return hk(e,n);const l={src:uo(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 Dz(e,n){const i={src:uo(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 Nz(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 Mz(e,n){const i=String(n.identifier).toUpperCase(),s=e.definitionById.get(i);if(!s)return hk(e,n);const l={href:uo(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 jz(e,n){const i={href:uo(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 Oz(e,n,i){const s=e.all(n),l=i?Lz(i):fk(n),h={},u=[];if(typeof n.checked=="boolean"){const g=s[0];let f;g&&g.type==="element"&&g.tagName==="p"?f=g:(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 g=s[o];(l||o!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
502
- `}),g.type==="element"&&g.tagName==="p"&&!l?u.push(...g.children):u.push(g)}const c=s[s.length-1];c&&(l||c.type!=="element"||c.tagName!=="p")&&u.push({type:"text",value:`
503
- `});const d={type:"element",tagName:"li",properties:h,children:u};return e.patch(n,d),e.applyData(n,d)}function Lz(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=fk(i[s])}return n}function fk(e){const n=e.spread;return n==null?e.children.length>1:n}function Iz(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 u=s[l];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.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 Bz(e,n){const i={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function zz(e,n){const i={type:"root",children:e.wrap(e.all(n))};return e.patch(n,i),e.applyData(n,i)}function Pz(e,n){const i={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Fz(e,n){const i=e.all(n),s=i.shift(),l=[];if(s){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(n.children[0],u),l.push(u)}if(i.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(i,!0)},o=Rg(n.children[1]),c=GC(n.children[n.children.length-1]);o&&c&&(u.position={start:o,end:c}),l.push(u)}const h={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(n,h),e.applyData(n,h)}function Hz(e,n,i){const s=i?i.children:void 0,h=(s?s.indexOf(n):1)===0?"th":"td",u=i&&i.type==="table"?i.align:void 0,o=u?u.length:n.children.length;let c=-1;const d=[];for(;++c<o;){const f=n.children[c],b={},S=u?u[c]:void 0;S&&(b.align=S);let k={type:"element",tagName:h,properties:b,children:[]};f&&(k.children=e.all(f),e.patch(f,k),k=e.applyData(f,k)),d.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(n,g),e.applyData(n,g)}function Uz(e,n){const i={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}const sx=9,ax=32;function $z(e){const n=String(e),i=/\r?\n|\r/g;let s=i.exec(n),l=0;const h=[];for(;s;)h.push(ox(n.slice(l,s.index),l>0,!0),s[0]),l=s.index+s[0].length,s=i.exec(n);return h.push(ox(n.slice(l),l>0,!1)),h.join("")}function ox(e,n,i){let s=0,l=e.length;if(n){let h=e.codePointAt(s);for(;h===sx||h===ax;)s++,h=e.codePointAt(s)}if(i){let h=e.codePointAt(l-1);for(;h===sx||h===ax;)l--,h=e.codePointAt(l-1)}return l>s?e.slice(s,l):""}function qz(e,n){const i={type:"text",value:$z(String(n.value))};return e.patch(n,i),e.applyData(n,i)}function Vz(e,n){const i={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,i),e.applyData(n,i)}const Gz={blockquote:xz,break:Sz,code:wz,delete:Cz,emphasis:kz,footnoteReference:Ez,heading:Az,html:Tz,imageReference:Rz,image:Dz,inlineCode:Nz,linkReference:Mz,link:jz,listItem:Oz,list:Iz,paragraph:Bz,root:zz,strong:Pz,table:Fz,tableCell:Uz,tableRow:Hz,text:qz,thematicBreak:Vz,toml:Au,yaml:Au,definition:Au,footnoteDefinition:Au};function Au(){}const pk=-1,Gd=0,wl=1,nd=2,Ig=3,Bg=4,zg=5,Pg=6,mk=7,gk=8,lx=typeof self=="object"?self:globalThis,Wz=(e,n)=>{const i=(l,h)=>(e.set(h,l),l),s=l=>{if(e.has(l))return e.get(l);const[h,u]=n[l];switch(h){case Gd:case pk:return i(u,l);case wl:{const o=i([],l);for(const c of u)o.push(s(c));return o}case nd:{const o=i({},l);for(const[c,d]of u)o[s(c)]=s(d);return o}case Ig:return i(new Date(u),l);case Bg:{const{source:o,flags:c}=u;return i(new RegExp(o,c),l)}case zg:{const o=i(new Map,l);for(const[c,d]of u)o.set(s(c),s(d));return o}case Pg:{const o=i(new Set,l);for(const c of u)o.add(s(c));return o}case mk:{const{name:o,message:c}=u;return i(new lx[o](c),l)}case gk:return i(BigInt(u),l);case"BigInt":return i(Object(BigInt(u)),l);case"ArrayBuffer":return i(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:o}=new Uint8Array(u);return i(new DataView(o),u)}}return i(new lx[h](u),l)};return s},cx=e=>Wz(new Map,e)(0),Ea="",{toString:Kz}={},{keys:Yz}=Object,fl=e=>{const n=typeof e;if(n!=="object"||!e)return[Gd,n];const i=Kz.call(e).slice(8,-1);switch(i){case"Array":return[wl,Ea];case"Object":return[nd,Ea];case"Date":return[Ig,Ea];case"RegExp":return[Bg,Ea];case"Map":return[zg,Ea];case"Set":return[Pg,Ea];case"DataView":return[wl,i]}return i.includes("Array")?[wl,i]:i.includes("Error")?[mk,i]:[nd,i]},Tu=([e,n])=>e===Gd&&(n==="function"||n==="symbol"),Xz=(e,n,i,s)=>{const l=(u,o)=>{const c=s.push(u)-1;return i.set(o,c),c},h=u=>{if(i.has(u))return i.get(u);let[o,c]=fl(u);switch(o){case Gd:{let g=u;switch(c){case"bigint":o=gk,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);g=null;break;case"undefined":return l([pk],u)}return l([o,g],u)}case wl:{if(c){let b=u;return c==="DataView"?b=new Uint8Array(u.buffer):c==="ArrayBuffer"&&(b=new Uint8Array(u)),l([c,[...b]],u)}const g=[],f=l([o,g],u);for(const b of u)g.push(h(b));return f}case nd:{if(c)switch(c){case"BigInt":return l([c,u.toString()],u);case"Boolean":case"Number":case"String":return l([c,u.valueOf()],u)}if(n&&"toJSON"in u)return h(u.toJSON());const g=[],f=l([o,g],u);for(const b of Yz(u))(e||!Tu(fl(u[b])))&&g.push([h(b),h(u[b])]);return f}case Ig:return l([o,u.toISOString()],u);case Bg:{const{source:g,flags:f}=u;return l([o,{source:g,flags:f}],u)}case zg:{const g=[],f=l([o,g],u);for(const[b,S]of u)(e||!(Tu(fl(b))||Tu(fl(S))))&&g.push([h(b),h(S)]);return f}case Pg:{const g=[],f=l([o,g],u);for(const b of u)(e||!Tu(fl(b)))&&g.push(h(b));return f}}const{message:d}=u;return l([o,{name:c,message:d}],u)};return h},ux=(e,{json:n,lossy:i}={})=>{const s=[];return Xz(!(n||i),!!n,new Map,s)(e),s},rd=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?cx(ux(e,n)):structuredClone(e):(e,n)=>cx(ux(e,n));function Zz(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 Qz(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Jz(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",i=e.options.footnoteBackContent||Zz,s=e.options.footnoteBackLabel||Qz,l=e.options.footnoteLabel||"Footnotes",h=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[c]);if(!d)continue;const g=e.all(d),f=String(d.identifier).toUpperCase(),b=uo(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-"+b+(S>1?"-"+S:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(c,S),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const _=g[g.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 g.push(...k);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+b},children:e.wrap(g,!0)};e.patch(d,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:h,properties:{...rd(u),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
504
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
505
- `}]}}const Wd=(function(e){if(e==null)return r8;if(typeof e=="function")return Kd(e);if(typeof e=="object")return Array.isArray(e)?e8(e):t8(e);if(typeof e=="string")return n8(e);throw new Error("Expected function, string, or object as test")});function e8(e){const n=[];let i=-1;for(;++i<e.length;)n[i]=Wd(e[i]);return Kd(s);function s(...l){let h=-1;for(;++h<n.length;)if(n[h].apply(this,l))return!0;return!1}}function t8(e){const n=e;return Kd(i);function i(s){const l=s;let h;for(h in e)if(l[h]!==n[h])return!1;return!0}}function n8(e){return Kd(n);function n(i){return i&&i.type===e}}function Kd(e){return n;function n(i,s,l){return!!(i8(i)&&e.call(this,i,typeof s=="number"?s:void 0,l||void 0))}}function r8(){return!0}function i8(e){return e!==null&&typeof e=="object"&&"type"in e}const vk=[],s8=!0,Cm=!1,a8="skip";function _k(e,n,i,s){let l;typeof n=="function"&&typeof i!="function"?(s=i,i=n):l=n;const h=Wd(l),u=s?-1:1;o(e,void 0,[])();function o(c,d,g){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(b,"name",{value:"node ("+(c.type+(S?"<"+S+">":""))+")"})}return b;function b(){let S=vk,k,w,_;if((!n||h(c,d,g[g.length-1]||void 0))&&(S=o8(i(c,g)),S[0]===Cm))return S;if("children"in c&&c.children){const y=c;if(y.children&&S[0]!==a8)for(w=(s?y.children.length:-1)+u,_=g.concat(y);w>-1&&w<y.children.length;){const v=y.children[w];if(k=o(v,w,_)(),k[0]===Cm)return k;w=typeof k[1]=="number"?k[1]:w+u}}return S}}}function o8(e){return Array.isArray(e)?e:typeof e=="number"?[s8,e]:e==null?vk:[e]}function Fg(e,n,i,s){let l,h,u;typeof n=="function"&&typeof i!="function"?(h=void 0,u=n,l=i):(h=n,u=i,l=s),_k(e,h,o,l);function o(c,d){const g=d[d.length-1],f=g?g.children.indexOf(c):void 0;return u(c,f,g)}}const km={}.hasOwnProperty,l8={};function c8(e,n){const i=n||l8,s=new Map,l=new Map,h=new Map,u={...Gz,...i.handlers},o={all:d,applyData:d8,definitionById:s,footnoteById:l,footnoteCounts:h,footnoteOrder:[],handlers:u,one:c,options:i,patch:u8,wrap:f8};return Fg(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const f=g.type==="definition"?s:l,b=String(g.identifier).toUpperCase();f.has(b)||f.set(b,g)}}),o;function c(g,f){const b=g.type,S=o.handlers[b];if(km.call(o.handlers,b)&&S)return S(o,g,f);if(o.options.passThrough&&o.options.passThrough.includes(b)){if("children"in g){const{children:w,..._}=g,y=rd(_);return y.children=o.all(g),y}return rd(g)}return(o.options.unknownHandler||h8)(o,g,f)}function d(g){const f=[];if("children"in g){const b=g.children;let S=-1;for(;++S<b.length;){const k=o.one(b[S],g);if(k){if(S&&b[S-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=dx(k.value)),!Array.isArray(k)&&k.type==="element")){const w=k.children[0];w&&w.type==="text"&&(w.value=dx(w.value))}Array.isArray(k)?f.push(...k):f.push(k)}}}return f}}function u8(e,n){e.position&&(n.position=Q6(e))}function d8(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 u="children"in i?i.children:[i];i={type:"element",tagName:s,properties:{},children:u}}i.type==="element"&&h&&Object.assign(i.properties,rd(h)),"children"in i&&i.children&&l!==null&&l!==void 0&&(i.children=l)}return i}function h8(e,n){const i=n.data||{},s="value"in n&&!(km.call(i,"hProperties")||km.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 f8(e,n){const i=[];let s=-1;for(n&&i.push({type:"text",value:`
506
- `});++s<e.length;)s&&i.push({type:"text",value:`
507
- `}),i.push(e[s]);return n&&e.length>0&&i.push({type:"text",value:`
508
- `}),i}function dx(e){let n=0,i=e.charCodeAt(n);for(;i===9||i===32;)n++,i=e.charCodeAt(n);return e.slice(n)}function hx(e,n){const i=c8(e,n),s=i.one(e,void 0),l=Jz(i),h=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return l&&h.children.push({type:"text",value:`
509
- `},l),h}function p8(e,n){return e&&"run"in e?async function(i,s){const l=hx(i,{file:s,...n});await e.run(l,s)}:function(i,s){return hx(i,{file:s,...e||n})}}function fx(e){if(e)throw e}var Ip,px;function m8(){if(px)return Ip;px=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},h=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var g=e.call(d,"constructor"),f=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!g&&!f)return!1;var b;for(b in d);return typeof b>"u"||e.call(d,b)},u=function(d,g){i&&g.name==="__proto__"?i(d,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):d[g.name]=g.newValue},o=function(d,g){if(g==="__proto__")if(e.call(d,g)){if(s)return s(d,g).value}else return;return d[g]};return Ip=function c(){var d,g,f,b,S,k,w=arguments[0],_=1,y=arguments.length,v=!1;for(typeof w=="boolean"&&(v=w,w=arguments[1]||{},_=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});_<y;++_)if(d=arguments[_],d!=null)for(g in d)f=o(w,g),b=o(d,g),w!==b&&(v&&b&&(h(b)||(S=l(b)))?(S?(S=!1,k=f&&l(f)?f:[]):k=f&&h(f)?f:{},u(w,{name:g,newValue:c(v,k,b)})):typeof b<"u"&&u(w,{name:g,newValue:b}));return w},Ip}var g8=m8();const Bp=sd(g8);function Em(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 v8(){const e=[],n={run:i,use:s};return n;function i(...l){let h=-1;const u=l.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);o(null,...l);function o(c,...d){const g=e[++h];let f=-1;if(c){u(c);return}for(;++f<l.length;)(d[f]===null||d[f]===void 0)&&(d[f]=l[f]);l=d,g?_8(g,o)(...d):u(null,...d)}}function s(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),n}}function _8(e,n){let i;return s;function s(...u){const o=e.length>u.length;let c;o&&u.push(l);try{c=e.apply(this,u)}catch(d){const g=d;if(o&&i)throw g;return l(g)}o||(c&&c.then&&typeof c.then=="function"?c.then(h,l):c instanceof Error?l(c):h(c))}function l(u,...o){i||(i=!0,n(u,...o))}function h(u){l(null,u)}}const wr={basename:y8,dirname:b8,extname:x8,join:S8,sep:"/"};function y8(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');ec(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 u=-1,o=n.length-1;for(;l--;)if(e.codePointAt(l)===47){if(h){i=l+1;break}}else u<0&&(h=!0,u=l+1),o>-1&&(e.codePointAt(l)===n.codePointAt(o--)?o<0&&(s=l):(o=-1,s=u));return i===s?s=u:s<0&&(s=e.length),e.slice(i,s)}function b8(e){if(ec(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 x8(e){ec(e);let n=e.length,i=-1,s=0,l=-1,h=0,u;for(;n--;){const o=e.codePointAt(n);if(o===47){if(u){s=n+1;break}continue}i<0&&(u=!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 S8(...e){let n=-1,i;for(;++n<e.length;)ec(e[n]),e[n]&&(i=i===void 0?e[n]:i+"/"+e[n]);return i===void 0?".":w8(i)}function w8(e){ec(e);const n=e.codePointAt(0)===47;let i=C8(e,!n);return i.length===0&&!n&&(i="."),i.length>0&&e.codePointAt(e.length-1)===47&&(i+="/"),n?"/"+i:i}function C8(e,n){let i="",s=0,l=-1,h=0,u=-1,o,c;for(;++u<=e.length;){if(u<e.length)o=e.codePointAt(u);else{if(o===47)break;o=47}if(o===47){if(!(l===u-1||h===1))if(l!==u-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=u,h=0;continue}}else if(i.length>0){i="",s=0,l=u,h=0;continue}}n&&(i=i.length>0?i+"/..":"..",s=2)}else i.length>0?i+="/"+e.slice(l+1,u):i=e.slice(l+1,u),s=u-l-1;l=u,h=0}else o===46&&h>-1?h++:h=-1}return i}function ec(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const k8={cwd:E8};function E8(){return"/"}function Am(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function A8(e){if(typeof e=="string")e=new URL(e);else if(!Am(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 T8(e)}function T8(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 zp=["history","path","basename","stem","extname","dirname"];class yk{constructor(n){let i;n?Am(n)?i={path:n}:typeof n=="string"||R8(n)?i={value:n}:i=n:i={},this.cwd="cwd"in i?"":k8.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<zp.length;){const h=zp[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)zp.includes(l)||(this[l]=i[l])}get basename(){return typeof this.path=="string"?wr.basename(this.path):void 0}set basename(n){Fp(n,"basename"),Pp(n,"basename"),this.path=wr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?wr.dirname(this.path):void 0}set dirname(n){mx(this.basename,"dirname"),this.path=wr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?wr.extname(this.path):void 0}set extname(n){if(Pp(n,"extname"),mx(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=wr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Am(n)&&(n=A8(n)),Fp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?wr.basename(this.path,this.extname):void 0}set stem(n){Fp(n,"stem"),Pp(n,"stem"),this.path=wr.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 un(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 Pp(e,n){if(e&&e.includes(wr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+wr.sep+"`")}function Fp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function mx(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function R8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const D8=(function(e){const s=this.constructor.prototype,l=s[e],h=function(){return l.apply(h,arguments)};return Object.setPrototypeOf(h,s),h}),N8={}.hasOwnProperty;class Hg extends D8{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=v8()}copy(){const n=new Hg;let i=-1;for(;++i<this.attachers.length;){const s=this.attachers[i];n.use(...s)}return n.data(Bp(!0,{},this.namespace)),n}data(n,i){return typeof n=="string"?arguments.length===2?($p("data",this.frozen),this.namespace[n]=i,this):N8.call(this.namespace,n)&&this.namespace[n]||void 0:n?($p("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=Ru(n),s=this.parser||this.Parser;return Hp("parse",s),s(String(i),i)}process(n,i){const s=this;return this.freeze(),Hp("process",this.parser||this.Parser),Up("process",this.compiler||this.Compiler),i?l(void 0,i):new Promise(l);function l(h,u){const o=Ru(n),c=s.parse(o);s.run(c,o,function(g,f,b){if(g||!f||!b)return d(g);const S=f,k=s.stringify(S,b);O8(k)?b.value=k:b.result=k,d(g,b)});function d(g,f){g||!f?u(g):h?h(f):i(void 0,f)}}}processSync(n){let i=!1,s;return this.freeze(),Hp("processSync",this.parser||this.Parser),Up("processSync",this.compiler||this.Compiler),this.process(n,l),vx("processSync","process",i),s;function l(h,u){i=!0,fx(h),s=u}}run(n,i,s){gx(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(u,o){const c=Ru(i);l.run(n,c,d);function d(g,f,b){const S=f||n;g?o(g):u?u(S):s(void 0,S,b)}}}runSync(n,i){let s=!1,l;return this.run(n,i,h),vx("runSync","run",s),l;function h(u,o){fx(u),l=o,s=!0}}stringify(n,i){this.freeze();const s=Ru(i),l=this.compiler||this.Compiler;return Up("stringify",l),gx(n),l(n,s)}use(n,...i){const s=this.attachers,l=this.namespace;if($p("use",this.frozen),n!=null)if(typeof n=="function")c(n,i);else if(typeof n=="object")Array.isArray(n)?o(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function h(d){if(typeof d=="function")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[g,...f]=d;c(g,f)}else u(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function u(d){if(!("plugins"in d)&&!("settings"in d))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(d.plugins),d.settings&&(l.settings=Bp(!0,l.settings,d.settings))}function o(d){let g=-1;if(d!=null)if(Array.isArray(d))for(;++g<d.length;){const f=d[g];h(f)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,g){let f=-1,b=-1;for(;++f<s.length;)if(s[f][0]===d){b=f;break}if(b===-1)s.push([d,...g]);else if(g.length>0){let[S,...k]=g;const w=s[b][1];Em(w)&&Em(S)&&(S=Bp(!0,w,S)),s[b]=[d,S,...k]}}}}const M8=new Hg().freeze();function Hp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Up(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $p(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 gx(e){if(!Em(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vx(e,n,i){if(!i)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ru(e){return j8(e)?e:new yk(e)}function j8(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function O8(e){return typeof e=="string"||L8(e)}function L8(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const I8="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_x=[],yx={allowDangerousHtml:!0},B8=/^(https?|ircs?|mailto|xmpp)$/i,z8=[{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 P8(e){const n=F8(e),i=H8(e);return U8(n.runSync(n.parse(i),i),e)}function F8(e){const n=e.rehypePlugins||_x,i=e.remarkPlugins||_x,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yx}:yx;return M8().use(bz).use(i).use(p8,s).use(n)}function H8(e){const n=e.children||"",i=new yk;return typeof n=="string"&&(i.value=n),i}function U8(e,n){const i=n.allowedElements,s=n.allowElement,l=n.components,h=n.disallowedElements,u=n.skipHtml,o=n.unwrapDisallowed,c=n.urlTransform||$8;for(const g of z8)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+I8+g.id,void 0);return Fg(e,d),rI(e,{Fragment:m.Fragment,components:l,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function d(g,f,b){if(g.type==="raw"&&b&&typeof f=="number")return u?b.children.splice(f,1):b.children[f]={type:"text",value:g.value},f;if(g.type==="element"){let S;for(S in jp)if(Object.hasOwn(jp,S)&&Object.hasOwn(g.properties,S)){const k=g.properties[S],w=jp[S];(w===null||w.includes(g.tagName))&&(g.properties[S]=c(String(k||""),S,g))}}if(g.type==="element"){let S=i?!i.includes(g.tagName):h?h.includes(g.tagName):!1;if(!S&&s&&typeof f=="number"&&(S=!s(g,f,b)),S&&b&&typeof f=="number")return o&&g.children?b.children.splice(f,1,...g.children):b.children.splice(f,1),f}}}function $8(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||B8.test(e.slice(0,n))?e:""}function bx(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 q8(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function V8(e,n,i){const l=Wd((i||{}).ignore||[]),h=G8(n);let u=-1;for(;++u<h.length;)_k(e,"text",o);function o(d,g){let f=-1,b;for(;++f<g.length;){const S=g[f],k=b?b.children:void 0;if(l(S,k?k.indexOf(S):void 0,b))return;b=S}if(b)return c(d,g)}function c(d,g){const f=g[g.length-1],b=h[u][0],S=h[u][1];let k=0;const _=f.children.indexOf(d);let y=!1,v=[];b.lastIndex=0;let x=b.exec(d.value);for(;x;){const E=x.index,N={index:x.index,input:x.input,stack:[...g,d]};let R=S(...x,N);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?b.lastIndex=E+1:(k!==E&&v.push({type:"text",value:d.value.slice(k,E)}),Array.isArray(R)?v.push(...R):R&&v.push(R),k=E+x[0].length,y=!0),!b.global)break;x=b.exec(d.value)}return y?(k<d.value.length&&v.push({type:"text",value:d.value.slice(k)}),f.children.splice(_,1,...v)):v=[d],_+v.length}}function G8(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([W8(l[0]),K8(l[1])])}return n}function W8(e){return typeof e=="string"?new RegExp(q8(e),"g"):e}function K8(e){return typeof e=="function"?e:function(){return e}}const qp="phrasing",Vp=["autolink","link","image","label"];function Y8(){return{transforms:[nP],enter:{literalAutolink:Z8,literalAutolinkEmail:Gp,literalAutolinkHttp:Gp,literalAutolinkWww:Gp},exit:{literalAutolink:tP,literalAutolinkEmail:eP,literalAutolinkHttp:Q8,literalAutolinkWww:J8}}}function X8(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:qp,notInConstruct:Vp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:qp,notInConstruct:Vp},{character:":",before:"[ps]",after:"\\/",inConstruct:qp,notInConstruct:Vp}]}}function Z8(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Gp(e){this.config.enter.autolinkProtocol.call(this,e)}function Q8(e){this.config.exit.autolinkProtocol.call(this,e)}function J8(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 eP(e){this.config.exit.autolinkEmail.call(this,e)}function tP(e){this.exit(e)}function nP(e){V8(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rP],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),iP]],{ignore:["link","linkReference"]})}function rP(e,n,i,s,l){let h="";if(!bk(l)||(/^w/i.test(n)&&(i=n+i,n="",h="http://"),!sP(i)))return!1;const u=aP(i+s);if(!u[0])return!1;const o={type:"link",title:null,url:h+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[o,{type:"text",value:u[1]}]:o}function iP(e,n,i,s){return!bk(s,!0)||/[-\d_]$/.test(i)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+i,children:[{type:"text",value:n+"@"+i}]}}function sP(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 aP(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=bx(e,"(");let h=bx(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 bk(e,n){const i=e.input.charCodeAt(e.index-1);return(e.index===0||Ns(i)||qd(i))&&(!n||i!==47)}xk.peek=mP;function oP(){this.buffer()}function lP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function cP(){this.buffer()}function uP(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function dP(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=dr(this.sliceSerialize(e)).toLowerCase(),i.label=n}function hP(e){this.exit(e)}function fP(e){const n=this.resume(),i=this.stack[this.stack.length-1];i.type,i.identifier=dr(this.sliceSerialize(e)).toLowerCase(),i.label=n}function pP(e){this.exit(e)}function mP(){return"["}function xk(e,n,i,s){const l=i.createTracker(s);let h=l.move("[^");const u=i.enter("footnoteReference"),o=i.enter("reference");return h+=l.move(i.safe(i.associationId(e),{after:"]",before:h})),o(),u(),h+=l.move("]"),h}function gP(){return{enter:{gfmFootnoteCallString:oP,gfmFootnoteCall:lP,gfmFootnoteDefinitionLabelString:cP,gfmFootnoteDefinition:uP},exit:{gfmFootnoteCallString:dP,gfmFootnoteCall:hP,gfmFootnoteDefinitionLabelString:fP,gfmFootnoteDefinition:pP}}}function vP(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:i,footnoteReference:xk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function i(s,l,h,u){const o=h.createTracker(u);let c=o.move("[^");const d=h.enter("footnoteDefinition"),g=h.enter("label");return c+=o.move(h.safe(h.associationId(s),{before:c,after:"]"})),g(),c+=o.move("]:"),s.children&&s.children.length>0&&(o.shift(4),c+=o.move((n?`
510
- `:" ")+h.indentLines(h.containerFlow(s,o.current()),n?Sk:_P))),d(),c}}function _P(e,n,i){return n===0?e:Sk(e,n,i)}function Sk(e,n,i){return(i?"":" ")+e}const yP=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];wk.peek=CP;function bP(){return{canContainEols:["delete"],enter:{strikethrough:SP},exit:{strikethrough:wP}}}function xP(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:yP}],handlers:{delete:wk}}}function SP(e){this.enter({type:"delete",children:[]},e)}function wP(e){this.exit(e)}function wk(e,n,i,s){const l=i.createTracker(s),h=i.enter("strikethrough");let u=l.move("~~");return u+=i.containerPhrasing(e,{...l.current(),before:u,after:"~"}),u+=l.move("~~"),h(),u}function CP(){return"~"}function kP(e){return e.length}function EP(e,n){const i=n||{},s=(i.align||[]).concat(),l=i.stringLength||kP,h=[],u=[],o=[],c=[];let d=0,g=-1;for(;++g<e.length;){const w=[],_=[];let y=-1;for(e[g].length>d&&(d=e[g].length);++y<e[g].length;){const v=AP(e[g][y]);if(i.alignDelimiters!==!1){const x=l(v);_[y]=x,(c[y]===void 0||x>c[y])&&(c[y]=x)}w.push(v)}u[g]=w,o[g]=_}let f=-1;if(typeof s=="object"&&"length"in s)for(;++f<d;)h[f]=xx(s[f]);else{const w=xx(s);for(;++f<d;)h[f]=w}f=-1;const b=[],S=[];for(;++f<d;){const w=h[f];let _="",y="";w===99?(_=":",y=":"):w===108?_=":":w===114&&(y=":");let v=i.alignDelimiters===!1?1:Math.max(1,c[f]-_.length-y.length);const x=_+"-".repeat(v)+y;i.alignDelimiters!==!1&&(v=_.length+v+y.length,v>c[f]&&(c[f]=v),S[f]=v),b[f]=x}u.splice(1,0,b),o.splice(1,0,S),g=-1;const k=[];for(;++g<u.length;){const w=u[g],_=o[g];f=-1;const y=[];for(;++f<d;){const v=w[f]||"";let x="",E="";if(i.alignDelimiters!==!1){const N=c[f]-(_[f]||0),R=h[f];R===114?x=" ".repeat(N):R===99?N%2?(x=" ".repeat(N/2+.5),E=" ".repeat(N/2-.5)):(x=" ".repeat(N/2),E=x):E=" ".repeat(N)}i.delimiterStart!==!1&&!f&&y.push("|"),i.padding!==!1&&!(i.alignDelimiters===!1&&v==="")&&(i.delimiterStart!==!1||f)&&y.push(" "),i.alignDelimiters!==!1&&y.push(x),y.push(v),i.alignDelimiters!==!1&&y.push(E),i.padding!==!1&&y.push(" "),(i.delimiterEnd!==!1||f!==d-1)&&y.push("|")}k.push(i.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return k.join(`
511
- `)}function AP(e){return e==null?"":String(e)}function xx(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 TP(e,n,i,s){const l=i.enter("blockquote"),h=i.createTracker(s);h.move("> "),h.shift(2);const u=i.indentLines(i.containerFlow(e,h.current()),RP);return l(),u}function RP(e,n,i){return">"+(i?"":" ")+e}function DP(e,n){return Sx(e,n.inConstruct,!0)&&!Sx(e,n.notInConstruct,!1)}function Sx(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 wx(e,n,i,s){let l=-1;for(;++l<i.unsafe.length;)if(i.unsafe[l].character===`
512
- `&&DP(i.stack,i.unsafe[l]))return/[ \t]/.test(s.before)?"":" ";return`\\
513
- `}function NP(e,n){const i=String(e);let s=i.indexOf(n),l=s,h=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===l?++h>u&&(u=h):h=1,l=s+n.length,s=i.indexOf(n,l);return u}function MP(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 jP(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 OP(e,n,i,s){const l=jP(i),h=e.value||"",u=l==="`"?"GraveAccent":"Tilde";if(MP(e,i)){const f=i.enter("codeIndented"),b=i.indentLines(h,LP);return f(),b}const o=i.createTracker(s),c=l.repeat(Math.max(NP(h,l)+1,3)),d=i.enter("codeFenced");let g=o.move(c);if(e.lang){const f=i.enter(`codeFencedLang${u}`);g+=o.move(i.safe(e.lang,{before:g,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=i.enter(`codeFencedMeta${u}`);g+=o.move(" "),g+=o.move(i.safe(e.meta,{before:g,after:`
514
- `,encode:["`"],...o.current()})),f()}return g+=o.move(`
515
- `),h&&(g+=o.move(h+`
516
- `)),g+=o.move(c),d(),g}function LP(e,n,i){return(i?"":" ")+e}function Ug(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 IP(e,n,i,s){const l=Ug(i),h=l==='"'?"Quote":"Apostrophe",u=i.enter("definition");let o=i.enter("label");const c=i.createTracker(s);let d=c.move("[");return d+=c.move(i.safe(i.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=i.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(i.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(o=i.enter("destinationRaw"),d+=c.move(i.safe(e.url,{before:d,after:e.title?" ":`
517
- `,...c.current()}))),o(),e.title&&(o=i.enter(`title${h}`),d+=c.move(" "+l),d+=c.move(i.safe(e.title,{before:d,after:l,...c.current()})),d+=c.move(l),o()),u(),d}function BP(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 jl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function id(e,n,i){const s=Ka(e),l=Ka(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}}Ck.peek=zP;function Ck(e,n,i,s){const l=BP(i),h=i.enter("emphasis"),u=i.createTracker(s),o=u.move(l);let c=u.move(i.containerPhrasing(e,{after:l,before:o,...u.current()}));const d=c.charCodeAt(0),g=id(s.before.charCodeAt(s.before.length-1),d,l);g.inside&&(c=jl(d)+c.slice(1));const f=c.charCodeAt(c.length-1),b=id(s.after.charCodeAt(0),f,l);b.inside&&(c=c.slice(0,-1)+jl(f));const S=u.move(l);return h(),i.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},o+c+S}function zP(e,n,i){return i.options.emphasis||"*"}function PP(e,n){let i=!1;return Fg(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return i=!0,Cm}),!!((!e.depth||e.depth<3)&&jg(e)&&(n.options.setext||i))}function FP(e,n,i,s){const l=Math.max(Math.min(6,e.depth||1),1),h=i.createTracker(s);if(PP(e,i)){const g=i.enter("headingSetext"),f=i.enter("phrasing"),b=i.containerPhrasing(e,{...h.current(),before:`
518
- `,after:`
519
- `});return f(),g(),b+`
520
- `+(l===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
521
- `))+1))}const u="#".repeat(l),o=i.enter("headingAtx"),c=i.enter("phrasing");h.move(u+" ");let d=i.containerPhrasing(e,{before:"# ",after:`
522
- `,...h.current()});return/^[\t ]/.test(d)&&(d=jl(d.charCodeAt(0))+d.slice(1)),d=d?u+" "+d:u,i.options.closeAtx&&(d+=" "+u),c(),o(),d}kk.peek=HP;function kk(e){return e.value||""}function HP(){return"<"}Ek.peek=UP;function Ek(e,n,i,s){const l=Ug(i),h=l==='"'?"Quote":"Apostrophe",u=i.enter("image");let o=i.enter("label");const c=i.createTracker(s);let d=c.move("![");return d+=c.move(i.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=i.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(i.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(o=i.enter("destinationRaw"),d+=c.move(i.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=i.enter(`title${h}`),d+=c.move(" "+l),d+=c.move(i.safe(e.title,{before:d,after:l,...c.current()})),d+=c.move(l),o()),d+=c.move(")"),u(),d}function UP(){return"!"}Ak.peek=$P;function Ak(e,n,i,s){const l=e.referenceType,h=i.enter("imageReference");let u=i.enter("label");const o=i.createTracker(s);let c=o.move("![");const d=i.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const f=i.safe(i.associationId(e),{before:c,after:"]",...o.current()});return u(),i.stack=g,h(),l==="full"||!d||d!==f?c+=o.move(f+"]"):l==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function $P(){return"!"}Tk.peek=qP;function Tk(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 u=i.unsafe[h],o=i.compilePattern(u);let c;if(u.atBreak)for(;c=o.exec(s);){let d=c.index;s.charCodeAt(d)===10&&s.charCodeAt(d-1)===13&&d--,s=s.slice(0,d)+" "+s.slice(c.index+1)}}return l+s+l}function qP(){return"`"}function Rk(e,n){const i=jg(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))}Dk.peek=VP;function Dk(e,n,i,s){const l=Ug(i),h=l==='"'?"Quote":"Apostrophe",u=i.createTracker(s);let o,c;if(Rk(e,i)){const g=i.stack;i.stack=[],o=i.enter("autolink");let f=u.move("<");return f+=u.move(i.containerPhrasing(e,{before:f,after:">",...u.current()})),f+=u.move(">"),o(),i.stack=g,f}o=i.enter("link"),c=i.enter("label");let d=u.move("[");return d+=u.move(i.containerPhrasing(e,{before:d,after:"](",...u.current()})),d+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=i.enter("destinationLiteral"),d+=u.move("<"),d+=u.move(i.safe(e.url,{before:d,after:">",...u.current()})),d+=u.move(">")):(c=i.enter("destinationRaw"),d+=u.move(i.safe(e.url,{before:d,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=i.enter(`title${h}`),d+=u.move(" "+l),d+=u.move(i.safe(e.title,{before:d,after:l,...u.current()})),d+=u.move(l),c()),d+=u.move(")"),o(),d}function VP(e,n,i){return Rk(e,i)?"<":"["}Nk.peek=GP;function Nk(e,n,i,s){const l=e.referenceType,h=i.enter("linkReference");let u=i.enter("label");const o=i.createTracker(s);let c=o.move("[");const d=i.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(d+"]["),u();const g=i.stack;i.stack=[],u=i.enter("reference");const f=i.safe(i.associationId(e),{before:c,after:"]",...o.current()});return u(),i.stack=g,h(),l==="full"||!d||d!==f?c+=o.move(f+"]"):l==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function GP(){return"["}function $g(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 WP(e){const n=$g(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 KP(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 Mk(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 YP(e,n,i,s){const l=i.enter("list"),h=i.bulletCurrent;let u=e.ordered?KP(i):$g(i);const o=e.ordered?u==="."?")":".":WP(i);let c=n&&i.bulletLastUsed?u===i.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.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),Mk(i)===u&&g){let f=-1;for(;++f<e.children.length;){const b=e.children[f];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(u=o),i.bulletCurrent=u;const d=i.containerFlow(e,s);return i.bulletLastUsed=u,i.bulletCurrent=h,l(),d}function XP(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 ZP(e,n,i,s){const l=XP(i);let h=i.bulletCurrent||$g(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 u=h.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const o=i.createTracker(s);o.move(h+" ".repeat(u-h.length)),o.shift(u);const c=i.enter("listItem"),d=i.indentLines(i.containerFlow(e,o.current()),g);return c(),d;function g(f,b,S){return b?(S?"":" ".repeat(u))+f:(S?h:h+" ".repeat(u-h.length))+f}}function QP(e,n,i,s){const l=i.enter("paragraph"),h=i.enter("phrasing"),u=i.containerPhrasing(e,s);return h(),l(),u}const JP=Wd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function e7(e,n,i,s){return(e.children.some(function(u){return JP(u)})?i.containerPhrasing:i.containerFlow).call(i,e,s)}function t7(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}jk.peek=n7;function jk(e,n,i,s){const l=t7(i),h=i.enter("strong"),u=i.createTracker(s),o=u.move(l+l);let c=u.move(i.containerPhrasing(e,{after:l,before:o,...u.current()}));const d=c.charCodeAt(0),g=id(s.before.charCodeAt(s.before.length-1),d,l);g.inside&&(c=jl(d)+c.slice(1));const f=c.charCodeAt(c.length-1),b=id(s.after.charCodeAt(0),f,l);b.inside&&(c=c.slice(0,-1)+jl(f));const S=u.move(l+l);return h(),i.attentionEncodeSurroundingInfo={after:b.outside,before:g.outside},o+c+S}function n7(e,n,i){return i.options.strong||"*"}function r7(e,n,i,s){return i.safe(e.value,s)}function i7(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 s7(e,n,i){const s=(Mk(i)+(i.options.ruleSpaces?" ":"")).repeat(i7(i));return i.options.ruleSpaces?s.slice(0,-1):s}const Ok={blockquote:TP,break:wx,code:OP,definition:IP,emphasis:Ck,hardBreak:wx,heading:FP,html:kk,image:Ek,imageReference:Ak,inlineCode:Tk,link:Dk,linkReference:Nk,list:YP,listItem:ZP,paragraph:QP,root:e7,strong:jk,text:r7,thematicBreak:s7};function a7(){return{enter:{table:o7,tableData:Cx,tableHeader:Cx,tableRow:c7},exit:{codeText:u7,table:l7,tableData:Wp,tableHeader:Wp,tableRow:Wp}}}function o7(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 l7(e){this.exit(e),this.data.inTable=void 0}function c7(e){this.enter({type:"tableRow",children:[]},e)}function Wp(e){this.exit(e)}function Cx(e){this.enter({type:"tableCell",children:[]},e)}function u7(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,d7));const i=this.stack[this.stack.length-1];i.type,i.value=n,this.exit(e)}function d7(e,n){return n==="|"?n:e}function h7(e){const n=e||{},i=n.tableCellPadding,s=n.tablePipeAlign,l=n.stringLength,h=i?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
523
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:c,tableRow:o}};function u(S,k,w,_){return d(g(S,w,_),S.align)}function o(S,k,w,_){const y=f(S,w,_),v=d([y]);return v.slice(0,v.indexOf(`
524
- `))}function c(S,k,w,_){const y=w.enter("tableCell"),v=w.enter("phrasing"),x=w.containerPhrasing(S,{..._,before:h,after:h});return v(),y(),x}function d(S,k){return EP(S,{align:k,alignDelimiters:s,padding:i,stringLength:l})}function g(S,k,w){const _=S.children;let y=-1;const v=[],x=k.enter("table");for(;++y<_.length;)v[y]=f(_[y],k,w);return x(),v}function f(S,k,w){const _=S.children;let y=-1;const v=[],x=k.enter("tableRow");for(;++y<_.length;)v[y]=c(_[y],S,k,w);return x(),v}function b(S,k,w){let _=Ok.inlineCode(S,k,w);return w.stack.includes("tableCell")&&(_=_.replace(/\|/g,"\\$&")),_}}function f7(){return{exit:{taskListCheckValueChecked:kx,taskListCheckValueUnchecked:kx,paragraph:m7}}}function p7(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:g7}}}function kx(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function m7(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,u;for(;++h<l.length;){const o=l[h];if(o.type==="paragraph"){u=o;break}}u===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 g7(e,n,i,s){const l=e.children[0],h=typeof e.checked=="boolean"&&l&&l.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",o=i.createTracker(s);h&&o.move(u);let c=Ok.listItem(e,n,i,{...s,...o.current()});return h&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(g){return g+u}}function v7(){return[Y8(),gP(),bP(),a7(),f7()]}function _7(e){return{extensions:[X8(),vP(e),xP(),h7(e),p7()]}}const y7={tokenize:k7,partial:!0},Lk={tokenize:E7,partial:!0},Ik={tokenize:A7,partial:!0},Bk={tokenize:T7,partial:!0},b7={tokenize:R7,partial:!0},zk={name:"wwwAutolink",tokenize:w7,previous:Fk},Pk={name:"protocolAutolink",tokenize:C7,previous:Hk},ci={name:"emailAutolink",tokenize:S7,previous:Uk},Dr={};function x7(){return{text:Dr}}let ws=48;for(;ws<123;)Dr[ws]=ci,ws++,ws===58?ws=65:ws===91&&(ws=97);Dr[43]=ci;Dr[45]=ci;Dr[46]=ci;Dr[95]=ci;Dr[72]=[ci,Pk];Dr[104]=[ci,Pk];Dr[87]=[ci,zk];Dr[119]=[ci,zk];function S7(e,n,i){const s=this;let l,h;return u;function u(f){return!Tm(f)||!Uk.call(s,s.previous)||qg(s.events)?i(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return Tm(f)?(e.consume(f),o):f===64?(e.consume(f),c):i(f)}function c(f){return f===46?e.check(b7,g,d)(f):f===45||f===95||cn(f)?(h=!0,e.consume(f),c):g(f)}function d(f){return e.consume(f),l=!0,c}function g(f){return h&&l&&pn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(f)):i(f)}}function w7(e,n,i){const s=this;return l;function l(u){return u!==87&&u!==119||!Fk.call(s,s.previous)||qg(s.events)?i(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(y7,e.attempt(Lk,e.attempt(Ik,h),i),i)(u))}function h(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function C7(e,n,i){const s=this;let l="",h=!1;return u;function u(f){return(f===72||f===104)&&Hk.call(s,s.previous)&&!qg(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(f),e.consume(f),o):i(f)}function o(f){if(pn(f)&&l.length<5)return l+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(f),c}return i(f)}function c(f){return f===47?(e.consume(f),h?d:(h=!0,c)):i(f)}function d(f){return f===null||td(f)||xt(f)||Ns(f)||qd(f)?i(f):e.attempt(Lk,e.attempt(Ik,g),i)(f)}function g(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(f)}}function k7(e,n,i){let s=0;return l;function l(u){return(u===87||u===119)&&s<3?(s++,e.consume(u),l):u===46&&s===3?(e.consume(u),h):i(u)}function h(u){return u===null?i(u):n(u)}}function E7(e,n,i){let s,l,h;return u;function u(d){return d===46||d===95?e.check(Bk,c,o)(d):d===null||xt(d)||Ns(d)||d!==45&&qd(d)?c(d):(h=!0,e.consume(d),u)}function o(d){return d===95?s=!0:(l=s,s=void 0),e.consume(d),u}function c(d){return l||s||!h?i(d):n(d)}}function A7(e,n){let i=0,s=0;return l;function l(u){return u===40?(i++,e.consume(u),l):u===41&&s<i?h(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Bk,n,h)(u):u===null||xt(u)||Ns(u)?n(u):(e.consume(u),l)}function h(u){return u===41&&s++,e.consume(u),l}}function T7(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||xt(o)||Ns(o)?n(o):i(o)}function l(o){return o===null||o===40||o===91||xt(o)||Ns(o)?n(o):s(o)}function h(o){return pn(o)?u(o):i(o)}function u(o){return o===59?(e.consume(o),s):pn(o)?(e.consume(o),u):i(o)}}function R7(e,n,i){return s;function s(h){return e.consume(h),l}function l(h){return cn(h)?i(h):n(h)}}function Fk(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function Hk(e){return!pn(e)}function Uk(e){return!(e===47||Tm(e))}function Tm(e){return e===43||e===45||e===46||e===95||cn(e)}function qg(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 D7={tokenize:z7,partial:!0};function N7(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:L7,continuation:{tokenize:I7},exit:B7}},text:{91:{name:"gfmFootnoteCall",tokenize:O7},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:M7,resolveTo:j7}}}}function M7(e,n,i){const s=this;let l=s.events.length;const h=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u;for(;l--;){const c=s.events[l][1];if(c.type==="labelImage"){u=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(!u||!u._balanced)return i(c);const d=dr(s.sliceSerialize({start:u.end,end:s.now()}));return d.codePointAt(0)!==94||!h.includes(d.slice(1))?i(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function j7(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)},u={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",u,n],["exit",u,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 O7(e,n,i){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let h=0,u;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",d)}function d(f){if(h>999||f===93&&!u||f===null||f===91||xt(f))return i(f);if(f===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(dr(s.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):i(f)}return xt(f)||(u=!0),h++,e.consume(f),f===92?g:d}function g(f){return f===91||f===92||f===93?(e.consume(f),h++,d):d(f)}}function L7(e,n,i){const s=this,l=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let h,u=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"),d}function d(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):i(k)}function g(k){if(u>999||k===93&&!o||k===null||k===91||xt(k))return i(k);if(k===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return h=dr(s.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return xt(k)||(o=!0),u++,e.consume(k),k===92?f:g}function f(k){return k===91||k===92||k===93?(e.consume(k),u++,g):g(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),l.includes(h)||l.push(h),it(e,S,"gfmFootnoteDefinitionWhitespace")):i(k)}function S(k){return n(k)}}function I7(e,n,i){return e.check(Jl,n,e.attempt(D7,n,i))}function B7(e){e.exit("gfmFootnoteDefinition")}function z7(e,n,i){const s=this;return it(e,l,"gfmFootnoteDefinitionIndent",5);function l(h){const u=s.events[s.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(h):i(h)}}function P7(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(u,o){let c=-1;for(;++c<u.length;)if(u[c][0]==="enter"&&u[c][1].type==="strikethroughSequenceTemporary"&&u[c][1]._close){let d=c;for(;d--;)if(u[d][0]==="exit"&&u[d][1].type==="strikethroughSequenceTemporary"&&u[d][1]._open&&u[c][1].end.offset-u[c][1].start.offset===u[d][1].end.offset-u[d][1].start.offset){u[c][1].type="strikethroughSequence",u[d][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[d][1].start),end:Object.assign({},u[c][1].end)},f={type:"strikethroughText",start:Object.assign({},u[d][1].end),end:Object.assign({},u[c][1].start)},b=[["enter",g,o],["enter",u[d][1],o],["exit",u[d][1],o],["enter",f,o]],S=o.parser.constructs.insideSpan.null;S&&Hn(b,b.length,0,Vd(S,u.slice(d+1,c),o)),Hn(b,b.length,0,[["exit",f,o],["enter",u[c][1],o],["exit",u[c][1],o],["exit",g,o]]),Hn(u,d-1,c-d+3,b),c=d+b.length-2;break}}for(c=-1;++c<u.length;)u[c][1].type==="strikethroughSequenceTemporary"&&(u[c][1].type="data");return u}function h(u,o,c){const d=this.previous,g=this.events;let f=0;return b;function b(k){return d===126&&g[g.length-1][1].type!=="characterEscape"?c(k):(u.enter("strikethroughSequenceTemporary"),S(k))}function S(k){const w=Ka(d);if(k===126)return f>1?c(k):(u.consume(k),f++,S);if(f<2&&!i)return c(k);const _=u.exit("strikethroughSequenceTemporary"),y=Ka(k);return _._open=!y||y===2&&!!w,_._close=!w||w===2&&!!y,o(k)}}}class F7{constructor(){this.map=[]}add(n,i,s){H7(this,n,i,s)}consume(n){if(this.map.sort(function(h,u){return h[0]-u[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 H7(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 U7(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 $7(){return{flow:{null:{name:"table",tokenize:q7,resolveAll:V7}}}}function q7(e,n,i){const s=this;let l=0,h=0,u;return o;function o(P){let $=s.events.length-1;for(;$>-1;){const Y=s.events[$][1].type;if(Y==="lineEnding"||Y==="linePrefix")$--;else break}const U=$>-1?s.events[$][1].type:null,q=U==="tableHead"||U==="tableRow"?R:c;return q===R&&s.parser.lazy[s.now().line]?i(P):q(P)}function c(P){return e.enter("tableHead"),e.enter("tableRow"),d(P)}function d(P){return P===124||(u=!0,h+=1),g(P)}function g(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)?it(e,g,"whitespace")(P):(h+=1,u&&(u=!1,l+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),f(P)))}function f(P){return P===null||P===124||xt(P)?(e.exit("data"),g(P)):(e.consume(P),P===92?b:f)}function b(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"),u=!1,Je(P)?it(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?(u=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),w):N(P)}function w(P){return Je(P)?it(e,_,"whitespace")(P):_(P)}function _(P){return P===58?(h+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),y):P===45?(h+=1,y(P)):P===null||Be(P)?E(P):N(P)}function y(P){return P===45?(e.enter("tableDelimiterFiller"),v(P)):N(P)}function v(P){return P===45?(e.consume(P),v):P===58?(u=!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)?it(e,E,"whitespace")(P):E(P)}function E(P){return P===124?k(P):P===null||Be(P)?!u||l!==h?N(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(P)):N(P)}function N(P){return i(P)}function R(P){return e.enter("tableRow"),M(P)}function M(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),M):P===null||Be(P)?(e.exit("tableRow"),n(P)):Je(P)?it(e,M,"whitespace")(P):(e.enter("data"),D(P))}function D(P){return P===null||P===124||xt(P)?(e.exit("data"),M(P)):(e.consume(P),P===92?O:D)}function O(P){return P===92||P===124?(e.consume(P),D):D(P)}}function V7(e,n){let i=-1,s=!0,l=0,h=[0,0,0,0],u=[0,0,0,0],o=!1,c=0,d,g,f;const b=new F7;for(;++i<e.length;){const S=e[i],k=S[1];S[0]==="enter"?k.type==="tableHead"?(o=!1,c!==0&&(Ex(b,n,c,d,g),g=void 0,c=0),d={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(i,0,[["enter",d,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(s=!0,f=void 0,h=[0,0,0,0],u=[0,i+1,0,0],o&&(o=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(i,0,[["enter",g,n]])),l=k.type==="tableDelimiterRow"?2:g?3:1):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(s=!1,u[2]===0&&(h[1]!==0&&(u[0]=u[1],f=Du(b,n,h,l,void 0,f),h=[0,0,0,0]),u[2]=i)):k.type==="tableCellDivider"&&(s?s=!1:(h[1]!==0&&(u[0]=u[1],f=Du(b,n,h,l,void 0,f)),h=u,u=[h[1],i,0,0])):k.type==="tableHead"?(o=!0,c=i):k.type==="tableRow"||k.type==="tableDelimiterRow"?(c=i,h[1]!==0?(u[0]=u[1],f=Du(b,n,h,l,i,f)):u[1]!==0&&(f=Du(b,n,u,l,i,f)),l=0):l&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=i)}for(c!==0&&Ex(b,n,c,d,g),b.consume(n.events),i=-1;++i<n.events.length;){const S=n.events[i];S[0]==="enter"&&S[1].type==="table"&&(S[1]._align=U7(n.events,i))}return e}function Du(e,n,i,s,l,h){const u=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",o="tableContent";i[0]!==0&&(h.end=Object.assign({},Ra(n.events,i[0])),e.add(i[0],0,[["exit",h,n]]));const c=Ra(n.events,i[1]);if(h={type:u,start:Object.assign({},c),end:Object.assign({},c)},e.add(i[1],0,[["enter",h,n]]),i[2]!==0){const d=Ra(n.events,i[2]),g=Ra(n.events,i[3]),f={type:o,start:Object.assign({},d),end:Object.assign({},g)};if(e.add(i[2],0,[["enter",f,n]]),s!==2){const b=n.events[i[2]],S=n.events[i[3]];if(b[1].end=Object.assign({},S[1].end),b[1].type="chunkText",b[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({},Ra(n.events,l)),e.add(l,0,[["exit",h,n]]),h=void 0),h}function Ex(e,n,i,s,l){const h=[],u=Ra(n.events,i);l&&(l.end=Object.assign({},u),h.push(["exit",l,n])),s.end=Object.assign({},u),h.push(["exit",s,n]),e.add(i+1,0,h)}function Ra(e,n){const i=e[n],s=i[0]==="enter"?"start":"end";return i[1][s]}const G7={name:"tasklistCheck",tokenize:K7};function W7(){return{text:{91:G7}}}function K7(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 xt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),u):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),u):i(c)}function u(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:Y7},n,i)(c):i(c)}}function Y7(e,n,i){return it(e,s,"whitespace");function s(l){return l===null?i(l):n(l)}}function X7(e){return JC([x7(),N7(),P7(e),$7(),W7()])}const Z7={};function Q7(e){const n=this,i=e||Z7,s=n.data(),l=s.micromarkExtensions||(s.micromarkExtensions=[]),h=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),u=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);l.push(X7(i)),h.push(v7()),u.push(_7(i))}function J7({children:e,className:n,inverted:i=!1}){return m.jsx("div",{className:_e("visualization-container markdown-render overflow-x-auto wrap-break-words break",n),children:m.jsx(P8,{remarkPlugins:[Q7],components:{code({className:s,children:l,...h}){const u=/language-(\w+)/.exec(s||""),o=u?u[1]:"",c=!o,d=Array.isArray(l)?l.join(""):String(l);return!c&&o?m.jsx("div",{className:"w-full max-w-full overflow-x-auto my-2 min-w-0",children:m.jsx(Eg,{theme:i?Nl.nightOwl:Nl.oneDark,code:d.trim(),language:o,children:({className:g,style:f,tokens:b,getLineProps:S,getTokenProps:k})=>m.jsx("pre",{className:_e("rounded-lg text-sm p-3",g),style:f,children:b.map((w,_)=>m.jsx("div",{...S({line:w}),children:w.map((y,v)=>m.jsx("span",{...k({token:y})},v))},_))})})}):m.jsx("code",{className:_e("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 m.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:_e("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 m.jsx("p",{className:"last:mb-0 leading-relaxed wrap-break-words",children:s})},ul({children:s}){return m.jsx("ul",{className:"list-outside list-disc pl-8",children:s})},ol({children:s}){return m.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 m.jsx("li",{className:_e("leading-snug",h&&"ml-8"),children:s})},h1({children:s}){return m.jsx("h1",{className:"text-lg font-semibold mb-1.5 mt-3 first:mt-0",children:s})},h2({children:s}){return m.jsx("h2",{className:"text-base font-semibold mb-1.5 mt-2.5 first:mt-0",children:s})},h3({children:s}){return m.jsx("h3",{className:"text-sm font-semibold mb-1 mt-2 first:mt-0",children:s})},blockquote({children:s}){return m.jsx("blockquote",{className:_e("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 m.jsx("strong",{className:_e("font-semibold",i&&"text-primary-foreground"),children:s})},em({children:s}){return m.jsx("em",{className:"italic",children:s})},hr(){return m.jsx("hr",{className:_e("my-3",i?"border-primary-foreground/30":"border-border")})},table({children:s}){return m.jsx("div",{className:"my-2 overflow-x-auto max-w-full",children:m.jsx("table",{className:"w-full border-collapse text-sm",children:s})})},th({children:s}){return m.jsx("th",{className:_e("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 m.jsx("td",{className:_e("border px-2 py-1.5",i?"border-primary-foreground/20":"border-border"),children:s})}},children:e})})}function Ax(e){return e.filter(n=>n.type==="text").map(n=>n.text).join("")}function e9(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 t9(e,n){const i=e.map(u=>({message:u.message,parts:u.parts,isQueued:!1})),s=n.map(u=>({message:{id:u.id,role:"user",sessionId:u.sessionId,createdAt:u.createdAt},parts:[{id:`${u.id}-part`,messageId:u.id,createdAt:u.createdAt,type:"text",text:u.content}],isQueued:!0,queueId:u.id})),l=[...i].sort((u,o)=>u.message.createdAt-o.message.createdAt),h=[...s].sort((u,o)=>u.message.createdAt-o.message.createdAt);return[...l,...h]}function n9(){return m.jsxs("div",{className:"mx-4 mt-4 flex items-center gap-2 text-sm text-muted-foreground bg-muted/50 rounded-lg px-3 py-2 border border-border",children:[m.jsx(Fx,{className:"size-4 animate-pulse"}),m.jsx("span",{children:"Compacting conversation..."})]})}function r9(){return m.jsxs("div",{className:"mx-4 mt-4 flex items-center gap-2 text-sm text-green-600 dark:text-green-400 bg-green-500/10 rounded-lg px-3 py-2 border border-green-500/20",children:[m.jsx(DA,{className:"size-4"}),m.jsx("span",{children:"Compaction complete"})]})}function i9({message:e,textContent:n,onRetry:i}){return m.jsxs("div",{className:"flex flex-col gap-1 mb-4 animate-slide-up min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-1.5 text-xs uppercase tracking-wide text-destructive ml-3",children:[m.jsx(Qp,{className:"size-3"}),"Compaction Failed"]}),m.jsxs("div",{className:"rounded-2xl px-4 py-3 max-w-full bg-destructive/10 border border-destructive/30 rounded-bl-md",children:[m.jsx("p",{className:"text-sm text-destructive/90",children:n||e.error||"Compaction failed. The conversation could not be summarized."}),i&&m.jsxs(ke,{variant:"outline",size:"sm",onClick:i,className:"mt-2 h-7 text-xs gap-1.5",children:[m.jsx(Hx,{className:"size-3"}),"Retry"]})]})]})}function s9({part:e}){const[n,i]=T.useState(!1),s=e.overflow?"overflow":e.auto?"auto":"manual";return m.jsxs("div",{className:"flex flex-col items-center my-4",children:[m.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?m.jsx(Ya,{className:"size-3"}):m.jsx(ri,{className:"size-3"}),m.jsxs("span",{className:"border-b border-dashed border-muted-foreground/40 pb-px",children:[s==="overflow"?"Context overflow":s==="auto"?"Auto":"Manual"," compaction"]})]}),n&&m.jsx("div",{className:"mt-2 text-xs text-muted-foreground italic",children:"Summary available in the assistant message below"})]})}function a9({parts:e,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s,inverted:l=!1}){const h=[...e].sort((u,o)=>u.createdAt-o.createdAt);return m.jsx(m.Fragment,{children:h.map(u=>{switch(u.type){case"text":return m.jsx("div",{className:"min-w-0",children:m.jsx(J7,{inverted:l,children:u.text||"..."})},u.id);case"reasoning":return m.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:u.text},u.id);case"tool":return m.jsx(w6,{part:u,pendingPermissions:n,onPermissionResponse:i,onNavigateToSubagent:s},u.id);case"image":return m.jsx("img",{src:u.url,alt:"",className:"max-w-full rounded-lg mt-2"},u.id);case"file":return m.jsx("div",{className:"mt-2 p-2 bg-muted rounded text-sm",children:u.filename||"unnamed"},u.id);default:return null}})})}function o9({session:e,messagesWithParts:n,queuedMessages:i,preconfigs:s,prompts:l,models:h,connectedProviderIds:u,connectableProviderIds:o,defaultModel:c,onSendMessage:d,onRemoveFromQueue:g,onChangePreconfig:f,onChangeModel:b,onChangeVariant:S,pendingPermissions:k,onPermissionResponse:w,onRename:_,usage:y,modelName:v,onNavigateToSubagent:x,onNavigateBack:E,isStreaming:N,onInterrupt:R,onRevert:M,onFork:D,onCompact:O,isCompacting:P,compactionSuccess:$,onClearCompactionSuccess:U,serverUrl:q,apiToken:Y,selectedVariant:K,variants:V}){const ne=!e.parentId&&e.status==="active";T.useEffect(()=>{if($){const X=setTimeout(()=>{U==null||U()},3e3);return()=>clearTimeout(X)}},[$,U]);const F=T.useRef(null),[j,I]=T.useState(!0),L=150,z=t9(n,i);T.useEffect(()=>{I(!0),F.current&&(F.current.scrollTop=F.current.scrollHeight)},[e.id]),T.useEffect(()=>{F.current&&j&&(F.current.scrollTop=F.current.scrollHeight)},[n,j]),T.useEffect(()=>{const X=F.current;if(!X)return;const ee=()=>{const{scrollHeight:W,scrollTop:H,clientHeight:te}=X,ae=W-H-te;I(ae<L)};return X.addEventListener("scroll",ee,{passive:!0}),()=>X.removeEventListener("scroll",ee)},[]);const Z=k.filter(X=>!n.some(ee=>ee.parts.some(W=>W.type==="tool"&&W.callId===X.toolCallId)));return m.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[m.jsx(rL,{session:e,preconfigs:s,models:h,defaultModel:c,usage:y,modelName:v,onChangePreconfig:f,onChangeModel:b,onChangeVariant:S,onRename:_,onNavigateBack:E,isStreaming:N,onInterrupt:R,onCompact:O,isCompacting:P,canCompact:n.length>=4,connectedProviderIds:u,connectableProviderIds:o,selectedVariant:K,variants:V}),P&&m.jsx(n9,{}),$&&m.jsx(r9,{}),e.status==="closed"&&m.jsx(Bu,{className:"mx-4 mt-4",children:m.jsx(zu,{children:"This session is archived. You can reopen it from the sidebar."})}),m.jsx(lo,{className:"flex-1 min-h-0",ref:F,children:m.jsxs("div",{className:"p-4",children:[z.length===0?m.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[m.jsx("p",{className:"text-lg mb-2",children:"Start a conversation"}),m.jsx("p",{className:"text-sm",children:"Send a message below to begin."})]}):z.map(X=>{const ee=X.parts.find(ae=>ae.type==="compaction");if(UO(X.message)&&X.message.mode==="compact_failed")return m.jsx(i9,{message:X.message,textContent:Ax(X.parts),onRetry:ne&&!P?O:void 0},X.message.id);if(ee)return m.jsx(s9,{part:ee},X.message.id);const H=!X.isQueued&&X.message.role==="user",te=H?e9(X.message.id,n):null;return m.jsx(iL,{message:X.message,textContent:Ax(X.parts),isQueued:X.isQueued,onRemove:X.isQueued?()=>g(X.queueId):void 0,canRevert:H&&te!==null,onRevert:te?()=>M==null?void 0:M(e.id,te):void 0,canFork:H&&te!==null,onFork:te?()=>D==null?void 0:D(e.id,X.message.id):void 0,children:X.parts.length===0?m.jsx("span",{className:"opacity-50",children:"..."}):m.jsx(a9,{parts:X.parts,pendingPermissions:k,onPermissionResponse:w,onNavigateToSubagent:x,inverted:X.message.role==="user"})},X.message.id)}),Z.length>0&&m.jsx("div",{className:"mt-4 flex flex-col gap-2",children:Z.map(X=>m.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-lg",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[m.jsx("span",{className:"text-sm font-medium",children:X.toolName}),m.jsx("span",{className:"text-xs text-muted-foreground",children:X.permissionType})]}),m.jsx("p",{className:"text-sm mb-3",children:X.message}),m.jsxs("div",{className:"flex justify-end gap-2",children:[m.jsx(ke,{variant:"outline",size:"sm",onClick:()=>w(X.toolCallId,!1,!1),children:"Deny"}),m.jsx(ke,{size:"sm",onClick:()=>w(X.toolCallId,!0,!1),children:"Approve"})]})]},X.toolCallId))})]})}),e.status==="active"&&!e.parentId&&m.jsx(T6,{onSendMessage:d,disabled:P,workspaceId:e.workspaceId,serverUrl:q,apiToken:Y,prompts:l}),e.parentId&&m.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:[m.jsx(lT,{className:"size-4"}),"This is a subagent session (read-only)"]})]})}function l9({className:e,orientation:n="horizontal",...i}){return m.jsx(n5,{"data-slot":"tabs","data-orientation":n,className:_e("group/tabs flex gap-2 data-horizontal:flex-col",e),...i})}const c9=Qa("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 u9({className:e,variant:n="default",...i}){return m.jsx(r5,{"data-slot":"tabs-list","data-variant":n,className:_e(c9({variant:n}),e),...i})}function Nu({className:e,...n}){return m.jsx(i5,{"data-slot":"tabs-trigger",className:_e("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 Mu({className:e,...n}){return m.jsx(s5,{"data-slot":"tabs-content",className:_e("flex-1 text-sm outline-none",e),...n})}function Tx(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function Rx({permission:e,onRevoke:n}){const i=!!e.revokedAt;return m.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border last:border-0",children:[m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[m.jsxs(ln,{variant:i?"outline":"secondary",children:[m.jsx($x,{className:"size-3","data-icon":"inline-start"}),e.permissionType]}),i&&m.jsx(ln,{variant:"outline",className:"text-muted-foreground",children:"Revoked"})]}),m.jsx("p",{className:"text-sm font-mono truncate text-muted-foreground",children:e.permissionKey}),m.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Granted ",Tx(e.grantedAt),e.revokedAt&&` • Revoked ${Tx(e.revokedAt)}`]})]}),!i&&m.jsx(ke,{variant:"ghost",size:"icon",onClick:()=>n(e.id),className:"size-8 text-destructive hover:text-destructive",children:m.jsx(Ll,{className:"size-4"})})]})}function d9({open:e,onOpenChange:n,title:i,description:s,confirmLabel:l="Confirm",cancelLabel:h="Cancel",variant:u="default",onConfirm:o,onCancel:c}){const d=()=>{c==null||c(),n(!1)},g=()=>{o(),n(!1)};return m.jsx(io,{open:e,onOpenChange:n,children:m.jsxs(so,{className:"sm:max-w-[425px]",children:[m.jsxs(ao,{children:[m.jsx(oo,{children:i}),m.jsx(Yl,{children:s})]}),m.jsxs(Od,{children:[m.jsx(ke,{variant:"outline",onClick:d,children:h}),m.jsx(ke,{variant:u==="destructive"?"destructive":"default",onClick:g,children:l})]})]})})}function h9({provider:e,onConnect:n,onDisconnect:i}){const[s,l]=T.useState(!1);T.useEffect(()=>{(e.error||e.connected)&&l(!1)},[e.error,e.connected]),T.useEffect(()=>{e.authorizationUrl&&l(!1)},[e.authorizationUrl]);const h=()=>{l(!0),n()},u=()=>{i()};return m.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-border p-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("div",{className:`size-2 rounded-full ${e.connected?"bg-green-500":"bg-muted-foreground"}`}),m.jsx("span",{className:"text-sm font-medium",children:e.displayName||e.provider})]}),e.connected&&m.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"})]}),e.error&&m.jsx("p",{className:"text-xs text-destructive",children:e.error}),e.connected&&e.connectedAt&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["Connected ",new Date(e.connectedAt).toLocaleDateString()]}),m.jsxs("div",{className:"flex gap-2",children:[!e.connected&&!e.authorizationUrl&&m.jsxs(ke,{size:"sm",onClick:h,disabled:s,children:[s?m.jsx(Pn,{className:"size-3 animate-spin","data-icon":"inline-start"}):null,"Connect"]}),!e.connected&&e.authorizationUrl&&m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("a",{href:e.authorizationUrl,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs text-blue-500 underline break-all",children:e.authorizationUrl}),m.jsxs(ke,{variant:"outline",size:"sm",onClick:async()=>{try{await navigator.clipboard.writeText(e.authorizationUrl)}catch{}},children:[m.jsx(Cl,{className:"size-3","data-icon":"inline-start"}),"Copy URL"]})]}),e.connected&&m.jsxs(ke,{variant:"destructive",size:"sm",onClick:u,children:[m.jsx(qT,{className:"size-3","data-icon":"inline-start"}),"Disconnect"]})]})]})}function f9({token:e,onLogout:n}){return m.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-muted",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[m.jsx("span",{className:"text-muted-foreground",children:"Token:"}),m.jsx("code",{className:"font-mono text-foreground bg-background px-1.5 py-0.5 rounded text-[10px]",children:aR(e)})]}),m.jsx(ke,{variant:"destructive",size:"sm",onClick:n,title:"Disconnect and clear token",children:"Logout"})]})}function p9({open:e,onOpenChange:n,permissions:i,onRefreshPermissions:s,onRevokePermission:l,onRevokeAllPermissions:h,apiToken:u,onLogout:o,providerStatuses:c,onConnectProvider:d,onDisconnectProvider:g}){const{theme:f,setTheme:b}=rA(),[S,k]=T.useState(!1),w=i.filter(y=>!y.revokedAt),_=i.filter(y=>y.revokedAt);return m.jsxs(io,{open:e,onOpenChange:n,children:[m.jsxs(so,{className:"sm:max-w-[500px] max-h-[80vh]",children:[m.jsxs(ao,{children:[m.jsx(oo,{children:"Settings"}),m.jsx(Yl,{children:"Manage your preferences and permissions"})]}),m.jsxs(l9,{defaultValue:"account",className:"mt-4",children:[m.jsxs(u9,{className:"grid w-full grid-cols-4",children:[m.jsxs(Nu,{value:"account",children:[m.jsx(Vx,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Account"})]}),m.jsxs(Nu,{value:"appearance",children:[m.jsx(vT,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Appearance"})]}),m.jsxs(Nu,{value:"permissions",children:[m.jsx($x,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Permissions"}),w.length>0&&m.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex size-3.5 items-center justify-center rounded-full bg-primary text-[8px] font-bold leading-none text-primary-foreground sm:static sm:flex sm:size-auto sm:ml-1.5 sm:px-1.5 sm:py-0.5 sm:text-xs sm:font-medium sm:leading-normal",children:w.length})]}),m.jsxs(Nu,{value:"providers",children:[m.jsx(sT,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Providers"})]})]}),m.jsx(Mu,{value:"account",className:"mt-4",children:m.jsx("div",{className:"flex flex-col gap-4",children:m.jsxs("div",{children:[m.jsx(ti,{className:"text-sm font-medium",children:"Session"}),m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Manage your current session"}),u?m.jsx(f9,{token:u,onLogout:o}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No active session"})]})})}),m.jsx(Mu,{value:"appearance",className:"mt-4",children:m.jsx("div",{className:"flex flex-col gap-4",children:m.jsxs("div",{children:[m.jsx(ti,{className:"text-sm font-medium",children:"Theme"}),m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose your preferred color scheme"}),m.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[m.jsxs(ke,{variant:f==="light"?"default":"outline",className:"justify-start",onClick:()=>b("light"),children:[m.jsx(BT,{className:"size-4","data-icon":"inline-start"}),"Light"]}),m.jsxs(ke,{variant:f==="dark"?"default":"outline",className:"justify-start",onClick:()=>b("dark"),children:[m.jsx(mT,{className:"size-4","data-icon":"inline-start"}),"Dark"]}),m.jsxs(ke,{variant:f==="system"?"default":"outline",className:"justify-start",onClick:()=>b("system"),children:[m.jsx(fT,{className:"size-4","data-icon":"inline-start"}),"System"]})]})]})})}),m.jsx(Mu,{value:"permissions",className:"mt-4",children:m.jsxs("div",{className:"flex flex-col gap-4",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("div",{children:[m.jsx(ti,{className:"text-sm font-medium",children:"Always-allowed Operations"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Tools you've approved to run without asking"})]}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(ke,{variant:"outline",size:"icon",onClick:s,className:"size-8",children:m.jsx(Na,{className:"size-4"})}),w.length>0&&m.jsxs(ke,{variant:"destructive",size:"sm",onClick:()=>k(!0),children:[m.jsx(Ll,{className:"size-4","data-icon":"inline-start"}),"Revoke All"]})]})]}),m.jsx(gl,{}),m.jsxs(lo,{className:"h-[300px]",children:[w.length===0&&_.length===0&&m.jsxs("div",{className:"text-center py-8 text-muted-foreground text-sm",children:["No permissions granted yet.",m.jsx("br",{}),'Approve tool requests with "Always allow" to add them here.']}),w.length>0&&m.jsxs("div",{className:"mb-4",children:[m.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Active (",w.length,")"]}),w.map(y=>m.jsx(Rx,{permission:y,onRevoke:l},y.id))]}),_.length>0&&m.jsxs("div",{children:[m.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Revoked (",_.length,")"]}),_.map(y=>m.jsx(Rx,{permission:y,onRevoke:l},y.id))]})]})]})}),m.jsx(Mu,{value:"providers",className:"mt-4",children:m.jsx("div",{className:"flex flex-col gap-4",children:m.jsxs("div",{children:[m.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Connect subscription-based providers to use models without API keys."}),m.jsx("div",{className:"flex flex-col gap-3",children:c.map(y=>m.jsx(h9,{provider:y,onConnect:()=>d(y.provider),onDisconnect:()=>g(y.provider)},y.provider))})]})})})]})]}),m.jsx(d9,{open:S,onOpenChange:k,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(),k(!1)}})]})}function m9({status:e}){switch(e.status){case"connected":return m.jsxs(ln,{variant:"default",className:"bg-green-600",children:[m.jsx(Ol,{className:"size-3 mr-1"}),"Connected"]});case"disabled":return m.jsxs(ln,{variant:"secondary",children:[m.jsx(ad,{className:"size-3 mr-1"}),"Disabled"]});case"failed":return m.jsxs(ln,{variant:"destructive",children:[m.jsx(vl,{className:"size-3 mr-1"}),"Failed"]});case"needs_auth":return m.jsxs(ln,{variant:"outline",className:"border-yellow-500 text-yellow-600",children:[m.jsx(vl,{className:"size-3 mr-1"}),"Needs Auth"]});case"needs_client_registration":return m.jsxs(ln,{variant:"outline",className:"border-orange-500 text-orange-600",children:[m.jsx(vl,{className:"size-3 mr-1"}),"Needs Registration"]});default:return m.jsx(ln,{variant:"secondary",children:"Unknown"})}}function g9({open:e,onOpenChange:n,workspaceId:i,workspacePath:s,serverUrl:l,apiToken:h}){const{fetchWithAuth:u}=Kl(),[o,c]=T.useState({}),[d,g]=T.useState(!1),[f,b]=T.useState(null),[S,k]=T.useState(null),w=T.useCallback(async()=>{if(i){g(!0),k(null);try{const E=await u(`/api/workspaces/${i}/mcp/status`,{},{serverUrl:l,token:h});if(!E.ok)throw new Error("Failed to load MCP status");const N=await E.json();c(N.status||{})}catch(E){const N=E instanceof Error?E.message:"Unknown error";k(N)}finally{g(!1)}}},[i,u,l,h]);T.useEffect(()=>{e&&i&&w()},[e,i,w]);const _=async E=>{if(i){b(E);try{if(!(await u(`/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(N){const R=N instanceof Error?N.message:"Unknown error";k(R)}finally{b(null)}}},y=async E=>{if(i){b(E);try{if(!(await u(`/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(N){const R=N instanceof Error?N.message:"Unknown error";k(R)}finally{b(null)}}},v=async E=>{if(i){b(E);try{const N=await u(`/api/workspaces/${i}/mcp/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E})},{serverUrl:l,token:h});if(!N.ok)throw new Error("Failed to start auth");const R=await N.json();R.authorizationUrl&&window.open(R.authorizationUrl,"_blank"),await w()}catch(N){const R=N instanceof Error?N.message:"Unknown error";k(R)}finally{b(null)}}},x=Object.entries(o);return m.jsx(io,{open:e,onOpenChange:n,children:m.jsxs(so,{className:"sm:max-w-[600px] max-h-[80vh]",children:[m.jsxs(ao,{children:[m.jsxs(oo,{className:"flex items-center gap-2",children:[m.jsx(ks,{className:"size-5"}),"MCP Servers"]}),m.jsx(Yl,{children:"Manage Model Context Protocol servers for this workspace"})]}),m.jsxs("div",{className:"mt-4 space-y-4",children:[S&&m.jsxs(Bu,{variant:"destructive",children:[m.jsx(vl,{className:"size-4"}),m.jsx(zu,{children:S})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure servers in ",m.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})]}),m.jsx(ke,{variant:"outline",size:"sm",onClick:w,disabled:d,children:m.jsx(Na,{className:`size-4 ${d?"animate-spin":""}`})})]}),m.jsx(lo,{className:"h-[400px]",children:d&&x.length===0?m.jsx("div",{className:"flex items-center justify-center py-8",children:m.jsx(Pn,{className:"size-6 animate-spin text-muted-foreground"})}):x.length===0?m.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[m.jsx(ks,{className:"size-12 mx-auto mb-3 opacity-50"}),m.jsx("p",{className:"font-medium",children:"No MCP servers configured"}),m.jsxs("p",{className:"text-sm mt-1",children:["Create ",m.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})," in your workspace to add servers."]})]}):m.jsx("div",{className:"space-y-3",children:x.map(([E,{config:N,status:R}])=>{var M;return m.jsxs("div",{className:"border rounded-lg p-4",children:[m.jsxs("div",{className:"flex items-start justify-between",children:[m.jsxs("div",{className:"flex items-start gap-3",children:[m.jsx(ks,{className:"size-5 text-muted-foreground mt-0.5"}),m.jsxs("div",{children:[m.jsx("div",{className:"font-medium",children:E}),m.jsx("div",{className:"text-sm text-muted-foreground",children:(N==null?void 0:N.type)==="local"?m.jsxs("span",{children:["Local - ",((M=N.command)==null?void 0:M[0])||"command"]}):(N==null?void 0:N.type)==="remote"?m.jsxs("span",{className:"flex items-center gap-1",children:["Remote - ",N.url]}):"Unknown type"}),R.status==="failed"&&"error"in R&&m.jsx(Bu,{variant:"destructive",className:"mt-2 py-2",children:m.jsx(zu,{className:"text-xs",children:R.error})}),R.status==="needs_client_registration"&&"error"in R&&m.jsx(Bu,{className:"mt-2 py-2 border-orange-500",children:m.jsx(zu,{className:"text-xs",children:R.error})})]})]}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsx(m9,{status:R})})]}),m.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[R.status==="connected"&&m.jsxs(ke,{variant:"outline",size:"sm",onClick:()=>y(E),disabled:f===E,children:[f===E?m.jsx(Pn,{className:"size-4 animate-spin"}):m.jsx(xT,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Disconnect"})]}),(R.status==="disabled"||R.status==="failed")&&m.jsxs(ke,{variant:"outline",size:"sm",onClick:()=>_(E),disabled:f===E,children:[f===E?m.jsx(Pn,{className:"size-4 animate-spin"}):m.jsx(wT,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Connect"})]}),R.status==="needs_auth"&&m.jsxs(ke,{variant:"default",size:"sm",onClick:()=>v(E),disabled:f===E,children:[f===E?m.jsx(Pn,{className:"size-4 animate-spin"}):m.jsx(Xp,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Authenticate"})]})]})]},E)})})})]})]})})}function Dx({message:e="Connecting to server..."}){return m.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-muted-foreground",children:[m.jsx(Pn,{className:"size-8 animate-spin"}),m.jsx("p",{className:"text-sm",children:e})]})}const v9=({serverUrl:e,authError:n,retryCount:i,nextRetryIn:s,onRetry:l,onLogout:h})=>m.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] px-4 text-center",children:[m.jsx(Gx,{className:"size-12 text-destructive mb-4"}),m.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Unable to connect to server"}),m.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-[400px]",children:n||"Please check that the server is running."}),e&&m.jsx("p",{className:"text-xs text-muted-foreground mb-6 font-mono bg-muted px-3 py-1.5 rounded",children:e}),m.jsxs("div",{className:"flex flex-col items-center gap-4",children:[m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Retrying in ",s,"s..."]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs(ke,{onClick:l,variant:"default",children:[m.jsx(Na,{className:"size-4 mr-2","data-icon":"inline-start"}),"Retry Now"]}),m.jsx(ke,{onClick:h,variant:"ghost",children:"Change Server"})]}),i>0&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retry attempt: ",i]})]})]});function Nx({onServerAdded:e,error:n}){const[i,s]=T.useState(""),[l,h]=T.useState(""),[u,o]=T.useState(""),[c,d]=T.useState(!1),[g,f]=T.useState(null),b=S=>{S.preventDefault();const k=i.trim(),w=l.trim(),_=u.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(!Kx(_)){f("Invalid token format. Token should be 64 hex characters (0-9, a-f).");return}const y=Fu(w),v={id:crypto.randomUUID(),name:k,url:y,token:_,createdAt:new Date().toISOString()};e(v)};return m.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:m.jsx("div",{className:"w-full max-w-md",children:m.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[m.jsxs("div",{className:"px-6 pt-6 pb-4 text-center border-b border-border",children:[m.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Add your first server"}),m.jsx("p",{className:"text-muted-foreground mt-1",children:"Connect to a Jean2 server to get started"})]}),m.jsxs("form",{onSubmit:b,className:"p-6 space-y-4",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{htmlFor:"serverName",className:"text-sm font-medium text-foreground",children:"Server Name"}),m.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"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{htmlFor:"serverUrl",className:"text-sm font-medium text-foreground",children:"Server URL"}),m.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"})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsx("label",{htmlFor:"token",className:"text-sm font-medium text-foreground",children:"API Token"}),m.jsxs("div",{className:"relative",children:[m.jsx("input",{id:"token",type:c?"text":"password",value:u,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"}),m.jsx("button",{type:"button",onClick:()=>d(!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?m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.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"})}):m.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),m.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"})]})})]})]}),(g||n)&&m.jsx("div",{className:"px-3 py-2 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive text-sm",children:g||n}),m.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 Mx({onServerSwitch:e,onSelectWorkspace:n}){const[i,s]=T.useState(!1),l=T.useRef(!1),h=Zl(),{quickConnections:u,switchServer:o,removeFromQuickConnections:c,isSwitching:d}=Za(),g=S=>{o(S.serverId)&&(l.current=!0,e==null||e(),S.workspaceId&&n&&n(S.workspaceId))};T.useEffect(()=>{!d&&i&&l.current&&(s(!1),l.current=!1)},[d,i]);const f=(S,k)=>{S.stopPropagation(),c(k)},b=()=>m.jsx(vg,{children:m.jsx(_g,{className:"max-h-[50vh] overflow-y-auto",children:u.length>0?m.jsx(Rl,{heading:"Quick Switch",children:u.map(S=>m.jsxs(Oa,{onSelect:()=>g(S),className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(ks,{className:"size-4 text-muted-foreground"}),m.jsxs("span",{children:[S.serverName,S.workspaceName&&m.jsxs("span",{className:"text-muted-foreground",children:[" / ",S.workspaceName]})]})]}),m.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:m.jsx(Ll,{className:"size-3 text-destructive"})})]},S.id))}):m.jsx(yg,{className:"py-6",children:m.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[m.jsx(lp,{className:"size-8"}),m.jsx("p",{className:"text-sm font-medium",children:"No favorites yet"}),m.jsx("p",{className:"text-xs",children:"Star a workspace to add it here"})]})})})});return h?m.jsxs(zd,{open:i,onOpenChange:s,children:[m.jsx(eO,{asChild:!0,children:m.jsx(ke,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:m.jsx(lp,{className:"size-4"})})}),m.jsxs(Pd,{side:"bottom",className:"max-h-[80vh]",children:[m.jsx(Fd,{children:m.jsx(Hd,{children:"Quick Switch"})}),m.jsx("div",{className:"mt-4",children:b()})]})]}):m.jsxs(Id,{open:i,onOpenChange:s,children:[m.jsx(bg,{asChild:!0,children:m.jsx(ke,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:m.jsx(lp,{className:"size-4"})})}),m.jsx(Bd,{className:"w-[300px] p-0",align:"start",children:b()})]})}function jx({viewMode:e,onViewModeChange:n}){const i=T.useCallback(()=>{n(e==="overview"?"default":"overview")},[e,n]),s=e==="overview";return m.jsx(Dl,{children:m.jsxs(Ha,{children:[m.jsx(Ua,{asChild:!0,children:m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:i,children:s?m.jsx(rT,{className:"h-4 w-4"}):m.jsx(tT,{className:"h-4 w-4"})})}),m.jsx($a,{children:s?"Single workspace":"Overview"})]})})}function _9({open:e,onOpenChange:n,editServer:i}){const{addServer:s,editServer:l}=Za(),[h,u]=T.useState(""),[o,c]=T.useState(""),[d,g]=T.useState(""),[f,b]=T.useState(!1),[S,k]=T.useState(null),w=i!=null;T.useEffect(()=>{i?(u(i.name),c(i.url),g(i.token)):(u(""),c(""),g("")),k(null),b(!1)},[i,e]);const _=y=>{y.preventDefault(),k(null);const v=h.trim(),x=o.trim(),E=d.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(!Kx(E)){k("Token must be 64 hexadecimal characters");return}const N=Fu(x);w?l(i.id,{name:v,url:N,token:E}):s(v,N,E),n(!1)};return m.jsx(io,{open:e,onOpenChange:n,children:m.jsxs(so,{className:"sm:max-w-[425px]",children:[m.jsxs(ao,{children:[m.jsx(oo,{children:w?"Edit Server":"Add Server"}),m.jsx(Yl,{children:w?"Update server details":"Enter your server details"})]}),m.jsxs("form",{onSubmit:_,children:[m.jsxs("div",{className:"grid gap-4 py-4",children:[m.jsxs("div",{className:"grid gap-2",children:[m.jsx(ti,{htmlFor:"server-name",children:"Name"}),m.jsx(Iu,{id:"server-name",value:h,onChange:y=>u(y.target.value),placeholder:"My Server"})]}),m.jsxs("div",{className:"grid gap-2",children:[m.jsx(ti,{htmlFor:"server-url",children:"Server URL"}),m.jsx(Iu,{id:"server-url",value:o,onChange:y=>c(y.target.value),placeholder:"localhost:3000"})]}),m.jsxs("div",{className:"grid gap-2",children:[m.jsx(ti,{htmlFor:"server-token",children:"API Token"}),m.jsxs("div",{className:"relative",children:[m.jsx(Iu,{id:"server-token",type:f?"text":"password",value:d,onChange:y=>g(y.target.value),placeholder:"64-character hex string",className:"pr-10"}),m.jsx("button",{type:"button",onClick:()=>b(!f),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-transparent",children:f?m.jsx(UA,{className:"size-4 text-muted-foreground"}):m.jsx(qA,{className:"size-4 text-muted-foreground"})})]})]}),S&&m.jsx("p",{className:"text-sm text-destructive",children:S})]}),m.jsxs(Od,{children:[m.jsx(ke,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),m.jsx(ke,{type:"submit",children:w?"Save":"Add"})]})]})]})})}const y9=(e,n)=>e&&n?`ws://${n}/ws?token=${e}`:null,Kp=e=>e?`http://${e}/api`:null;function b9(){var vo,Vs,Or,_o;const{servers:e,activeServer:n,addServer:i,removeServer:s,isSwitching:l,clearSwitchingState:h,quickConnections:u}=Za(),[o,c]=T.useState([]),[d,g]=T.useState([]),[f,b]=T.useState([]),[S,k]=T.useState(null),[w,_]=T.useState({}),[y,v]=T.useState({}),[x,E]=T.useState(null),N=T.useRef(null),[R,M]=T.useState(!1),[D,O]=T.useState(null),[P,$]=T.useState({promptTokens:0,completionTokens:0,totalTokens:0}),[U,q]=T.useState("gpt-4o"),[Y,K]=T.useState(null),[V,J]=T.useState([]),[ne,F]=T.useState("gpt-4o");T.useEffect(()=>{var be;const Q=(be=V.find(Ve=>Ve.id===U))==null?void 0:be.variants;Y&&Q&&!Q[Y]&&K(null)},[U,Y,V]);const[j,I]=T.useState([]),[L,z]=T.useState(null),[Z,X]=T.useState(!1),[ee,W]=T.useState(!1),[H,te]=T.useState(!1),[ae,pe]=T.useState(!1),[ce,Oe]=T.useState(()=>localStorage.getItem("jean2_sidebar_view")||"default"),[Ie,Ue]=T.useState([]),[ut,Ne]=T.useState([]),[gn,Gt]=T.useState({}),[sn,Wt]=T.useState([]),[$n,Mt]=T.useState(null),[Tt,Zt]=T.useState(!1),[he,Se]=T.useState(null),[Re,Pe]=T.useState(!1),[qe,wt]=T.useState(0),[nt,Rt]=T.useState(0),[jt,Qt]=T.useState(0),lt=(vo=S==null?void 0:S.compacting)!=null?vo:!1,[mr,dn]=T.useState(!1);T.useEffect(()=>{localStorage.setItem("jean2_sidebar_view",ce)},[ce]);const Yd=1e4,Bs=3e4,zs=1e3,Nr=T.useRef(null),qn=T.useRef(null),[ho,Mr]=T.useState(!1),vt=(Vs=n==null?void 0:n.token)!=null?Vs:null,ft=(Or=n==null?void 0:n.url)!=null?Or:null;T.useEffect(()=>{N.current=x},[x]);const ui=T.useRef(null),gr=T.useRef(!1),tc=T.useCallback(Q=>{i(Q.name,Q.url,Q.token)},[i]),vr=T.useCallback(()=>{n&&s(n.id),N.current&&N.current.close(),E(null),M(!1),Pe(!1),wt(0),Rt(0)},[n,s]),nc=T.useCallback(()=>{wt(Q=>Q+1),Pe(!1),Rt(0)},[]),Ps=T.useCallback(()=>{N.current&&N.current.close(),E(null),M(!1),Pe(!1),wt(0),Rt(0),c([]),g([]),k(null),_({}),v({}),O(null),$({promptTokens:0,completionTokens:0,totalTokens:0}),q("gpt-4o"),J([]),I([]),z(null),Ue([]),Ne([]),Gt({}),Qt(Q=>Q+1)},[]),An=T.useCallback(async(Q,be={})=>{if(!vt)throw new Error("No API token available");const Ve=new Headers(be.headers||{});Ve.set("Authorization",`Bearer ${vt}`);const Fe=await fetch(Q,{...be,signal:be.signal,headers:Ve});if(Fe.status===401)throw Mt("Authentication failed. Your token may have been regenerated."),vr(),new Error("Unauthorized");return Fe},[vt,vr]),fo=T.useCallback(Q=>{const be=w[Q]||[],Ve=y[Q]||{};return be.map(Fe=>({message:Fe,parts:(Ve[Fe.id]||[]).sort((Ct,Tn)=>Ct.createdAt-Tn.createdAt)}))},[w,y]);T.useEffect(()=>{if(!vt||!ft)return;const Q=y9(vt,ft);if(!Q)return;const be=new WebSocket(Q);return be.onopen=()=>{M(!0),Mt(null),wt(0),Pe(!1)},be.onclose=Ve=>{M(!1),(Ve.code===1008||Ve.code===401)&&(Mt("Authentication failed. Please check your token."),vr())},be.onerror=Ve=>{console.error("WebSocket error:",Ve)},be.onmessage=Ve=>{var Ct;const Fe=JSON.parse(Ve.data);(Ct=ui.current)==null||Ct.call(ui,Fe)},E(be),()=>be.close()},[vt,ft,vr,jt]),T.useEffect(()=>{if(vt&&ft&&!R&&!Re){const Q=setTimeout(()=>{R||Pe(!0)},Yd);return()=>clearTimeout(Q)}},[vt,ft,R,Re]),T.useEffect(()=>{if(Re&&!R&&vt&&ft){const Q=Math.min(zs*Math.pow(2,qe),Bs);let be=Math.floor(Q/1e3);Rt(be);const Ve=setInterval(()=>{be-=1,Rt(Math.max(0,be))},1e3),Fe=setTimeout(()=>{wt(Ct=>Ct+1),Qt(Ct=>Ct+1)},Q);return()=>{clearInterval(Ve),clearTimeout(Fe)}}},[Re,R,vt,ft,qe]),T.useEffect(()=>{var Ve;if(!vt||!ft)return;(Ve=Nr.current)==null||Ve.abort(),Nr.current=new AbortController;const Q=Nr.current.signal,be=Kp(ft);if(be)return Mr(!0),Promise.all([An(`${be}/sessions`,{signal:Q}).then(Fe=>Fe.json()),An(`${be}/preconfigs`,{signal:Q}).then(Fe=>Fe.json()),An(`${be}/prompts`,{signal:Q}).then(Fe=>Fe.json()),An(`${be}/models`,{signal:Q}).then(Fe=>Fe.json()),An(`${be}/workspaces`,{signal:Q}).then(Fe=>Fe.json()),An(`${be}/providers`,{signal:Q}).then(Fe=>Fe.json())]).then(([Fe,Ct,Tn,ye,Ce,st])=>{c(Fe.sessions||[]),g(Ct.preconfigs||[]),b(Tn.prompts||[]),J(ye.models||[]),F(ye.defaultModel||"gpt-4o"),Wt(st.providers||[]);const yt=Ce.workspaces||[];if(I(yt),qn.current){const hn=yt.find(_n=>_n.id===qn.current);hn&&z(hn),qn.current=null}else{const hn=localStorage.getItem("activeWorkspaceId"),_n=yt.find(ar=>ar.id===hn);z(_n||yt[0])}h(),Mr(!1)}).catch(Fe=>{var Ct;if(Fe.name==="AbortError"){console.log("Fetch aborted due to server switch");return}console.error("Failed to load server data:",Fe),Mr(!1),(Ct=Fe.message)!=null&&Ct.includes("Unauthorized")||Mt("Failed to connect to server")}),()=>{var Fe;(Fe=Nr.current)==null||Fe.abort()}},[vt,ft,An,h]),T.useEffect(()=>{L&&localStorage.setItem("activeWorkspaceId",L.id)},[L]);const po=async(Q,be,Ve)=>{const Fe=Kp(ft);if(!Fe)return;const Tn=await(await An(`${Fe}/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Q,path:be,isVirtual:Ve})})).json();return I(ye=>[...ye,Tn.workspace]),Tn.workspace},rc=Q=>{z(Q),k(null)},ir=Q=>{qn.current=Q},Ut=async Q=>{const be=Kp(ft);be&&(await An(`${be}/workspaces/${Q}`,{method:"DELETE"}),I(Ve=>Ve.filter(Fe=>Fe.id!==Q)),(L==null?void 0:L.id)===Q&&z(j[0]||null))},an=async()=>{const Q=`Workspace ${j.length+1}`,be=`~/.jean2/workspaces/${crypto.randomUUID()}`;await po(Q,be,!0)},di=async Q=>{const be=Q.split("/").pop()||Q.split("\\").pop()||"Workspace";await po(be,Q,!1)},Fs=T.useCallback(Q=>{var be,Ve,Fe;switch(Q.type){case"session.created":c(ye=>[Q.session,...ye]),gr.current&&(k(Q.session),_(ye=>({...ye,[Q.session.id]:[]})),v(ye=>({...ye,[Q.session.id]:{}})),$({promptTokens:0,completionTokens:0,totalTokens:0}),q(Q.session.selectedModel||ne),K((be=Q.session.selectedVariant)!=null?be:null),gr.current=!1);break;case"session.resumed":k(Q.session),Q.isRunning&&O(Q.session.id),Q.messages&&(_(ye=>({...ye,[Q.session.id]:Q.messages.map(Ce=>Ce.message)})),v(ye=>{const Ce={...ye};Ce[Q.session.id]={};for(const st of Q.messages)Ce[Q.session.id][st.message.id]=st.parts;return Ce})),$((Ve=Q.usage)!=null?Ve:{promptTokens:0,completionTokens:0,totalTokens:0}),q(Q.session.selectedModel||ne),K(Q.session.selectedVariant||null);const Ct=Q.session.selectedModel||ne,Tn=(Fe=V.find(ye=>ye.id===Ct))==null?void 0:Fe.variants;Q.session.selectedVariant&&Tn&&!Tn[Q.session.selectedVariant]&&K(null);break;case"message.created":_(ye=>({...ye,[Q.message.sessionId]:[...ye[Q.message.sessionId]||[],Q.message]})),v(ye=>({...ye,[Q.message.sessionId]:{...ye[Q.message.sessionId],[Q.message.id]:[]}})),"status"in Q.message&&Q.message.status==="streaming"&&O(Q.message.sessionId);break;case"message.updated":_(ye=>({...ye,[Q.message.sessionId]:(ye[Q.message.sessionId]||[]).map(Ce=>Ce.id===Q.message.id?Q.message:Ce)})),"status"in Q.message&&Q.message.status!=="streaming"&&O(ye=>ye===Q.message.sessionId?null:ye);break;case"part.created":v(ye=>{const Ce=ye[Q.sessionId]||{},st=Ce[Q.part.messageId]||[];return{...ye,[Q.sessionId]:{...Ce,[Q.part.messageId]:[...st,Q.part]}}});break;case"part.updated":v(ye=>{const Ce=ye[Q.sessionId]||{},st=Ce[Q.part.messageId]||[];return{...ye,[Q.sessionId]:{...Ce,[Q.part.messageId]:st.map(yt=>yt.id===Q.part.id?Q.part:yt)}}});break;case"part.append":O(Q.sessionId),v(ye=>{const Ce=ye[Q.sessionId]||{};for(const st of Object.keys(Ce)){const yt=Ce[st],hn=yt.findIndex(_n=>_n.id===Q.partId);if(hn!==-1){const _n=yt[hn];if(_n.type==="text"||_n.type==="reasoning"){const ar=[...yt];return ar[hn]={..._n,text:_n.text+Q.delta},{...ye,[Q.sessionId]:{...Ce,[st]:ar}}}}}return ye});break;case"chat.usage":if(Q.sessionId!==(S==null?void 0:S.id))return;$({promptTokens:Q.usage.promptTokens,completionTokens:Q.usage.completionTokens,totalTokens:Q.usage.totalTokens}),q(Q.model);break;case"error":console.error("Server error:",Q.code,Q.message);break;case"session.closed":c(ye=>ye.map(Ce=>Ce.id===Q.sessionId?{...Ce,status:"closed"}:Ce)),_(ye=>{const Ce={...ye};return delete Ce[Q.sessionId],Ce}),v(ye=>{const Ce={...ye};return delete Ce[Q.sessionId],Ce}),(S==null?void 0:S.id)===Q.sessionId&&k(null);break;case"session.reopened":c(ye=>ye.map(Ce=>Ce.id===Q.session.id?Q.session:Ce)),(S==null?void 0:S.id)===Q.session.id&&k(Q.session);break;case"session.deleted":c(ye=>ye.filter(Ce=>Ce.id!==Q.sessionId)),_(ye=>{const Ce={...ye};return delete Ce[Q.sessionId],Ce}),v(ye=>{const Ce={...ye};return delete Ce[Q.sessionId],Ce}),(S==null?void 0:S.id)===Q.sessionId&&k(null);break;case"session.updated":c(ye=>ye.map(Ce=>Ce.id===Q.session.id?Q.session:Ce)),(S==null?void 0:S.id)===Q.session.id&&(k(Q.session),Q.session.selectedVariant!==void 0&&K(Q.session.selectedVariant));break;case"session.renamed":c(ye=>ye.map(Ce=>Ce.id===Q.session.id?Q.session:Ce)),(S==null?void 0:S.id)===Q.session.id&&k(Q.session);break;case"permission.list":Ue(Q.permissions);break;case"permission.revoked":Ue(ye=>ye.map(Ce=>Ce.id===Q.permissionId?{...Ce,revokedAt:new Date().toISOString()}:Ce));break;case"permission.all_revoked":Ue(ye=>{const Ce=new Date().toISOString();return ye.map(st=>({...st,revokedAt:Ce}))});break;case"permission.request":{const ye={toolCallId:Q.toolCallId,toolName:Q.toolName,args:Q.args,permissionType:Q.permissionType,permissionKey:Q.permissionKey,message:Q.message,details:Q.details,dangerous:Q.dangerous,childSessionId:Q.childSessionId,subagentName:Q.subagentName};Ne(Ce=>[...Ce,ye]);break}case"permission.granted":Ne(ye=>ye.filter(Ce=>Ce.toolCallId!==Q.toolCallId));break;case"session.interrupted":D===Q.sessionId&&O(null),Q.result.cascadedTo.length>0&&console.log(`Session ${Q.sessionId} interrupted. Cascaded to:`,Q.result.cascadedTo);break;case"queue.list":Gt(ye=>({...ye,[Q.sessionId]:Q.messages}));break;case"queue.added":Gt(ye=>({...ye,[Q.sessionId]:[...ye[Q.sessionId]||[],Q.message]}));break;case"queue.removed":Gt(ye=>({...ye,[Q.sessionId]:(ye[Q.sessionId]||[]).filter(Ce=>Ce.id!==Q.queueId)}));break;case"queue.sending":Gt(ye=>({...ye,[Q.sessionId]:(ye[Q.sessionId]||[]).filter(Ce=>Ce.id!==Q.queueId)}));break;case"session.reverted":console.log(`Session reverted to message ${Q.revertedTo.messageId}, removed ${Q.removed.messageIds.length} messages`);break;case"compaction.complete":Q.sessionId===(S==null?void 0:S.id)&&dn(!0);break;case"session.forked":{const{forkedSession:ye,messages:Ce}=Q;c(st=>[ye,...st]),_(st=>({...st,[ye.id]:Ce.map(yt=>yt.message)})),v(st=>{const yt={...st};yt[ye.id]={};for(const hn of Ce)yt[ye.id][hn.message.id]=hn.parts;return yt}),k(ye),$({promptTokens:0,completionTokens:0,totalTokens:0});break}case"session.state":_(ye=>({...ye,[Q.sessionId]:Q.messages.map(Ce=>Ce.message)})),v(ye=>{const Ce={...ye};Ce[Q.sessionId]={};for(const st of Q.messages)Ce[Q.sessionId][st.message.id]=st.parts;return Ce}),D===Q.sessionId&&O(null);break;case"provider.status":{Wt(ye=>ye.find(st=>st.provider===Q.provider)?ye.map(st=>st.provider===Q.provider?{...st,connected:Q.connected,authorizationUrl:Q.authorizationUrl,error:Q.error}:st):[...ye,{provider:Q.provider,connected:Q.connected,authorizationUrl:Q.authorizationUrl,error:Q.error}]);break}case"provider.connected":Wt(ye=>ye.map(Ce=>Ce.provider===Q.provider?{...Ce,connected:Q.connected,connectedAt:Q.connectedAt,accountId:Q.accountId}:Ce));break}},[S,ne,D]);T.useEffect(()=>{ui.current=Fs},[Fs]),T.useEffect(()=>{const Q=async be=>{const Ve=be.target;if(!(Ve.tagName==="INPUT"||Ve.tagName==="TEXTAREA"||Ve.isContentEditable)){if((be.metaKey||be.ctrlKey)&&be.key==="`"){be.preventDefault(),te(Ct=>!Ct);return}if((be.metaKey||be.ctrlKey)&&be.key==="n"){be.preventDefault();try{await iA("create_new_window")}catch(Ct){console.error("Failed to create new window:",Ct)}}}};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[]);const He=T.useCallback((Q,be)=>{x&&x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({type:Q,...be}))},[x]),Xd=T.useCallback((Q,be)=>{gr.current=!0,He("session.create",{preconfigId:Q,title:be,workspaceId:L==null?void 0:L.id})},[He,L]),ts=T.useCallback(Q=>{Ne([]),O(null),dn(!1);const be=o.find(Ve=>Ve.id===Q);if(be!=null&&be.workspaceId&&be.workspaceId!==(L==null?void 0:L.id)){const Ve=j.find(Fe=>Fe.id===be.workspaceId);Ve&&z(Ve)}He("session.resume",{sessionId:Q})},[He,o,j,L]),ns=T.useCallback(Q=>{He("session.close",{sessionId:Q})},[He]),mo=T.useCallback((Q,be)=>{He("session.revert",{sessionId:Q,messageId:be})},[He]),hi=T.useCallback((Q,be)=>{He("session.fork",{sessionId:Q,messageId:be})},[He]),fi=T.useCallback(Q=>{He("session.compact",{sessionId:Q})},[He]),rs=T.useCallback(Q=>{He("session.reopen",{sessionId:Q})},[He]),pi=T.useCallback(Q=>{He("session.delete",{sessionId:Q})},[He]),It=T.useCallback(Q=>{S&&He("session.update",{sessionId:S.id,preconfigId:Q})},[S,He]),ic=T.useCallback((Q,be)=>{q(Q),K(null),S&&He("session.update_model",{sessionId:S.id,modelId:Q,providerId:be})},[S,He]),sc=T.useCallback(Q=>{S&&(He("session.update_model",{sessionId:S.id,modelId:S.selectedModel||U,providerId:S.selectedProvider||"openai",variant:Q}),K(Q))},[S,U,He]),jr=T.useCallback((Q,be)=>{He("session.rename",{sessionId:Q,title:be})},[He]),mi=T.useCallback(()=>{S!=null&&S.parentId&&ts(S.parentId)},[S,ts]),ac=T.useCallback((Q,be)=>{He("queue.add",{sessionId:Q,content:be})},[He]),oc=T.useCallback(Q=>{He("queue.remove",{queueId:Q})},[He]),lc=T.useCallback(Q=>{!S||lt||(D===S.id?ac(S.id,Q):He("chat.message",{sessionId:S.id,content:Q}))},[S,D,lt,He,ac]),Zd=T.useCallback((Q,be,Ve)=>{Ne(Fe=>Fe.filter(Ct=>Ct.toolCallId!==Q)),He("permission.response",{toolCallId:Q,allowed:be,alwaysAllow:Ve})},[He]),Hs=T.useCallback(()=>{S&&He("session.interrupt",{sessionId:S.id})},[S,He]),Us=T.useCallback(()=>{L&&He("permission.list",{workspaceId:L.id})},[L,He]),sr=T.useCallback(Q=>{He("provider.connect",{provider:Q})},[He]),vn=T.useCallback(Q=>{He("provider.disconnect",{provider:Q})},[He]),cc=o.filter(Q=>Q.workspaceId===(L==null?void 0:L.id)),Qd=u.filter(Q=>Q.serverId===(n==null?void 0:n.id)&&Q.workspaceId).map(Q=>Q.workspaceId),$s=S?fo(S.id):[],is=d.filter(Q=>Q.mode!=="subagent"),qs=T.useCallback(Q=>{var Ve;z(j.find(Fe=>Fe.id===Q)||null),gr.current=!0;const be=(Ve=is[0])==null?void 0:Ve.id;He("session.create",{preconfigId:be,workspaceId:Q})},[He,j,is]),Jd=!(S!=null&&S.parentId),_t=!!n,go=()=>{var Q;return e.length===0?m.jsx(Nx,{onServerAdded:tc,error:$n||void 0}):_t?l?m.jsx("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:m.jsx(Dx,{message:`Connecting to ${(n==null?void 0:n.name)||"server"}...`})}):!R&&o.length===0?Re?m.jsx("div",{className:"flex w-full h-full items-center justify-center bg-background",children:m.jsx(v9,{serverUrl:ft,authError:$n,retryCount:qe,nextRetryIn:nt,onRetry:nc,onLogout:vr})}):m.jsxs("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:[m.jsx(Dx,{}),m.jsx(ke,{variant:"ghost",size:"sm",onClick:vr,className:"text-muted-foreground",children:"Change Server"})]}):m.jsx(m.Fragment,{children:S?m.jsx(o9,{session:S,messagesWithParts:$s,queuedMessages:gn[S.id]||[],preconfigs:Jd?is:d,prompts:f,models:V,connectedProviderIds:new Set(sn.filter(be=>be.connected).map(be=>be.provider)),connectableProviderIds:new Set(sn.filter(be=>be.connectable).map(be=>be.provider)),defaultModel:ne,onSendMessage:lc,onRemoveFromQueue:oc,onChangePreconfig:It,onChangeModel:ic,onChangeVariant:sc,selectedVariant:Y,variants:(Q=V.find(be=>be.id===U))==null?void 0:Q.variants,pendingPermissions:ut,onPermissionResponse:Zd,onRename:jr,usage:P,modelName:U,onNavigateToSubagent:ts,onNavigateBack:mi,isStreaming:D===S.id,onInterrupt:Hs,onRevert:mo,onFork:hi,onCompact:$s.filter(Ve=>Ve.message.role!=="system").length>=4?()=>fi(S.id):void 0,isCompacting:lt,compactionSuccess:mr,onClearCompactionSuccess:()=>dn(!1),serverUrl:ft!=null?ft:void 0,apiToken:vt!=null?vt:void 0}):m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center text-muted-foreground px-6",children:[m.jsx("h2",{className:"mb-2",children:"Select or create a session"}),m.jsx("p",{children:"Choose a session from the sidebar or create a new one to start chatting."})]})}):m.jsx(Nx,{onServerAdded:tc,error:$n||void 0})};return m.jsxs(uO,{defaultOpen:!0,children:[_t&&m.jsx(wO,{allSessions:o,viewMode:ce,favoritedWorkspaceIds:Qd,sessions:cc,currentSession:S,currentSessionId:(_o=S==null?void 0:S.id)!=null?_o:null,streamingSessionId:D,connected:R,workspaces:j,activeWorkspace:L,onCreateSession:()=>{var Q;return Xd((Q=is[0])==null?void 0:Q.id)},onResumeSession:ts,onCloseSession:ns,onReopenSession:rs,onDeleteSession:pi,onSelectWorkspace:rc,onCreateVirtualWorkspace:an,onCreatePhysicalWorkspace:di,onDeleteWorkspace:Ut,onOpenSettings:()=>X(!0),onOpenMCP:()=>pe(!0),onOpenAddServer:()=>Zt(!0),onServerSwitch:Ps,onCreateSessionInWorkspace:qs}),m.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:[m.jsxs("header",{className:"md:hidden flex items-center justify-between p-3 border-b border-border bg-background sticky top-0 z-10",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[_t&&m.jsx(k0,{}),m.jsx("span",{className:"font-semibold",children:"Jean2"})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[_t&&m.jsx(Mx,{onServerSwitch:Ps,onSelectWorkspace:ir}),_t&&m.jsx(jx,{viewMode:ce,onViewModeChange:Oe}),_t&&L&&m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>W(!ee),title:ee?"Hide Files":"Show Files",children:m.jsx(Zp,{className:"w-4 h-4"})}),_t&&L&&m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>te(!H),title:H?"Hide Terminal":"Show Terminal",children:m.jsx(Lb,{className:"w-4 h-4"})})]})]}),m.jsxs("header",{className:"hidden md:flex items-center justify-between p-3 border-b border-border",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[_t&&m.jsx(k0,{}),m.jsx("span",{className:"font-semibold",children:"Jean2"})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[_t&&m.jsx(Mx,{onServerSwitch:Ps,onSelectWorkspace:ir}),_t&&m.jsx(jx,{viewMode:ce,onViewModeChange:Oe}),_t&&L&&m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>W(!ee),title:ee?"Hide Files":"Show Files",children:m.jsx(Zp,{className:"w-4 h-4"})}),_t&&L&&m.jsx(ke,{variant:"ghost",size:"icon-sm",onClick:()=>te(!H),title:H?"Hide Terminal":"Show Terminal",children:m.jsx(Lb,{className:"w-4 h-4"})})]})]}),go(),_t&&m.jsx(FO,{workspaceId:L==null?void 0:L.id,workspacePath:L==null?void 0:L.path,workspaceName:L==null?void 0:L.name,serverUrl:ft!=null?ft:void 0,apiToken:vt!=null?vt:void 0,isOpen:H,onClose:()=>te(!1)})]}),_t&&m.jsxs(m.Fragment,{children:[m.jsx(EO,{workspaceId:L==null?void 0:L.id,serverUrl:ft!=null?ft:void 0,apiToken:vt!=null?vt:void 0,isOpen:ee,onClose:()=>W(!1)}),m.jsx(p9,{open:Z,onOpenChange:X,permissions:Ie,onRefreshPermissions:Us,onRevokePermission:Q=>{He("permission.revoke",{permissionId:Q})},onRevokeAllPermissions:()=>{He("permission.revoke_all",{workspaceId:L==null?void 0:L.id})},apiToken:vt,onLogout:vr,providerStatuses:sn,onConnectProvider:sr,onDisconnectProvider:vn}),m.jsx(g9,{open:ae,onOpenChange:pe,workspaceId:L==null?void 0:L.id,workspacePath:L==null?void 0:L.path,serverUrl:ft!=null?ft:void 0,apiToken:vt!=null?vt:void 0})]}),m.jsx(_9,{open:Tt,onOpenChange:Q=>{Zt(Q),Q||Se(null)},editServer:he})]})}function x9(){return m.jsx(oR,{children:m.jsx(b9,{})})}eA.createRoot(document.getElementById("root")).render(m.jsx(T.StrictMode,{children:m.jsx(nA,{defaultTheme:"dark",storageKey:"jean2-theme",children:m.jsx(x9,{})})}));